/* ---------- root tokens ---------- */
:root {
  --bg-0: #05060d;
  --bg-1: #0a0a1a;
  --bg-2: #16213e;
  --bg-3: #0f3460;
  --ink: #e8f4fd;
  --ink-dim: #98b3d3;
  --ink-mute: #5a7a9e;
  --line: rgba(180, 210, 255, 0.08);
  --line-strong: rgba(180, 210, 255, 0.18);

  /* Brand pair — pulled directly from the VeritaSaint logo */
  --cyan: #00d4ff;             /* AI / tech accent (V monogram side) */
  --blue-deep: #0f3460;        /* deep brand blue */
  --blue-mid: #2c5fa8;         /* mid blue arc */
  --gold: #f5a742;             /* Saint / brand accent (feather) */
  --gold-light: #ffd166;       /* highlights, embers */
  --gold-deep: #d4791e;        /* deep gold shadow */
  --violet: #7c5cff;
  --pink: #ff6b9d;

  --shadow: 0 24px 60px rgba(0, 8, 30, 0.55);
  --shadow-gold: 0 18px 50px rgba(245,167,66,0.18);
  --glass: rgba(15, 25, 50, 0.55);
  --glass-strong: rgba(15, 25, 50, 0.78);

  --grad-blue: linear-gradient(135deg, #ffffff 0%, #b9d4ff 45%, #6f9ad6 100%);
  --grad-gold: linear-gradient(135deg, #ffe9a8 0%, #ffd166 35%, #f5a742 70%, #d4791e 100%);
  --grad-cta-gold: linear-gradient(135deg, #ffd166 0%, #f5a742 60%, #d4791e 100%);

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* ---------- reset ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0.005em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, textarea, button { font-family: inherit; }

/* ---------- background ---------- */
#bg {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: -2;
  background:
    radial-gradient(1200px 800px at 70% 10%, rgba(15,52,96,0.55), transparent 60%),
    radial-gradient(900px 700px at 10% 90%, rgba(124,92,255,0.18), transparent 60%),
    linear-gradient(180deg, #05060d 0%, #0a0a1a 50%, #05060d 100%);
}
.vignette {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 40%, transparent 40%, rgba(0,0,0,0.55) 100%);
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: linear-gradient(180deg, rgba(5,6,13,0.55), rgba(5,6,13,0));
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  box-shadow: 0 0 0 4px rgba(15,52,96,0.18), 0 4px 16px rgba(0,0,0,0.4);
  animation: breathe 4.5s ease-in-out infinite;
}
.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.22em;
  color: var(--ink);
}
.brand-mark-thin {
  font-weight: 600;
  margin-left: 0.35em;
  background: var(--grad-gold);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

.alex-mark {
  display: flex;
  align-items: center;
  height: 14px;
  opacity: 0;
  transition: opacity .6s ease;
  flex-shrink: 0;
}
.alex-mark.visible { opacity: 0.6; }
.alex-mark:hover   { opacity: 0.9; }
.alex-mark .alex-logo {
  height: 100%;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.22));
}
@media (max-width: 720px) {
  .alex-mark { height: 12px; }
}

/* ---------- stage ---------- */
:root { --topbar-h: 80px; }
@media (max-width: 720px) { :root { --topbar-h: 68px; } }

html { scroll-padding-top: calc(var(--topbar-h) + 8px); }

.stage {
  max-width: 1180px; margin: 0 auto;
  padding: 0 28px 60px;
}

/* ---------- intro — viewport-centered ---------- */
.intro {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--topbar-h) 0 24px;
  animation: introIn 1.0s cubic-bezier(.16,.84,.3,1) both;
  transition: opacity 0.4s ease;
}

/* Cinematic overlay — VS logo + alex greet logo. Absolute so it never
   pushes the centered final content (tagline / typed line / chips). */
.intro-cinematic {
  position: absolute;
  top: var(--topbar-h);
  left: 0; right: 0;
  height: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  padding-bottom: 28px;
  pointer-events: none;
  animation: cinematicOut 0.8s cubic-bezier(0.55, 0.06, 0.68, 0.19) 3.0s forwards;
}
@keyframes cinematicOut {
  to { opacity: 0; transform: translateY(-12px); }
}
.intro.fade-out { opacity: 0; pointer-events: none; }
.intro.hidden   { display: none; }

