/* =========================================================
   KAINGS · Luxe AI Atelier
   ========================================================= */

:root {
  --black: #030303;
  --char: #0a0a0a;
  --ink: #121212;

  --gold-deep: #7a5a1a;
  --gold-dark: #a98326;
  --gold: #d4af37;
  --gold-warm: #e8c547;
  --gold-light: #f5e1a0;
  --champagne: #fbf0c4;

  --silver-dark: #6b6b6b;
  --silver: #c5c5c5;
  --silver-light: #f0f0f0;

  --text: #e8dcb8;
  --text-dim: rgba(232, 220, 184, 0.5);
  --text-faint: rgba(232, 220, 184, 0.45);

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-lux: cubic-bezier(0.65, 0, 0.35, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Skip link — visually hidden until keyboard focus */
.skip-link {
  position: fixed;
  top: -100px;
  left: 14px;
  z-index: 10000;
  padding: 10px 16px;
  background: #030303;
  border: 1px solid var(--gold);
  color: var(--gold-light);
  text-decoration: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: top 0.25s var(--ease-out);
}
.skip-link:focus {
  top: 14px;
  outline: none;
  box-shadow: 0 0 16px rgba(212,175,55,0.5);
}

/* Global keyboard focus — gold ring */
:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}
/* Remove default focus outline only when :focus-visible is supported */
*:focus:not(:focus-visible) { outline: none; }

html {
  scroll-behavior: smooth;
  background: var(--black);
}

html, body {
  width: 100%;
  background: var(--black);
  color: var(--text);
  font-family: "Instrument Serif", Georgia, serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Hide default cursor on devices that support fine pointer */
@media (pointer: fine) {
  html, body, * { cursor: none !important; }
}

.mono {
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  font-weight: 300;
  letter-spacing: 0.18em;
  font-size: 11px;
  text-transform: uppercase;
}

/* =========================================================
   Atmospheric Layers (all fixed)
   ========================================================= */

#neural {
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0.6;
  mix-blend-mode: screen;
  pointer-events: none;
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.orb-1 {
  width: 720px; height: 720px;
  background: radial-gradient(circle,
    rgba(212, 175, 55, 0.38) 0%,
    rgba(212, 175, 55, 0.08) 45%,
    transparent 70%);
  top: -220px; left: -220px;
  animation: orb-drift-1 22s var(--ease-lux) infinite;
}
.orb-2 {
  width: 620px; height: 620px;
  background: radial-gradient(circle,
    rgba(197, 197, 197, 0.18) 0%,
    rgba(197, 197, 197, 0.04) 50%,
    transparent 72%);
  bottom: -200px; right: -180px;
  animation: orb-drift-2 28s var(--ease-lux) infinite;
}
.orb-3 {
  width: 480px; height: 480px;
  background: radial-gradient(circle,
    rgba(232, 197, 71, 0.22) 0%,
    rgba(212, 175, 55, 0.05) 45%,
    transparent 70%);
  top: 40%; right: 10%;
  animation: orb-drift-3 32s var(--ease-lux) infinite;
}

@keyframes orb-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(120px, 140px) scale(1.08); }
  66% { transform: translate(60px, 220px) scale(0.95); }
}
@keyframes orb-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-140px, -120px) scale(1.12); }
}
@keyframes orb-drift-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40% { transform: translate(-160px, 80px) scale(1.05); }
  70% { transform: translate(80px, -100px) scale(0.92); }
}

/* God rays — subtle diagonal gold rays from top-left drifting down */
.godrays {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    conic-gradient(
      from 200deg at 18% -10%,
      rgba(245,225,160,0.14) 0deg,
      rgba(245,225,160,0.06) 8deg,
      transparent 14deg,
      rgba(212,175,55,0.08) 22deg,
      transparent 30deg,
      rgba(245,225,160,0.12) 42deg,
      transparent 52deg
    );
  mix-blend-mode: screen;
  opacity: 0.85;
  animation: godrays-drift 28s var(--ease-lux) infinite;
  filter: blur(8px);
}
@keyframes godrays-drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.85; }
  50%      { transform: translate(2%, 1%) rotate(3deg); opacity: 1; }
}
.low-power .godrays { opacity: 0.6; animation-duration: 40s; filter: blur(14px); }

.vignette {
  position: fixed; inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 45%,
      transparent 0%, transparent 35%,
      rgba(3,3,3,0.55) 75%, rgba(3,3,3,0.9) 100%),
    radial-gradient(ellipse at 50% 0%,
      rgba(212,175,55,0.08) 0%, transparent 50%);
}

.grain {
  position: fixed; inset: -20%;
  z-index: 3;
  pointer-events: none;
  opacity: 0.12;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain-shift 1.2s steps(6) infinite;
}
@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  17%  { transform: translate(-8%, -6%); }
  33%  { transform: translate(6%, -10%); }
  50%  { transform: translate(-4%, 8%); }
  67%  { transform: translate(10%, 4%); }
  83%  { transform: translate(-6%, 10%); }
  100% { transform: translate(0, 0); }
}

.scanline {
  position: fixed; left: 0; right: 0; top: 72px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%, rgba(212,175,55,0) 10%,
    rgba(212,175,55,0.55) 50%,
    rgba(212,175,55,0) 90%, transparent 100%);
  z-index: 3;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(212,175,55,0.35);
  animation: scan 11s linear infinite;
  opacity: 0.8;
}
@keyframes scan {
  0%   { transform: translateY(0); opacity: 0; }
  5%   { opacity: 0.7; }
  95%  { opacity: 0.7; }
  100% { transform: translateY(calc(100vh - 72px)); opacity: 0; }
}

/* Corners — fixed over viewport */
.corner {
  position: fixed;
  width: 28px; height: 28px;
  z-index: 9;
  pointer-events: none;
  border-color: rgba(212,175,55,0.45);
  opacity: 0;
  animation: corner-in 1.4s var(--ease-out) 1.9s forwards;
}
.corner.tl { top: 20px; left: 20px;  border-top: 1px solid; border-left: 1px solid; }
.corner.tr { top: 20px; right: 20px; border-top: 1px solid; border-right: 1px solid; }
.corner.bl { bottom: 20px; left: 20px; border-bottom: 1px solid; border-left: 1px solid; }
.corner.br { bottom: 20px; right: 20px; border-bottom: 1px solid; border-right: 1px solid; }

