/* ==========================================================================
   Darshan Subedi — portfolio
   ========================================================================== */

:root {
  --bg: #0a0b0d;
  --bg-2: #0e1013;
  --surface: rgba(19, 22, 26, 0.92);
  --surface-solid: #13161a;
  --surface-2: #181c21;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --text: #ecebe6;
  --body: #c9c8c2;
  --muted: #8d919a;
  --dim: #5b606a;
  --accent: #ff6a2b;
  --accent-2: #ff8a52;
  --accent-soft: rgba(255, 106, 43, 0.14);
  --accent-ink: #160803;
  --cool: #8fb8ff;
  --win-close: #c42b1c;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.83, 0, 0.17, 1);

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --nav-h: 72px;

  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
html:not(.lenis) { scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { html:not(.lenis) { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
svg { display: block; }

::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.accent { color: var(--accent); }
.cool { color: var(--cool); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 560px) { .hide-sm { display: none !important; } }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: fixed; left: 16px; top: -60px; z-index: 1001;
  background: var(--accent); color: var(--accent-ink); padding: 10px 14px; font-weight: 600;
}
.skip:focus { top: 16px; }

/* Text that rolls up to a duplicate on hover */
.roll { position: relative; display: inline-flex; flex-direction: column; overflow: hidden; height: 1.3em; line-height: 1.3em; vertical-align: top; }
.roll > span { display: block; transition: transform 0.6s var(--ease-out); white-space: nowrap; }
a:hover .roll > span, button:hover .roll > span { transform: translateY(-100%); }

/* --------------------------------------------------------------------------
   Ambient layers
   -------------------------------------------------------------------------- */
.terrain {
  position: fixed; inset: 0; z-index: -2;
  width: 100%; height: 100%;
  display: block;
  pointer-events: none;
}
.no-webgl .terrain { display: none; }
.no-webgl body {
  background:
    radial-gradient(ellipse 70% 50% at 70% 0%, rgba(255, 106, 43, 0.08), transparent 70%),
    var(--bg);
}
.atmos {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  opacity: 0.05;
}

/* Retro mode (unlockable) */
.crt { position: fixed; inset: 0; z-index: 990; pointer-events: none; opacity: 0; transition: opacity 0.5s; }
.retro .crt {
  opacity: 1;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.3) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55));
}
.retro .h2, .retro .hero__name, .retro .coop__title, .retro .wordmark {
  text-shadow: 2px 0 rgba(255, 60, 60, 0.55), -2px 0 rgba(60, 200, 255, 0.55);
}

/* --------------------------------------------------------------------------
   Reticle cursor
   -------------------------------------------------------------------------- */
.cursor { display: none; }
.has-cursor, .has-cursor * { cursor: none !important; }
.has-cursor .cursor { display: block; position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; }
.cursor.is-hidden { opacity: 0; }
.cursor__ring { position: fixed; left: 0; top: 0; width: 30px; height: 30px; will-change: transform, width, height; }
.cursor__ring i {
  position: absolute; width: 8px; height: 8px;
  border: 0 solid var(--text);
  transition: border-color 0.25s, width 0.3s var(--ease-out), height 0.3s var(--ease-out);
}
.cursor__ring i:nth-child(1) { left: 0; top: 0; border-top-width: 1.5px; border-left-width: 1.5px; }
.cursor__ring i:nth-child(2) { right: 0; top: 0; border-top-width: 1.5px; border-right-width: 1.5px; }
.cursor__ring i:nth-child(3) { left: 0; bottom: 0; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.cursor__ring i:nth-child(4) { right: 0; bottom: 0; border-bottom-width: 1.5px; border-right-width: 1.5px; }
.cursor.is-locked .cursor__ring i { border-color: var(--accent); width: 12px; height: 12px; }
.cursor.is-down .cursor__ring i { border-color: var(--accent); }
.cursor__dot {
  position: fixed; left: 0; top: 0; width: 4px; height: 4px; margin: -2px 0 0 -2px;
  background: var(--accent);
  will-change: transform;
}
.cursor.is-locked .cursor__dot { opacity: 0; }
.cursor__label {
  position: fixed; left: 0; top: 0;
  padding: 3px 6px 2px;
  font: 600 10px/1.2 var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--accent); color: var(--accent-ink);
  white-space: nowrap;
  opacity: 0; transform-origin: left top;
  transition: opacity 0.2s;
  will-change: transform;
}
.cursor.has-label .cursor__label { opacity: 1; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  --h: 52px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 24px;
  font-weight: 600; font-size: 15px;
  font-variation-settings: "wdth" 106;
  letter-spacing: 0.01em;
  isolation: isolate;
  overflow: hidden;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: color 0.4s var(--ease-out);
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.5s var(--ease-out); }
.btn:hover svg { transform: translateX(3px); }
.btn[download]:hover svg { transform: translateY(2px); }
.btn--sm { --h: 38px; padding: 0 14px; font-size: 13px; }

.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--text);
  transform: translateY(101%);
  transition: transform 0.6s var(--ease-out);
}
.btn--primary:hover::after { transform: translateY(0); }

/* Ghost: an outer clipped layer acts as the border so the cut corners stay outlined */
.btn--ghost { background: rgba(255, 255, 255, 0.2); color: var(--text); }
.btn--ghost::before {
  content: ""; position: absolute; inset: 1px; z-index: -1;
  background: #111317;
  clip-path: polygon(9.6px 0, 100% 0, 100% calc(100% - 9.6px), calc(100% - 9.6px) 100%, 0 100%, 0 9.6px);
}
.btn--ghost::after {
  content: ""; position: absolute; inset: 1px; z-index: -1;
  background: var(--accent);
  clip-path: polygon(9.6px 0, 100% 0, 100% calc(100% - 9.6px), calc(100% - 9.6px) 100%, 0 100%, 0 9.6px);
  transform: translateY(101%);
  transition: transform 0.6s var(--ease-out);
}
.btn--ghost:hover { color: var(--accent-ink); }
.btn--ghost:hover::after { transform: translateY(0); }