/* Once the cinematic intro has played, lock the layout into its final state.
   When the user returns from a panel, no animation replays — content is
   simply already there. */
.intro.played { animation: none !important; }
.intro.played .intro-cinematic { display: none !important; }
.intro.played .tagline,
.intro.played .alex-line,
.intro.played .hero-chip {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}
@keyframes introIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 6.4rem);
  letter-spacing: 0.04em;
  line-height: 1;
  display: flex; gap: 0.35em;
}
.word-veritas {
  font-weight: 700;
  background: var(--grad-blue);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 28px rgba(0,212,255,0.14));
}
.word-saint {
  font-weight: 600;
  background: var(--grad-gold);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 36px rgba(245,167,66,0.32));
}

.tagline {
  margin: 18px 0 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
  text-transform: lowercase;
  opacity: 0;
  animation: introTaglineIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 1.55s both;
}
@keyframes introTaglineIn {
  0%   { opacity: 0; transform: translateY(6px); letter-spacing: 0.4em; }
  100% { opacity: 1; transform: translateY(0);   letter-spacing: 0.18em; }
}

/* ---------- intro sequence — pure CSS, cinematic ---------- */

/* VS logo wrapper holds the burst rings */
.intro-logo-wrap {
  position: relative;
  width: 140px; height: 140px;
  display: flex; align-items: center; justify-content: center;
}
.alex-greet-logo-wrap {
  transition: opacity 0.5s ease, height 0.5s ease, margin 0.5s ease;
}

.intro-logo {
  width: 140px; height: 140px;
  border-radius: 50%;
  position: relative; z-index: 2;
  opacity: 0;
  animation: introLogoIn 1.05s cubic-bezier(0.16, 0.84, 0.3, 1) 0.2s both;
}