@keyframes corner-in {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

/* =========================================================
   Nav + scroll rail
   ========================================================= */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 28px 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 8;
  color: var(--text-dim);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: linear-gradient(180deg, rgba(3,3,3,0.4), transparent);
}

.mark {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: slip-in 1s var(--ease-out) 0.3s forwards;
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold), 0 0 3px var(--gold-light);
  animation: pulse-dot 2.4s var(--ease-lux) infinite;
}
.mark-sep { color: var(--gold); padding: 0 2px; }
.mark-time {
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.18em;
  min-width: 10ch;
  display: inline-block;
}
.mark-label { color: var(--text-dim); }

/* Mini brand mark visible only on narrow viewports — balances the nav */
.nav-brand {
  display: none;
  color: var(--gold);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3em;
  padding: 2px 8px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(3, 3, 3, 0.4);
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.8); }
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 28px;
  opacity: 0;
  animation: slip-in 1s var(--ease-out) 0.4s forwards;
}
.nav-anchor {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.4s var(--ease-lux);
  position: relative;
}
.nav-anchor::before {
  content: "";
  position: absolute;
  left: -10px; top: 50%;
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--gold);
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.4s;
}
.nav-anchor:hover { color: var(--gold-light); }
.nav-anchor:hover::before { opacity: 1; }

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.45s var(--ease-lux);
}
.nav-envelope {
  padding: 8px 10px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 2px;
  gap: 6px;
  transition: color 0.4s var(--ease-lux), border-color 0.4s var(--ease-lux), background 0.4s var(--ease-lux);
}
.nav-envelope:hover,
.nav-envelope:focus-visible {
  color: var(--gold-light);
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.2);
}
/* Remove underline effect from envelope variant */
.nav-envelope::after { display: none; }
.nav-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
  animation: pulse-dot 2.4s var(--ease-lux) infinite;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 16px; bottom: -6px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.6s var(--ease-lux);
}
.nav-link:hover { color: var(--gold-light); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link:hover .arrow { transform: translate(2px, -2px); }
.arrow { transition: transform 0.4s var(--ease-lux); }

/* Scroll progress rail on right edge */
.rail {
  position: fixed;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  width: 1px;
  height: 180px;
  background: rgba(232,220,184,0.1);
  z-index: 7;
  pointer-events: none;
  opacity: 0;
  animation: fade-in 1s var(--ease-out) 2.2s forwards;
}
.rail-fill {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 0%;
  background: linear-gradient(180deg, var(--gold-light), var(--gold), var(--gold-deep));
  box-shadow: 0 0 8px var(--gold);
  transition: height 0.15s linear;
}

/* =========================================================
   Hero
   ========================================================= */

.hero {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 140px;
  text-align: center;
}

.eyebrow {
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 44px;
  opacity: 0;
  animation: fade-in 1.4s var(--ease-out) 0.6s forwards;
}
.bracket { color: var(--gold); font-size: 13px; transform: translateY(-1px); }

.logo {
  position: relative;
  display: inline-block;
  font-family: "Unbounded", "Arial Black", sans-serif;
  font-weight: 900;
  /* Softer scale — dominant but not overwhelming.
     Mobile 375: 11vw=41, min 44 → 44px
     Desktop 1440: 11vw=158 → 158px
     XL 1920+: capped at 168px */
  font-size: clamp(44px, 11vw, 168px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  white-space: nowrap;
  user-select: none;
  will-change: transform, filter, opacity;
}
.logo .logo-text { white-space: nowrap; }
.logo .logo-text { display: block; position: relative; }
.logo .logo-text {
  background: linear-gradient(115deg,
    #6b4f14 0%, #a98326 10%, #d4af37 22%,
    #f5e1a0 38%, #ffffff 50%, #f5e1a0 62%,
    #d4af37 78%, #a98326 90%, #6b4f14 100%);
  background-size: 300% auto;
  background-position: 0% center;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation:
    shimmer 9s linear infinite,
    logo-enter 1.6s var(--ease-out) 0.8s forwards;
  opacity: 0;
  transform: translateY(40px) scale(0.96);
  filter: blur(8px);
}

/* Each letter gets its OWN background-clip:text setup so that children with
   their own filter / transform contexts still render the gold gradient.
   Without this, filter on a child breaks parent's background-clip inheritance
   in Safari/WebKit and the letter renders fully transparent (invisible). */
.lc {
  display: inline-block;
  position: relative;
  line-height: inherit;
  background: linear-gradient(115deg,
    #6b4f14 0%, #a98326 10%, #d4af37 22%,
    #f5e1a0 38%, #ffffff 50%, #f5e1a0 62%,
    #d4af37 78%, #a98326 90%, #6b4f14 100%);
  background-size: 300% auto;
  background-position: inherit;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
/* The A and I letters emerge from tiny cipher glyphs, scramble, then
   explode into crisp full-size letters. Delay past parent logo-enter
   (0.8s + 1.6s = 2.4s) so the journey is fully visible. */
.lc-ai {
  transform-origin: center 70%;
  transform: scale(0.14);
  opacity: 0.6;
  filter: blur(1px) drop-shadow(0 0 6px rgba(212, 175, 55, 0.9));
  animation: ai-emerge 2s cubic-bezier(0.16, 1, 0.3, 1) 1.9s forwards;
  will-change: transform, filter, opacity;
}
/* In the tiny / scrambling phase the text is much narrower than a full letter.
   Reserve the final letter width so the other characters don't jump when the
   cipher glyph is shorter/wider than A/I. */
.lc-ai::after {
  content: attr(data-c);
  display: inline-block;
  width: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}
@keyframes ai-emerge {
  /* Tiny cipher → growth → explosion → crisp */
  0%   { opacity: 0.6; transform: scale(0.14); filter: blur(1.2px) drop-shadow(0 0 6px rgba(212,175,55,0.9)); }
  25%  { opacity: 0.85; transform: scale(0.32); filter: blur(1px) drop-shadow(0 0 10px rgba(245,225,160,0.9)); }
  55%  { opacity: 1;   transform: scale(0.78); filter: blur(0.6px) drop-shadow(0 0 16px rgba(245,225,160,0.65)); }
  /* 80% — EXPLOSION: max glow burst at overshoot scale */
  80%  { opacity: 1;   transform: scale(1.18); filter: blur(0)    drop-shadow(0 0 34px rgba(255,240,200,0.95)); }
  /* 90% — settling */
  90%  { opacity: 1;   transform: scale(0.98); filter: blur(0)    drop-shadow(0 0 12px rgba(245,225,160,0.35)); }
  /* 100% — clean crisp letters, NO halo bleed */
  100% { opacity: 1;   transform: scale(1);    filter: blur(0)    drop-shadow(0 0 0 transparent); }
}

/* Reusable emerge + burst effect for section titles and CTAs.
   Triggers when element enters viewport via JS-added .emerge-in class. */
.burst-emerge {
  transform: scale(0.6);
  opacity: 0;
  will-change: transform, opacity, filter;
}
.burst-emerge.emerge-in {
  animation: burst-pop 0.9s cubic-bezier(0.34, 1.45, 0.4, 1) forwards;
  /* If element has --stagger defined, delay its start for a cascading reveal */
  animation-delay: calc(var(--stagger, 0) * 90ms);
}
@keyframes burst-pop {
  0%   { opacity: 0;   transform: scale(0.6);  filter: blur(6px) drop-shadow(0 0 6px rgba(212,175,55,0.6)); }
  40%  { opacity: 1;   transform: scale(0.95); filter: blur(1px) drop-shadow(0 0 16px rgba(245,225,160,0.8)); }
  65%  { opacity: 1;   transform: scale(1.12); filter: blur(0)   drop-shadow(0 0 28px rgba(255,240,200,0.9)); }
  80%  { opacity: 1;   transform: scale(0.98); filter: blur(0)   drop-shadow(0 0 12px rgba(245,225,160,0.35)); }
  100% { opacity: 1;   transform: scale(1);    filter: blur(0)   drop-shadow(0 0 0 transparent); }
}
.low-power .burst-emerge.emerge-in {
  animation-duration: 0.75s;
}

/* Radial burst flash — shockwave aligned with the explosion overshoot */
.lc-ai::before {
  content: "";
  position: absolute;
  inset: -40%;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 240, 200, 0.7) 0%,
    rgba(245, 225, 160, 0.35) 25%,
    rgba(212, 175, 55, 0.1) 55%,
    transparent 75%);
  opacity: 0;
  transform: scale(0.1);
  pointer-events: none;
  z-index: -1;
  mix-blend-mode: screen;
  animation: ai-burst 1s cubic-bezier(0.2, 0.9, 0.3, 1) 3.3s forwards;
  will-change: opacity, transform;
}
@keyframes ai-burst {
  0%   { opacity: 0;    transform: scale(0.1); }
  35%  { opacity: 1;    transform: scale(1.8); }
  70%  { opacity: 0.35; transform: scale(2.6); }
  100% { opacity: 0;    transform: scale(3.2); }
}

/* Low-power: keep mobile at same snappy timing */
.low-power .lc-ai {
  animation-duration: 1.7s;
}
.low-power .lc-ai::before {
  animation-delay: 2.9s;
  animation-duration: 0.9s;
}
/* Gold halo glow — CSS-only pseudo-element (no duplicate text in DOM for SEO) */
.logo .logo-text::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  background: none;
  color: rgba(212,175,55,0.22);
  -webkit-text-fill-color: rgba(212,175,55,0.22);
  filter: blur(26px);
  animation: glow-pulse 5s var(--ease-lux) infinite;
  pointer-events: none;
  aria-hidden: true;
}
@keyframes shimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 300% center; }
}
@keyframes logo-enter {
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes glow-pulse {
  0%, 100% { opacity: 0.6; filter: blur(26px); }
  50%      { opacity: 1;   filter: blur(34px); }
}

.tagline-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 48px;
  opacity: 0;
  animation: fade-in 1.2s var(--ease-out) 1.4s forwards;
}
.tagline-wrap .rule {
  flex: 0 0 60px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,0.7));
}
.tagline-wrap .rule:last-child {
  background: linear-gradient(90deg, rgba(212,175,55,0.7), transparent);
}
.tagline {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: clamp(20px, 2.3vw, 30px);
  color: var(--silver-light);
  letter-spacing: 0.005em;
  white-space: nowrap;
}
.tagline em {
  font-style: italic;
  color: var(--gold-light);
  padding: 0 2px;
}