/* --------------------------------------------------------------------------
   Loader
   -------------------------------------------------------------------------- */
.loader { display: none; }
.js .loader.is-on { display: block; position: fixed; inset: 0; z-index: 980; }
.loader__cols { position: absolute; inset: 0; display: flex; }
.loader__cols i { flex: 1; background: var(--bg); border-right: 1px solid rgba(255, 255, 255, 0.03); }
.loader__content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(20px, 4vw, 48px);
}
.loader__top { display: flex; justify-content: space-between; color: var(--muted); }
.loader__bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.loader__tip { color: var(--dim); text-transform: none; letter-spacing: 0; font-size: 12.5px; max-width: 34ch; padding-bottom: 2vw; }
.loader__num {
  font-size: clamp(96px, 22vw, 340px);
  font-weight: 800; font-variation-settings: "wdth" 115;
  line-height: 0.8; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}
.loader__num span { display: block; }
.loader__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.loader__bar i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }

/* --------------------------------------------------------------------------
   Nav
   -------------------------------------------------------------------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  transition: transform 0.6s var(--ease-out), background-color 0.4s, backdrop-filter 0.4s;
}
.nav.is-scrolled {
  background: rgba(10, 11, 13, 0.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
          backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: inset 0 -1px 0 var(--line);
}
.nav.is-hidden { transform: translateY(-100%); }
.nav__inner { height: 100%; display: flex; align-items: center; gap: 24px; }

.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand__mark {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  font-family: var(--mono); font-weight: 600; font-size: 12px;
  border: 1px solid var(--accent);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  transition: background-color 0.3s, color 0.3s;
}
.brand:hover .brand__mark { background: var(--accent); color: var(--accent-ink); }
.brand__name { font-weight: 600; font-variation-settings: "wdth" 112; font-size: 15px; letter-spacing: 0.01em; }
@media (max-width: 1240px) { .brand__name { display: none; } }

.motion-toggle {
  display: inline-flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 10px;
  font-size: 11px; color: var(--muted);
  transition: color 0.3s;
}
.motion-toggle:hover { color: var(--text); }
.motion-toggle b { font-weight: 500; color: var(--text); }
.motion-toggle__track {
  position: relative; width: 28px; height: 14px;
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: box-shadow 0.3s;
}
.motion-toggle__track i {
  position: absolute; top: 3px; left: 3px; width: 8px; height: 8px;
  background: var(--muted);
  transition: transform 0.35s var(--ease-out), background-color 0.3s;
}
.motion-toggle[aria-pressed="true"] .motion-toggle__track { box-shadow: inset 0 0 0 1px rgba(255, 106, 43, 0.6); }
.motion-toggle[aria-pressed="true"] .motion-toggle__track i { transform: translateX(14px); background: var(--accent); }

.nav__links { display: flex; gap: 2px; }
.nav__links a {
  position: relative;
  display: flex; align-items: center; gap: 7px;
  padding: 8px 12px;
  font-size: 14px; color: var(--muted);
  transition: color 0.3s;
}
.nav__links a .mono { font-size: 10px; color: var(--dim); transition: color 0.3s; }
.nav__links a:hover, .nav__links a.is-active { color: var(--text); }
.nav__links a.is-active .mono { color: var(--accent); }
.nav__links a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: right;
  transition: transform 0.6s var(--ease-out);
}
.nav__links a.is-active::after { transform: scaleX(1); transform-origin: left; }

.nav__toggle { display: none; width: 44px; height: 44px; position: relative; }
.nav__toggle span {
  position: absolute; left: 11px; right: 11px; height: 1.5px; background: var(--text);
  transition: transform 0.5s var(--ease-out), top 0.5s var(--ease-out);
}
.nav__toggle span:first-child { top: 17px; }
.nav__toggle span:last-child { top: 25px; }
.menu-open .nav__toggle span:first-child { top: 21px; transform: rotate(45deg); }
.menu-open .nav__toggle span:last-child { top: 21px; transform: rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(10, 11, 13, 0.97);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  padding-top: calc(var(--nav-h) + 24px);
  display: flex; flex-direction: column;
}
.menu[hidden] { display: none; }
.menu__links { display: flex; flex-direction: column; }
.menu__links a {
  display: flex; align-items: baseline; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
  font-size: clamp(30px, 9vw, 44px); font-weight: 750; font-variation-settings: "wdth" 118; text-transform: uppercase; line-height: 1.1;
}
.menu__links .mono { font-size: 12px; color: var(--accent); }
.menu__foot { margin-top: auto; padding-bottom: 28px; display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--muted); }
.menu__foot .motion-toggle { padding-right: 0; }

@media (max-width: 1020px) {
  .nav__links, .nav__resume, .nav__motion { display: none; }
  .nav__toggle { display: block; }
}

/* --------------------------------------------------------------------------
   HUD (fixed section + progress readout)
   -------------------------------------------------------------------------- */
.hud {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 var(--gutter) 22px;
  pointer-events: none;
  font-size: 10.5px; color: var(--muted);
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.hud.is-on { opacity: 1; transform: none; }
.hud__left, .hud__right { display: flex; align-items: center; gap: 12px; }
.hud__idx, .hud__name, .hud__pct { display: inline-block; overflow: hidden; height: 1.3em; line-height: 1.3em; }
.hud__idx > span, .hud__name > span { display: inline-block; }
.hud__idx { color: var(--accent); }
.hud__name, .hud__pct { color: var(--text); font-variant-numeric: tabular-nums; }
.hud__bar { position: relative; width: 64px; height: 1px; background: var(--line-2); }
.hud__bar i { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(0); }
@media (max-width: 1020px) { .hud { display: none; } }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: calc(var(--nav-h) + 20px) 0 clamp(28px, 5vh, 48px);
}
.hero__frame { inset: 12px; --c: rgba(255, 255, 255, 0.22); --s: 22px; }