@keyframes introLogoIn {
  0% {
    opacity: 0;
    transform: scale(0.45);
    filter:
      drop-shadow(0 0 0 rgba(0,212,255,0))
      drop-shadow(0 0 0 rgba(245,167,66,0))
      blur(14px);
  }
  60% {
    opacity: 1;
    filter:
      drop-shadow(0 0 50px rgba(0,212,255,0.7))
      drop-shadow(0 0 80px rgba(245,167,66,0.45))
      blur(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter:
      drop-shadow(0 0 32px rgba(0,212,255,0.28))
      drop-shadow(0 0 64px rgba(245,167,66,0.18))
      blur(0);
  }
}


/* Portal burst rings — cyan + gold, the brand pair */
.intro-logo-burst {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid;
  pointer-events: none;
  opacity: 0;
  z-index: 1;
}
.burst-cyan {
  border-color: rgba(0, 212, 255, 0.75);
  animation: burstRing 1.7s cubic-bezier(0.16, 0.84, 0.3, 1) 0.45s forwards;
}
.burst-gold {
  border-color: rgba(245, 167, 66, 0.7);
  animation: burstRing 1.7s cubic-bezier(0.16, 0.84, 0.3, 1) 0.72s forwards;
}
@keyframes burstRing {
  0%   { opacity: 0;    transform: scale(0.92); border-width: 2px; }
  10%  { opacity: 0.9; }
  100% { opacity: 0;    transform: scale(3.4);  border-width: 0.5px; }
}

/* Alex greeting logo — flashes in over the cinematic overlay */
.alex-greet-logo-wrap {
  display: flex; justify-content: center;
  opacity: 0;
  animation: introAlexIn 0.85s cubic-bezier(0.16, 0.84, 0.3, 1) 1.05s both;
}
.alex-greet-logo {
  height: 34px; width: auto;
  filter: drop-shadow(0 0 18px rgba(0,212,255,0.55));
  animation: alexLogoFlash 0.85s cubic-bezier(0.16, 0.84, 0.3, 1) 1.05s both;
}
@keyframes introAlexIn {
  0%   { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes alexLogoFlash {
  0%   { filter: drop-shadow(0 0 0 transparent) brightness(2.2) saturate(1.6); transform: scaleX(0.7); }
  45%  { transform: scaleX(1.04); }
  60%  { filter: drop-shadow(0 0 30px rgba(0,212,255,0.95)) brightness(1.4) saturate(1.2); }
  100% { filter: drop-shadow(0 0 18px rgba(0,212,255,0.55)) brightness(1) saturate(1); transform: scaleX(1); }
}

/* ---------- prompt zone ---------- */
.prompt-zone {
  margin-top: 3vh;
  width: 100%; max-width: 760px;
  display: flex; flex-direction: column; align-items: center; gap: 38px;
}

.alex-line {
  display: flex; align-items: baseline; gap: 12px;
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  color: var(--ink);
  min-height: 1.6em;
  text-align: left;
  width: 100%;
  justify-content: center;
  opacity: 0;
  animation: alexLineIn 0.5s ease 3.5s both;
}
@keyframes alexLineIn { to { opacity: 1; } }
.alex-prefix {
  color: var(--cyan);
  font-weight: 500;
  letter-spacing: 0.08em;
}
.alex-prefix::after { content: '›'; margin-left: 8px; color: var(--ink-mute); }
.alex-text { color: var(--ink); }
.caret {
  display: inline-block;
  color: var(--cyan);
  animation: blink 1s steps(2) infinite;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }
.caret.thinking {
  animation: alex-think 1.2s ease-in-out infinite;
  transform-origin: 50% 75%;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.7);
}
@keyframes alex-think {
  0%, 100% { transform: scaleY(1);   opacity: 0.85; }
  50%      { transform: scaleY(0.4); opacity: 0.4;  }
}
.alex-progress {
  height: 1px;
  width: 100%;
  max-width: 480px;
  margin: 14px auto 0;
  background: linear-gradient(90deg, var(--cyan), var(--gold-light));
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
}
/* Duration is set by JS via --pause-ms (matches readPause(text), 900-2400ms).
   The 1600ms fallback only fires if JS hasn't set the var — defensive default. */
.alex-progress.running {
  opacity: 0.55;
  animation: alex-progress-draw var(--pause-ms, 1600ms) cubic-bezier(.5, .05, .2, 1) forwards;
}
@keyframes alex-progress-draw {
  to { transform: scaleX(1); }
}

/* ---------- HERO CHIPS — primary navigation ---------- */
.hero-suggestions {
  width: 100%;
  max-width: 760px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  perspective: 1200px;
}

.hero-chip {
  position: relative;
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  border-radius: 20px;
  isolation: isolate;
  outline: none;
  /* enter animation */
  opacity: 0;
  transform: translateY(18px) scale(.985);
  animation: chipIn .9s cubic-bezier(.16,.84,.3,1) both;
}
.hero-chip:nth-child(1) { animation-delay: 3.55s; }
.hero-chip:nth-child(2) { animation-delay: 3.7s;  }
.hero-chip:nth-child(3) { animation-delay: 3.85s; }
.hero-chip:nth-child(4) { animation-delay: 4.0s;  }

@keyframes chipIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Animated conic-gradient border, masked to a 1.4px ring */
.hero-chip::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 1.4px;
  background: conic-gradient(
    from 0deg,
    rgba(0,212,255,0.55) 0deg,
    rgba(0,212,255,0.05) 70deg,
    rgba(245,167,66,0.45) 180deg,
    rgba(0,212,255,0.05) 290deg,
    rgba(0,212,255,0.55) 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: conicSpin 9s linear infinite;
  opacity: 0.65;
  transition: opacity .35s ease;
  z-index: 1;
  pointer-events: none;
}
.hero-chip:hover::before { opacity: 1; animation-duration: 4s; }

@keyframes conicSpin {
  to { transform: rotate(360deg); }
}

/* Soft outer glow that grows on hover */
.hero-chip-glow {
  position: absolute;
  inset: -1px;
  border-radius: 22px;
  background: radial-gradient(60% 80% at 30% 0%, rgba(0,212,255,0.18), transparent 70%);
  opacity: 0;
  transition: opacity .4s ease;
  z-index: 0;
  pointer-events: none;
  filter: blur(14px);
}
.hero-chip:hover .hero-chip-glow { opacity: 1; }
.hero-chip[data-intent="contact"] .hero-chip-glow {
  background: radial-gradient(60% 80% at 30% 0%, rgba(245,167,66,0.28), transparent 70%);
}

/* Inner card surface */
.hero-chip-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  border-radius: 18.6px;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(0,212,255,0.05), transparent 55%),
    linear-gradient(180deg, rgba(20,30,60,0.80) 0%, rgba(10,16,38,0.86) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  transition: transform .35s cubic-bezier(.16,.84,.3,1), background .35s ease;
}
.hero-chip:hover .hero-chip-content {
  transform: translateY(-3px);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(0,212,255,0.12), transparent 55%),
    linear-gradient(180deg, rgba(28,42,80,0.85) 0%, rgba(14,22,50,0.92) 100%);
}
.hero-chip:active .hero-chip-content { transform: translateY(-1px); }

