/* ================================================================
   OMNIAGENT  —  Design System v2  |  Cinematic Enterprise
   ================================================================ */

/* ── Tokens ───────────────────────────────────────────────────── */
:root {
  /* Core palette */
  --black:      #060609;
  --surface:    #0d0d12;
  --raised:     #131318;
  --white:      #f0f0ea;
  --muted:      rgba(240,240,234,0.65);
  --line:       rgba(240,240,234,0.07);
  --line-mid:   rgba(240,240,234,0.13);
  --accent:     #5d73ff;
  --accent-dim: rgba(93,115,255,0.18);

  /* Backward-compat aliases for showcase.css / inner pages */
  --bg-base:          var(--black);
  --bg-elevated:      var(--raised);
  --bg-card:          var(--raised);  /* matches orbit card background */
  --text-primary:     var(--white);
  --text-secondary:   var(--muted);
  --text-tertiary:    rgba(240,240,234,0.22);
  --accent-bright:    #7b8fff;
  --accent-glow:      rgba(93,115,255,0.25);
  --border-subtle:    var(--line);
  --border-strong:    var(--line-mid);

  /* Type */
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body:    'Manrope', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;

  /* Easing */
  --ease-expo:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out:      cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:   cubic-bezier(0.65, 0, 0.35, 1);
  --d-fast: 160ms;
  --d-base: 240ms;
  --d-slow: 420ms;

  /* Radii */
  --r-sm: 4px;
  --r-md: 6px;
  --r-xl: 1.25rem;

  /* Font sizes */
  --fs-12: 0.75rem;
  --fs-14: 0.875rem;
  --fs-16: 1rem;
  --fs-20: 1.25rem;
  --fs-24: 1.5rem;
  --fs-32: 2rem;
  --fs-44: 2.75rem;
  --fs-64: 4rem;
  --fs-88: 5.5rem;

  /* Spacing */
  --sp-2: 0.5rem; --sp-4: 1rem; --sp-6: 1.5rem; --sp-8: 2rem;
  --sp-10: 2.5rem; --sp-12: 3rem; --sp-16: 4rem; --sp-20: 5rem;

  /* Layout */
  --max-w: 100%;
  --pad:   clamp(1.5rem, 5vw, 6rem);
  --container-max:    100%;
  --container-narrow: 780px;
  --container-pad:    clamp(1.5rem, 5vw, 6rem);
}

/* ── Reset ────────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip; /* clip instead of hidden — hidden can break position:sticky */
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  line-height: 1.55;
  scrollbar-color: rgba(255,255,255,0.12) var(--black);
  scrollbar-width: thin;
}
body {
  overflow-x: clip; /* clip instead of hidden — hidden can break position:sticky */
  min-height: 100vh;
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(93,115,255,0.055) 0%, transparent 65%),
    var(--black);
  position: relative;
}

/* Film grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

img,svg,video { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
input,textarea,select { font: inherit; color: inherit; }
ol,ul { list-style: none; }
p { margin: 0; color: var(--muted); }
h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--white);
  margin: 0;
}
::selection { background: var(--accent); color: #fff; }

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ── Layout ───────────────────────────────────────────────────── */
.wrap, .container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--pad);
}
.container--narrow { max-width: var(--container-narrow); }
.section { padding-block: clamp(4rem,8vw,7rem); position: relative; }
.section--tight { padding-block: clamp(3rem,5vw,4.5rem); }

/* ── Type utilities ───────────────────────────────────────────── */
.c-eyebrow, .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.c-eyebrow::before, .eyebrow::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: currentColor;
  flex-shrink: 0;
}
.lede { font-size: var(--fs-20); color: var(--muted); max-width: 62ch; line-height: 1.5; }
.muted { color: var(--text-tertiary); }
.mono  { font-family: var(--font-mono); }
.accent-text { color: var(--accent-bright); }
.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;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.c-btn, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: var(--r-sm);
  transition:
    transform 180ms var(--ease-out),
    background 220ms var(--ease-out),
    border-color 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out);
  white-space: nowrap;
}
.c-btn--primary, .btn-primary {
  background: var(--white);
  color: var(--black);
}
.c-btn--primary:hover, .btn-primary:hover {
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.07), 0 16px 40px rgba(0,0,0,0.5);
  transform: translateY(-2px);
}
.c-btn--ghost, .btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--line-mid);
}
.c-btn--ghost:hover, .btn-ghost:hover {
  border-color: rgba(240,240,234,0.32);
  background: rgba(255,255,255,0.04);
  transform: translateY(-2px);
}
.btn-accent {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(93,115,255,0.4); }
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--white);
  font-weight: 500;
  font-size: var(--fs-14);
}
.btn-link:hover { color: var(--accent-bright); }