.pills {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 44px;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.32em;
  opacity: 0;
  animation: fade-in 1.2s var(--ease-out) 1.8s forwards;
}
.pills li {
  transition: color 0.4s var(--ease-lux), letter-spacing 0.5s var(--ease-lux);
}
.pills li:hover { color: var(--gold-light); letter-spacing: 0.4em; }
.pill-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s var(--ease-lux);
  padding: 2px 0;
}
.pill-link:hover { color: var(--gold-light); }
.pills .dot { color: var(--gold); font-size: 8px; transform: translateY(-1px); }
.pills .dot:hover { color: var(--gold); letter-spacing: 0.32em; }

/* Console / system prompt card — for design/AI/dev audiences */
.console {
  margin-top: 64px;
  width: min(92vw, 560px);
  border: 1px solid rgba(212,175,55,0.22);
  background: rgba(10,8,3,0.72);
  box-shadow:
    0 0 60px rgba(212,175,55,0.06),
    inset 0 0 40px rgba(212,175,55,0.03);
  opacity: 0;
  animation: fade-in 1.2s var(--ease-out) 2.2s forwards;
  text-align: left;
  overflow: hidden;
}
.console-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(212,175,55,0.15);
  background: linear-gradient(180deg, rgba(20,14,2,0.4), rgba(10,8,3,0));
  font-size: 9px;
  letter-spacing: 0.28em;
  color: var(--text-faint);
}
.console-dots {
  display: inline-flex;
  gap: 6px;
}
.console-dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(212,175,55,0.3);
  display: inline-block;
}
.console-dots i:last-child {
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}
.console-title { flex: 1; text-transform: none; letter-spacing: 0.18em; color: var(--text-dim); }
.console-tag { color: var(--gold); }