/* Shimmer sweep on hover */
.hero-chip-content::after {
  content: '';
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(110deg,
    transparent 0%,
    rgba(255,255,255,0.06) 45%,
    rgba(255,255,255,0.10) 50%,
    rgba(255,255,255,0.06) 55%,
    transparent 100%);
  transform: skewX(-18deg);
  pointer-events: none;
  transition: left .9s cubic-bezier(.4,.1,.3,1);
}
.hero-chip:hover .hero-chip-content::after { left: 140%; }

/* Icon plate */
.hero-chip-icon {
  position: relative;
  width: 52px; height: 52px;
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--cyan);
  background:
    linear-gradient(135deg, rgba(0,212,255,0.20) 0%, rgba(0,212,255,0.04) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(0,212,255,0.32),
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 6px 18px rgba(0,212,255,0.18);
  transition: transform .35s cubic-bezier(.16,.84,.3,1), box-shadow .35s ease;
}
.hero-chip:hover .hero-chip-icon {
  transform: scale(1.06) rotate(-3deg);
  box-shadow:
    inset 0 0 0 1px rgba(0,212,255,0.55),
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 12px 28px rgba(0,212,255,0.36);
}
.hero-chip-icon svg { width: 24px; height: 24px; }

/* Text block */
.hero-chip-text {
  display: flex; flex-direction: column; gap: 5px;
  min-width: 0;
}
.hero-chip-main {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-chip-hint {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-mute);
  letter-spacing: 0.10em;
  text-transform: lowercase;
}

/* Arrow */
.hero-chip-arrow {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-dim);
  border-radius: 10px;
  transition: transform .35s cubic-bezier(.16,.84,.3,1), color .25s ease, background .25s ease;
}
.hero-chip-arrow svg { width: 20px; height: 20px; }
.hero-chip:hover .hero-chip-arrow {
  color: var(--cyan);
  transform: translateX(5px);
  background: rgba(0,212,255,0.08);
}

/* GOLD VARIANT for contact (the conversion CTA) */
.hero-chip[data-intent="contact"]::before {
  background: conic-gradient(
    from 0deg,
    rgba(255,209,102,0.65) 0deg,
    rgba(245,167,66,0.10) 80deg,
    rgba(255,233,168,0.7) 180deg,
    rgba(245,167,66,0.10) 280deg,
    rgba(255,209,102,0.65) 360deg
  );
  opacity: 0.85;
}
.hero-chip[data-intent="contact"] .hero-chip-icon {
  color: var(--gold);
  background: linear-gradient(135deg, rgba(245,167,66,0.22) 0%, rgba(245,167,66,0.04) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(245,167,66,0.36),
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 6px 20px rgba(245,167,66,0.22);
}
.hero-chip[data-intent="contact"]:hover .hero-chip-icon {
  box-shadow:
    inset 0 0 0 1px rgba(255,209,102,0.6),
    inset 0 1px 0 rgba(255,255,255,0.16),
    0 14px 32px rgba(245,167,66,0.42);
}
.hero-chip[data-intent="contact"]:hover .hero-chip-arrow {
  color: var(--gold-light);
  background: rgba(245,167,66,0.10);
}
.hero-chip[data-intent="contact"] .hero-chip-content {
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(245,167,66,0.06), transparent 55%),
    linear-gradient(180deg, rgba(40,28,12,0.55) 0%, rgba(20,14,6,0.75) 100%);
}
.hero-chip[data-intent="contact"]:hover .hero-chip-content {
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(245,167,66,0.14), transparent 55%),
    linear-gradient(180deg, rgba(56,40,18,0.70) 0%, rgba(28,18,8,0.85) 100%);
}

