/* ============================================================
   components.css — cursor, nav, buttons, reveals, chrome
   ============================================================ */

/* ============================================================
   CURSOR — a literal vector: a head that tracks exactly, a tail
   that lags, and the arrow between them. The lag *is* velocity,
   so the readout beside it prints real magnitude and direction.
   ============================================================ */
.cursor{
  position:fixed; top:0; left:0;
  z-index:9500;
  pointer-events:none;
  opacity:0;
  transition:opacity .35s var(--ease);
}
.cursor.is-ready{ opacity:1; }
.cursor.is-out{ opacity:0; }

.cursor-dot{
  position:fixed; top:0; left:0;
  width:7px; height:7px;
  margin:-3.5px 0 0 -3.5px;
  border-radius:50%;
  background:var(--lime);
  will-change:transform;
}
.cursor-ring{
  position:fixed; top:0; left:0;
  width:40px; height:40px;
  margin:-20px 0 0 -20px;
  border:1px solid rgba(255,255,255,.45);
  border-radius:50%;
  will-change:transform;
  transition:width .32s var(--ease), height .32s var(--ease),
             margin .32s var(--ease), border-color .32s var(--ease),
             border-radius .32s var(--ease), opacity .32s var(--ease);
}
.cursor-shaft{
  position:fixed; top:0; left:0;
  height:1px; width:0;
  background:linear-gradient(90deg, rgba(198,255,61,0), var(--lime));
  transform-origin:0 50%;
  opacity:0;
  will-change:transform,width;
}
.cursor-ring::before,
.cursor-ring::after{
  content:"";
  position:absolute; left:50%;
  width:1px; height:5px;
  background:var(--lime);
  transform:translateX(-50%);
  opacity:.75;
}
.cursor-ring::before{ top:-6px; }
.cursor-ring::after{ bottom:-6px; }

.cursor-readout{
  position:fixed; top:0; left:0;
  font-family:var(--mono);
  font-size:.57rem;
  letter-spacing:.08em;
  color:var(--lime);
  white-space:nowrap;
  opacity:0;
  transform:translate(28px, 15px);
  transition:opacity .3s var(--ease);
  font-variant-numeric:tabular-nums;
  text-shadow:0 0 10px rgba(0,0,0,.95);
}
.cursor.is-moving .cursor-readout{ opacity:.8; }

.cursor.is-hover .cursor-ring{
  width:64px; height:64px;
  margin:-32px 0 0 -32px;
  border-color:var(--lime);
  border-radius:3px;
}
.cursor.is-down .cursor-ring{ width:28px; height:28px; margin:-14px 0 0 -14px; }
.cursor.is-grab .cursor-ring{
  width:78px; height:78px;
  margin:-39px 0 0 -39px;
  border-style:dashed;
  border-color:var(--lime);
}

.cursor-label{
  position:fixed; top:0; left:0;
  padding:5px 11px;
  background:var(--lime);
  color:var(--black);
  font-family:var(--mono);
  font-size:.61rem;
  font-weight:600;
  letter-spacing:.12em;
  text-transform:uppercase;
  white-space:nowrap;
  opacity:0;
  transform:translate(-50%, 34px) scale(.82);
  transform-origin:50% 0;
  transition:opacity .26s var(--ease), transform .26s var(--ease);
}
.cursor.is-labelled .cursor-label{ opacity:1; transform:translate(-50%, 34px) scale(1); }

body.has-custom-cursor,
body.has-custom-cursor a,
body.has-custom-cursor button,
body.has-custom-cursor [data-cursor]{ cursor:none; }

@media (hover:none), (pointer:coarse){
  .cursor{ display:none !important; }
  body.has-custom-cursor,
  body.has-custom-cursor a,
  body.has-custom-cursor button{ cursor:auto; }
}
@media (prefers-reduced-motion: reduce){ .cursor-shaft{ display:none; } }

/* ============================================================
   PRELOADER
   ============================================================ */
