/* ============================================
   DESIGN TOKENS
   Palette sampled from the CogniSion logo:
   cyan rim -> electric blue iris -> violet edge
   ============================================ */
:root {
  --bg:          #0A1128;
  --surface:     #0E1838;
  --card:        #122046;
  --border:      #1A2E5C;
  --cyan:        #00E5FF;
  --blue:        #1E7BFF;
  --violet:      #7B5CFF;
  --text:        #F0F4F8;
  --text-soft:   #CBD5E1;
  --muted:       #8C9DB5;

  --cyan-08: rgba(0, 229, 255, 0.08);
  --cyan-15: rgba(0, 229, 255, 0.15);
  --cyan-30: rgba(0, 229, 255, 0.30);
  --cyan-50: rgba(0, 229, 255, 0.50);

  --glow:    0 0 25px rgba(0, 229, 255, 0.30);
  --glow-lg: 0 0 50px rgba(0, 229, 255, 0.50);
  --glow-hud: 0 0 15px rgba(0, 229, 255, 0.20), inset 0 0 15px rgba(0, 229, 255, 0.10);

  --font-sans: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --max-width: 1240px;
  --pad-x:     clamp(1rem, 4vw, 2rem);
  --radius:    16px;
  --radius-sm: 10px;
  --ease:      0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   RESET
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img  { display: block; max-width: 100%; height: auto; }
a    { color: inherit; text-decoration: none; }
ul   { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--cyan); color: var(--bg); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

.sprite { display: none; }
/* Components set display (e.g. .btn is inline-flex); the hidden attribute must still win */
[hidden] { display: none !important; }

/* ============================================
   LAYOUT & UTILITIES
   ============================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}
.container--narrow { max-width: 900px; }

.accent { color: var(--cyan); }
.muted  { color: var(--muted); }
.strong { font-weight: 700; }

.gradient-text {
  background: linear-gradient(90deg, var(--cyan), #7DD3FC 45%, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.icon {
  width: 1rem; height: 1rem;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--sm { width: 0.875rem; height: 0.875rem; }
.icon--lg { width: 1.5rem; height: 1.5rem; }
.icon--accent { color: var(--cyan); }

.glass {
  background: rgba(14, 24, 56, 0.7);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--cyan-15);
  border-radius: var(--radius);
  transition: border-color var(--ease);
}

/* Gradient edge that lights up on hover */
.glow-card { position: relative; isolation: isolate; transition: transform var(--ease), border-color var(--ease); }
.glow-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--cyan-50), transparent 60%, rgba(123, 92, 255, 0.5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.35;
  transition: opacity var(--ease);
  pointer-events: none;
  z-index: -1;
}
.glow-card:hover::before { opacity: 1; }

.grid-bg {
  background-image:
    radial-gradient(circle, rgba(0, 229, 255, 0.08) 1px, transparent 1px),
    linear-gradient(to right, rgba(0, 229, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 229, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}

.bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}
main, .footer { position: relative; z-index: 1; }

/* ============================================
   TYPOGRAPHY
   ============================================ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
}
.section { padding: clamp(4rem, 9vw, 6.5rem) 0; border-top: 1px solid rgba(26, 46, 92, 0.5); }
.section--alt { background-color: rgba(14, 24, 56, 0.35); }
.section__head { text-align: center; max-width: 44rem; margin: 0 auto 3rem; }
.section__head--split {
  max-width: none;
  text-align: left;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}
.section__title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.15;
  font-weight: 700;
  margin-top: 0.5rem;
}
.section__lead { color: var(--muted); margin-top: 0.85rem; }

/* ============================================
   BUTTONS, CHIPS, TAGS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.75rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), box-shadow var(--ease), border-color var(--ease);
  white-space: nowrap;
}
.btn--primary { background: var(--cyan); color: var(--bg); }
.btn--primary:hover { background: #fff; box-shadow: var(--glow-lg); }
.btn--glass {
  background: rgba(14, 24, 56, 0.7);
  border-color: var(--cyan-15);
  color: var(--text);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.btn--glass:hover { color: var(--cyan); border-color: var(--cyan-50); }
.btn--glow {
  padding: 0.6rem 1.1rem;
  font-size: 0.72rem;
  background: rgba(0, 229, 255, 0.1);
  border-color: rgba(0, 229, 255, 0.4);
  color: var(--cyan);
  box-shadow: var(--glow);
}
.btn--glow:hover { background: var(--cyan); color: var(--bg); }
.btn--block { width: 100%; }

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-soft);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  line-height: 1rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color var(--ease);
}
.chip .icon { color: var(--cyan); }
/* Trim the label to cap height so the letters, not the font's line box, centre on the icon */
.chip span { line-height: 1; text-box: trim-both cap alphabetic; }
.chip:hover { border-color: var(--cyan); }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-soft); }
.tags li, .tag {
  padding: 0.25rem 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.tag { display: inline-block; font-family: var(--font-mono); font-size: 0.7rem; }
.tag--accent { background: var(--cyan-15); border-color: transparent; color: var(--cyan); text-transform: uppercase; }

.icon-btn {
  display: inline-flex;
  padding: 0.35rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--ease);
}
.icon-btn:hover { color: var(--cyan); }