/* Click pulse */
.hero-chip.firing .hero-chip-content {
  animation: chipFire .55s ease;
}
@keyframes chipFire {
  0%   { box-shadow: 0 0 0 0 rgba(0,212,255,0.5); }
  100% { box-shadow: 0 0 0 22px rgba(0,212,255,0); }
}
.hero-chip[data-intent="contact"].firing .hero-chip-content {
  animation: chipFireGold .55s ease;
}
@keyframes chipFireGold {
  0%   { box-shadow: 0 0 0 0 rgba(245,167,66,0.55); }
  100% { box-shadow: 0 0 0 22px rgba(245,167,66,0); }
}

/* Focus visible — keyboard accessibility */
.hero-chip:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}
.hero-chip[data-intent="contact"]:focus-visible {
  outline-color: var(--gold-light);
}

/* responsive — single column on small screens */
@media (max-width: 720px) {
  .hero-suggestions { grid-template-columns: 1fr; gap: 12px; }
  .hero-chip-content { padding: 18px 20px; gap: 14px; }
  .hero-chip-icon { width: 44px; height: 44px; border-radius: 12px; }
  .hero-chip-icon svg { width: 20px; height: 20px; }
  .hero-chip-main { font-size: 1rem; white-space: normal; }
  .hero-chip-arrow { width: 28px; height: 28px; }
}

/* ---------- reveals ---------- */
.reveals {
  display: flex; flex-direction: column; gap: 28px;
  padding-top: 24px;
  min-height: calc(100dvh - 60px);
}
.intro:not(.hidden) + .reveals { padding-top: 0; min-height: 0; }

.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(15,25,50,0.78) 0%, rgba(10,15,35,0.72) 100%);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: 38px 36px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  opacity: 0;
  overflow: hidden;
  scroll-margin-top: 84px;
}
.panel::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(600px 200px at 80% 0%, rgba(0,212,255,0.08), transparent 70%);
}
.panel.dismissing { animation: panelOut .45s ease forwards; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(28px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes panelOut {
  to { opacity: 0; transform: translateY(-12px) scale(.98); }
}

.panel-close {
  position: absolute; top: 14px; right: 16px;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--ink-mute);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 1.4rem; line-height: 1;
  transition: all .2s ease;
}
.panel-close:hover { color: var(--ink); border-color: var(--line-strong); }

.panel-head { margin-bottom: 24px; }
.panel-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--cyan);
  text-transform: lowercase;
  margin-bottom: 10px;
}
.panel-head h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.panel-sub {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.98rem;
  max-width: 60ch;
}

/* ---------- portfolio cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.card {
  position: relative;
  padding: 22px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01));
  border: 1px solid var(--line-strong);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 14%, transparent), transparent 60%);
  opacity: 0; transition: opacity .3s ease;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--c) 50%, transparent);
  box-shadow: 0 18px 40px rgba(0,0,0,0.45),
              0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent);
}
.card:hover::before { opacity: 1; }
.card-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--c, var(--cyan));
  text-transform: lowercase;
  margin-bottom: 10px;
}
.card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
}
.card p {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: var(--ink-dim);
  line-height: 1.55;
}
.card-stack {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

/* ---------- speed stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat {
  padding: 22px 18px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(0,212,255,0.04), rgba(0,212,255,0.0));
  text-align: left;
}
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #00d4ff 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  line-height: 1;
}
.stat-lbl {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  text-transform: lowercase;
}
.how {
  margin: 0; padding: 0; list-style: none;
  display: grid; gap: 10px;
}
.how li {
  position: relative; padding: 12px 14px 12px 38px;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 0.94rem;
}
.how li::before {
  content: '→';
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--cyan);
  font-family: var(--font-mono);
}
.how b { color: var(--ink); font-weight: 600; }

/* ---------- alex panel ---------- */
.alex-head { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.alex-hero {
  height: 48px; width: auto;
  filter: drop-shadow(0 0 26px rgba(0,212,255,0.5));
  margin-bottom: 8px;
}
.alex-body .lead {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--ink);
  margin: 0 0 18px;
  font-weight: 500;
}
.alex-body .lead em { color: var(--cyan); font-style: normal; font-family: var(--font-mono); font-size: 1.15rem; }
.alex-body p { color: var(--ink-dim); max-width: 68ch; }
.alex-briefs {
  margin-top: 24px;
  padding: 22px 24px;
  border-left: 2px solid var(--cyan);
  background: linear-gradient(90deg, rgba(0,212,255,0.06), transparent 70%);
  border-radius: 0 12px 12px 0;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.alex-briefs .qmark {
  color: var(--cyan); font-size: 2rem; line-height: 0;
  vertical-align: -0.4em; margin-right: 6px;
  align-self: flex-start;
}
.alex-briefs .brief { color: var(--ink); }
.alex-briefs .qcite {
  display: block; margin-top: 10px;
  color: var(--ink-mute); font-size: 0.8rem; letter-spacing: 0.04em;
}

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.about-grid h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--cyan);
  letter-spacing: 0.02em;
}
.about-grid p { margin: 0; color: var(--ink-dim); font-size: 0.94rem; }