.preloader{
  position:fixed; inset:0;
  z-index:9800;
  background:var(--black);
  display:grid;
  place-items:center;
  transition:opacity .8s var(--ease), visibility .8s;
}
.preloader.is-done{ opacity:0; visibility:hidden; }
.pre-inner{ width:min(340px, 74vw); }
.pre-mark{ width:52px; margin-bottom:28px; animation:preFloat 2.4s var(--ease-io) infinite; }
@keyframes preFloat{
  0%,100%{ transform:translateY(0) rotate(0); }
  50%{ transform:translateY(-10px) rotate(-5deg); }
}
.pre-label{
  display:flex; justify-content:space-between;
  font-family:var(--mono);
  font-size:.64rem;
  letter-spacing:.22em;
  text-transform:uppercase;
  color:var(--muted-2);
  margin-bottom:13px;
}
.pre-label b{ color:var(--lime); font-weight:500; }
.pre-track{ height:1px; background:var(--line-2); position:relative; overflow:hidden; }
.pre-fill{
  position:absolute; inset:0 auto 0 0; width:0%;
  background:var(--lime);
  box-shadow:0 0 16px var(--lime);
  transition:width .25s linear;
}

/* ============================================================
   NAV
   ============================================================ */
.nav{
  position:fixed; top:0; left:0; right:0;
  z-index:600;
  height:var(--nav-h);
  display:flex; align-items:center; justify-content:space-between;
  gap:24px;
  padding-inline:var(--gutter);
  transition:background .45s var(--ease), border-color .45s var(--ease), height .45s var(--ease);
  border-bottom:1px solid transparent;
}
.nav.is-stuck{
  height:60px;
  background:rgba(0,0,0,.66);
  backdrop-filter:blur(18px) saturate(150%);
  -webkit-backdrop-filter:blur(18px) saturate(150%);
  border-bottom-color:var(--line);
}
/* the brand must be able to give way: with flex-shrink:0 it forced the
   nav wider than the viewport on small phones and pushed the menu
   button off-screen */
.brand{ display:flex; align-items:center; gap:12px; min-width:0; }
.brand-mark{ width:30px; height:30px; object-fit:contain; flex-shrink:0; }
.brand-name{
  font-family:var(--display);
  font-weight:700; font-size:.95rem;
  letter-spacing:.05em; line-height:1;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
@media (max-width:420px){
  .brand-id{ display:none; }
}
.brand-id{
  font-family:var(--mono); font-size:.62rem;
  color:var(--lime); letter-spacing:.12em;
  padding-left:12px; border-left:1px solid var(--line-2); line-height:1;
}
.nav-end{ display:flex; align-items:center; gap:14px; }
.nav-links{ display:flex; gap:32px; }
.nav-links a{
  position:relative;
  font-family:var(--mono);
  font-size:.72rem;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--muted);
  padding-block:6px;
  transition:color .25s var(--ease);
}
.nav-links a::after{
  content:"";
  position:absolute; left:0; bottom:0;
  width:100%; height:1px;
  background:var(--lime);
  transform:scaleX(0); transform-origin:100% 50%;
  transition:transform .45s var(--ease);
}
.nav-links a:hover, .nav-links a.is-active{ color:var(--paper); }
.nav-links a:hover::after, .nav-links a.is-active::after{ transform:scaleX(1); transform-origin:0 50%; }

