/* ═══════════════════════════════════════════════════════════
   JARVIS — cinematic scroll site
   Palette lifted from the real HUD: cyan rgba(40,232,255) on #04070d
   ═══════════════════════════════════════════════════════════ */

:root {
  --cyan: 40, 232, 255;
  --ice: 205, 238, 255;
  --dim: 127, 214, 232;
  --gold: 255, 190, 100;
  --bg0: #01030a;
  --bg1: #04070d;
  --bg2: #0a1420;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --mono: 'Chakra Petch', 'SF Mono', monospace;
  --disp: 'Audiowide', 'Chakra Petch', sans-serif;
}

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

html { scroll-behavior: auto; }
html, body { background: #000; }

body {
  color: rgb(var(--ice));
  font-family: var(--mono);
  overflow-x: hidden;
  background: #000;
  -webkit-font-smoothing: antialiased;
}
body.no-touch, body.no-touch a { cursor: none; }

::selection { background: rgba(var(--cyan), .35); color: #fff; }
::-webkit-scrollbar { display: none; }
html { scrollbar-width: none; }

body.locked { overflow: hidden; height: 100vh; }

/* ─────────────── LOADER ─────────────── */

#loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg0);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 26px;
  transition: clip-path 1s cubic-bezier(.76, 0, .24, 1);
  clip-path: inset(0 0 0 0);
}
#loader.done { clip-path: inset(0 0 100% 0); pointer-events: none; }

.loader-core { position: relative; display: grid; place-items: center; }
.loader-ring {
  position: absolute; width: 190px; height: 190px; border-radius: 50%;
  border: 1px solid rgba(var(--cyan), .16);
  border-top-color: rgba(var(--cyan), .75);
  animation: spin 1.3s linear infinite;
}
.loader-ring::after {
  content: ''; position: absolute; inset: 14px; border-radius: 50%;
  border: 1px dashed rgba(var(--cyan), .12);
  animation: spin 9s linear infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }

#loader-num {
  font-family: var(--disp);
  font-size: 56px;
  color: rgb(var(--ice));
  text-shadow: 0 0 30px rgba(var(--cyan), .55);
  letter-spacing: 2px;
  min-width: 190px; text-align: center;
  padding: 60px 0;
}

#loader-line {
  font-size: 10px; letter-spacing: 5px;
  color: rgb(var(--dim));
  min-height: 14px;
  animation: flicker 2.2s infinite;
}
@keyframes flicker { 0%,100% {opacity:.9} 92% {opacity:.9} 94% {opacity:.35} 96% {opacity:.9} }

.loader-bar {
  width: min(320px, 60vw); height: 1px;
  background: rgba(var(--cyan), .14);
}
#loader-fill {
  display: block; height: 100%; width: 0%;
  background: rgb(var(--cyan));
  box-shadow: 0 0 12px rgba(var(--cyan), .8);
}

.loader-foot {
  position: absolute; bottom: 28px; left: 32px; right: 32px;
  display: flex; justify-content: space-between;
  font-size: 9px; letter-spacing: 3px; color: rgba(var(--dim), .55);
}

/* ─────────────── WORLD LAYERS ─────────────── */

#scene {
  position: fixed; inset: 0; z-index: 1;
  width: 100vw; height: 100vh;
  opacity: 0; transition: opacity 1.6s ease .2s;
}
body.ready #scene { opacity: 1; }

/* Three.js hologram layer — the real Mark 85 mesh shown in the hero,
   crossfaded into the particle canvas as you scroll past it */
#holo {
  position: fixed; inset: 0; z-index: 2;
  pointer-events: none;
  opacity: 0; transition: opacity .9s ease;
}
body.ready #holo { opacity: 1; }
#holo canvas { display: block; width: 100%; height: 100%; }

/* ambient scene glow removed — pure black behind the particle cloud */
#glow { display: none; }

/* vignette — darkens the particle field toward the edges to frame the
   composition. Sits above the canvas but below the copy (z-index 20). */
#vignette {
  position: fixed; inset: 0; z-index: 5; pointer-events: none;
  background:
    radial-gradient(ellipse 92% 82% at 50% 44%, transparent 42%, rgba(0,2,6,0.5) 100%),
    linear-gradient(180deg, rgba(0,2,6,0.5) 0%, transparent 18% 82%, rgba(0,2,6,0.6) 100%);
}