/* ---------- contact ---------- */
.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-wide { grid-column: 1 / -1; }
.field span {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  text-transform: lowercase;
}
.field input, .field textarea {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--ink);
  font-size: 0.96rem;
  outline: none;
  resize: vertical;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:focus, .field textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.12);
}
.contact-send {
  grid-column: 1 / -1;
  justify-self: start;
  border: 0;
  padding: 14px 26px;
  border-radius: 12px;
  background: var(--grad-cta-gold);
  color: #1a0e00;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 30px rgba(245,167,66,0.34);
  transition: transform .15s ease, filter .15s ease, box-shadow .2s ease;
}
.contact-send:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 14px 36px rgba(245,167,66,0.45);
}
.contact-sent {
  text-align: center; padding: 30px 0;
  animation: panelIn .6s ease both;
}
.contact-sent h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0 0 8px;
  color: var(--cyan);
}
.contact-sent p { color: var(--ink-dim); margin: 0; }

/* ---------- whatsapp CTA (the gold conversion button) ---------- */
.wa-cta {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 22px;
  padding: 0;
  border-radius: 16px;
  text-decoration: none;
  isolation: isolate;
  transition: transform .25s cubic-bezier(.16,.84,.3,1), box-shadow .3s ease;
}
.wa-cta-ring {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1.4px;
  background: conic-gradient(
    from 0deg,
    rgba(255,209,102,0.85) 0deg,
    rgba(245,167,66,0.30) 90deg,
    rgba(212,121,30,0.70) 180deg,
    rgba(245,167,66,0.30) 270deg,
    rgba(255,209,102,0.85) 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: conicSpin 14s linear infinite;
  opacity: 0.85;
  transition: opacity .35s ease;
  pointer-events: none;
  z-index: 1;
}
.wa-cta:hover .wa-cta-ring { opacity: 1; animation-duration: 5s; }
.wa-cta-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 20px 24px;
  min-height: 80px;
  border-radius: 14.6px;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(245,167,66,0.10), transparent 55%),
    linear-gradient(180deg, rgba(28,20,8,0.88) 0%, rgba(16,10,4,0.92) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  transition: background .35s ease;
}
.wa-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(245,167,66,0.22);
}
.wa-cta:hover .wa-cta-inner {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(245,167,66,0.16), transparent 55%),
    linear-gradient(180deg, rgba(40,28,12,0.90) 0%, rgba(22,14,6,0.94) 100%);
}
.wa-cta-label {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--gold-light);
  text-transform: lowercase;
}
.wa-cta-arrow {
  display: inline-block;
  margin-left: 4px;
  transition: transform .2s ease;
}
.wa-cta:hover .wa-cta-arrow { transform: translateX(3px); }
.wa-cta-num {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
}

/* ---------- "or write it out" divider ---------- */
.contact-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 22px;
}
.contact-divider::before,
.contact-divider::after {
  content: '';
  flex: 1 1 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(245,167,66,0.28) 50%,
    transparent 100%);
}
.contact-divider span {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  text-transform: lowercase;
  white-space: nowrap;
}

