/* ============================================================
   JUN JOHNNY — PORTFOLIO 2026
   Concept: "PHOSPHOR" — terminal noir research journal.
   Type: Syne (display) · Space Grotesk (body) · JetBrains Mono (log)
   ============================================================ */

/* ---------- Fonts ----------
   One file per family: the former per-weight files were byte-identical,
   so separate URLs only made the browser download the same font twice. */
@font-face {
  font-family: 'Syne';
  src: url('../fonts/Syne.woff2') format('woff2');
  font-weight: 700 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/SpaceGrotesk-300-700.woff2') format('woff2');
  font-weight: 300 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/JetBrainsMono.woff2') format('woff2');
  font-weight: 400 700; font-style: normal; font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  --bg:        #0A0A0B;
  --bg-lift:   #101013;
  --bg-panel:  #0E0E10;
  --ink:       #F2F2ED;
  --muted:     #A6A69C;
  --faint:     #6E6E66;
  --acid:      #D6FF4B;
  --acid-dim:  rgba(214, 255, 75, 0.14);
  --line:      rgba(242, 242, 237, 0.10);
  --line-soft: rgba(242, 242, 237, 0.06);

  --font-display: 'Syne', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'Space Grotesk', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --ease-out:  cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout:cubic-bezier(0.65, 0, 0.35, 1);

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --section-pad: clamp(7rem, 14vh, 12rem);
  --radius: 2px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }
body.no-cursor, body.no-cursor a, body.no-cursor button { cursor: none; }

::selection { background: var(--acid); color: #0A0A0B; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2A2A2C; border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3A3A3D; }

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
code { font-family: var(--font-mono); font-size: 0.85em; color: var(--acid); }

.mono { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }

:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; border-radius: var(--radius); }

.skip-link {
  position: fixed; top: -100%; left: 1rem; z-index: 200;
  padding: 0.6rem 1rem; background: var(--acid); color: #0A0A0B;
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em;
  transition: top 0.2s var(--ease-out);
}
.skip-link:focus-visible { top: 1rem; }