.nav-toggle{
  display:none;
  width:42px; height:42px;
  align-items:center; justify-content:center;
  border:1px solid var(--line-2);
  transition:border-color .25s var(--ease);
}
.nav-toggle:hover{ border-color:var(--lime); }
.nav-toggle .bars{ display:block; width:17px; }
.nav-toggle i{ display:block; height:1px; background:var(--paper); transition:transform .4s var(--ease); }
.nav-toggle i:first-child{ margin-bottom:5px; }
.nav-toggle[aria-expanded="true"] i:first-child{ transform:translateY(3px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] i:last-child{ transform:translateY(-3px) rotate(-45deg); }

.nav-menu{
  position:fixed; inset:0; z-index:590;
  display:flex; flex-direction:column; justify-content:center; gap:32px;
  padding:calc(var(--nav-h) + 28px) var(--gutter) 40px;
  background:rgba(0,0,0,.97);
  backdrop-filter:blur(22px);
  -webkit-backdrop-filter:blur(22px);
  transform:translateY(-101%);
  transition:transform .66s var(--ease);
  overflow-y:auto;
}
.nav-menu.is-open{ transform:translateY(0); }
.menu-list a{
  display:flex; align-items:baseline; gap:16px;
  padding:14px 0;
  border-bottom:1px solid var(--line);
  font-family:var(--display);
  font-size:clamp(1.6rem, 8vw, 2.6rem);
  font-weight:700;
  letter-spacing:-.035em;
  text-transform:uppercase;
  transition:color .25s var(--ease), padding-left .25s var(--ease);
}
.menu-list a:hover{ color:var(--lime); padding-left:12px; }
.menu-list .n{ font-family:var(--mono); font-size:.66rem; color:var(--lime); letter-spacing:.12em; }

@media (max-width:900px){
  .nav-links{ display:none; }
  .nav-toggle{ display:flex; }
  /* scoped so it outranks .btn's display, declared later in this file */
  .nav-end .nav-cta{ display:none; }
}
@media (min-width:901px){ .nav-menu{ display:none; } }

body.is-menu-open{ overflow:hidden; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn{
  position:relative;
  display:inline-flex; align-items:center; justify-content:center; gap:11px;
  padding:16px 28px;
  font-family:var(--mono);
  font-size:.74rem; font-weight:500;
  letter-spacing:.14em; text-transform:uppercase;
  overflow:hidden; isolation:isolate;
  border:1px solid transparent;
  transition:color .35s var(--ease), border-color .35s var(--ease);
  white-space:nowrap;
}
.btn span{ position:relative; z-index:2; display:inline-flex; align-items:center; gap:10px; }
.btn::before{
  content:""; position:absolute; inset:0; z-index:1;
  transform:scaleY(0); transform-origin:50% 100%;
  transition:transform .48s var(--ease);
}
.btn-solid{ background:var(--lime); color:var(--black); font-weight:600; }
.btn-solid::before{ background:var(--paper); }
.btn-solid:hover::before, .btn-solid:focus-visible::before{ transform:scaleY(1); }

.btn-ghost{ border-color:var(--line-2); color:var(--paper); }
.btn-ghost::before{ background:var(--lime); }
.btn-ghost:hover, .btn-ghost:focus-visible{ color:var(--black); border-color:var(--lime); }
.btn-ghost:hover::before, .btn-ghost:focus-visible::before{ transform:scaleY(1); }

.btn-arrow{ transition:transform .35s var(--ease); }
.btn:hover .btn-arrow{ transform:translateX(6px); }
.btn-block{ width:100%; }
.btn-sm{ padding:11px 18px; font-size:.68rem; }

/* ============================================================
   HUD / meta chrome
   ============================================================ */
.hud{
  display:flex; align-items:center; gap:9px;
  font-family:var(--mono);
  font-size:.62rem;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--muted-2);
}
.hud b{ color:var(--lime); font-weight:500; }
.hud .dot{
  width:5px; height:5px; border-radius:50%;
  background:var(--lime);
  animation:pulse 2.4s var(--ease-io) infinite;
}
@keyframes pulse{
  0%{ box-shadow:0 0 0 0 rgba(198,255,61,.55); }
  70%{ box-shadow:0 0 0 10px rgba(198,255,61,0); }
  100%{ box-shadow:0 0 0 0 rgba(198,255,61,0); }
}

.progress{
  position:fixed; top:0; left:0;
  height:2px; width:100%;
  transform:scaleX(0); transform-origin:0 50%;
  background:linear-gradient(90deg, var(--cyan), var(--lime));
  z-index:700;
  will-change:transform;
}

.rail{
  position:fixed;
  right:calc(var(--gutter) * .5);
  top:50%; transform:translateY(-50%);
  z-index:500;
  display:flex; flex-direction:column; gap:14px; align-items:flex-end;
}
.rail a{
  display:flex; align-items:center; gap:10px;
  font-family:var(--mono); font-size:.56rem;
  letter-spacing:.16em; text-transform:uppercase;
  color:var(--muted-2);
  transition:color .3s var(--ease);
}
.rail .tick{ width:14px; height:1px; background:currentColor; transition:width .4s var(--ease); }
.rail .name{ opacity:0; transform:translateX(6px); transition:opacity .3s var(--ease), transform .3s var(--ease); }
.rail a:hover{ color:var(--paper); }
.rail a:hover .name, .rail a.is-active .name{ opacity:1; transform:translateX(0); }
.rail a.is-active{ color:var(--lime); }
.rail a.is-active .tick{ width:32px; }
@media (max-width:1240px){ .rail{ display:none; } }

/* ============================================================
   MARQUEE
   ============================================================ */
.marquee{
  position:relative;
  overflow:hidden;
  border-block:1px solid var(--line);
  padding-block:22px;
  mask-image:linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image:linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track{ display:flex; gap:48px; width:max-content; animation:slide 38s linear infinite; }
.marquee:hover .marquee-track{ animation-play-state:paused; }
@keyframes slide{ to{ transform:translateX(-50%); } }
.marquee-item{
  display:inline-flex; align-items:center; gap:48px;
  font-family:var(--display);
  font-weight:700;
  font-size:clamp(1.1rem, 2.4vw, 2rem);
  letter-spacing:-.02em;
  text-transform:uppercase;
  color:var(--muted-2);
  white-space:nowrap;
}
.marquee-item i{ color:var(--lime); font-style:normal; }
.marquee-item::after{
  content:""; width:7px; height:7px;
  background:var(--lime); transform:rotate(45deg); flex-shrink:0;
}

/* ============================================================
   PANEL primitive
   ============================================================ */
.panel{
  position:relative;
  background:linear-gradient(170deg, rgba(16,18,25,.82), rgba(6,7,11,.7));
  border:1px solid var(--line);
  overflow:hidden;
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
  transition:border-color .45s var(--ease), transform .45s var(--ease);
}
.panel:hover{ border-color:var(--line-2); }

/* placeholder marker — every unfilled field is visibly flagged */
.todo{
  color:var(--lime);
  border-bottom:1px dashed var(--lime-soft);
  font-family:var(--mono);
  font-size:.92em;
}

/* callouts pinned to projected 3D anchors */
.callout-layer{
  position:fixed; inset:0;
  z-index:4;
  pointer-events:none;
  /* clips callouts parked at the origin before the scene positions them,
     which would otherwise widen the document */
  overflow:hidden;
}
.callout{
  /* absolute (not fixed) so the layer above can actually clip it;
     the layer spans the viewport, so the coordinates are identical */
  position:absolute;
  z-index:4;
  display:flex; align-items:center; gap:8px;
  transform:translate(-50%,-50%);
  pointer-events:none;
  opacity:0;
  transition:opacity .45s var(--ease);
  will-change:transform;
}
.callout.is-on{ opacity:1; }
.callout .pip{
  width:7px; height:7px;
  border:1px solid var(--lime); border-radius:50%;
  background:rgba(0,0,0,.8); flex-shrink:0;
}
.callout .txt{
  font-family:var(--mono);
  font-size:.57rem;
  letter-spacing:.14em; text-transform:uppercase;
  color:var(--paper-2);
  background:rgba(0,0,0,.72);
  border:1px solid var(--line);
  padding:4px 9px;
  white-space:nowrap;
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
}
.callout .txt b{ color:var(--lime); font-weight:500; }

/* ============================================================
   REVEALS
   ============================================================ */
[data-reveal]{
  opacity:0;
  transform:translateY(30px);
  transition:opacity .9s var(--ease) var(--reveal-delay,0ms),
             transform .9s var(--ease) var(--reveal-delay,0ms);
  will-change:opacity, transform;
}
[data-reveal="fade"]{ transform:none; }
[data-reveal="left"]{ transform:translateX(-36px); }
[data-reveal="scale"]{ transform:scale(.96); }
[data-reveal].is-in{ opacity:1; transform:none; }

[data-reveal="line"]{
  opacity:1; transform:none;
  transform-origin:0 50%;
  scale:0 1;
  transition:scale 1.2s var(--ease) var(--reveal-delay,0ms);
}
[data-reveal="line"].is-in{ scale:1 1; }

/* Headline reveal, per line.
   Lines are VISIBLE by default and only animate once .is-lit is
   applied, so a JS failure can never leave the headline blank. */
[data-line]{ display:block; }
.line-mask{ display:block; overflow:hidden; padding-bottom:.1em; margin-bottom:-.1em; }
.line-inner{ display:block; will-change:transform; }
.is-lit .line-inner{
  animation:lineIn 1.15s var(--ease) both;
  animation-delay:var(--line-delay, 0ms);
}
@keyframes lineIn{
  from{ transform:translateY(104%); }
  to  { transform:translateY(0); }
}

@media (prefers-reduced-motion: reduce){
  [data-reveal]{ opacity:1 !important; transform:none !important; scale:none !important; }
  .is-lit .line-inner{ animation:none; }
  .marquee-track{ animation:none; }
}