/* ---------- honeypot (off-screen, non-interactive) ---------- */
.hp-field {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ---------- inline form error ---------- */
.form-error {
  grid-column: 1 / -1;
  padding: 10px 14px;
  border: 1px solid rgba(245,167,66,0.35);
  border-radius: 10px;
  background: rgba(245,167,66,0.06);
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  letter-spacing: 0.02em;
}

/* ---------- failure block (parallel to .contact-sent) ---------- */
.contact-failure {
  text-align: center;
  padding: 30px 0 10px;
  animation: panelIn .6s ease both;
}
.contact-failure h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0 0 8px;
  color: var(--gold-light);
}
.contact-failure p { color: var(--ink-dim); margin: 0 0 18px; }
.contact-failure-wa {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 12px;
  background: var(--grad-cta-gold);
  color: #1a0e00;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 30px rgba(245,167,66,0.34);
  transition: transform .15s ease, filter .15s ease;
}
.contact-failure-wa:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

/* ---------- panel-next chips (contextual flow) ---------- */
.panel-next {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.panel-next-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  text-transform: lowercase;
}
.panel-next-chips {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.panel-next-chips .chip-next {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,0.025);
  color: var(--ink-dim);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  transition: all .25s ease;
}
.panel-next-chips .chip-next:hover {
  color: var(--ink);
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(245,167,66,0.08), rgba(245,167,66,0.02));
  box-shadow: 0 6px 22px rgba(245,167,66,0.18);
  transform: translateY(-1px);
}
.panel-next-chips .chip-next[data-intent="contact"] {
  border-color: rgba(245,167,66,0.4);
  background: linear-gradient(135deg, rgba(245,167,66,0.12), rgba(245,167,66,0.04));
  color: var(--gold-light);
}
.panel-next-chips .chip-next[data-intent="contact"]:hover {
  border-color: var(--gold-light);
  box-shadow: 0 8px 26px rgba(245,167,66,0.32);
}

/* ---------- back-top button (persistent navigation) ---------- */
.back-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 20, 40, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--ink-mute);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  font: inherit;
  transition: opacity .32s ease, transform .32s ease,
              border-color .18s ease, color .18s ease;
}
.back-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-top:hover {
  border-color: rgba(0, 212, 255, 0.5);
  color: var(--cyan);
}
.back-top svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}
.back-top-label {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  max-width: 0;
  opacity: 0;
  margin-right: 0;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  letter-spacing: 0.01em;
  color: inherit;
  transition: max-width .22s ease, opacity .22s ease, margin-right .22s ease;
}
.back-top.expanded .back-top-label,
.back-top:hover .back-top-label,
.back-top:focus-visible .back-top-label {
  max-width: 110px;
  opacity: 1;
  margin-right: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .back-top-label {
    transition-duration: 0s;
  }
}

@media (max-width: 720px) {
  .back-top { right: 18px; bottom: 18px; }
}

/* ---------- footer ---------- */
.footbar {
  text-align: center;
  padding: 30px 16px 40px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-mute);
  letter-spacing: 0.08em;
}
.footbar .dot-sep { margin: 0 10px; opacity: 0.5; }
.footbar .muted { opacity: 0.7; }

/* ---------- animations ---------- */
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 4px rgba(15,52,96,0.18), 0 4px 16px rgba(0,0,0,0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(245,167,66,0.20), 0 4px 22px rgba(245,167,66,0.18); }
}
/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .topbar { padding: 12px 16px; }
  .brand-mark { font-size: 0.78rem; letter-spacing: 0.18em; }
  .stage { padding: 0 16px 40px; }
  .panel { padding: 24px 20px; border-radius: 18px; }
  .contact-form { grid-template-columns: 1fr; }

  /* Compact intro so chips + logo all fit one viewport */
  .intro { padding: var(--topbar-h) 0 16px; }
  .intro-cinematic { gap: 14px; padding-bottom: 18px; }
  .intro-logo, .intro-logo-wrap { width: 96px; height: 96px; }
  .tagline { font-size: 0.82rem; margin-top: 12px; }
  .alex-greet-logo { height: 26px; }
  .prompt-zone { gap: 22px; margin-top: 2vh; }
  .hero-suggestions { gap: 10px; }
  .hero-chip-content { padding: 14px 16px; }
}

/* ---------- prefers-reduced-motion — scoped, not global ---------- */
@media (prefers-reduced-motion: reduce) {
  /* Stop only the looping decorative animations. The intro narrative still plays. */
  .hero-chip::before { animation-duration: 30s; }
  .brand-logo { animation: none; }
}