/* ── Reveal — cinematic system ───────────────────────────────── */
/* Hero title: line-mask reveal on page load */
.c-line-wrap {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em; /* prevent descender clip */
}
.c-line-wrap > span {
  display: block;
  opacity: 0;
  transform: translateY(1.1em);
  will-change: transform, opacity;
}
body.page-ready .c-line-wrap:nth-child(1) > span { animation: c-line-up 1.1s var(--ease-expo)  80ms both; }
body.page-ready .c-line-wrap:nth-child(2) > span { animation: c-line-up 1.1s var(--ease-expo) 220ms both; }
body.page-ready .c-line-wrap:nth-child(3) > span { animation: c-line-up 1.1s var(--ease-expo) 380ms both; }
@keyframes c-line-up { to { opacity: 1; transform: translateY(0); } }

/* Hero sub / actions: fade-up on page load */
.c-fade-up {
  opacity: 0;
  transform: translateY(22px);
  will-change: transform, opacity;
}
body.page-ready .c-fade-up {
  animation: c-fade-up 0.9s var(--ease-expo) var(--delay, 580ms) both;
}
@keyframes c-fade-up { to { opacity: 1; transform: translateY(0); } }

/* Scroll reveals */
.c-reveal {
  opacity: 0;
  transition: opacity 1.05s var(--ease-expo), transform 1.05s var(--ease-expo);
}
.c-reveal[data-dir="up"]    { transform: translateY(90px); }
.c-reveal[data-dir="left"]  { transform: translateX(-90px); }
.c-reveal[data-dir="right"] { transform: translateX(90px); }
.c-reveal[data-dir="scale"] { transform: scale(0.9); }
.c-reveal.is-visible { opacity: 1; transform: none; }
.c-reveal[data-delay="80"].is-visible  { transition-delay:  80ms; }
.c-reveal[data-delay="150"].is-visible { transition-delay: 150ms; }
.c-reveal[data-delay="220"].is-visible { transition-delay: 220ms; }
.c-reveal[data-delay="290"].is-visible { transition-delay: 290ms; }
.c-reveal[data-delay="350"].is-visible { transition-delay: 350ms; }
.c-reveal[data-delay="430"].is-visible { transition-delay: 430ms; }

/* Backward-compat: old .reveal class used on inner pages */
.reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  transition: opacity 750ms var(--ease-expo), transform 750ms var(--ease-expo);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="60"].is-visible  { transition-delay:  60ms; }
.reveal[data-delay="100"].is-visible { transition-delay: 100ms; }
.reveal[data-delay="150"].is-visible { transition-delay: 150ms; }
.reveal[data-delay="200"].is-visible { transition-delay: 200ms; }
.reveal[data-delay="300"].is-visible { transition-delay: 300ms; }
.reveal[data-delay="400"].is-visible { transition-delay: 400ms; }
.reveal[data-delay="500"].is-visible { transition-delay: 500ms; }

/* ── Nav ──────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 100;
  transition: background 300ms var(--ease-out), border-color 300ms var(--ease-out);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(6,6,9,0.88);
  backdrop-filter: blur(22px) saturate(120%);
  -webkit-backdrop-filter: blur(22px) saturate(120%);
  border-bottom-color: var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  height: 68px;
  gap: 1.5rem;
  max-width: 100%;    /* override .container */
  margin-inline: 0;   /* kill centering */
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}
.nav__brand img { border-radius: 4px; }
.nav__brand-text {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
}
.nav__brand-text span { color: rgba(240,240,234,0.45); }
.nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}
.nav__link {
  padding: 0.45rem 0.85rem;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--muted);
  border-radius: var(--r-sm);
  transition: color 200ms, background 200ms;
}
.nav__link:hover, .nav__link.is-active { color: var(--white); background: rgba(255,255,255,0.05); }
.nav__cta { display: flex; align-items: center; gap: 0.5rem; }
.nav__toggle {
  display: none;
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  color: var(--white);
  transition: background 200ms;
}
.nav__toggle:hover { background: rgba(255,255,255,0.06); }
.nav__toggle svg { width: 18px; height: 18px; }

/* Mobile menu */
.nav__menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--black);
  display: flex;
  flex-direction: column;
  padding: var(--pad);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms var(--ease-out);
}
.nav__menu.is-open { opacity: 1; pointer-events: auto; }
.nav__menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}
.nav__menu-close {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  color: var(--white);
  transition: background 200ms;
}
.nav__menu-close:hover { background: rgba(255,255,255,0.06); }
.nav__menu-close svg { width: 20px; height: 20px; }
.nav__menu-links {
  display: flex; flex-direction: column; flex: 1;
  justify-content: center; gap: 0;
}
.nav__menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.5rem,4vw,2.25rem);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--white);
  transition: color 200ms;
}
.nav__menu-link:hover { color: var(--muted); }
.nav__menu-link svg { width: 20px; height: 20px; opacity: 0.5; }
.nav__menu-cta { padding-top: 2rem; display: flex; gap: 1rem; }