.console-body {
  padding: 16px 18px 18px;
  display: grid;
  gap: 8px;
}
.console-line {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 16px;
  align-items: baseline;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: none;
  line-height: 1.6;
}
.console-k {
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  white-space: nowrap;
}
.console-v {
  color: var(--text);
  font-weight: 300;
  min-height: 1.3em;
  white-space: normal;
}
.console-caret {
  display: inline-block;
  width: 7px;
  height: 12px;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
  vertical-align: text-bottom;
  margin-left: 4px;
  animation: caret 1s steps(2) infinite;
  animation-delay: 5s;
}
@keyframes caret {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@media (max-width: 560px) {
  .console-line {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .console-k { font-size: 8px; }
}

/* Scroll cue */
.scroll-cue {
  position: absolute;
  bottom: 48px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  color: var(--text-faint);
  text-decoration: none;
  opacity: 0;
  animation: fade-in 1.2s var(--ease-out) 2.4s forwards;
}
.scroll-cue span:first-child {
  font-size: 9px;
  letter-spacing: 0.45em;
}
.scroll-line {
  width: 1px; height: 44px;
  background: linear-gradient(180deg, rgba(212,175,55,0.7), transparent);
  position: relative;
  overflow: hidden;
}
.scroll-line::after {
  content: "";
  position: absolute; left: 0; right: 0;
  top: -14px; height: 14px;
  background: linear-gradient(180deg, transparent, var(--gold-light));
  animation: drip 2.4s var(--ease-lux) infinite;
}
@keyframes drip {
  0%   { transform: translateY(0); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translateY(58px); opacity: 0; }
}

/* =========================================================
   Shared Section
   ========================================================= */

.section {
  position: relative;
  z-index: 5;
  padding: 140px 56px 120px;
  max-width: 1280px;
  margin: 0 auto;
}

.section-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 72px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(212,175,55,0.15);
}
.section-idx {
  color: var(--gold);
  font-weight: 400;
  letter-spacing: 0.3em;
}
.section-title {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(42px, 6vw, 84px);
  color: var(--silver-light);
  letter-spacing: -0.01em;
  line-height: 1;
  text-align: center;
  background: linear-gradient(115deg,
    #a98326 0%, #f5e1a0 40%, #ffffff 50%, #f5e1a0 60%, #a98326 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer-slow 14s linear infinite;
}
@keyframes shimmer-slow {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}
.section-meta {
  color: var(--text-faint);
  letter-spacing: 0.28em;
}

/* Scramble text utility */
.scramble { display: inline-block; }

/* =========================================================
   Section · Signal
   ========================================================= */

.signal-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 440px;
  padding: 20px 0;
}

.sigil {
  width: clamp(280px, 38vw, 440px);
  height: clamp(280px, 38vw, 440px);
  position: relative;
  filter: drop-shadow(0 0 40px rgba(212,175,55,0.18));
}
.sigil-svg { width: 100%; height: 100%; display: block; }

.sigil .ring { transform-origin: 200px 200px; transform-box: view-box; }
.ring-outer { animation: spin 50s linear infinite; }
.ring-mid   { animation: spin 38s linear infinite reverse; }
.ring-core  { animation: spin 70s linear infinite; }
.ring-cross { animation: spin 90s linear infinite reverse; }

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.cipher {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: min(28vw, 260px);
  display: flex; flex-direction: column;
  gap: 10px;
  color: var(--text-faint);
  font-size: 10px;
  letter-spacing: 0.15em;
  pointer-events: none;
}
.cipher-l { left: 0; text-align: right; }
.cipher-r { right: 0; text-align: left; }
.cipher-line {
  white-space: nowrap;
  overflow: hidden;
  transition: color 0.3s;
}
.cipher-line:nth-child(odd)  { color: rgba(212,175,55,0.4); }
.cipher-line:nth-child(even) { color: rgba(232,220,184,0.35); }

.signal-readouts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  margin-top: 64px;
  border: 1px solid rgba(212,175,55,0.2);
  background: rgba(212,175,55,0.05);
}
.readout {
  padding: 18px 22px;
  background: rgba(3,3,3,0.5);
  display: flex; flex-direction: column;
  gap: 6px;
}
.readout-k { color: var(--text-faint); font-size: 9px; letter-spacing: 0.3em; }
.readout-v {
  color: var(--gold-light);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.15em;
  font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; gap: 8px;
}
.dot-ok {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
  animation: pulse-dot 2s ease-in-out infinite;
}

/* =========================================================
   Section · Territory (NL map)
   ========================================================= */

.territory { padding-top: 120px; }

/* Map stage — lightweight SVG */
.map-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.map-stage {
  position: relative;
  width: min(92vw, 720px);
  aspect-ratio: 10 / 9;
  border: 1px solid rgba(212,175,55,0.22);
  background:
    radial-gradient(ellipse at 50% 42%, rgba(10,8,3,0.8) 0%, rgba(3,3,3,0.3) 70%, rgba(3,3,3,0) 100%),
    linear-gradient(180deg, rgba(3,3,3,0.9), rgba(3,3,3,0.5));
  overflow: hidden;
  box-shadow:
    0 0 80px rgba(212,175,55,0.08),
    inset 0 0 60px rgba(212,175,55,0.04);
}
/* Scan line across the frame */
.map-stage::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%, rgba(212,175,55,0.55) 50%, transparent 100%);
  animation: map-scan 8s linear infinite;
  pointer-events: none;
  z-index: 6;
}
@keyframes map-scan {
  0%   { transform: translateY(0); opacity: 0; }
  6%   { opacity: 0.7; }
  94%  { opacity: 0.7; }
  100% { transform: translateY(100%); opacity: 0; }
}