.hero__top { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); }
.hero__geo { display: flex; gap: 18px; font-variant-numeric: tabular-nums; }
.hero__geo > span { min-width: 9ch; text-align: right; }

.hero__name {
  align-self: center;
  display: flex; flex-direction: column;
  font-size: clamp(46px, 13vw, 188px);
  font-weight: 800;
  line-height: 0.82;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  padding-top: 3vh; padding-bottom: 3vh;
  user-select: none;
}
.hero__row { display: block; white-space: nowrap; }
.hero__row--outline { padding-left: 0.9em; }
.hero__name .chw { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.02em 0 0.06em; margin: -0.02em 0 -0.06em; }
.hero__name .ch {
  display: inline-block;
  --w: 112; --g: 800; --f: 0;
  font-variation-settings: "wdth" var(--w), "wght" var(--g);
}
.hero__row--outline .ch {
  color: rgb(236 235 230 / var(--f));
  -webkit-text-stroke: 1.5px var(--text);
}

.hero__bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: end;
}
.hero__lead { font-size: clamp(17px, 1.45vw, 20px); line-height: 1.55; color: var(--body); max-width: 36ch; }
.hero__lead strong { color: var(--text); font-weight: 600; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }

.xp { justify-self: end; width: min(100%, 400px); }
.xp__head, .xp__foot { display: flex; justify-content: space-between; gap: 12px; color: var(--dim); }
.xp__head b { color: var(--text); font-weight: 500; margin-left: 6px; }
.xp__bar { position: relative; height: 8px; margin: 10px 0; background: rgba(24, 28, 33, 0.9); box-shadow: inset 0 0 0 1px var(--line-2); overflow: hidden; }
.xp__bar > i {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, #ff4d1a, var(--accent) 60%, #ffa06e);
  transform-origin: left; transform: scaleX(0.78);
}
.xp__ticks { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), var(--bg) calc(10% - 1px) 10%); }
.xp__foot { font-size: 10px; }

.hero__scroll {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--dim); font-size: 10px;
}
.hero__scroll i { width: 1px; height: 40px; background: var(--line-2); position: relative; overflow: hidden; }
.hero__scroll i::after {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 40%;
  background: var(--accent);
  animation: scrollcue 2.4s var(--ease-io) infinite;
}
@keyframes scrollcue { 0% { transform: translateY(-100%); } 100% { transform: translateY(260%); } }

@media (max-width: 1100px) {
  .hero__bottom { grid-template-columns: 1fr 1fr; }
  .hero__lead { grid-column: 1 / -1; }
  .xp { justify-self: end; }
  .hero__scroll { display: none; }
}
@media (max-width: 680px) {
  .hero { min-height: 100svh; }
  .hero__geo > span:not(.accent) { display: none; }
  .hero__bottom { grid-template-columns: 1fr; }
  .xp { justify-self: stretch; }
  .hero__row--outline { padding-left: 0; }
  .hero__row--outline .ch { -webkit-text-stroke-width: 1px; }
  .hero__frame { display: none; }
}

/* JS-driven initial states (only when motion is allowed) */
.js:not(.no-anim):not(.reduced) [data-hero],
.js:not(.no-anim):not(.reduced) [data-reveal] { opacity: 0; }
.js:not(.no-anim):not(.reduced) .xp__bar > i { transform: scaleX(0); }
.js:not(.no-anim):not(.reduced) .hero__name { visibility: hidden; }
.js:not(.no-anim):not(.reduced) .hero__name.is-split { visibility: visible; }

/* --------------------------------------------------------------------------
   Marquee
   -------------------------------------------------------------------------- */
.marquee {
  position: relative;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 20px 0;
  background: rgba(10, 11, 13, 0.82);
}
.marquee__track { display: flex; width: max-content; align-items: center; gap: 40px; will-change: transform; }
.marquee__track span {
  font-size: clamp(30px, 4.4vw, 60px);
  font-weight: 750; font-variation-settings: "wdth" 122;
  text-transform: uppercase; letter-spacing: -0.01em; line-height: 1;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
  white-space: nowrap;
}
.marquee__track span:nth-of-type(3n+1) { color: var(--text); -webkit-text-stroke-color: transparent; }
.marquee__track b { color: var(--accent); font-size: 14px; font-weight: 400; }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
/* clip (not hidden) keeps the oversized ghost words from widening the page on touch devices
   without breaking the sticky photo and level readout inside */
.section, .missions { overflow-x: clip; }
.section { padding: clamp(110px, 15vw, 200px) 0 0; position: relative; }
.kicker { color: var(--accent); margin-bottom: 20px; display: inline-flex; align-items: center; gap: 10px; }
.kicker::before { content: ""; width: 18px; height: 1px; background: currentColor; }

.h2 {
  --w: 116; --g: 760;
  font-size: clamp(40px, 6.4vw, 96px);
  font-weight: 760;
  font-variation-settings: "wdth" var(--w), "wght" var(--g);
  line-height: 0.92; letter-spacing: -0.03em;
  text-transform: uppercase;
}
.h2--md { font-size: clamp(32px, 4.2vw, 60px); }
.h2--xl { font-size: clamp(48px, 6.6vw, 108px); }