/* ---------- Film grain ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05;
  animation: grain-shift 0.9s steps(2) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  50% { transform: translate(1.5%, -1%); }
  100% { transform: translate(-1%, 1.5%); }
}

/* ---------- Custom cursor ---------- */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cursor { display: block; position: fixed; top: 0; left: 0; z-index: 150; pointer-events: none; }
  .cursor__dot, .cursor__ring { position: fixed; top: 0; left: 0; border-radius: 50%; will-change: transform; }
  .cursor__dot {
    width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--acid);
  }
  .cursor__ring {
    width: 34px; height: 34px; margin: -17px 0 0 -17px;
    border: 1px solid rgba(214, 255, 75, 0.55);
    transition: width 0.35s var(--ease-out), height 0.35s var(--ease-out),
                margin 0.35s var(--ease-out), border-color 0.35s var(--ease-out),
                background-color 0.35s var(--ease-out), opacity 0.3s ease;
  }
  .cursor--hover .cursor__ring {
    width: 58px; height: 58px; margin: -29px 0 0 -29px;
    border-color: transparent; background: rgba(214, 255, 75, 0.10);
  }
  .cursor--press .cursor__ring { width: 24px; height: 24px; margin: -12px 0 0 -12px; }
}

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 180;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--bg);
  transition: transform 0.9s cubic-bezier(0.76, 0, 0.24, 1);
}
.preloader--done { transform: translateY(-101%); }
.preloader__log {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em;
  color: var(--faint); text-transform: uppercase; line-height: 2;
}
.preloader__log .ok { color: var(--acid); }
.preloader__count {
  font-family: 'Syne', var(--font-display); font-weight: 800;
  font-size: clamp(4rem, 12vw, 9rem); line-height: 0.9;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.preloader__count::after { content: '%'; font-size: 0.35em; color: var(--faint); margin-left: 0.1em; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: 1.1rem var(--gutter);
  background: linear-gradient(to bottom, rgba(10,10,11,0.85), rgba(10,10,11,0));
  backdrop-filter: blur(0px);
  transition: background 0.4s ease, backdrop-filter 0.4s ease, border-color 0.4s ease, padding 0.4s ease;
  border-bottom: 1px solid transparent;
}
.nav--scrolled {
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line-soft);
  padding-block: 0.85rem;
}
.nav__brand {
  font-family: var(--font-display); font-weight: 800; font-size: 0.95rem;
  letter-spacing: 0.04em; white-space: nowrap; position: relative;
}
.nav__brand-mark { color: var(--acid); font-size: 0.7em; vertical-align: super; }
.nav__links { display: flex; gap: clamp(1.25rem, 2.5vw, 2.5rem); }
.nav__link {
  position: relative; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  transition: color 0.3s ease; padding-block: 0.3rem;
}
.nav__link::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: var(--acid); transform: scaleX(0); transform-origin: right;
  transition: transform 0.45s var(--ease-out);
}
.nav__link:hover, .nav__link.is-current { color: var(--ink); }
.nav__link:hover::after, .nav__link.is-current::after { transform: scaleX(1); transform-origin: left; }
.nav__progress {
  position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%;
  background: var(--acid); transform: scaleX(0); transform-origin: left;
  pointer-events: none;
}
.nav__aux { display: flex; align-items: center; gap: 1.4rem; }
.lang-switch { display: flex; align-items: center; gap: 0.35rem; font-family: var(--font-mono); font-size: 0.72rem; }
.lang-switch__btn { color: var(--faint); letter-spacing: 0.06em; padding: 0.2rem 0.1rem; transition: color 0.25s ease; }
.lang-switch__btn:hover { color: var(--ink); }
.lang-switch__btn.is-active { color: var(--acid); }
.lang-switch__sep { color: var(--faint); }
.nav__clock { color: var(--faint); font-variant-numeric: tabular-nums; }

.nav__burger { display: none; flex-direction: column; gap: 6px; padding: 0.5rem; }
.nav__burger-line { width: 26px; height: 1.5px; background: var(--ink); transition: transform 0.4s var(--ease-out), opacity 0.3s ease; }
.nav__burger[aria-expanded="true"] .nav__burger-line:nth-child(1) { transform: translateY(3.75px) rotate(45deg); }
.nav__burger[aria-expanded="true"] .nav__burger-line:nth-child(2) { transform: translateY(-3.75px) rotate(-45deg); }