/* Pinging status dot */
.ping {
  position: relative;
  display: inline-block;
  width: 0.55rem; height: 0.55rem;
  border-radius: 50%;
  background: var(--cyan);
}
.ping::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--cyan);
  animation: ping 1.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* ============================================
   NAV
   ============================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 1rem 0;
  transition: padding var(--ease);
}
.nav.scrolled { padding: 0.5rem 0; }
.nav__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.65rem 1.1rem;
  border-color: rgba(0, 229, 255, 0.2);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.nav.scrolled .nav__bar { border-color: var(--cyan-30); }

.brand { display: inline-flex; align-items: center; gap: 0.8rem; }
.brand__mark {
  width: 52px;
  height: auto;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.45));
  transition: transform 0.5s ease, filter var(--ease);
}
.brand:hover .brand__mark { transform: scale(1.08); filter: drop-shadow(0 0 14px rgba(0, 229, 255, 0.8)); }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-size: 1.3rem; font-weight: 700; letter-spacing: 0.02em; color: #fff; }
.brand__sub {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.2rem;
}

.nav__links {
  display: flex;
  gap: 2rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav__links a { color: var(--text-soft); transition: color var(--ease); }
.nav__links a:hover { color: var(--cyan); }
.slash { color: var(--cyan); }

.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav__hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

.nav__mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  background: rgba(10, 17, 40, 0.96);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.nav__mobile-overlay.open { display: flex; }
.nav__close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  padding: 0.5rem;
  background: none;
  border: 0;
  color: var(--text);
  cursor: pointer;
}
.nav__mobile-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.nav__mobile-links a:not(.btn):hover { color: var(--cyan); }

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8rem 0 4rem;
  overflow: hidden;
}
.hero__laser {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation: laser 6s ease-in-out infinite;
  pointer-events: none;
}
.hero__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: var(--glow-hud);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--cyan);
}

.hero__logo {
  position: relative;
  width: clamp(200px, 30vw, 340px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.hero__logo::before {
  content: '';
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.35), rgba(30, 123, 255, 0.15) 50%, transparent 70%);
  filter: blur(30px);
  animation: pulse 4s ease-in-out infinite;
}
.hero__logo picture { position: relative; width: 88%; }
.hero__logo img { filter: drop-shadow(0 0 24px rgba(0, 229, 255, 0.55)); animation: float 6s ease-in-out infinite; }
.hero__ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero__ring--outer { inset: 0; border: 1px dashed rgba(0, 229, 255, 0.25); animation: spin 40s linear infinite; }
.hero__ring--inner { inset: 9%; border: 1px solid rgba(0, 229, 255, 0.08); border-top-color: rgba(0, 229, 255, 0.5); animation: spin 14s linear infinite reverse; }