[data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
[data-split] .wi { display: inline-block; font-variation-settings: "wdth" var(--w), "wght" var(--g); }

.section__head {
  position: relative;
  display: grid; grid-template-columns: 1fr minmax(0, 400px); gap: 32px; align-items: end;
  margin-bottom: clamp(56px, 7vw, 96px);
  padding-bottom: 32px;
}
.section__head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line-2);
  transform-origin: left; transform: scaleX(var(--line-p, 1));
}
.section__note { color: var(--muted); font-size: 16px; }
@media (max-width: 800px) { .section__head { grid-template-columns: 1fr; } }

/* Giant outlined word drifting behind each section */
.ghost {
  position: absolute; top: clamp(40px, 7vw, 100px); left: 0;
  font-size: clamp(120px, 20vw, 340px);
  font-weight: 800; font-variation-settings: "wdth" 125;
  line-height: 1; letter-spacing: -0.04em; text-transform: uppercase;
  white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.05);
  pointer-events: none; user-select: none;
  z-index: -1;
}

/* HUD corners — four bracket marks around an element */
.hud-corners {
  position: absolute; inset: -6px; pointer-events: none;
  --c: var(--accent); --s: 14px;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--s) 1px,
    linear-gradient(var(--c), var(--c)) top left / 1px var(--s),
    linear-gradient(var(--c), var(--c)) top right / var(--s) 1px,
    linear-gradient(var(--c), var(--c)) top right / 1px var(--s),
    linear-gradient(var(--c), var(--c)) bottom left / var(--s) 1px,
    linear-gradient(var(--c), var(--c)) bottom left / 1px var(--s),
    linear-gradient(var(--c), var(--c)) bottom right / var(--s) 1px,
    linear-gradient(var(--c), var(--c)) bottom right / 1px var(--s);
  background-repeat: no-repeat;
  transition: inset 0.6s var(--ease-out);
}

/* Cursor-following spotlight on cards */
.spot { position: relative; isolation: isolate; }
.spot::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(460px circle at var(--x, 50%) var(--y, 50%), rgba(255, 106, 43, 0.1), transparent 60%);
  opacity: 0; transition: opacity 0.5s;
}
.spot:hover::before { opacity: 1; }


/* --------------------------------------------------------------------------
   Profile
   -------------------------------------------------------------------------- */
.profile__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 6vw, 104px); align-items: start; }