/* Overlay menu (mobile) */
.overlay {
  position: fixed; inset: 0; z-index: 95; background: var(--bg);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 6rem var(--gutter) 2rem;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.7s var(--ease-inout);
  visibility: hidden;
}
.overlay.is-open { clip-path: inset(0 0 0% 0); visibility: visible; }
.overlay__nav { display: flex; flex-direction: column; }
.overlay__link {
  display: flex; align-items: baseline; gap: 1rem;
  font-family: var(--font-display); font-weight: 800; font-size: clamp(1.25rem, 6.6vw, 3.2rem);
  line-height: 1.25; text-transform: uppercase; color: var(--ink);
  border-bottom: 1px solid var(--line-soft); padding-block: 0.55rem;
  min-width: 0;
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.6s var(--ease-out), color 0.3s ease;
}
.overlay.is-open .overlay__link { opacity: 1; transform: translateY(0); }
.overlay.is-open .overlay__link:nth-child(1) { transition-delay: 0.15s; }
.overlay.is-open .overlay__link:nth-child(2) { transition-delay: 0.22s; }
.overlay.is-open .overlay__link:nth-child(3) { transition-delay: 0.29s; }
.overlay.is-open .overlay__link:nth-child(4) { transition-delay: 0.36s; }
.overlay.is-open .overlay__link:nth-child(5) { transition-delay: 0.43s; }
.overlay.is-open .overlay__link:nth-child(6) { transition-delay: 0.5s; }
.overlay__link:active { color: var(--acid); }
.overlay__index { color: var(--acid); }
.overlay__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; color: var(--muted); }
.overlay__foot .lang-switch { display: flex; margin-left: auto; font-size: 0.85rem; }
.overlay__foot .lang-switch__btn { padding: 0.4rem 0.3rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 70% 20%, transparent 40%, rgba(10,10,11,0.55) 100%),
    linear-gradient(to bottom, rgba(10,10,11,0.25), transparent 30%, transparent 62%, var(--bg) 96%);
}
.hero__inner {
  position: relative; z-index: 2; flex: 1;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(6rem, 12vh, 8.5rem) var(--gutter) clamp(2rem, 5vh, 3.5rem);
}
.hero__meta {
  display: flex; justify-content: space-between; gap: 1rem;
  color: var(--faint);
}
.hero__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(4rem, 15.5vw, 14rem);
  line-height: 0.86; letter-spacing: -0.015em; text-transform: uppercase;
  margin-block: auto;
}
.hero__line { display: block; overflow: hidden; padding-block: 0.04em; }
.hero__line-inner { display: inline-block; will-change: transform; }
.hero__line--offset { margin-left: clamp(2rem, 11vw, 11rem); }
.hero__line--offset .hero__line-inner {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
}
.hero__line--offset .hero__line-inner::selection { background: var(--acid); -webkit-text-stroke: 0; color: #0A0A0B; }

.hero__foot {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 3rem;
  flex-wrap: wrap;
}
.hero__statement {
  max-width: 34rem; font-size: clamp(1.05rem, 1rem + 0.5vw, 1.35rem);
  line-height: 1.55; color: var(--muted); font-weight: 400;
  text-wrap: balance;
}
.hero__status {
  display: inline-flex; align-items: center; gap: 0.6rem; color: var(--muted);
}
.hero__status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--acid);
  box-shadow: 0 0 0 0 rgba(214, 255, 75, 0.5);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(214, 255, 75, 0.45); }
  70% { box-shadow: 0 0 0 9px rgba(214, 255, 75, 0); }
  100% { box-shadow: 0 0 0 0 rgba(214, 255, 75, 0); }
}
.hero__scroll {
  display: inline-flex; flex-direction: column; align-items: center; gap: 0.7rem;
  color: var(--faint);
}
.hero__scroll-track {
  width: 1px; height: 52px; background: var(--line); position: relative; overflow: hidden;
}
.hero__scroll-thumb {
  position: absolute; left: 0; top: -40%; width: 100%; height: 40%;
  background: var(--acid); animation: scroll-drip 1.8s var(--ease-inout) infinite;
}
@keyframes scroll-drip {
  0% { top: -40%; }
  100% { top: 110%; }
}

/* Hero entrance choreography */
.reveal-hero { opacity: 0; transform: translateY(26px); transition: opacity 0.8s ease, transform 0.9s var(--ease-out); }
.hero__line-inner { transform: translateY(112%); transition: transform 1.1s var(--ease-out); }
body.is-ready .reveal-hero { opacity: 1; transform: translateY(0); }
body.is-ready .hero__line-inner { transform: translateY(0); }
body.is-ready [data-delay="0"] { transition-delay: 0.05s; }
body.is-ready .hero__line-inner[data-delay="1"] { transition-delay: 0.1s; }
body.is-ready .hero__line-inner[data-delay="2"] { transition-delay: 0.22s; }
body.is-ready [data-delay="3"] { transition-delay: 0.4s; }
body.is-ready [data-delay="4"] { transition-delay: 0.52s; }
body.is-ready [data-delay="5"] { transition-delay: 0.62s; }

/* ---------- Marquee ---------- */
.marquee {
  border-block: 1px solid var(--line);
  padding-block: 1.1rem; overflow: hidden;
  background: var(--bg-panel);
}
.marquee__track {
  display: flex; align-items: center; gap: 2.2rem; width: max-content;
  animation: marquee 36s linear infinite;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1rem, 1rem + 0.6vw, 1.4rem); text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--faint); white-space: nowrap;
  will-change: transform;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item { flex-shrink: 0; }