.map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* Context countries — draw in */
.ctx-path {
  stroke-dasharray: 1600;
  stroke-dashoffset: 1600;
  transition: stroke-dashoffset 2.6s var(--ease-lux);
}
.map-wrap.in-view .ctx-path { stroke-dashoffset: 0; }
.ctx-path:nth-child(1) { transition-delay: 0.1s; }
.ctx-path:nth-child(2) { transition-delay: 0.25s; }
.ctx-path:nth-child(3) { transition-delay: 0.4s; }
.ctx-path:nth-child(4) { transition-delay: 0.55s; }
.ctx-path:nth-child(5) { transition-delay: 0.7s; }
.ctx-path:nth-child(6) { transition-delay: 0.85s; }
.ctx-path:nth-child(7) { transition-delay: 1s; }
.ctx-path:nth-child(8) { transition-delay: 1.15s; }

/* Netherlands fill & stroke — drawn after, with glow */
.nl-path {
  stroke-dasharray: 2400;
  stroke-dashoffset: 2400;
  transition: stroke-dashoffset 3s var(--ease-lux) 1.2s, filter 0.6s ease;
  filter: drop-shadow(0 0 0 rgba(212,175,55,0));
}
.map-wrap.in-view .nl-path {
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 14px rgba(245,225,160,0.35));
}

/* Inland water bodies (IJsselmeer + Markermeer) */
.nl-water { /* always visible with NL */ }

/* Hengelo node fades in last */
.hengelo-node {
  opacity: 0;
  transition: opacity 0.6s ease 3.2s;
}
.map-wrap.in-view .hengelo-node { opacity: 1; }

.radar {
  transform-origin: center;
  transform-box: fill-box;
}
.radar-1 { animation: radar-pulse 3.2s ease-out infinite; }
.radar-2 { animation: radar-pulse 3.2s ease-out 0.6s infinite; }
.radar-3 { animation: radar-pulse 3.2s ease-out 1.2s infinite; }
@keyframes radar-pulse {
  0%   { transform: scale(0.35); opacity: 1; }
  80%  { opacity: 0; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* Satellite drifts across the map */
.sat-g {
  opacity: 0;
  transition: opacity 0.6s ease 1.4s;
}
.map-wrap.in-view .sat-g { opacity: 1; }
.satellite-svg {
  filter: drop-shadow(0 0 4px rgba(245,225,160,0.65));
  animation: sat-orbit 22s linear 2s infinite;
}
@keyframes sat-orbit {
  0%   { transform: translate(-60px, 60px) rotate(14deg); }
  100% { transform: translate(680px, 40px) rotate(-4deg); }
}

/* HUD */
.map-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 7;
}
.hud-corner {
  position: absolute;
  padding: 10px 14px;
  background: rgba(3,3,3,0.58);
  border: 1px solid rgba(212,175,55,0.2);
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.8s var(--ease-lux) 0.6s;
}
.map-wrap.in-view .hud-corner { opacity: 1; }
.hud-tl { top: 16px; left: 16px; }
.hud-tr { top: 16px; right: 16px; text-align: right; align-items: flex-end; }
.hud-bl { bottom: 16px; left: 16px; }
.hud-br { bottom: 16px; right: 16px; text-align: right; align-items: flex-end; }
.hud-k {
  color: rgba(232,220,184,0.4);
  font-size: 8px;
  letter-spacing: 0.32em;
}
.hud-v {
  color: var(--gold-light);
  font-size: 10px;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  color: var(--text-faint);
  font-size: 10px;
  letter-spacing: 0.28em;
}
.map-id { color: var(--gold-light); }
.map-sep { color: rgba(212,175,55,0.4); }
.blink { color: var(--gold); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* =========================================================
   Section · Rendezvous
   ========================================================= */

.rendezvous {
  padding-bottom: 160px;
}
.rdv-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 64px;
}
.rdv-lead {
  font-family: "Instrument Serif", serif;
  font-size: clamp(20px, 2.4vw, 28px);
  color: var(--silver-light);
  text-align: center;
  line-height: 1.35;
  letter-spacing: 0.005em;
}
.rdv-lead em {
  color: var(--gold-light);
  font-style: italic;
}

/* CTA */
.cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 44px;
}
.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 30px;
  padding: 38px 64px;
  text-decoration: none;
  color: var(--gold-light);
  font-family: "Unbounded", sans-serif;
  font-weight: 700;
  font-size: clamp(32px, 4vw, 56px);
  letter-spacing: 0.01em;
  isolation: isolate;
  overflow: visible;
  transition: transform 0.5s var(--ease-lux), color 0.3s;
}
.cta:hover { transform: translateY(-3px); color: #fff; }

.cta-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cta-corner {
  position: absolute;
  width: 18px; height: 18px;
  border-color: var(--gold);
  transition: all 0.5s var(--ease-lux);
}
.cta-corner.tl { top: 0; left: 0; border-top: 1px solid; border-left: 1px solid; }
.cta-corner.tr { top: 0; right: 0; border-top: 1px solid; border-right: 1px solid; }
.cta-corner.bl { bottom: 0; left: 0; border-bottom: 1px solid; border-left: 1px solid; }
.cta-corner.br { bottom: 0; right: 0; border-bottom: 1px solid; border-right: 1px solid; }
.cta:hover .cta-corner { width: 26px; height: 26px; border-color: var(--gold-light); }

/* Orbiting gold trace around the CTA */
.cta-orbit {
  position: absolute;
  inset: -1px;
  border: 1px solid transparent;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, var(--gold) 30%, var(--gold-light) 50%, var(--gold) 70%, transparent) border-box;
  -webkit-mask:
    linear-gradient(#000 0 0) padding-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0.9;
  background-size: 300% 100%;
  animation: orbit-trace 4s linear infinite;
}
@keyframes orbit-trace {
  0%   { background-position: 0% 0%; }
  100% { background-position: 300% 0%; }
}

.cta-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.cta-main {
  background: linear-gradient(115deg,
    #a98326 0%, #f5e1a0 40%, #ffffff 50%, #f5e1a0 60%, #a98326 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer-slow 6s linear infinite;
}
.cta-sub {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.3em;
}
.cta-arrow {
  color: var(--gold);
  transition: transform 0.5s var(--ease-lux), color 0.3s;
  flex-shrink: 0;
}
.cta:hover .cta-arrow { transform: translate(4px, -4px); color: var(--gold-light); }

/* Channels */
.cta-channels {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.26em;
}
.channel {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  text-align: center;
  transition: color 0.4s var(--ease-lux);
}
.channel-k { color: var(--text-faint); font-size: 9px; }
.channel-v {
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: none;
}
.channel:hover { color: var(--gold-light); }
.channel:hover .channel-v { color: var(--gold-light); }

.channel-sep {
  width: 1px; height: 22px;
  background: linear-gradient(180deg, transparent, rgba(212,175,55,0.5), transparent);
}

/* =========================================================
   Footer (at end of doc)
   ========================================================= */

.foot {
  position: relative;
  z-index: 5;
  padding: 36px 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.28em;
  border-top: 1px solid rgba(212,175,55,0.12);
}
.foot-item { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.foot-item.right { color: var(--text-faint); }
.foot .line {
  flex: 1; height: 1px; margin: 0 28px;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,0.35), transparent);
}
.pulse-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 8px var(--gold);
  animation: pulse-dot 2s ease-in-out infinite;
}
.foot-link {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.3s var(--ease-lux);
}
.foot-link:hover { color: var(--gold-light); }
.foot-sep { color: rgba(212,175,55,0.4); margin: 0 8px; }