.card-photo { position: sticky; top: calc(var(--nav-h) + 32px); }
.card-photo__img { position: relative; overflow: hidden; aspect-ratio: 4 / 5; background: var(--surface-solid); }
.card-photo__media { position: absolute; left: 0; right: 0; top: 0; height: 118%; }
.card-photo__media img, .card-photo__media canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.card-photo__media img { filter: saturate(0.92) contrast(1.05); }
.card-photo__media canvas { image-rendering: pixelated; }
.card-photo__img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 52%, rgba(10, 11, 13, 0.88)); pointer-events: none; }
.card-photo__scan {
  position: absolute; left: 0; right: 0; top: 0; height: 30%; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(255, 106, 43, 0.16) 85%, rgba(255, 140, 80, 0.7) 99%, transparent);
  transform: translateY(-110%);
}
.card-photo__hud {
  position: absolute; top: 14px; left: 14px; right: 14px; z-index: 2;
  display: flex; justify-content: space-between;
  font-size: 10.5px; color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
.card-photo__cap { position: absolute; left: 18px; right: 18px; bottom: 16px; z-index: 2; display: flex; flex-direction: column; gap: 2px; }
.card-photo__cap .mono { font-size: 10.5px; }
.card-photo__cap strong { font-size: 24px; font-weight: 750; font-variation-settings: "wdth" 116; text-transform: uppercase; letter-spacing: -0.01em; line-height: 1.2; }
.card-photo:hover .hud-corners { inset: -12px; }

.profile__body .h2 { margin-bottom: 32px; }
.prose { display: grid; gap: 18px; color: var(--body); max-width: 62ch; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
.stat { padding: 22px 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.stat__num { font-size: clamp(40px, 4.4vw, 60px); font-weight: 800; font-variation-settings: "wdth" 120; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat__num em { font-style: normal; color: var(--accent); }
.stat__label { color: var(--muted); margin-top: 12px; font-size: 10.5px; }

@media (max-width: 900px) {
  .profile__grid { grid-template-columns: 1fr; }
  .card-photo { position: relative; top: 0; max-width: 440px; }
}
@media (max-width: 520px) {
  .stats { gap: 8px; }
  .stat { padding: 16px 12px; }
}

/* --------------------------------------------------------------------------
   Windows-style window
   -------------------------------------------------------------------------- */
.win-slot { position: relative; min-height: 410px; margin-top: 44px; }
.win {
  position: relative;
  background: #1b1d22;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 40px 90px -24px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  display: flex; flex-direction: column;
  transform-origin: 50% 100%;
}
.win.is-dragging { box-shadow: 0 60px 120px -20px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 106, 43, 0.4); z-index: 50; }
.win.is-max { position: fixed; z-index: 300; inset: max(24px, 5vh) max(16px, 5vw); }
.win__bar { display: flex; align-items: stretch; justify-content: space-between; height: 34px; background: #202227; user-select: none; touch-action: none; }
.win__title { display: flex; align-items: center; gap: 10px; padding-left: 12px; font-size: 12px; color: #c5c6c9; font-family: "Segoe UI", var(--font); min-width: 0; }
.win__title > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win__icon {
  display: inline-grid; place-items: center; flex: none;
  width: 16px; height: 16px; border-radius: 2px;
  background: #3178c6; color: #fff;
  font: 700 8px/1 var(--mono);
}
.win__controls { display: flex; flex: none; }
.win__btn { width: 46px; height: 100%; display: grid; place-items: center; color: #d6d7da; transition: background-color 0.12s, color 0.12s; }
.win__btn svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1; }
.win__btn:hover { background: rgba(255, 255, 255, 0.08); }
.win__btn:active { background: rgba(255, 255, 255, 0.05); }
.win__btn--close:hover { background: var(--win-close); color: #fff; }
.win__btn--close:active { background: #9b2216; }
.win__btn .i-restore { display: none; }
.win.is-max .win__btn .i-max { display: none; }
.win.is-max .win__btn .i-restore { display: block; }

.win__tabs { display: flex; background: #181a1e; border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-size: 11px; text-transform: none; letter-spacing: 0; }
.win__tabs span { padding: 8px 14px; color: #7d8088; border-right: 1px solid rgba(255, 255, 255, 0.05); }
.win__tabs .is-active { color: #e6e6e6; background: #1b1d22; box-shadow: inset 0 1px 0 var(--accent); }

.win__code {
  flex: 1; margin: 0; padding: 16px 0 18px;
  min-height: 300px;
  font-size: 13px; line-height: 1.75;
  text-transform: none; letter-spacing: 0;
  color: #d4d4d4;
  overflow: auto;
  white-space: pre;
  counter-reset: ln;
}
.win.is-max .win__code { font-size: clamp(14px, 1.3vw, 18px); padding-top: 28px; }
.win__code .ln { display: block; padding-right: 16px; min-height: 1.75em; }
.win__code .ln::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 44px; padding-right: 18px; text-align: right; color: #4b4f57; }
.win__code .ln.is-current { background: rgba(255, 255, 255, 0.035); }
.win__code .ln.is-current::before { color: #c6c6c6; }
.tk-k { color: #c586c0; }
.tk-v { color: #4fc1ff; }
.tk-p { color: #d4d4d4; }
.tk-pr { color: #9cdcfe; }
.tk-s { color: #ce9178; }
.tk-n { color: #b5cea8; }
.tk-c { color: #6a9955; font-style: italic; }
.tk-f { color: #dcdcaa; }
.caret { display: inline-block; width: 2px; height: 1.15em; margin-left: 1px; vertical-align: -0.2em; background: var(--accent); }
.caret.is-idle { animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

.win__status {
  display: flex; gap: 14px; align-items: center;
  height: 24px; padding: 0 12px;
  background: #16181c; border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 10.5px; color: #8a8d94; text-transform: none; letter-spacing: 0;
}
.win__status .grow { flex: 1; }
.win__status span:first-child::before { content: "⎇ "; }

.win-backdrop {
  position: fixed; inset: 0; z-index: 290;
  background: rgba(5, 6, 8, 0.72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.5s var(--ease-out), visibility 0.5s;
}
.win-backdrop.is-on { opacity: 1; visibility: visible; }

.dock {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  border: 1px dashed var(--line-2); border-radius: 8px;
  text-align: center; padding: 24px;
  background: rgba(10, 11, 13, 0.5);
}
.dock[hidden] { display: none; }
.dock__msg { color: var(--muted); text-transform: none; letter-spacing: 0; font-size: 12.5px; max-width: 32ch; }
.dock__app {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  font-size: 13px; font-family: "Segoe UI", var(--font);
  transition: background-color 0.2s;
}
.dock__app::after {
  content: ""; position: absolute; left: 50%; bottom: 3px; width: 16px; height: 3px; margin-left: -8px;
  border-radius: 3px; background: var(--muted);
  transition: width 0.3s var(--ease-out), margin 0.3s var(--ease-out), background-color 0.3s;
}
.dock__app:hover { background: rgba(255, 255, 255, 0.1); }
.dock__app:hover::after { width: 24px; margin-left: -12px; background: var(--accent); }

@media (max-width: 560px) {
  .win-slot { min-height: 360px; }
  .win__code { font-size: 11.5px; min-height: 260px; }
  .win__code .ln::before { width: 32px; padding-right: 12px; }
}

/* --------------------------------------------------------------------------
   Quest log
   -------------------------------------------------------------------------- */
.quests__grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.qaside { position: sticky; top: calc(var(--nav-h) + 48px); }
.qaside__inner { padding-top: 8px; }
.qaside__label { color: var(--dim); font-size: 10.5px; }
.qaside__lv { display: flex; align-items: flex-start; gap: 6px; margin: 10px 0 18px; }
.qaside__lvtag { color: var(--accent); padding-top: 1.2em; }
.qaside__num {
  display: inline-block; overflow: hidden;
  font-size: clamp(110px, 11vw, 168px);
  font-weight: 800; font-variation-settings: "wdth" 125;
  line-height: 0.82; letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  padding-bottom: 0.04em;
}
.qaside__num > span { display: inline-block; }
.qaside__role { overflow: hidden; font-size: 22px; font-weight: 650; font-variation-settings: "wdth" 110; line-height: 1.2; }
.qaside__role > span, .qaside__when > span, .qaside__type > span { display: inline-block; }
.qaside__when { overflow: hidden; color: var(--muted); margin-top: 8px; }
.qaside__segs { display: flex; gap: 4px; margin-top: 26px; }
.qaside__segs i { flex: 1; height: 4px; background: var(--line-2); transition: background-color 0.5s; }
.qaside__segs i.is-on { background: var(--accent); }
.qaside__type { overflow: hidden; margin-top: 12px; color: var(--dim); font-size: 10.5px; }

.timeline { position: relative; display: grid; gap: 28px; padding-left: 44px; }
.timeline__rail { position: absolute; left: 5px; top: 10px; bottom: 10px; width: 1px; background: var(--line-2); }
.timeline__rail i { position: absolute; inset: 0; background: linear-gradient(var(--accent), var(--accent-2)); transform-origin: top; transform: scaleY(0); }
.quest { position: relative; }
.quest__node {
  position: absolute; left: -44px; top: 34px;
  width: 11px; height: 11px;
  transform: rotate(45deg);
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: background-color 0.4s, box-shadow 0.4s;
}
.quest.is-on .quest__node { background: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); }

.quest__card {
  padding: clamp(22px, 3vw, 36px);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 0.5s;
}
.quest.is-active .quest__card { box-shadow: inset 0 0 0 1px rgba(255, 106, 43, 0.35); }
.quest__top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 11px; margin-bottom: 14px; }
.quest__card h3 { font-size: clamp(24px, 2.6vw, 34px); font-weight: 720; font-variation-settings: "wdth" 112; line-height: 1.12; letter-spacing: -0.015em; }
.quest__org { color: var(--muted); margin-top: 4px; }
.quest__promo { color: var(--accent); font-size: 11px; margin-top: 12px; }
.quest__list { margin-top: 18px; display: grid; gap: 10px; color: var(--body); font-size: 16px; }
.quest__list li { position: relative; padding-left: 22px; }
.quest__list li::before { content: ""; position: absolute; left: 2px; top: 0.72em; width: 8px; height: 1px; background: var(--accent); }
.quest__stack { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--dim); font-size: 11px; }

@media (max-width: 960px) {
  .quests__grid { grid-template-columns: 1fr; }
  .qaside { display: none; }
  .timeline { padding-left: 32px; }
  .quest__node { left: -32px; }
}

.training { margin-top: clamp(80px, 9vw, 130px); }
.training__rows { border-top: 1px solid var(--line); }
.training__row {
  position: relative;
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 24px; align-items: center;
  padding: 26px 0; border-bottom: 1px solid var(--line);
  transition: padding 0.6s var(--ease-out);
}
.training__row::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, var(--accent-soft), transparent 70%);
  transform: scaleX(0); transform-origin: left; transition: transform 0.7s var(--ease-out);
}
.training__row:hover { padding-left: 14px; padding-right: 14px; }
.training__row:hover::before { transform: scaleX(1); }
.training__idx { color: var(--accent); }
.training__row h3 { font-size: clamp(18px, 2vw, 24px); font-weight: 620; font-variation-settings: "wdth" 108; line-height: 1.3; }
.training__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
@media (max-width: 640px) {
  .training__row { grid-template-columns: 32px minmax(0, 1fr); gap: 10px 14px; }
  .training__meta { grid-column: 2; align-items: flex-start; text-align: left; }
}

/* --------------------------------------------------------------------------
   Loadout
   -------------------------------------------------------------------------- */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; perspective: 1400px; }
.panel {
  grid-column: span 2;
  display: flex; flex-direction: column;
  padding: 22px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.bento .panel:nth-child(1), .bento .panel:nth-child(2) { grid-column: span 3; }
.panel__head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 18px; color: var(--accent); font-size: 11px; }
.panel__foot { margin-top: auto; padding-top: 18px; color: var(--muted); font-size: 14px; line-height: 1.5; }

.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.slots--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.slot {
  position: relative;
  height: 112px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(14, 16, 19, 0.85);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: center;
  font-size: 13px; color: var(--muted);
  transition: box-shadow 0.3s, color 0.3s, translate 0.5s var(--ease-out), background-color 0.3s;
}
.slot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 106, 43, 0.22), transparent);
  opacity: 0;
}
.slot.is-flash::after { animation: equip 0.9s var(--ease-out); }
@keyframes equip { 0% { opacity: 1; } 100% { opacity: 0; } }
/* Logos sit muted until hovered, but keep their real shapes and colours */
.slot i { font-size: 34px; filter: saturate(0.35) brightness(1.1) opacity(0.8); transition: filter 0.4s var(--ease-out), transform 0.5s var(--ease-out); }
.slot:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); translate: 0 -3px; background: rgba(24, 28, 33, 0.9); }
.slot:hover i { filter: none; transform: scale(1.1); }
.slot span { line-height: 1.2; padding: 0 6px; }
.slot__svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.3; color: #9a9ea6; opacity: 0.7; transition: color 0.4s, opacity 0.4s, transform 0.5s var(--ease-out); }
.slot:hover .slot__svg { color: var(--cool); opacity: 1; transform: scale(1.1); }
.slot .devicon-django-plain.colored, .slot .devicon-flask-original.colored { color: #e8e8e8 !important; }
@media (hover: none) { .slot i { filter: none; } .slot__svg { color: var(--cool); opacity: 1; } }

.perks { display: grid; gap: 10px; }
.perks li { display: flex; gap: 14px; align-items: flex-start; padding: 12px; background: rgba(14, 16, 19, 0.85); box-shadow: inset 0 0 0 1px var(--line); }
.perk__key { flex: none; display: grid; place-items: center; width: 30px; height: 30px; font-size: 10.5px; color: var(--accent); box-shadow: inset 0 0 0 1px rgba(255, 106, 43, 0.4); }
.perks strong { display: block; font-size: 15px; font-weight: 600; }
.perks span.muted { font-size: 13.5px; line-height: 1.45; display: block; }

@media (max-width: 1024px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento .panel, .bento .panel:nth-child(1), .bento .panel:nth-child(2) { grid-column: span 1; }
  .bento .panel--perks { grid-column: span 2; }
}
@media (max-width: 640px) {
  .bento { grid-template-columns: 1fr; }
  .bento .panel, .bento .panel:nth-child(1), .bento .panel:nth-child(2), .bento .panel--perks { grid-column: auto; }
  .slot i { font-size: 28px; }
  .slot__svg { width: 28px; height: 28px; }
  .slot { font-size: 12px; height: 96px; }
  .slots--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------------------
   Missions — horizontal track on desktop
   -------------------------------------------------------------------------- */
/* Default (no JS, reduced motion, small screens): a plain vertical stack that always scrolls.
   .has-hscroll is added by JS only after the pinned sideways track is actually running. */
.missions { position: relative; padding-top: clamp(110px, 15vw, 200px); }
.missions__pin { position: relative; }
.missions__track { display: flex; flex-direction: column; gap: clamp(20px, 3vw, 40px); width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.mpanel { flex: none; width: 100%; }
.mpanel--intro { display: flex; flex-direction: column; justify-content: center; padding-bottom: 12px; }
.mpanel--intro .h2 { margin-bottom: 28px; }
.mpanel__hint { display: none; align-items: center; gap: 14px; margin-top: 40px; color: var(--muted); }
.mpanel__hint svg { width: 40px; height: 10px; fill: none; stroke: var(--accent); stroke-width: 1.2; }
.mpanel--outro { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 20px; padding-top: 40px; }
.mpanel__big {
  font-size: clamp(72px, 8.4vw, 136px); font-weight: 800; font-variation-settings: "wdth" var(--w, 125);
  line-height: 0.85; letter-spacing: -0.04em; text-transform: uppercase;
  color: transparent; -webkit-text-stroke: 1.5px var(--text);
}

.missions__meter { display: none; align-items: center; gap: 16px; margin-top: 36px; color: var(--muted); font-size: 11px; }
.missions__bar { position: relative; flex: 1; max-width: 320px; height: 1px; background: var(--line-2); }
.missions__bar i { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(0); }

.mission {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px); align-items: center;
  padding: clamp(22px, 3vw, 40px);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.mission__index {
  position: absolute; right: clamp(18px, 2.4vw, 32px); top: clamp(10px, 1.6vw, 20px);
  font-size: clamp(56px, 6vw, 96px); font-weight: 800; font-family: var(--font); font-variation-settings: "wdth" 125;
  letter-spacing: -0.04em; line-height: 1;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.12);
}

.viz { position: relative; background: rgba(14, 16, 19, 0.9); box-shadow: inset 0 0 0 1px var(--line); padding: 18px 18px 14px; }
.viz svg { width: 100%; height: auto; overflow: visible; color: var(--accent); }
.viz figcaption { color: var(--dim); font-size: 10.5px; margin-top: 8px; }
.viz .hud-corners { inset: -1px; --s: 10px; }
.mission:hover .viz .hud-corners { inset: -7px; }

.viz__grid path { stroke: var(--line-2); stroke-width: 1; fill: none; stroke-dasharray: 2 4; }
.viz__hist .line { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; }
.viz__fore .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 5; stroke-linejoin: round; }
.viz__fore .band { fill: var(--accent); opacity: 0.13; }
.viz__now { stroke: var(--dim); stroke-width: 1; stroke-dasharray: 3 3; }
.viz__dot { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.viz__label { font-family: var(--mono); font-size: 11px; fill: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.viz__label--accent { fill: var(--accent); }

.scan__tile rect { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1; transition: fill 0.35s, stroke 0.35s; }
.scan__tile circle, .scan__tile path.avatar { fill: none; stroke: var(--dim); stroke-width: 1.4; transition: stroke 0.35s; }
.scan__tile .x { stroke: var(--accent-ink); stroke-width: 2; opacity: 0; transition: opacity 0.35s; fill: none; }
.scan__tile.is-ok rect { stroke: rgba(143, 184, 255, 0.55); }
.scan__tile.is-ok circle, .scan__tile.is-ok path.avatar { stroke: var(--cool); }
.scan__tile.is-fake rect { fill: var(--accent); stroke: var(--accent); }
.scan__tile.is-fake circle, .scan__tile.is-fake path.avatar { stroke: transparent; }
.scan__tile.is-fake .x { opacity: 1; }
.scan__beam { fill: var(--accent); }

.mission__top { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--accent); font-size: 11px; margin-bottom: 16px; padding-right: 90px; }
.mission h3 { font-size: clamp(26px, 2.8vw, 40px); font-weight: 760; font-variation-settings: "wdth" 114; line-height: 1.04; letter-spacing: -0.02em; text-transform: uppercase; margin-bottom: 16px; }
.mission__body > p:not(.mission__stack) { color: var(--body); }
.objectives { margin-top: 22px; display: grid; gap: 10px; font-size: 15.5px; }
.objectives li { position: relative; padding-left: 30px; color: var(--body); }
.objectives li::before {
  content: ""; position: absolute; left: 0; top: 0.3em; width: 16px; height: 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 106, 43, 0.55);
  background: linear-gradient(var(--accent), var(--accent)) center / 6px 6px no-repeat;
}
.mission__stack { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--dim); font-size: 11px; }

@media (max-width: 900px) { .mission { grid-template-columns: 1fr; } }

/* Enhanced: the section pins and the track scrolls sideways */
.has-hscroll .missions { padding-top: 0; margin-top: clamp(110px, 15vw, 200px); }
.has-hscroll .missions__pin { height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-top: var(--nav-h); }
.has-hscroll .missions__track { flex-direction: row; width: auto; max-width: none; margin: 0; will-change: transform; }
.has-hscroll .mpanel--intro { width: min(720px, 84vw); padding-bottom: 0; }
.has-hscroll .mission { width: min(1120px, 84vw); }
.has-hscroll .mpanel--outro { width: min(680px, 84vw); padding: 0 var(--gutter) 0 0; }
.has-hscroll .mpanel__hint, .has-hscroll .missions__meter { display: flex; }

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */
.coop { padding-bottom: clamp(100px, 12vw, 170px); }
.coop__title {
  --w: 118; --g: 800;
  font-size: clamp(46px, 9.6vw, 150px);
  font-weight: 800;
  font-variation-settings: "wdth" var(--w), "wght" var(--g);
  line-height: 0.88; letter-spacing: -0.04em;
  text-transform: uppercase;
  max-width: 12ch;
}
.coop__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(32px, 5vw, 80px); align-items: end; margin-top: clamp(40px, 5vw, 64px); }
.coop__lead { max-width: 44ch; color: var(--body); font-size: clamp(17px, 1.4vw, 19px); }

.coop__email { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.coop__mail {
  position: relative; display: inline-block;
  font-size: clamp(26px, 4.2vw, 62px); font-weight: 650; font-variation-settings: "wdth" 108;
  letter-spacing: -0.025em; line-height: 1.1;
  word-break: break-all;
}
.coop__mail-fill {
  position: absolute; inset: 0;
  color: var(--accent);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.8s var(--ease-out);
}
.coop__mail:hover .coop__mail-fill { clip-path: inset(0 0 0 0); }
.coop__email .btn svg { width: 15px; height: 15px; }
.coop__email .btn:hover svg { transform: none; }
@media (max-width: 860px) { .coop__grid { grid-template-columns: 1fr; } }

.links { margin-top: clamp(56px, 7vw, 96px); border-top: 1px solid var(--line); }
.links a {
  position: relative;
  display: grid; grid-template-columns: 48px 1fr auto 28px; gap: 20px; align-items: center;
  padding: 26px 0; border-bottom: 1px solid var(--line);
  overflow: hidden;
  transition: color 0.4s;
}
.links a::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform 0.6s var(--ease-out);
}
.links a:hover { color: var(--accent-ink); }
.links a:hover::before { transform: translateY(0); }
.links a:hover .links__idx, .links a:hover .links__handle { color: var(--accent-ink); }
.links__idx { color: var(--accent); padding-left: 4px; transition: color 0.4s; }
.links__label { font-size: clamp(22px, 2.8vw, 40px); font-weight: 720; font-variation-settings: "wdth" 115; text-transform: uppercase; letter-spacing: -0.015em; line-height: 1.1; transition: transform 0.6s var(--ease-out); }
.links a:hover .links__label { transform: translateX(14px); }
.links__handle { color: var(--muted); font-size: 11.5px; transition: color 0.4s; }
.links__arrow { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.6s var(--ease-out); }
.links a:hover .links__arrow { transform: rotate(45deg); }
.links a:hover .links__arrow--down { transform: translateY(3px); }
@media (max-width: 560px) { .links__handle { display: none; } .links a { grid-template-columns: 32px 1fr 24px; gap: 12px; } }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer { position: relative; overflow: hidden; border-top: 1px solid var(--line); background: rgba(10, 11, 13, 0.92); }
.footer__inner { padding: 56px 0 28px; }

.achievements__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 18px; }
.achievements__head .kicker { margin: 0; }
.achievements__list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ach { display: flex; gap: 12px; align-items: center; padding: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 0.4s; }
.ach__icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; background: var(--bg-2); color: var(--dim); box-shadow: inset 0 0 0 1px var(--line-2); transition: background-color 0.4s, color 0.4s; }
.ach__icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.ach__name { font-size: 14px; font-weight: 600; line-height: 1.25; color: var(--muted); }
.ach__hint { font-family: var(--mono); font-size: 10.5px; color: var(--dim); line-height: 1.4; margin-top: 2px; }
.ach.is-unlocked { box-shadow: inset 0 0 0 1px rgba(255, 106, 43, 0.35); }
.ach.is-unlocked .ach__icon { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.ach.is-unlocked .ach__name { color: var(--text); }
@media (max-width: 1100px) { .achievements__list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .achievements__list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .achievements__list { grid-template-columns: 1fr; } }

.wordmark-wrap { margin-top: clamp(56px, 8vw, 110px); }
.wordmark__label { display: flex; justify-content: space-between; color: var(--accent); font-size: 11px; margin-bottom: 8px; }
.wordmark {
  font-size: 14.2vw;
  font-weight: 800; font-variation-settings: "wdth" 100;
  line-height: 0.8; letter-spacing: -0.05em;
  text-transform: lowercase;
  text-align: center;
  white-space: nowrap;
  user-select: none;
  padding: 0.1em 1vw 0;
  overflow: hidden;
}
.wordmark .wl { display: inline-block; --g: 800; --w: 100; font-variation-settings: "wdth" var(--w), "wght" var(--g); }
.wordmark .wl:nth-child(n+3):nth-child(-n+10) { color: transparent; -webkit-text-stroke: 1.5px var(--text); }

.footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 11px;
}
.footer__bottom [data-clock] { color: var(--text); font-variant-numeric: tabular-nums; margin-left: 6px; }
.footer__top { transition: color 0.3s; }
.footer__top:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   Toasts (achievement-style)
   -------------------------------------------------------------------------- */
.toasts { position: fixed; left: 50%; bottom: 28px; z-index: 970; transform: translateX(-50%); display: grid; gap: 10px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  display: flex; align-items: center; gap: 14px;
  min-width: 300px; max-width: 100%;
  padding: 10px 22px 10px 10px;
  background: rgba(22, 25, 30, 0.95);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7), inset 0 0 0 1px var(--line-2);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  position: relative; overflow: hidden;
}
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--accent); transform-origin: left; animation: toastbar var(--hold, 3.6s) linear forwards; }
@keyframes toastbar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast__icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; background: var(--accent); color: var(--accent-ink); clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.toast__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.toast__eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.toast__title { font-size: 15px; font-weight: 600; line-height: 1.3; }
.toast__sub { font-size: 13px; color: var(--muted); line-height: 1.3; }

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .hero__scroll i::after, .caret.is-idle, .toast::after { animation: none; }
}
.reduced .caret.is-idle, .reduced .hero__scroll i::after { animation: none; }