.marquee__ver { color: var(--acid); font-size: 0.7em; vertical-align: super; margin-left: 0.25em; }
.marquee__dot { color: var(--acid); font-size: 0.5em; flex-shrink: 0; }
@keyframes marquee { to { transform: translateX(calc(-50% - 1.1rem)); } }

/* ---------- Sections ---------- */
.section { padding: var(--section-pad) var(--gutter); position: relative; }
.section__head {
  display: flex; align-items: baseline; gap: 1.4rem;
  flex-wrap: wrap; row-gap: 0.5rem;
  padding-bottom: 1.6rem; margin-bottom: clamp(3rem, 7vh, 5.5rem);
  border-bottom: 1px solid var(--line);
}
.section__index { color: var(--acid); }
.section__title {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(2.4rem, 6vw, 5rem); line-height: 0.95; letter-spacing: -0.01em;
  min-width: 0;
}
.section__badge {
  margin-left: auto; color: var(--muted); border: 1px solid var(--line);
  padding: 0.45rem 0.8rem; border-radius: 99px; white-space: nowrap;
}
.section__badge::before {
  content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--acid); margin-right: 0.6rem; vertical-align: 1px;
  animation: pulse 2.2s ease-out infinite;
}

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.85s ease, transform 0.95s var(--ease-out); }
.reveal.is-inview { opacity: 1; transform: translateY(0); }

/* ---------- Research ---------- */
.research__intro {
  max-width: 46rem; margin-bottom: clamp(3.5rem, 8vh, 6rem);
  font-size: clamp(1.15rem, 1.05rem + 0.6vw, 1.5rem); line-height: 1.6;
  color: var(--ink); font-weight: 400; text-wrap: pretty;
}
.research__intro em { font-style: normal; color: var(--acid); }
.research__intro p + p { margin-top: 1em; }

.research__list { display: flex; flex-direction: column; }
.pillar {
  display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 2rem;
  padding-block: clamp(2rem, 5vh, 3.4rem);
  border-top: 1px solid var(--line-soft);
  position: relative;
}
.pillar:last-child { border-bottom: 1px solid var(--line-soft); }
.pillar::before {
  content: ''; position: absolute; left: 0; top: 0; height: 100%; width: 0;
  background: linear-gradient(to right, var(--acid-dim), transparent 60%);
  transition: width 0.6s var(--ease-out); pointer-events: none;
}
.pillar:hover::before { width: 100%; }
.pillar__num {
  color: var(--faint); padding-top: 0.45rem;
  transition: color 0.4s ease;
}
.pillar:hover .pillar__num { color: var(--acid); }
.pillar__title {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(1.5rem, 2.6vw, 2.4rem); line-height: 1.05; margin-bottom: 0.9rem;
  transition: transform 0.5s var(--ease-out);
}
.pillar:hover .pillar__title { transform: translateX(0.5rem); }
.pillar__text { max-width: 40rem; color: var(--muted); line-height: 1.7; }
.pillar__tags {
  display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1.4rem;
}
.pillar__tags li {
  color: var(--faint); border: 1px solid var(--line); border-radius: 99px;
  padding: 0.35rem 0.75rem; font-size: 0.62rem;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.pillar:hover .pillar__tags li { border-color: rgba(214, 255, 75, 0.35); color: var(--muted); }

/* ---------- Flagship ---------- */
.flagship { background: var(--bg-panel); border-block: 1px solid var(--line); }
.flagship__grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2.5rem, 5vw, 5rem); align-items: start;
}
.flagship__lead {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem); line-height: 1.6;
  color: var(--ink); margin-bottom: 2rem; max-width: 34rem;
}
.flagship__stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft);
  margin-bottom: 2.4rem;
}
.flagship__stats > div { background: var(--bg); padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column-reverse; gap: 0.35rem; }
.flagship__stats dt { color: var(--faint); font-size: 0.6rem; }
.flagship__stats dd {
  font-family: var(--font-display); font-weight: 800; color: var(--ink);
  font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.3rem); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.flagship__stats > div:first-child dd { color: var(--acid); }