.hero__heading {
  max-width: 60rem;
  font-size: clamp(2.3rem, 6vw, 4.4rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hero__sub {
  max-width: 44rem;
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  font-weight: 300;
  color: var(--muted);
}
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  width: 100%;
  max-width: 56rem;
  margin-top: 1rem;
  font-family: var(--font-mono);
}
.fact { padding: 0.75rem 0.75rem; border-color: rgba(0, 229, 255, 0.2); border-radius: 12px; line-height: 1.35; }
.fact dt { font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.fact dd { margin-top: 0.25rem; font-size: 0.8rem; font-weight: 700; color: var(--cyan); }

/* ============================================
   SERVICES
   ============================================ */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.6rem;
  border-radius: var(--radius);
  background: rgba(14, 24, 56, 0.7);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.card:hover { transform: translateY(-4px); }
.card__icon {
  display: grid;
  place-items: center;
  width: 3rem; height: 3rem;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid var(--cyan-30);
  color: var(--cyan);
}
.card__title { font-size: 1.2rem; font-weight: 700; }
.card__desc { flex: 1; font-size: 0.92rem; color: var(--muted); }
.card__stack { padding-top: 1rem; border-top: 1px solid rgba(26, 46, 92, 0.6); }
.card__stack-label { display: block; margin-bottom: 0.5rem; font-family: var(--font-mono); font-size: 0.7rem; color: var(--cyan); }

/* ============================================
   ABOUT / BRAND
   ============================================ */
.brand-split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: center; }

.showcase {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 440px;
  padding: 3.5rem 2rem;
  border-color: var(--cyan-30);
  overflow: hidden;
}
.showcase::after {
  content: '';
  position: absolute;
  inset: 20%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.25), transparent 70%);
  filter: blur(40px);
  z-index: -1;
}
.showcase picture { display: flex; justify-content: center; align-items: center; width: 100%; }
.showcase__img { width: min(100%, 440px); filter: drop-shadow(0 0 30px rgba(0, 229, 255, 0.35)); }
.hud {
  position: absolute;
  top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
}
.hud b { color: var(--cyan); }
.hud--tl { left: 1.25rem; }
.hud--tr { right: 1.25rem; color: var(--text-soft); }
.corner { position: absolute; width: 18px; height: 18px; border: 0 solid var(--cyan); opacity: 0.7; }
.corner--tl { top: 3rem; left: 1.25rem; border-top-width: 2px; border-left-width: 2px; }
.corner--tr { top: 3rem; right: 1.25rem; border-top-width: 2px; border-right-width: 2px; }
.corner--bl { bottom: 1.25rem; left: 1.25rem; border-bottom-width: 2px; border-left-width: 2px; }
.corner--br { bottom: 1.25rem; right: 1.25rem; border-bottom-width: 2px; border-right-width: 2px; }

.meaning { display: flex; flex-direction: column; gap: 1.25rem; }
.meaning__item { display: flex; gap: 1rem; padding: 1.5rem; border-color: rgba(0, 229, 255, 0.2); }
.meaning__item:hover { border-color: rgba(0, 229, 255, 0.4); }
.meaning__item .card__icon { width: 2.6rem; height: 2.6rem; }
.meaning__item h3 { font-size: 1.15rem; margin-bottom: 0.35rem; }
.meaning__item p { font-size: 0.92rem; color: var(--muted); }

.founder {
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
  margin-top: 2rem;
  padding: 2rem;
  border-color: rgba(0, 229, 255, 0.2);
}
.founder__avatar {
  width: 96px; height: 96px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--cyan);
  box-shadow: var(--glow);
}
.founder__label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--cyan);
}
.founder__name { margin: 0.3rem 0 0.6rem; font-size: 1.3rem; }
.founder__bio { font-size: 0.92rem; color: var(--muted); }
.founder__meta {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 2.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(26, 46, 92, 0.6);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.founder__meta dt { color: var(--muted); text-transform: uppercase; }
.founder__meta dd { margin-top: 0.2rem; font-weight: 700; }

/* ============================================
   WORK
   ============================================ */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filters[hidden] { display: none; }
.filter {
  padding: 0.55rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--cyan-15);
  background: rgba(14, 24, 56, 0.7);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-soft);
  cursor: pointer;
  transition: color var(--ease), background var(--ease);
}
.filter:hover { color: var(--cyan); }
.filter[aria-pressed="true"] { background: var(--cyan); border-color: var(--cyan); color: var(--bg); font-weight: 700; }