/* =========================================================
   Shared animations
   ========================================================= */

@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slip-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   Custom cursor
   ========================================================= */

.cursor, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 10001;
  mix-blend-mode: screen;
  will-change: transform;
}
.cursor {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 8px var(--gold), 0 0 20px rgba(212,175,55,0.6);
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}
.cursor-ring {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(212,175,55,0.45);
  transform: translate(-50%, -50%);
  transition: width 0.4s var(--ease-lux), height 0.4s var(--ease-lux),
              border-color 0.4s var(--ease-lux), opacity 0.3s;
  opacity: 0.8;
}
.cursor.is-hover { width: 12px; height: 12px; }
.cursor-ring.is-hover { width: 56px; height: 56px; border-color: var(--gold); }

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 960px) {
  .section { padding: 100px 24px 80px; }
  .section-head {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 10px;
  }
  .section-idx, .section-meta { justify-self: center; }
  .signal-readouts { grid-template-columns: repeat(2, 1fr); }
  .cipher { display: none; }
  .foot {
    padding: 28px 24px;
    flex-direction: column;
    gap: 18px;
    text-align: center;
  }
  .foot .line { display: none; }
}

@media (max-width: 680px) {
  .nav {
    padding: 14px 18px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
  }
  .nav-brand {
    display: inline-block;
    grid-column: 1;
    justify-self: start;
  }
  .mark {
    grid-column: 2;
    justify-self: center;
    gap: 8px;
  }
  .nav-right {
    grid-column: 3;
    justify-self: end;
    gap: 12px;
  }
  /* Simpler clock on mobile: dot + HH:MM only, compact */
  .mark-label, .mark-sep { display: none; }
  .mark-time {
    font-size: 9px;
    letter-spacing: 0.12em;
    min-width: auto;
  }
  .nav-anchor { display: none; }
  .nav-link { font-size: 9px; letter-spacing: 0.12em; }
  .nav-link svg { display: none; }
  .tagline { white-space: normal; }
  .tagline-wrap .rule { flex: 0 0 28px; }
  .pills { gap: 14px; font-size: 11px; }
  .corner { width: 20px; height: 20px; }
  .corner.tl, .corner.tr { top: 14px; }
  .corner.bl, .corner.br { bottom: 14px; }
  .corner.tl, .corner.bl { left: 14px; }
  .corner.tr, .corner.br { right: 14px; }
  .cta { padding: 24px 34px; }
  .cta-channels { flex-direction: column; gap: 18px; }
  .channel-sep { display: none; }
  .rail { display: none; }
}

@media (pointer: coarse) {
  .cursor, .cursor-ring { display: none; }
}

/* =========================================================
   Mobile / Low-power — spectacular AND fast
   Keep the atmosphere, cut only the GPU-killers
   ========================================================= */

/* Content-visibility so off-screen sections skip rendering work */
.section {
  content-visibility: auto;
  contain-intrinsic-size: 1px 800px;
}

/* ------- Low-power: smaller + slower, NOT stripped ------- */

/* Orbs: scale down but keep all three for composition */
.low-power .orb-1 {
  width: 480px; height: 480px;
  filter: blur(60px);
  top: -160px; left: -160px;
  animation-duration: 40s;
}
.low-power .orb-2 {
  width: 400px; height: 400px;
  filter: blur(60px);
  bottom: -140px; right: -140px;
  animation-duration: 46s;
}
.low-power .orb-3 {
  width: 300px; height: 300px;
  filter: blur(60px);
  animation-duration: 52s;
}

/* Grain stays but slower + quieter */
.low-power .grain {
  opacity: 0.07;
  animation-duration: 2.4s;
}

/* Scanline stays but slower (less visible, less CPU) */
.low-power .scanline {
  animation-duration: 18s;
  opacity: 0.55;
}

/* Sigil rings: keep rotating but slower */
.low-power .ring-outer { animation-duration: 90s; }
.low-power .ring-mid   { animation-duration: 70s; }
.low-power .ring-core  { animation-duration: 120s; }
.low-power .ring-cross { animation-duration: 150s; }