#grain {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* corner frame brackets */
.frame { position: fixed; inset: 18px; z-index: 30; pointer-events: none; }
.frame .c { position: absolute; width: 22px; height: 22px; opacity: .45; }
.frame .tl { top: 0; left: 0; border-top: 1px solid rgb(var(--dim)); border-left: 1px solid rgb(var(--dim)); }
.frame .tr { top: 0; right: 0; border-top: 1px solid rgb(var(--dim)); border-right: 1px solid rgb(var(--dim)); }
.frame .bl { bottom: 0; left: 0; border-bottom: 1px solid rgb(var(--dim)); border-left: 1px solid rgb(var(--dim)); }
.frame .br { bottom: 0; right: 0; border-bottom: 1px solid rgb(var(--dim)); border-right: 1px solid rgb(var(--dim)); }

/* ─────────────── CHROME (header + telemetry) ─────────────── */

#chrome-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 30px 44px;
  opacity: 0; transform: translateY(-12px);
  transition: opacity 1s ease .6s, transform 1s ease .6s;
}
body.ready #chrome-top { opacity: 1; transform: none; }

.wordmark {
  font-family: var(--disp); font-size: 15px; letter-spacing: 5px;
  color: rgb(var(--ice)); text-decoration: none;
  text-shadow: 0 0 16px rgba(var(--cyan), .5);
}

#chrome-top nav { display: flex; gap: 34px; }
#chrome-top nav a {
  font-size: 10px; letter-spacing: 4px;
  color: rgba(var(--dim), .85); text-decoration: none;
  position: relative; padding: 4px 0;
  transition: color .3s;
}
#chrome-top nav a::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: rgb(var(--cyan));
  transform: scaleX(0); transform-origin: right;
  transition: transform .4s cubic-bezier(.76, 0, .24, 1);
}
#chrome-top nav a:hover { color: rgb(var(--ice)); }
#chrome-top nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.status { display: flex; align-items: center; gap: 9px; font-size: 10px; letter-spacing: 3px; color: rgb(var(--dim)); }
.status .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgb(var(--cyan));
  box-shadow: 0 0 10px rgba(var(--cyan), .9);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }

.chrome-corner {
  position: fixed; bottom: 34px; z-index: 50;
  font-size: 9px; letter-spacing: 2.5px; color: rgb(var(--dim));
  line-height: 2;
  opacity: 0; transition: opacity 1s ease 1s;
}
body.ready .chrome-corner { opacity: 1; }
#chrome-br { right: 44px; text-align: right; }
#tel-section { font-family: var(--disp); font-size: 13px; color: rgb(var(--ice)); }
.tel-dim { color: rgba(var(--dim), .5); }
.progress-rail {
  width: 120px; height: 1px; margin: 8px 0 8px auto;
  background: rgba(var(--cyan), .15);
}
#progress-fill {
  display: block; height: 100%; width: 0%;
  background: rgb(var(--cyan));
  box-shadow: 0 0 8px rgba(var(--cyan), .7);
}

/* ─────────────── SECTIONS ─────────────── */

main { position: relative; z-index: 20; }

.pin { height: 220vh; position: relative; }
#hero.pin { height: 200vh; }

.sticky {
  position: sticky; top: 0; height: 100vh;
  display: flex; align-items: center;
  padding: 0 9vw;
}
.sticky.center { justify-content: center; text-align: center; }
.sticky.left { justify-content: flex-start; }
.sticky.right { justify-content: flex-end; }

/* readability shadow — a soft pool attached to EACH TEXT BLOCK, not to the
   viewport. It travels with the copy and fades out in every direction well
   inside its own bounds, so no screen-sized rectangle can ever sweep across
   the scene as sections hand off (that was the "black box" artifact). */
.block::before, .hero-inner::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  inset: -3.5em -5em;
  background: radial-gradient(ellipse 62% 58% at 50% 50%,
    rgba(1,4,10,0.86) 0%, rgba(1,4,10,0.52) 46%, transparent 72%);
}
/* hero title keeps a lighter veil so the Mark 85 stays vivid behind it */
.hero-inner::before {
  background: radial-gradient(ellipse 56% 50% at 50% 50%,
    rgba(1,4,10,0.5) 0%, rgba(1,4,10,0.22) 46%, transparent 70%);
}