.flagship__features { display: flex; flex-direction: column; gap: 1.15rem; margin-bottom: 2.6rem; }
.flagship__feature {
  display: flex; gap: 1.1rem; padding: 1rem 1.1rem;
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: var(--bg);
  transition: border-color 0.35s ease, transform 0.45s var(--ease-out), background 0.35s ease;
}
.flagship__feature:hover {
  border-color: rgba(214, 255, 75, 0.4); transform: translateX(6px);
}
.flagship__feature-num { color: var(--acid); padding-top: 0.2rem; }
.flagship__feature h4 {
  font-family: var(--font-body); font-weight: 600; font-size: 1rem; margin-bottom: 0.2rem;
}
.flagship__feature p { color: var(--muted); font-size: 0.92rem; line-height: 1.55; }

.flagship__cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 2.2rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.8rem;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.1em;
  padding: 0.95rem 1.6rem; border-radius: 99px; position: relative; overflow: hidden;
  transition: color 0.35s ease, border-color 0.35s ease;
  isolation: isolate;
}
.btn::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  transform: translateY(101%); transition: transform 0.5s var(--ease-out);
}
.btn:hover::before { transform: translateY(0); }
.btn--solid { background: var(--acid); color: #0A0A0B; }
.btn--solid::before { background: var(--ink); }
.btn--ghost { border: 1px solid var(--line); color: var(--muted); }
.btn--ghost::before { background: var(--acid); }
.btn--ghost:hover { color: #0A0A0B; border-color: var(--acid); }
.btn__dollar { color: var(--acid); }
.btn--ghost:hover .btn__dollar { color: #0A0A0B; }
.btn__copy-hint { font-size: 0.6rem; color: var(--faint); border-left: 1px solid var(--line); padding-left: 0.8rem; transition: color 0.3s ease; }
.btn--ghost:hover .btn__copy-hint { color: rgba(10,10,11,0.6); }
.btn--ghost.is-copied { border-color: var(--acid); }
.btn--ghost.is-copied .btn__copy-hint { color: var(--acid); }

.flagship__meta {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft);
}
.flagship__meta > div { background: var(--bg-panel); padding: 0.9rem 1rem; }
.flagship__meta dt { color: var(--faint); font-size: 0.62rem; margin-bottom: 0.35rem; }
.flagship__meta dd { color: var(--ink); font-size: 0.72rem; letter-spacing: 0.04em; }

/* Terminal */
.flagship__terminal { position: sticky; top: 16vh; }
.term {
  position: relative;
  background: #070708; border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(214, 255, 75, 0.04);
  overflow: hidden;
}
.term::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(255,255,255,0.012) 2px 4px);
}
.term__bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1rem; border-bottom: 1px solid var(--line-soft); background: #0C0C0E;
}
.term__dot { width: 10px; height: 10px; border-radius: 50%; background: #26262A; }
.term__dot:first-child { background: rgba(214, 255, 75, 0.5); }
.term__title { margin-left: auto; color: var(--faint); font-size: 0.65rem; }
.term__body {
  padding: 1.4rem 1.4rem 0.4rem; min-height: 25.5rem;
  font-size: 0.8rem; line-height: 1.9; color: var(--muted);
  text-transform: none; letter-spacing: 0.02em; /* commands are case-sensitive */
  white-space: pre-wrap; word-break: break-word;
}
.term__body .t-cmd { color: var(--ink); }
.term__body .t-prompt { color: var(--acid); }
.term__body .t-dim { color: var(--faint); }
.term__body .t-acid { color: var(--acid); }
.term__caret { color: var(--acid); display: inline-block; animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Work ---------- */
.work__list { display: flex; flex-direction: column; }
.work__row { border-top: 1px solid var(--line-soft); }
.work__row:last-child { border-bottom: 1px solid var(--line-soft); }
.work__link {
  display: grid; grid-template-columns: 6rem minmax(0, 1fr) auto 3rem;
  align-items: center; gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.6rem, 4vh, 2.6rem) 0.5rem;
  position: relative; overflow: hidden;
}
.work__link::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: var(--bg-lift);
  transform: scaleY(0); transform-origin: bottom;
  transition: transform 0.5s var(--ease-out);
}
.work__link:hover::before { transform: scaleY(1); }
.work__link > * { position: relative; z-index: 1; }
.work__index { color: var(--faint); transition: color 0.3s ease; }
.work__link:hover .work__index { color: var(--acid); }
.work__name {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(1.3rem, 2.4vw, 2rem); line-height: 1.1;
  transition: transform 0.5s var(--ease-out);
}
.work__desc { color: var(--muted); font-size: 0.92rem; line-height: 1.6; max-width: 36rem; margin-top: 0.45rem; }
.work__tags { display: flex; flex-wrap: wrap; gap: 0.5rem; color: var(--faint); font-size: 0.62rem; }
.work__tags span { border: 1px solid var(--line); padding: 0.3rem 0.65rem; border-radius: 99px; white-space: nowrap; transition: color .3s, border-color .3s; }
.work__link:hover .work__tags span { border-color: rgba(214,255,75,.35); color: var(--muted); }
.work__arrow {
  font-size: 1.6rem; color: var(--faint); text-align: right;
  transition: transform 0.45s var(--ease-out), color 0.3s ease;
}
.work__link:hover .work__arrow { color: var(--acid); transform: translate(6px, -6px); }
.work__link:hover .work__name { transform: translateX(0.6rem); }
.work__more {
  display: inline-block; margin-top: 2.2rem; color: var(--muted);
  border-bottom: 1px solid var(--line); padding-bottom: 0.35rem;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.work__more:hover { color: var(--acid); border-color: var(--acid); }

/* ---------- Release log ---------- */
.log { background: var(--bg-panel); border-block: 1px solid var(--line); }
.log__list { position: relative; list-style: none; }
.log__list::before {
  content: ''; position: absolute; left: 0.3rem; top: 0.6rem; bottom: 0.6rem;
  width: 1px; background: var(--line);
}
.log__link {
  display: grid; grid-template-columns: 7.5rem 13.5rem minmax(0, 1fr) 2rem;
  align-items: baseline; gap: 1.5rem;
  padding: 1.35rem 0.5rem 1.35rem 2rem; position: relative;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.35s ease;
}
.log__item:last-child .log__link { border-bottom: 0; }
.log__link::before {
  content: ''; position: absolute; left: 0; top: 1.85rem;
  width: 0.65rem; height: 0.65rem; border-radius: 50%;
  background: var(--bg-panel); border: 1px solid var(--faint);
  transition: background 0.3s ease, border-color 0.3s ease;
}
.log__item:first-child .log__link::before { background: var(--acid); border-color: var(--acid); }
.log__link:hover { background: var(--bg-lift); }
.log__link:hover::before { border-color: var(--acid); }
.log__date { color: var(--faint); font-variant-numeric: tabular-nums; }
.log__pkg { color: var(--acid); }
.log__text { color: var(--muted); font-size: 0.95rem; line-height: 1.6; max-width: 46rem; transition: color 0.3s ease; }
.log__link:hover .log__text { color: var(--ink); }
.log__arrow { color: var(--faint); text-align: right; transition: transform 0.45s var(--ease-out), color 0.3s ease; }
.log__link:hover .log__arrow { color: var(--acid); transform: translate(4px, -4px); }

/* ---------- Stack ---------- */
.stack__grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft);
}
.stack__col { background: var(--bg); padding: clamp(1.4rem, 2.5vw, 2rem); transition: background 0.4s ease; }
.stack__col:hover { background: var(--bg-lift); }
.stack__head { color: var(--acid); margin-bottom: 1.4rem; font-size: 0.7rem; }
.stack__items { display: flex; flex-direction: column; gap: 0.65rem; }
.stack__items li {
  color: var(--muted); font-size: 0.95rem; padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line-soft);
  transition: color 0.25s ease, padding-left 0.35s var(--ease-out);
}
.stack__col:hover .stack__items li { color: var(--ink); }
.stack__items li:hover { color: var(--acid) !important; padding-left: 0.4rem; }
.stack__items li:last-child { border-bottom: 0; }