.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.work-grid:empty { display: none; }
.work-grid:not(:empty) + .work-empty { margin-top: 1.5rem; }

/* Projects are listed one per row as wide cards */
.work-grid.work-grid--rows { grid-template-columns: 1fr; }
.work-grid--rows .project { flex-direction: row; }
.work-grid--rows .project__cover { flex: 0 0 40%; height: auto; min-height: 15rem; }
.work-grid--rows .project__logo { max-width: min(70%, 300px); }
.work-grid--rows .project__title { font-size: 1.75rem; }
.work-grid--rows .project__body { padding: 2rem; }
.work-grid--rows .project__summary { font-size: 0.98rem; }
.project { display: flex; flex-direction: column; overflow: hidden; }
.project[hidden] { display: none; }
.project__cover {
  position: relative;
  height: 12rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(135deg, #1e1b4b, #0f172a 55%, var(--bg));
  background-size: cover;
  background-position: center;
}
.project__cover::after { content: ''; position: absolute; inset: 0; background: rgba(0, 229, 255, 0.08); opacity: 0; transition: opacity var(--ease); }
.project:hover .project__cover::after { opacity: 1; }
.project__cover .tag { align-self: flex-start; background: rgba(10, 17, 40, 0.8); border-color: transparent; color: var(--cyan); text-transform: uppercase; }
.project__title { position: relative; font-size: 1.25rem; transition: color var(--ease); }
.project__cover--logo { height: 15rem; }
/* Logo sits dead centre of the cover, sized to fit both wide and round marks */
.project__logo {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: auto;
  width: auto;
  height: auto;
  max-width: min(70%, 280px);
  max-height: 50%;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.35));
  transition: transform var(--ease);
}
.project:hover .project__logo { transform: scale(1.04); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.project:hover .project__title { color: var(--cyan); }
.project__body { display: flex; flex-direction: column; flex: 1; gap: 1rem; padding: 1.5rem; }
.project__summary { flex: 1; font-size: 0.9rem; color: var(--muted); }
.project__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.project__more {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--cyan);
  cursor: pointer;
}
.project__more:hover { text-decoration: underline; }
.project__actions { display: flex; align-items: center; gap: 1.25rem; }
.project__foot { flex-wrap: wrap; gap: 0.75rem; }
.project__foot > span { white-space: nowrap; }

.work-empty {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  border-style: dashed;
  border-color: var(--cyan-30);
}
.work-empty[hidden] { display: none; }
.work-empty > div { flex: 1; }
.work-empty__title { font-size: 1.15rem; font-weight: 700; }
.work-empty__text { margin-top: 0.25rem; font-size: 0.92rem; color: var(--muted); }

.modal {
  width: min(42rem, calc(100% - 2rem));
  margin: auto;
  padding: 2rem;
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: var(--glow-lg);
  color: var(--text);
}
.modal[open] { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; animation: fade-up 0.25s ease; }
.modal::backdrop { background: rgba(10, 17, 40, 0.85); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.modal__close { position: absolute; top: 1rem; right: 1rem; }
.modal__title { font-size: 1.6rem; padding-right: 2.5rem; }
.modal__desc { color: var(--muted); font-size: 0.95rem; }
.modal__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; margin-top: 0.5rem; }
.modal__credit {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cyan);
}
.modal__credit:hover { text-decoration: underline; }
.modal__credit[hidden] { display: none; }

/* ============================================
   CONTACT
   ============================================ */