.block { max-width: 620px; position: relative; z-index: 2; will-change: transform, opacity; }
.hero-inner { position: relative; z-index: 2; }
.center-block { text-align: center; }
.center-block .specs { text-align: left; }

/* hero */
.hero-inner { will-change: transform, opacity; }
.eyebrow {
  font-size: 10px; letter-spacing: 7px; color: rgb(var(--dim));
  text-shadow: 0 1px 12px rgba(0,0,0,0.85);
  margin-bottom: 3.2vh;
}
.hero-title {
  font-family: var(--disp);
  font-size: clamp(64px, 16.5vw, 230px);
  font-weight: 400;
  letter-spacing: .06em;
  line-height: 1;
  color: rgb(var(--ice));
  text-shadow: 0 0 60px rgba(var(--cyan), .35), 0 0 140px rgba(var(--cyan), .18);
  display: flex; justify-content: center;
}
.hero-title span {
  display: inline-block;
  transform: translateY(115%) rotate(4deg);
  opacity: 0;
  transition: transform 1.1s cubic-bezier(.19, 1, .22, 1), opacity .7s ease;
}
body.ready .hero-title span { transform: none; opacity: 1; }
body.ready .hero-title span:nth-child(1) { transition-delay: .30s }
body.ready .hero-title span:nth-child(2) { transition-delay: .38s }
body.ready .hero-title span:nth-child(3) { transition-delay: .46s }
body.ready .hero-title span:nth-child(4) { transition-delay: .54s }
body.ready .hero-title span:nth-child(5) { transition-delay: .62s }
body.ready .hero-title span:nth-child(6) { transition-delay: .70s }

.hero-sub {
  margin-top: 3vh;
  font-size: clamp(10px, 1.2vw, 13px);
  letter-spacing: .5em;
  color: rgb(var(--dim));
  text-shadow: 0 1px 12px rgba(0,0,0,0.85);
}
.hero-tag {
  margin-top: 2vh;
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(17px, 1.9vw, 24px);
  color: rgba(var(--ice), .85);
  text-shadow: 0 1px 14px rgba(0,0,0,0.85);
}

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1.2s ease, transform 1.2s cubic-bezier(.19,1,.22,1); }
body.ready .reveal { opacity: 1; transform: none; }
body.ready .eyebrow.reveal { transition-delay: .9s; }
body.ready .hero-sub.reveal { transition-delay: 1.05s; }
body.ready .hero-tag.reveal { transition-delay: 1.2s; }

.scroll-hint {
  position: absolute; bottom: 5vh; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  font-size: 9px; letter-spacing: 5px; color: rgba(var(--dim), .7);
  opacity: 0; transition: opacity 1.4s ease 1.8s;
}
body.ready .scroll-hint { opacity: 1; }
.scroll-hint i {
  width: 1px; height: 52px;
  background: linear-gradient(rgb(var(--cyan)), transparent);
  animation: drop 2s cubic-bezier(.76, 0, .24, 1) infinite;
  transform-origin: top;
}
@keyframes drop { 0% { transform: scaleY(0) } 45% { transform: scaleY(1) } 100% { transform: scaleY(0); transform-origin: bottom } }

/* chapter blocks */
.chip {
  display: inline-flex; align-items: center; gap: 14px;
  font-size: 10px; letter-spacing: 5px; font-weight: 600;
  color: rgb(var(--cyan));
  text-shadow: 0 1px 10px rgba(0,0,0,0.85);
  margin-bottom: 3.4vh;
}
.chip::before { content: ''; width: 44px; height: 1px; background: rgba(var(--cyan), .6); }
.center-block .chip::after { content: ''; width: 44px; height: 1px; background: rgba(var(--cyan), .6); }

h2, #end h3 {
  font-family: var(--serif);
  font-weight: 300; font-style: italic;
  font-size: clamp(44px, 6.4vw, 92px);
  line-height: 1.02;
  color: rgb(var(--ice));
  letter-spacing: .01em;
  text-shadow: 0 2px 26px rgba(0,0,0,0.9), 0 0 48px rgba(var(--cyan), .16);
  margin-bottom: 3.2vh;
}