/* Logo glow pulse stays, just a bit slower */
.low-power .logo .logo-text::after {
  animation-duration: 8s;
}

/* Heavy backdrop-filter blur → solid (GPU-friendly) */
.low-power .nav {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: linear-gradient(180deg, rgba(3,3,3,0.75), rgba(3,3,3,0.1));
}
.low-power .hud-corner {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(3,3,3,0.75);
}

/* Map stage: keep the atmosphere including scan line but slower */
.low-power .map-stage { box-shadow: 0 0 50px rgba(212,175,55,0.06); }
.low-power .map-stage::after { animation-duration: 14s; }

/* Radar rings on Hengelo: slower on mobile (less paint work) */
.low-power .radar-1,
.low-power .radar-2,
.low-power .radar-3 { animation-duration: 4.2s; }

/* CTA orbit trace: slower */
.low-power .cta-orbit { animation-duration: 7s; }

/* =========================================================
   CONTACT — 3D-print fabricator modal
   ========================================================= */

.contact-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  max-height: 100vh;
  height: 100vh;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  overflow: hidden;
  z-index: 9999;
}
.contact-modal:not([open]) { display: none; }
.contact-modal::backdrop { background: transparent; }

/* backdrop blur layer */
.contact-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 3, 0.78);
  backdrop-filter: blur(14px) saturate(0.8);
  -webkit-backdrop-filter: blur(14px) saturate(0.8);
  opacity: 0;
  animation: fade-in 0.4s var(--ease-out) forwards;
}
.low-power .contact-backdrop {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(3, 3, 3, 0.92);
}

/* The fabrication sheet — rises from the build plate */
.contact-sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92vw, 640px);
  max-height: min(88vh, 860px);
  overflow: auto;
  padding: 48px 44px 40px;
  border: 1px solid rgba(212, 175, 55, 0.32);
  background:
    radial-gradient(circle at 50% 10%, rgba(14, 10, 2, 0.92) 0%, rgba(6, 5, 2, 0.96) 65%),
    linear-gradient(180deg, rgba(10, 8, 3, 0.95), rgba(3, 3, 3, 0.98));
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.7),
    0 0 80px rgba(212, 175, 55, 0.18),
    inset 0 0 60px rgba(212, 175, 55, 0.05);
  transform-origin: 50% 100%;
  transform: translate(-50%, -40%) rotateX(-24deg) translateY(160px) scale(0.85);
  opacity: 0;
  animation: sheet-raise 1.1s cubic-bezier(0.2, 0.9, 0.28, 1.1) 0.15s forwards;
}
@keyframes sheet-raise {
  0%   { opacity: 0; transform: translate(-50%, -40%) rotateX(-24deg) translateY(160px) scale(0.85); }
  55%  { opacity: 1; }
  100% { opacity: 1; transform: translate(-50%, -50%) rotateX(0deg) translateY(0) scale(1); }
}

/* Build-plate grid background */
.print-bed {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(212, 175, 55, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 175, 55, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, transparent 0%, black 18%, black 82%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 18%, black 82%, transparent 100%);
  z-index: 0;
}