/* ── Footer ───────────────────────────────────────────────────── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-block: clamp(3rem,6vw,5rem);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 2.5rem 3rem;
  margin-bottom: clamp(2.5rem,5vw,4rem);
}
.footer__brand p {
  margin-top: 1rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--muted);
  max-width: 34ch;
}
.footer__col h6 {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.footer__col ul { display: flex; flex-direction: column; gap: 0.75rem; }
.footer__col a { font-size: 0.875rem; color: rgba(240,240,234,0.45); transition: color 200ms; }
.footer__col a:hover { color: var(--white); }
.footer__bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 1.5rem; border-top: 1px solid var(--line);
  gap: 1rem; flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(240,240,234,0.22);
}
.footer__bottom-links { display: flex; gap: 1.5rem; }
.footer__bottom-links a { color: inherit; transition: color 200ms; }
.footer__bottom-links a:hover { color: var(--muted); }

/* ── Mesh bg utility (inner pages) ───────────────────────────── */
.mesh-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle 600px at var(--mx,30%) var(--my,20%), rgba(93,115,255,0.09), transparent 60%);
  z-index: 0;
}
.grid-pattern {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: c-grid-breathe 8s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .grid-pattern { animation: none; }
}

/* ── Skill bars (about / capabilities) ───────────────────────── */
.skill-row { opacity: 0; transition: opacity 600ms var(--ease-expo); }
.skill-row.is-visible { opacity: 1; }

/* ── Card utility (inner pages) ──────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  transition: border-color 220ms, transform 220ms, box-shadow 220ms;
}

/* ── Section head (inner pages) ──────────────────────────────── */
.section-head { display: grid; gap: var(--sp-4); margin-bottom: var(--sp-12); max-width: 760px; }
.section-head h2 { font-size: clamp(1.5rem, 4vw, 2.75rem); }

/* ── FAQ shared (contact page) ───────────────────────────────── */
.faq__list { display: flex; flex-direction: column; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item__btn {
  width: 100%; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
  padding: 1.4rem 0;
  font-size: 0.9375rem; font-weight: 500;
  color: var(--white); text-align: left;
  transition: color 200ms;
}
.faq-item__btn:hover { color: var(--muted); }
.faq-item__icon { flex-shrink: 0; width: 20px; height: 20px; }
.faq-item__icon svg { width: 100%; height: 100%; }
.faq-item__panel {
  overflow: hidden; max-height: 0;
  transition: max-height 420ms var(--ease-expo);
}
.faq-item__panel p { padding-bottom: 1.4rem; font-size: 0.9375rem; line-height: 1.7; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__cta { margin-left: auto; }
  .nav__cta .c-btn, .nav__cta .btn { display: none; }
  .nav__toggle { display: flex; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
/* ─────────────────────────────────────────────────────────────
   Easter egg — airplane overlay (desktop only)
   ───────────────────────────────────────────────────────────── */
#ee-ov {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #030408;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  cursor: pointer;
}
#ee-ov.ee-in  { opacity: 1; }
#ee-ov.ee-out { opacity: 0; }
.ee-scene {
  position: relative;
  width: clamp(560px, 88vw, 900px);
}
.ee-svg { display: block; width: 100%; height: auto; }
.ee-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.ee-star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  display: block;
}
/* Exhaust zone — positioned over engine exhausts in SVG space */
.ee-exz {
  position: absolute;
  left: 14.5%;
  top: 64%;
  width: 6%;
  height: 14%;
  pointer-events: none;
  overflow: visible;
}
.ee-snip {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(calc(-50% + var(--dy, 0px)));
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: #50e890;
  white-space: nowrap;
  opacity: 0;
  animation: ee-drift 2.2s ease-out forwards;
  text-shadow: 0 0 8px rgba(80,232,144,0.7);
}
@keyframes ee-drift {
  0%   { opacity: 0;    transform: translateX(0)        translateY(calc(-50% + var(--dy,0px))); }
  8%   { opacity: 0.92; }
  85%  { opacity: 0.5;  }
  100% { opacity: 0;    transform: translateX(-260px)   translateY(calc(-50% + var(--dy,0px))); }
}
.ee-cap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.25rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: rgba(200,220,240,0.55);
  padding-inline: 0.25rem;
}
.ee-dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5d73ff;
  flex-shrink: 0;
  animation: ee-pulse 1s ease-in-out infinite;
}
@keyframes ee-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.3; transform: scale(0.6); }
}
.ee-bar {
  margin-top: 0.6rem;
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.07);
  border-radius: 1px;
  overflow: hidden;
}
.ee-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #5d73ff, #4ade80);
  border-radius: 1px;
}
.ee-hint {
  text-align: center;
  font-family: var(--font-mono, monospace);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(200,220,240,0.22);
  margin-top: 0.5rem;
}

@media (max-width: 480px) {
  .footer__grid { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
  /* Bump muted text opacity for low-brightness mobile screens */
  :root {
    --muted:          rgba(240, 240, 234, 0.6);
    --text-secondary: rgba(240, 240, 234, 0.6);
    --text-tertiary:  rgba(240, 240, 234, 0.38);
  }
}