.lead {
  font-size: clamp(13px, 1.25vw, 16px);
  font-weight: 300;
  line-height: 1.9;
  letter-spacing: .04em;
  color: rgba(230, 246, 255, 0.95);
  text-shadow: 0 1px 12px rgba(0,0,0,0.9), 0 0 2px rgba(0,0,0,0.7);
  max-width: 54ch;
}
.center-block .lead { margin: 0 auto; }
.lead em {
  font-style: normal; color: rgb(var(--cyan));
  text-shadow: 0 0 14px rgba(var(--cyan), .4);
}

.specs {
  list-style: none;
  margin-top: 4.2vh;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0 34px;
}
.specs li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 13px 2px;
  border-top: 1px solid rgba(var(--cyan), .28);
  font-size: 10px; letter-spacing: 2.5px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.85);
}
.specs li b { font-weight: 600; color: rgba(var(--dim), .92); }
.specs li span { color: rgb(var(--ice)); text-align: right; }
.specs.grid4 { grid-template-columns: repeat(4, 1fr); gap: 0 18px; }
.specs.grid4 li { justify-content: center; text-align: center; }
.specs.grid4 li span { text-align: center; color: rgba(var(--ice), .95); }

/* ─────────────── FOOTER ─────────────── */

#end {
  min-height: 100vh; position: relative; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 12vh 8vw;
}
#end::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 62% 74% at 50% 50%,
    rgba(1,4,10,0.95) 0%, rgba(1,4,10,0.86) 36%, rgba(1,4,10,0.5) 56%,
    rgba(1,4,10,0) 80%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 15%, #000 85%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 15%, #000 85%, transparent 100%);
}
.end-inner { position: relative; z-index: 2; }
.end-inner .chip { justify-content: center; }
.end-inner .chip::after { content: ''; width: 44px; height: 1px; background: rgba(var(--cyan), .6); }
#end h3 { font-size: clamp(42px, 7.5vw, 110px); margin-bottom: 6vh; }
.end-meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 44px;
  font-size: 9px; letter-spacing: 3px; color: rgba(var(--dim), .75);
  text-shadow: 0 1px 10px rgba(0,0,0,0.85);
  margin-bottom: 7vh;
}
.back-top {
  font-size: 10px; letter-spacing: 4px;
  color: rgb(var(--dim)); text-decoration: none;
  border: 1px solid rgba(var(--cyan), .3);
  padding: 15px 34px; border-radius: 40px;
  transition: all .4s ease;
  background: rgba(var(--cyan), .03);
}
.back-top:hover {
  color: #fff; border-color: rgba(var(--cyan), .9);
  box-shadow: 0 0 30px rgba(var(--cyan), .25), inset 0 0 18px rgba(var(--cyan), .08);
}

/* ─────────────── CURSOR ─────────────── */

#cursor { position: fixed; top: 0; left: 0; z-index: 90; pointer-events: none; display: none; }
body.no-touch #cursor { display: block; }
.cur-dot, .cur-ring { position: fixed; border-radius: 50%; transform: translate(-50%, -50%); }
.cur-dot {
  width: 4px; height: 4px; background: rgb(var(--cyan));
  box-shadow: 0 0 8px rgba(var(--cyan), .9);
}
.cur-ring {
  width: 34px; height: 34px;
  border: 1px solid rgba(var(--cyan), .5);
  transition: width .35s ease, height .35s ease, border-color .35s ease;
}
#cursor.hot .cur-ring { width: 58px; height: 58px; border-color: rgba(var(--cyan), .95); }

/* ─────────────── RESPONSIVE ─────────────── */

@media (max-width: 860px) {
  #chrome-top { padding: 22px 20px; }
  #chrome-top nav { display: none; }
  .frame { inset: 12px; }
  #chrome-bl { left: 20px; bottom: 22px; }
  #chrome-br { right: 20px; bottom: 22px; }
  #tel-sys { display: none; }
  .sticky { padding: 0 7vw; }
  .sticky.left, .sticky.right { justify-content: center; }
  .specs { grid-template-columns: 1fr; }
  .specs.grid4 { grid-template-columns: repeat(2, 1fr); }
  .pin { height: 190vh; }
  .lead { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}