/* ---------- Contact ---------- */
.contact { padding-bottom: clamp(4rem, 8vh, 7rem); }
.contact__body { text-align: left; }
.contact__kicker { color: var(--muted); font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem); max-width: 32rem; margin-bottom: 2rem; text-wrap: balance; }
.contact__mail {
  display: inline-flex; align-items: baseline; gap: clamp(1rem, 3vw, 2.5rem);
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(3.4rem, 13vw, 12rem); line-height: 0.95; letter-spacing: -0.01em;
  position: relative; margin-bottom: 1.6rem;
}
.contact__mail-text {
  position: relative; color: var(--ink);
  transition: color 0.4s ease;
}
.contact__mail-text::after {
  content: ''; position: absolute; left: 0; bottom: 0.02em; height: 0.06em; width: 100%;
  background: var(--acid); transform: scaleX(0); transform-origin: right;
  transition: transform 0.6s var(--ease-out);
}
.contact__mail:hover .contact__mail-text { color: var(--acid); }
.contact__mail:hover .contact__mail-text::after { transform: scaleX(1); transform-origin: left; }
.contact__mail-arrow {
  font-size: 0.35em; color: var(--acid);
  transition: transform 0.5s var(--ease-out);
}
.contact__mail:hover .contact__mail-arrow { transform: translate(0.15em, -0.15em); }
.contact__email {
  display: inline-block; color: var(--faint); font-size: 0.8rem; letter-spacing: 0.14em;
  margin-bottom: clamp(3rem, 7vh, 5rem);
  transition: color 0.3s ease;
}
.contact__email:hover { color: var(--acid); }
.contact__links {
  display: flex; flex-wrap: wrap; gap: 1rem;
  border-top: 1px solid var(--line); padding-top: 2rem;
}
.contact__links li { flex: 1 1 220px; }
.contact__link {
  display: flex; align-items: center; gap: 1rem;
  border: 1px solid var(--line); padding: 1.3rem 1.5rem; border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.1em;
  color: var(--ink); position: relative; overflow: hidden;
  transition: color 0.35s ease, border-color 0.35s ease;
}
.contact__link::before {
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--acid);
  transform: translateY(101%); transition: transform 0.5s var(--ease-out);
}
.contact__link:hover { color: #0A0A0B; border-color: var(--acid); }
.contact__link:hover::before { transform: translateY(0); }
.contact__link .mono { color: var(--faint); transition: color 0.35s ease; }
.contact__link:hover .mono { color: rgba(10, 10, 11, 0.55); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 1.6rem var(--gutter) 1.2rem; }
.footer__row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2.5rem;
  color: var(--faint); font-size: 0.65rem;
}
.footer__row > span:nth-child(2) { margin-right: auto; }
.footer__clock { font-variant-numeric: tabular-nums; }
.footer__top {
  color: var(--muted); letter-spacing: 0.08em; font-size: 0.65rem;
  transition: color 0.3s ease; font-family: var(--font-mono);
}
.footer__top:hover { color: var(--acid); }
.footer__type { margin-top: 0.9rem; color: #3C3C38; font-size: 0.6rem; letter-spacing: 0.14em; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .flagship__grid { grid-template-columns: 1fr; }
  .flagship__terminal { position: static; }
  .stack__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .log__link { grid-template-columns: 7.5rem minmax(0, 1fr) 2rem; grid-template-areas: "date pkg arrow" "text text text"; row-gap: 0.5rem; }
  .log__date { grid-area: date; }
  .log__pkg { grid-area: pkg; }
  .log__text { grid-area: text; }
  .log__arrow { grid-area: arrow; }
}