/* Scanning print-head line */
.print-scan {
  position: absolute;
  left: 0; right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(245, 225, 160, 0.05) 10%,
    var(--gold) 50%,
    rgba(245, 225, 160, 0.05) 90%,
    transparent 100%);
  box-shadow: 0 0 20px var(--gold-light);
  opacity: 0;
  animation: scan-travel 2.6s ease-in-out 0.3s forwards, scan-loop 8s ease-in-out 3s infinite;
  z-index: 1;
  pointer-events: none;
}
@keyframes scan-travel {
  0%   { opacity: 0; top: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { opacity: 0; top: 100%; }
}
@keyframes scan-loop {
  0%   { opacity: 0; top: 0; }
  10%  { opacity: 0.9; }
  50%  { top: 100%; opacity: 0.9; }
  55%  { opacity: 0; }
  100% { opacity: 0; top: 0; }
}

/* Corner brackets */
.contact-corners { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.c-corner {
  position: absolute;
  width: 20px; height: 20px;
  border-color: var(--gold);
  opacity: 0;
  animation: fade-in 0.6s var(--ease-out) 0.8s forwards;
}
.c-corner.tl { top: 12px; left: 12px; border-top: 1px solid; border-left: 1px solid; }
.c-corner.tr { top: 12px; right: 12px; border-top: 1px solid; border-right: 1px solid; }
.c-corner.bl { bottom: 12px; left: 12px; border-bottom: 1px solid; border-left: 1px solid; }
.c-corner.br { bottom: 12px; right: 12px; border-bottom: 1px solid; border-right: 1px solid; }

/* Close button — large, prominent, always visible above content */
.contact-close {
  position: sticky;
  top: 14px;
  margin-left: auto;
  margin-right: -20px;
  margin-top: -20px;
  margin-bottom: -44px;
  float: right;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  background: rgba(3, 3, 3, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.55);
  color: var(--gold-light);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.3s var(--ease-lux);
  z-index: 20;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}
.contact-close:hover,
.contact-close:focus-visible {
  background: var(--gold-deep);
  color: #fff;
  transform: rotate(90deg);
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.45);
}

/* Header */
.contact-head {
  position: relative;
  z-index: 3;
  text-align: center;
  margin-bottom: 24px;
}
.contact-idx {
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  margin-bottom: 14px;
}
.contact-idx .bracket { color: var(--gold); font-size: 12px; }
.contact-title {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(36px, 5.2vw, 64px);
  line-height: 1;
  margin: 0 0 14px;
  background: linear-gradient(115deg,
    #a98326 0%, #f5e1a0 40%, #ffffff 50%, #f5e1a0 60%, #a98326 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer-slow 8s linear infinite;
}
.contact-meta {
  color: var(--text-faint);
  font-size: 9px;
  letter-spacing: 0.28em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Print-head progress bar */
.print-head {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(3, 3, 3, 0.55);
  margin-bottom: 28px;
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.24em;
}
.ph-label { color: var(--gold); }
.ph-count { color: var(--gold-light); font-variant-numeric: tabular-nums; }
.ph-track {
  position: relative;
  height: 2px;
  background: rgba(212, 175, 55, 0.15);
  overflow: hidden;
}
.ph-bar {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light));
  box-shadow: 0 0 8px var(--gold);
  animation: ph-fill 2.4s ease-out 0.3s forwards;
}
@keyframes ph-fill {
  0%   { width: 0%; }
  100% { width: 100%; }
}

/* Form */
.contact-form {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.field { position: relative; display: block; }
.field-k {
  display: block;
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.32em;
  margin-bottom: 8px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: rgba(3, 3, 3, 0.4);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 0;
  color: var(--silver-light);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 300;
  font-size: 13px;
  letter-spacing: 0.05em;
  padding: 12px 14px;
  transition: border-color 0.3s var(--ease-lux), background 0.3s var(--ease-lux), box-shadow 0.3s var(--ease-lux);
  appearance: none;
  -webkit-appearance: none;
}
.field input::placeholder,
.field textarea::placeholder { color: rgba(232, 220, 184, 0.3); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(10, 8, 3, 0.6);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.25), 0 0 24px rgba(212, 175, 55, 0.12);
}
.field textarea { resize: vertical; min-height: 90px; }

/* Gold under-rail animated on focus */
.field-rail {
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s var(--ease-lux);
  pointer-events: none;
}
.field:focus-within .field-rail { transform: scaleX(1); }

/* Custom select chevron */
.field-select { position: relative; }
.field-chevron {
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: var(--gold);
  pointer-events: none;
  font-size: 12px;
}
.field select {
  padding-right: 32px;
  background-image: none;
}
.field select option {
  background: #050404;
  color: var(--silver-light);
}

/* Form foot with Transmit button */
.form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.form-note {
  color: var(--text-faint);
  font-size: 9px;
  letter-spacing: 0.28em;
}

.send-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background: rgba(3, 3, 3, 0.4);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--gold-light);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.4s var(--ease-lux);
  isolation: isolate;
}
.send-btn:hover {
  border-color: var(--gold);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.2);
}
.send-frame {
  position: absolute;
  inset: -1px;
  pointer-events: none;
}
.sf-corner {
  position: absolute;
  width: 10px; height: 10px;
  border-color: var(--gold);
  transition: all 0.4s var(--ease-lux);
}
.sf-corner.tl { top: -1px; left: -1px; border-top: 1px solid; border-left: 1px solid; }
.sf-corner.tr { top: -1px; right: -1px; border-top: 1px solid; border-right: 1px solid; }
.sf-corner.bl { bottom: -1px; left: -1px; border-bottom: 1px solid; border-left: 1px solid; }
.sf-corner.br { bottom: -1px; right: -1px; border-bottom: 1px solid; border-right: 1px solid; }
.send-btn:hover .sf-corner { width: 16px; height: 16px; }
.send-arrow {
  transition: transform 0.4s var(--ease-lux);
}
.send-btn:hover .send-arrow { transform: translate(3px, -3px); }
.send-btn:disabled { opacity: 0.6; cursor: wait; }

/* Layer stagger — each field "prints" in */
.layer {
  opacity: 0;
  transform: translateY(14px);
  animation: layer-print 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.layer-1 { animation-delay: 0.55s; }
.layer-2 { animation-delay: 0.75s; }
.layer-3 { animation-delay: 0.95s; }
.layer-4 { animation-delay: 1.15s; }
.layer-5 { animation-delay: 1.35s; }
@keyframes layer-print {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Success state */
.form-success {
  display: none;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.08), rgba(3, 3, 3, 0.4));
  color: var(--gold-light);
  margin-top: 14px;
}
.form-success[data-show] { display: flex; }
.form-success svg { flex-shrink: 0; color: var(--gold); }
.form-success strong { display: block; font-family: "Instrument Serif", serif; font-size: 17px; font-style: italic; color: #fff; font-weight: 400; margin-bottom: 4px; }
.form-success .mono { color: rgba(232, 220, 184, 0.65); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; }

/* Mobile — slide up from bottom, no 3D rotate */
@media (max-width: 680px) {
  .contact-modal { position: fixed; }
  .contact-sheet {
    padding: 18px 18px 26px;
    width: 100vw;
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
    left: 0; top: 0;
    transform-origin: 50% 100%;
    transform: translate(0, 100%);
    animation: sheet-slide-up 0.55s cubic-bezier(0.2, 0.9, 0.28, 1.05) 0.05s forwards;
    border-left: 0; border-right: 0;
    border-top: 1px solid rgba(212, 175, 55, 0.32);
    border-bottom: 0;
  }
  @keyframes sheet-slide-up {
    from { opacity: 0; transform: translate(0, 100%); }
    to   { opacity: 1; transform: translate(0, 0); }
  }
  .contact-close {
    width: 48px; height: 48px;
    font-size: 26px;
    margin: 0 -4px 8px auto;
  }
  .c-corner { width: 14px; height: 14px; }
  .form-foot { flex-direction: column; align-items: stretch; gap: 14px; }
  .send-btn { width: 100%; justify-content: center; }
  .print-head { grid-template-columns: auto 1fr; gap: 10px; }
  .print-head .ph-count { grid-column: 1 / -1; text-align: right; }
  /* Slim down large title on small screens */
  .contact-title { font-size: clamp(32px, 8vw, 48px); }
  .contact-head { margin-bottom: 16px; }
  .contact-idx { margin-bottom: 10px; }
}

/* Low-power: disable the infinite scan loop inside modal to save CPU */
.low-power .print-scan {
  animation: scan-travel 2.6s ease-in-out 0.3s forwards;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .contact-sheet,
  .layer,
  .ph-bar,
  .print-scan,
  .c-corner {
    animation: none !important;
    opacity: 1 !important;
    transform: translate(-50%, -50%) !important;
  }
}

/* Reduced motion: freeze everything for accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #neural { display: none; }
  .grain, .scanline { display: none; }
}