.terminal { overflow: hidden; border-color: rgba(0, 229, 255, 0.4); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); }
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1.1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.terminal__dots { display: flex; gap: 0.45rem; }
.terminal__dots i { width: 0.75rem; height: 0.75rem; border-radius: 50%; background: rgba(239, 68, 68, 0.8); }
.terminal__dots i:nth-child(2) { background: rgba(234, 179, 8, 0.8); }
.terminal__dots i:nth-child(3) { background: rgba(34, 197, 94, 0.8); }
.terminal__name { flex: 1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.terminal__status { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; color: var(--cyan); }
.terminal__body { display: flex; flex-direction: column; gap: 1.75rem; padding: clamp(1.25rem, 4vw, 2rem); }
.terminal__log { display: flex; flex-direction: column; gap: 0.35rem; font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }

.form { display: flex; flex-direction: column; gap: 1.1rem; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field label { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--cyan); }
.optional { color: var(--muted); text-transform: none; letter-spacing: 0; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(10, 17, 40, 0.9);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.field textarea { resize: vertical; min-height: 8rem; }
.field input::placeholder, .field textarea::placeholder { color: #64748B; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan);
}
.field [aria-invalid="true"] { border-color: #F87171; }
.form__error { font-family: var(--font-mono); font-size: 0.75rem; color: #F87171; }
.form__hint { text-align: center; font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); }
.form__error a { color: inherit; text-decoration: underline; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.form-success {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(52, 211, 153, 0.4);
  background: rgba(16, 185, 129, 0.1);
  color: #34D399;
}
.form-success[hidden] { display: none; }
.form-success:focus { outline: none; }
.form-success__title { font-weight: 700; }
.form-success__text { font-size: 0.9rem; color: var(--text-soft); }

.terminal__direct {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(26, 46, 92, 0.6);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.terminal__direct a:hover { text-decoration: underline; }
.copy-status { font-size: 0.72rem; color: #34D399; }

/* ============================================
   FOOTER
   ============================================ */
.footer { padding: 2rem 0; border-top: 1px solid rgba(26, 46, 92, 0.5); font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.footer__mail { color: var(--cyan); }
.footer__mail:hover { text-decoration: underline; }
.footer__legal {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(26, 46, 92, 0.5);
  font-style: normal;
  font-size: 0.68rem;
  line-height: 1.6;
  color: #6B7C96;
}
.footer__legal strong { color: var(--text-soft); font-weight: 500; }
.brand--small .brand__mark { width: 36px; }
.brand--small .brand__name { font-size: 1rem; }

/* ============================================
   SCROLL FADE-IN
   ============================================ */
.fade-in { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: none; }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes ping    { 75%, 100% { transform: scale(2.2); opacity: 0; } }
@keyframes pulse   { 0%, 100% { opacity: 0.55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes float   { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes laser   { 0% { transform: translateY(0); opacity: 0; } 50% { opacity: 0.6; } 100% { transform: translateY(100vh); opacity: 0; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .work-grid--rows .project { flex-direction: column; }
  .work-grid--rows .project__cover { flex-basis: auto; min-height: 16rem; }
  .services, .work-grid { grid-template-columns: repeat(2, 1fr); }
  .brand-split { grid-template-columns: 1fr; }
  .nav__links { gap: 1.25rem; }
}

@media (max-width: 960px) {
  .facts { grid-template-columns: repeat(2, 1fr); max-width: 32rem; }
}

@media (max-width: 860px) {
  .nav__links, .nav__cta { display: none; }
  .nav__hamburger { display: flex; }
}

@media (max-width: 640px) {
  .services, .work-grid, .form__row { grid-template-columns: 1fr; }
  .hero { padding-top: 7rem; }
  .hero__actions { flex-direction: column; width: 100%; }
  .hero__actions .btn { width: 100%; }
  .badge { font-size: 0.65rem; text-align: left; }
  .fact { padding: 0.7rem 0.5rem; }
  .fact dd { font-size: 0.74rem; }
  .showcase { min-height: 0; }
  .founder { flex-direction: column; padding: 1.5rem; }
  .founder__meta { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .work-empty { flex-direction: column; align-items: flex-start; }
  .work-grid--rows .project__body { padding: 1.5rem; }
  .footer__inner { flex-direction: column; text-align: center; }
  .footer__legal { text-align: center; }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .fade-in { opacity: 1; transform: none; }
  .hero__laser { display: none; }
}