@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .nav__clock { display: none; }
  .pillar { grid-template-columns: 1fr; gap: 0.8rem; }
  .pillar__num { padding-top: 0; }
  .work__link { grid-template-columns: 3rem minmax(0, 1fr); grid-template-areas: "idx body" ". tags"; row-gap: 0.9rem; }
  .work__index { grid-area: idx; align-self: start; padding-top: 0.3rem; }
  .work__body { grid-area: body; }
  .work__tags { grid-area: tags; }
  .work__arrow { display: none; }
}

@media (max-width: 640px) {
  .lang-switch { display: none; }
  .section__title { font-size: clamp(1.7rem, 8.5vw, 2.5rem); }
  .hero__meta { flex-direction: column; gap: 0.35rem; }
  .hero__meta-right { display: none; }
  .hero__line--offset { margin-left: clamp(1.5rem, 10vw, 4rem); }
  .hero__foot { flex-direction: column; align-items: flex-start; gap: 1.8rem; }
  .hero__scroll { flex-direction: row; align-items: center; }
  .hero__scroll-track { width: 52px; height: 1px; }
  .hero__scroll-thumb { top: 0; left: -40%; height: 100%; width: 40%; animation: scroll-drip-h 1.8s var(--ease-inout) infinite; }
  .section__badge { display: none; }
  .flagship__cta { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
  .flagship__meta { grid-template-columns: 1fr; }
  .flagship__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stack__grid { grid-template-columns: 1fr; }
  .log__link { grid-template-columns: minmax(0, 1fr); grid-template-areas: "date" "pkg" "text"; row-gap: 0.3rem; padding-left: 1.6rem; }
  .log__arrow { display: none; }
  .term__body { font-size: 0.72rem; }
  .contact__mail { flex-direction: column; gap: 0.5rem; }
  .contact__links { flex-direction: column; }
  .contact__links li { flex-basis: auto; }
  .footer__row { flex-direction: column; align-items: flex-start; gap: 0.7rem; }
  .footer__row > span:nth-child(2) { margin-right: 0; }
  .footer__row > * { margin-right: 0; }
}
@keyframes scroll-drip-h {
  0% { left: -40%; }
  100% { left: 110%; }
}

/* ============================================================
   QA mode (?qa) — deterministic rendering for automated captures
   ============================================================ */
html.qa .preloader { display: none !important; }
html.qa body.is-loading { overflow: auto; }
html.qa .reveal, html.qa .reveal-hero { opacity: 1 !important; transform: none !important; transition: none !important; }
html.qa .hero__line-inner { transform: none !important; transition: none !important; }
html.qa .hero { min-height: 0; height: 900px; }
html.qa .hero__canvas { display: none; }

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-hero, .hero__line-inner { opacity: 1; transform: none; }
  .preloader { display: none; }
  .marquee__track { animation: none; flex-wrap: wrap; }
  .hero__canvas { display: none; }
}

/* ============================================================
   i18n — CJK refinements
   ============================================================ */
/* i18n.js sets lang="zh-CN" / "zh-Hant"; :lang(zh) matches both. */
html:lang(zh) .hero__title { letter-spacing: 0; }
html:lang(zh) .pillar__title,
html:lang(zh) .work__name {
  text-transform: none; letter-spacing: 0.02em;
}
html:lang(zh) .section__title { letter-spacing: 0.04em; }
html:lang(zh) .contact__mail { letter-spacing: 0.02em; }
html:lang(zh) .log__text, html:lang(zh) .pillar__text, html:lang(zh) .work__desc { line-height: 1.8; }
