/* ========================================================
   PZW PORTFOLIO · 3 DIRECTIONS
   [data-direction="editorial"]  · deep warm black + cream
   [data-direction="paper"]      · cream paper + ink
   [data-direction="terminal"]   · phosphor black + green
======================================================== */

:root {
  --accent-hue: 118;
  --accent: oklch(0.85 0.16 var(--accent-hue));
  --accent-soft: oklch(0.85 0.16 var(--accent-hue) / 0.35);
  --serif: "Instrument Serif", "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

/* -------- EDITORIAL (default: dark warm) -------- */
:root,
[data-direction="editorial"] {
  --bg:     #0d0c0a;
  --bg-2:   #15130f;
  --bg-3:   #1d1a14;
  --fg:     #ede7dc;
  --fg-dim: #8a8475;
  --line:   rgba(237, 231, 220, 0.12);
  --line-2: rgba(237, 231, 220, 0.28);
  --hot:    var(--accent);
  color-scheme: dark;
}

/* -------- PAPER (cream editorial) -------- */
[data-direction="paper"] {
  --bg:     #f1ede2;
  --bg-2:   #e7e1d0;
  --bg-3:   #dcd5bf;
  --fg:     #14130f;
  --fg-dim: #6a6552;
  --line:   rgba(20, 19, 15, 0.16);
  --line-2: rgba(20, 19, 15, 0.36);
  --hot:    #14130f;
  color-scheme: light;
}
[data-direction="paper"] .accent { color: #14130f !important; border-bottom: 1px solid currentColor; }
[data-direction="paper"] em.accent { border-bottom: 2px solid var(--accent); }
[data-direction="paper"] .dot { background: var(--fg); }

/* -------- TERMINAL (phosphor green) -------- */
[data-direction="terminal"] {
  --bg:     #06080a;
  --bg-2:   #0b0f11;
  --bg-3:   #10151a;
  --fg:     #c8d5c0;
  --fg-dim: #5e6a5a;
  --line:   rgba(160, 220, 160, 0.1);
  --line-2: rgba(160, 220, 160, 0.28);
  --accent: #9ce87a;
  --accent-soft: rgba(156, 232, 122, 0.35);
  --hot: #9ce87a;
  --serif: var(--mono);
  color-scheme: dark;
}
[data-direction="terminal"] .serif { font-family: var(--mono); letter-spacing: -0.01em; font-weight: 500; }
[data-direction="terminal"] body { font-family: var(--mono); }

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  transition: background 500ms, color 500ms;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { overflow-x: hidden; cursor: none; }
@media (max-width: 900px), (hover: none) { body { cursor: auto; } }

a { color: inherit; text-decoration: none; }
em { font-style: normal; }
em.accent { color: var(--accent); font-style: normal; }
.accent { color: var(--accent); }

kbd {
  font-family: var(--mono); font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: var(--bg-2);
  color: var(--fg);
}

/* grain overlay */
html.grain body::before {
  content: ""; position: fixed; inset: 0;
  pointer-events: none; z-index: 100;
  opacity: 0.06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.7 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
[data-direction="terminal"] html.grain body::before,
html.grain[data-direction="terminal"] body::before { display: none; }
[data-direction="terminal"] body::after {
  content: ""; position: fixed; inset: 0;
  pointer-events: none; z-index: 99;
  background: repeating-linear-gradient(0deg, rgba(156,232,122,0.04) 0 1px, transparent 1px 3px);
}

/* helpers */
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.015em; }
.mono  { font-family: var(--mono); letter-spacing: 0; }
.small { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.dim   { color: var(--fg-dim); }
.tag, .tag-chip {
  display: inline-block; padding: 3px 8px;
  border: 1px solid var(--line-2); border-radius: 3px;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-dim);
}

/* page frame */
.site { max-width: 1440px; margin: 0 auto; padding: 0 56px; }

/* =============== TOPNAV =============== */
.topnav {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; padding: 18px 0;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: blur(14px);
}
.topnav__left { display: flex; align-items: center; gap: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.topnav__nav { display: flex; gap: 14px; flex-wrap: nowrap; }
.topnav__nav a { color: var(--fg-dim); transition: color .2s; white-space: nowrap; }
.topnav__nav a:hover { color: var(--fg); }
.topnav__right { display: flex; gap: 14px; justify-content: flex-end; align-items: center; }
.status { display: inline-flex; gap: 6px; align-items: center; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* =============== HERO =============== */
.hero { padding: 80px 0 120px; border-bottom: 1px solid var(--line); }
.hero__grid {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 72px; align-items: flex-start;
}
.hero__badge {
  display: inline-flex; gap: 10px; align-items: center;
  padding: 6px 12px; margin-bottom: 60px;
  border: 1px solid var(--line-2); border-radius: 999px;
  color: var(--fg);
}
.led { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 2s infinite; }

.hero__name {
  display: flex; align-items: baseline; gap: 20px; margin: 0 0 32px; line-height: 0.9;
}
.hero__name-zh { font-size: clamp(82px, 11vw, 156px); letter-spacing: -0.04em; }
.hero__name-en { color: var(--fg-dim); }

.hero__role {
  font-size: clamp(46px, 5.4vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 48px;
}
.hero__role span { color: var(--fg-dim); }

.hero__statement {
  font-size: 16px; line-height: 1.75;
  max-width: 480px; margin: 0 0 56px;
}
.hero__statement .tag { margin-bottom: 10px; }
.hero__statement em { border-bottom: 1px solid var(--accent-soft); padding-bottom: 1px; }

.hero__figures {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line); padding-top: 22px;
}
.fig { padding-right: 14px; border-right: 1px solid var(--line); }
.fig:last-child { border-right: none; }
.fig__n { font-size: 40px; line-height: 1; margin-bottom: 10px; }
.fig__lbl { font-size: 9px; }

/* portrait */
.hero__right { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 80px; }
.portrait {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  overflow: hidden;
  filter: contrast(1.02) saturate(0.9);
}
.portrait img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(0.35) contrast(1.05);
  transition: filter 600ms;
}
[data-direction="terminal"] .portrait img { filter: grayscale(1) contrast(1.2) brightness(0.85) sepia(0.5) hue-rotate(50deg) saturate(3); }
[data-direction="paper"] .portrait img { filter: grayscale(0.2) contrast(1.08); }
.portrait__caption-removed {
  display: none;
  position: absolute; left: 16px; bottom: 14px;
  display: flex; gap: 8px; color: var(--fg); z-index: 2;
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  padding: 4px 8px; border: 1px solid var(--line-2);
}
.portrait__marks {
  position: absolute; top: 14px; right: 14px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  color: var(--fg);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  padding: 4px 8px; border: 1px solid var(--line-2);
}
.portrait::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, color-mix(in oklab, var(--bg) 70%, transparent) 100%);
  pointer-events: none;
}

/* terminal box */
.terminal {
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  font-size: 12px;
}
.terminal__bar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--fg-dim);
}
.terminal__bar > span:last-child { margin-left: 10px; }
.tdot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.tdot.r { background: #ff5f56; } .tdot.y { background: #ffbd2e; } .tdot.g { background: #27c93f; }

.terminal__body { padding: 14px; line-height: 1.7; min-height: 200px; max-height: 360px; overflow-y: auto; }
.tline { white-space: pre-wrap; word-break: break-word; }
.tline--prompt { color: var(--accent); }
.tline--out { color: var(--fg); padding-left: 12px; }
.caret { display: inline-block; animation: blink 1s steps(1) infinite; margin-left: 2px; }
.caret-lg { display: inline-block; animation: blink 1s steps(1) infinite; color: var(--accent); }

/* interactive input row inside terminal */
.term-form { display: flex; align-items: baseline; gap: 0; margin: 0; }
.term-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0;
  color: var(--fg);
  font: inherit;
  caret-color: var(--accent);
}
.term-input::placeholder { color: var(--fg-dim); opacity: 0.7; }

.term-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 10px 12px; }
.term-chip {
  font-size: 11px;
  padding: 4px 10px;
  border: 1px dashed var(--line-2);
  background: transparent;
  color: var(--fg-dim);
  cursor: pointer;
  border-radius: 999px;
  transition: color .15s, border-color .15s, background .15s;
}
.term-chip:hover { color: var(--accent); border-color: var(--accent); background: color-mix(in oklab, var(--accent) 8%, transparent); }
@keyframes blink { 50% { opacity: 0; } }

/* =============== SECTIONS =============== */
.sec { padding: 130px 0; border-bottom: 1px solid var(--line); }
.sec:last-of-type { border-bottom: none; }

.sec-head { margin-bottom: 80px; max-width: 880px; }
.sec-head__top { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.sec-head__no { color: var(--accent); }
.sec-head__line { flex: 0 0 80px; height: 1px; background: var(--line-2); }
.sec-head__title {
  font-size: clamp(48px, 6.5vw, 96px);
  line-height: 0.98; margin: 0 0 20px;
  letter-spacing: -0.025em;
}
/* sec-head__desc removed */

/* =============== TIMELINE GROUPS =============== */
.tl-group { margin-bottom: 80px; }
.tl-group:last-child { margin-bottom: 0; }
.tl-group__head {
  display: flex; align-items: baseline; gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  letter-spacing: 0.06em;
}
.tl-group__head .accent { font-size: 15px; letter-spacing: 0.04em; }
.tl-group__line { flex: 1; height: 1px; background: var(--line); margin: 0 8px; align-self: center; }
.tl-group__count { font-variant-numeric: tabular-nums; font-size: 12px; }

.tl-group--awards .awards-list {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--line);
}
.award-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  transition: padding 200ms, background 200ms;
}
.award-row:hover { padding-left: 12px; }
.award-row__year { font-variant-numeric: tabular-nums; }
.award-row__name { font-size: 22px; line-height: 1.2; }
.award-row__prize { color: var(--fg-dim); letter-spacing: 0.04em; text-align: right; }
@media (max-width: 700px) {
  .award-row { grid-template-columns: 50px 1fr; gap: 12px; }
  .award-row__prize { grid-column: 2; text-align: left; font-size: 11px; }
}

/* =============== PRESS =============== */
.tl-group--press .press {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.press__row { display: block; }
.press__link {
  display: flex; flex-direction: column; gap: 14px;
  padding: 32px 32px 28px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: background .25s, transform .25s;
  height: 100%;
  position: relative;
}
.press__link:hover {
  background: var(--bg-2);
}
.press__link:hover .press__arrow { transform: translate(4px, -4px); }
.press__outlet {
  display: flex; gap: 10px; align-items: center;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.press__kind { color: var(--fg-dim); opacity: 0.7; }
.press__outlet-name { letter-spacing: 0.12em; }
.press__title {
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.2; margin: 0;
  color: var(--fg);
}
.press__sub {
  color: var(--fg-dim); font-size: 14px; line-height: 1.6;
  margin: 0;
}
.press__cta {
  margin-top: auto;
  display: inline-flex; gap: 8px; align-items: center;
  color: var(--accent);
  letter-spacing: 0.16em; text-transform: uppercase;
  padding-top: 8px;
  border-top: 1px dashed var(--line-2);
}
.press__arrow { transition: transform .25s; display: inline-block; }
@media (max-width: 760px) {
  .tl-group--press .press { grid-template-columns: 1fr; }
  .press__link { padding: 24px 22px; }
}

/* =============== TIMELINE =============== */
.timeline {
  position: relative;
  display: flex; flex-direction: column;
}
.tl-item {
  display: grid;
  grid-template-columns: 40px 180px 1fr;
  gap: 28px;
  padding: 40px 0;
  border-top: 1px solid var(--line);
  position: relative;
}
.tl-item:last-child { border-bottom: 1px solid var(--line); }
.tl-item__spine {
  position: relative; display: flex; justify-content: center; padding-top: 8px;
}
.tl-item__spine::before {
  content: ""; position: absolute;
  top: 0; bottom: -40px;
  width: 1px; background: var(--line);
  left: 50%; transform: translateX(-50%);
}
.tl-item:last-child .tl-item__spine::before { bottom: 0; }
.tl-item__marker {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line-2);
  position: relative; z-index: 2;
}
.tl-item--internship .tl-item__marker { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px var(--accent-soft); }
.tl-item--project .tl-item__marker { background: var(--fg); border-color: var(--fg); }
.tl-item--showcase .tl-item__marker { background: transparent; border-color: var(--accent); box-shadow: 0 0 8px var(--accent-soft); }

.tl-item__meta { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.tl-item__body { }
.tl-item__org { margin-bottom: 6px; }
.tl-item__venue {
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, opacity .2s;
}
.tl-item__venue:hover { border-bottom-color: var(--accent); }
.tl-item__venue-arrow { display: inline-block; transition: transform .2s; opacity: 0.7; }
.tl-item__venue:hover .tl-item__venue-arrow { transform: translate(2px, -2px); opacity: 1; }
.tl-item__title { font-size: clamp(38px, 4.4vw, 64px); line-height: 1; margin: 0 0 8px; letter-spacing: -0.01em; }
.tl-item__subtitle { font-size: clamp(20px, 1.8vw, 26px); line-height: 1.2; margin: 0 0 12px; color: var(--fg); opacity: 0.78; font-style: italic; }
.tl-item__role { color: var(--fg); margin-bottom: 14px; }
.tl-item__summary { font-size: 16px; margin: 0 0 22px; max-width: 720px; line-height: 1.65; }
.tl-item__bullets { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-direction: column; gap: 14px; max-width: 780px; }
.tl-item__bullets li { display: grid; grid-template-columns: 20px 1fr; gap: 12px; font-size: 15px; line-height: 1.65; }
.tl-item__bullets li span:first-child { padding-top: 5px; }
.tl-item__metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); padding-top: 18px; margin-top: 4px; max-width: 640px; }
.metric { padding-right: 10px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.metric:last-child { border-right: none; }
.metric__n { font-size: 26px; line-height: 1; }
.metric__l { font-size: 10px; }
.tl-item__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }

/* =============== METHODOLOGY =============== */
.method { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.method__row {
  display: grid; grid-template-columns: 80px 1fr;
  gap: 32px; padding: 40px 0;
  border-bottom: 1px solid var(--line);
  transition: background 300ms;
}
.method__row:hover { background: var(--bg-2); padding-left: 16px; padding-right: 16px; }
.method__step { font-size: 14px; color: var(--accent); padding-top: 8px; }
.method__title { font-size: clamp(28px, 3vw, 42px); margin: 0 0 16px; line-height: 1; }
.method__body { font-size: 17px; line-height: 1.7; max-width: 720px; margin: 0 0 20px; text-wrap: pretty; }
.method__sample { font-size: 12px; color: var(--fg); padding: 14px 18px; border-left: 2px solid var(--accent); background: var(--bg-2); max-width: 780px; line-height: 1.7; }

/* legacy awards marquee removed — see .award-row */

/* =============== FIELD STACK (hover to focus) =============== */
.fstack {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  position: relative;
}
.fstack__meta {
  display: flex; align-items: baseline; gap: 12px;
  color: var(--fg-dim);
  letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 28px;
}
.fstack__meta .dim { opacity: 0.6; }

/* 4×2 grid of thumbnails */
.fstack__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  width: 100%;
}

.fstack__card {
  position: relative;
  aspect-ratio: 4 / 3;
  margin: 0;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  box-shadow:
    0 2px 0 rgba(0,0,0,0.3),
    0 12px 24px rgba(0,0,0,0.45);
  cursor: pointer;
  transform-origin: 50% 50%;
  transition:
    transform 320ms cubic-bezier(.22,.8,.2,1),
    opacity 240ms ease,
    filter 240ms ease,
    box-shadow 240ms ease,
    border-color 240ms ease;
  overflow: hidden;
}
.fstack__card img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(0.2) contrast(1.02);
  transition: filter .4s;
}
.fstack__card.is-hover {
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent-soft), 0 16px 32px rgba(0,0,0,0.55);
}
.fstack__card.is-hover img { filter: grayscale(0) contrast(1.05); }

/* Lightbox: full-viewport overlay + centered enlarged image */
.fstack__lightbox {
  position: fixed; inset: 0;
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  animation: fstackFadeIn 220ms ease both;
}
.fstack__lightbox-overlay {
  position: absolute; inset: 0;
  background: rgba(8, 8, 6, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: auto;
}
.fstack__lightbox-card {
  position: relative;
  width: min(70vw, 960px);
  aspect-ratio: 4 / 3;
  margin: 0;
  background: var(--bg-2);
  border: 1px solid var(--accent-soft);
  box-shadow: 0 60px 120px rgba(0,0,0,0.8), 0 0 80px rgba(156, 232, 122, 0.18);
  pointer-events: auto;
  animation: fstackPop 220ms cubic-bezier(.22,.8,.2,1) both;
  overflow: hidden;
}
.fstack__lightbox-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.fstack__lightbox-cap {
  position: absolute; inset: auto 0 0 0;
  display: flex; flex-direction: column; gap: 4px;
  padding: 22px 26px;
  background: linear-gradient(to top, rgba(10,10,8,0.96) 30%, rgba(10,10,8,0.6) 80%, transparent 100%);
}
.fstack__tag {
  color: var(--accent);
  letter-spacing: 0.12em; text-transform: uppercase;
  font-size: 13px;
}
.fstack__caption { font-size: 16px; color: var(--fg); line-height: 1.5; }

.fstack__lightbox-close {
  position: absolute;
  top: 24px; right: 32px;
  z-index: 2;
  background: transparent;
  border: 1px solid var(--accent-soft);
  color: var(--accent);
  padding: 8px 14px;
  cursor: pointer;
  letter-spacing: 0.18em;
  pointer-events: auto;
  transition: background .2s, color .2s;
  font-family: inherit;
}
.fstack__lightbox-close:hover { background: var(--accent); color: #000; }

@keyframes fstackFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fstackPop {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.fstack__idx {
  position: absolute; top: 8px; right: 10px;
  color: var(--fg); opacity: 0;
  padding: 2px 6px;
  background: rgba(10,10,8,0.55);
  backdrop-filter: blur(4px);
  letter-spacing: 0.08em;
  transition: opacity .3s;
}
.fstack__card.is-hover .fstack__idx { opacity: 0.8; }

@media (max-width: 900px) {
  .fstack__grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .fstack__lightbox-card { width: 90vw; }
}

/* =============== PRESS =============== */
.press { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.press__row {
  display: grid; grid-template-columns: auto 1fr auto auto;
  align-items: baseline; gap: 14px;
  color: var(--fg);
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left 300ms;
}
.press__row:hover { padding-left: 12px; }
.press__row:hover .press__arrow { color: var(--accent); transform: translate(4px, -4px); }
.press__arrow { color: var(--fg-dim); font-size: 16px; transition: color .3s, transform .3s; }
.press__src { font-size: 26px; line-height: 1; }
.press__dots { overflow: hidden; white-space: nowrap; color: var(--fg-dim); letter-spacing: 0.2em; }
.press__note { font-size: 14px; color: var(--fg); }

/* =============== SKILLS =============== */
.skills { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.skills__row {
  display: grid; grid-template-columns: 200px 1fr;
  gap: 24px; padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.skills__group { padding-top: 8px; }
.skills__items { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-chip {
  display: inline-block; padding: 7px 13px;
  border: 1px solid var(--line-2); border-radius: 3px;
  font-family: var(--mono); font-size: 13px;
  transition: border-color .2s, color .2s, transform .2s;
}
.skill-chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* =============== INPUTS (now / listening / reading) =============== */
.inputs__meta {
  display: flex; align-items: center; gap: 12px;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.inputs__meta .dim:last-child {
  text-transform: none; letter-spacing: 0.02em;
  font-family: var(--serif); font-size: 16px; font-style: italic;
  flex: 1; min-width: 200px;
}
.inputs__rule { width: 60px; height: 1px; background: var(--line); }

.inputs__grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 64px 56px;
}
.inputs__col { display: flex; flex-direction: column; gap: 0; }
.inputs__colhead {
  display: flex; align-items: baseline; gap: 12px;
  padding-bottom: 14px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.inputs__zh {
  font-size: 22px; line-height: 1; letter-spacing: -0.01em;
  text-transform: none; color: var(--ink);
}
.inputs__colrule { flex: 1; height: 1px; background: var(--line); margin: 0 4px; }
.inputs__list { list-style: none; margin: 0; padding: 0; }
.inputs__item { border-bottom: 1px solid var(--line); }
.inputs__item:last-child { border-bottom: none; }
.inputs__link {
  display: block; padding: 22px 0;
  text-decoration: none; color: inherit;
  transition: padding-left .3s var(--ease);
}
.inputs__link:hover { padding-left: 16px; }
.inputs__row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 6px;
}
.inputs__title {
  font-size: 20px; line-height: 1.25; letter-spacing: -0.01em;
  color: var(--ink);
  transition: color .2s;
}
.inputs__link:hover .inputs__title { color: var(--accent); }
.inputs__arrow {
  font-size: 14px; color: var(--ink-3);
  transition: transform .25s var(--ease), color .2s;
  flex: 0 0 auto;
}
.inputs__link:hover .inputs__arrow { transform: translate(4px, -4px); color: var(--accent); }
.inputs__src { margin-bottom: 10px; }
.inputs__note {
  margin: 0;
  font-size: 14.5px; line-height: 1.55;
  color: var(--ink-2);
  max-width: 56ch;
}

@media (max-width: 760px) {
  .inputs__grid { grid-template-columns: 1fr; gap: 48px; }
  .inputs__title { font-size: 18px; }
  .inputs__meta .dim:last-child { font-size: 14px; }
}

/* =============== AGENT CHAT =============== */
.sec--agent .sec-head { margin-bottom: 60px; }
.chat {
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  max-width: 940px;
}
.chat__head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--fg-dim);
}
.chat__head > span:nth-child(4) { margin-left: 12px; color: var(--fg); }
.chat__model { margin-left: auto; }
.chat__body {
  padding: 18px 22px; min-height: 260px; max-height: 420px;
  overflow-y: auto; font-size: 13px; line-height: 1.8;
  scroll-behavior: smooth;
}
.cline { margin-bottom: 8px; }
.cline--system { color: var(--fg-dim); }
.cline--user .cline__who { color: var(--accent); }
.cline--assistant .cline__who { color: var(--fg); }
.cline__who { text-transform: lowercase; letter-spacing: 0.05em; }

.chat__suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.chat__chip {
  padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 999px;
  background: transparent; color: var(--fg); cursor: pointer;
  font-size: 11px; letter-spacing: 0.04em; text-transform: none;
  transition: border-color .2s, color .2s, background .2s;
}
.chat__chip:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.chat__chip:disabled { opacity: 0.4; cursor: not-allowed; }

.chat__form {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--line);
}
.chat__prompt { color: var(--accent); font-size: 13px; }
.chat__input {
  background: transparent; border: none; outline: none;
  color: var(--fg); font-family: var(--mono); font-size: 14px;
  width: 100%; padding: 6px 0;
}
.chat__input::placeholder { color: var(--fg-dim); }
.chat__send {
  padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 3px;
  background: transparent; color: var(--fg); cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.chat__send:hover:not(:disabled) { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.chat__send:disabled { opacity: 0.4; cursor: not-allowed; }

/* =============== CONTACT =============== */
.contact { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: flex-start; }
.contact__headline {
  font-size: clamp(44px, 5.4vw, 78px);
  line-height: 1.05; letter-spacing: -0.025em;
}
.contact__grid { display: flex; flex-direction: column; }
.contact__row {
  display: grid; grid-template-columns: 110px 1fr auto;
  align-items: center; gap: 16px;
  padding: 22px 0; border-bottom: 1px solid var(--line);
  transition: padding-left 300ms, color 300ms;
}
.contact__row:first-child { border-top: 1px solid var(--line); }
.contact__row:hover { padding-left: 12px; }
.contact__row:hover .contact__arrow { color: var(--accent); transform: translate(4px, -4px); }
.contact__handle { font-size: 18px; font-family: var(--mono); }
.contact__arrow { font-size: 18px; color: var(--fg-dim); transition: transform .3s, color .3s; }

/* =============== FOOTER =============== */
.footer {
  padding: 36px 0 56px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
}

/* =============== CURSOR =============== */
.cursor-ring {
  position: fixed; top: 0; left: 0;
  width: 32px; height: 32px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transition: width .2s, height .2s, background .2s;
  display: flex; align-items: center; justify-content: center;
}
.cursor-ring--hot { width: 56px; height: 56px; background: var(--accent); mix-blend-mode: difference; }
.cursor-ring__label {
  color: var(--bg); font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: lowercase;
  opacity: 0; transition: opacity .2s;
}
.cursor-ring--hot .cursor-ring__label { opacity: 1; }
@media (max-width: 900px), (hover: none) {
  .cursor-ring { display: none !important; }
}

/* =============== KEYHINT (removed) =============== */
.keyhint-removed {
  display: none;
  position: fixed; bottom: 20px; left: 50%;
  transform: translate(-50%, 30px);
  opacity: 0;
  padding: 8px 14px;
  background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 999px;
  z-index: 80;
  pointer-events: none;
  transition: opacity .4s, transform .4s;
}
.keyhint--in { opacity: 1; transform: translate(-50%, 0); }

/* =============== HELPSHEET =============== */
.helpsheet {
  position: fixed; inset: 0; z-index: 200;
  background: color-mix(in oklab, var(--bg) 60%, black 40% / 70%);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}
.helpsheet__card {
  background: var(--bg-2); border: 1px solid var(--line-2);
  padding: 24px 28px; min-width: 320px;
}
.helpsheet__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.helpsheet__x { background: none; border: none; color: var(--fg); font-size: 22px; cursor: pointer; }
.helpsheet table { width: 100%; border-collapse: collapse; font-size: 13px; }
.helpsheet td { padding: 6px 0; }
.helpsheet td:first-child { width: 100px; }

/* =============== RESPONSIVE =============== */
@media (max-width: 1080px) {
  .site { padding: 0 32px; }
  .hero__grid {
    display: flex;
    flex-direction: column;
    gap: 36px;
  }
  .hero__left, .hero__right { display: contents; }
  .hero__right { position: static; }
  .portrait { max-width: 420px; }

  /* mobile order: badge → name → role → TERMINAL → features → statement → figures → portrait → fstack */
  .hero__badge     { order: 1; }
  .hero__name      { order: 2; }
  .hero__role      { order: 3; }
  .terminal        { order: 4; }
  .features        { order: 5; }
  .hero__statement { order: 6; }
  .hero__figures   { order: 7; }
  .portrait        { order: 8; }
  .fstack          { order: 9; }
}
@media (max-width: 1100px) {
  .topnav__nav { display: none; }
  .topnav__right > span:first-child { display: none; }
  .hero__name { flex-direction: column; gap: 10px; align-items: flex-start; }
  .hero__figures { grid-template-columns: repeat(2, 1fr); gap: 16px 0; }
  .fig:nth-child(2) { border-right: none; }
  .tl-item { grid-template-columns: 28px 1fr; gap: 18px; }
  .tl-item__spine { grid-column: 1; grid-row: 1 / span 2; }
  .tl-item__meta { grid-column: 2; grid-row: 1; flex-direction: row; gap: 10px; flex-wrap: wrap; }
  .tl-item__body { grid-column: 2; grid-row: 2; min-width: 0; }
  .tl-item__metrics { grid-template-columns: repeat(2, 1fr); gap: 16px 0; }
  .metric:nth-child(2) { border-right: none; }
  .skills__row { grid-template-columns: 1fr; gap: 10px; }
  .method__row { grid-template-columns: 1fr; gap: 12px; }
  .press__dots { display: none; }
  .press__row { grid-template-columns: 1fr auto; }
  .press__src { grid-row: 1; }
  .press__note { grid-row: 2; grid-column: 1 / -1; color: var(--fg-dim); font-size: 13px; }
  .contact { grid-template-columns: 1fr; gap: 40px; }
  .keyhint { display: none; }
  .footer { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 600px) {
  .site { padding: 0 18px; }
  .sec { padding: 80px 0; }
  .hero { padding: 60px 0 80px; }
  .awards { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .topnav { position: static; }
  .fstack__grid { grid-template-columns: 1fr; }
  .chat__form { padding: 10px 12px; gap: 6px; }
  .chat__input { font-size: 13px; min-width: 0; }
  .chat__send { padding: 6px 10px; font-size: 11px; }
}

/* =============== MOBILE NAV (FAB + fullscreen overlay) =============== */
.navfab {
  display: none;
  position: fixed;
  top: 16px; left: 16px;
  z-index: 70;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 4px;
  border: 1px solid var(--line-2);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: border-color .2s;
}
.navfab span {
  display: block;
  width: 16px; height: 1.5px;
  background: var(--fg);
  transition: background .2s;
}
.navfab:hover { border-color: var(--accent); }
.navfab:hover span { background: var(--accent); }

.navsheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: color-mix(in oklab, var(--bg) 96%, transparent);
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
  display: flex; flex-direction: column;
  padding: 60px 32px 32px;
  opacity: 0; pointer-events: none;
  transform: translateY(-12px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.navsheet.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.navsheet__close {
  position: absolute;
  top: 18px; right: 22px;
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  color: var(--fg);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.navsheet__close:hover { border-color: var(--accent); color: var(--accent); }
.navsheet__head {
  display: flex; align-items: baseline; gap: 8px;
  letter-spacing: 0.14em; text-transform: uppercase;
  font-size: 11px;
  margin-bottom: 28px;
  color: var(--accent);
}
.navsheet__list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column;
  flex: 1;
  overflow-y: auto;
}
.navsheet__list li {
  border-bottom: 1px solid var(--line);
}
.navsheet__list a {
  display: flex; align-items: baseline; gap: 18px;
  padding: 18px 0;
  text-decoration: none;
  transition: padding-left .25s var(--ease);
}
.navsheet__list a:hover, .navsheet__list a:active { padding-left: 10px; }
.navsheet__num {
  font-size: 12px;
  letter-spacing: 0.06em;
  flex: 0 0 auto;
  width: 28px;
}
.navsheet__zh {
  font-size: 28px;
  letter-spacing: -0.01em;
  color: var(--fg);
  line-height: 1;
}

@media (max-width: 1100px) {
  .navfab { display: flex; }
}

/* =============== OPEN SOURCE SKILLS =============== */
.oss {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.oss__row { display: block; }
.oss__card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 32px 32px 28px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: background .25s, transform .25s;
  height: 100%;
  position: relative;
}
.oss__card:hover { background: var(--bg-2); }
.oss__card:hover .oss__arrow { transform: translate(4px, -4px); color: var(--accent); }
.oss__head {
  display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-dim);
}
.oss__kind { color: var(--accent); white-space: nowrap; }
.oss__kind--memory    { color: oklch(0.78 0.20 305); }
.oss__kind--knowledge { color: oklch(0.82 0.15 200); }
.oss__repo { letter-spacing: 0.06em; word-break: break-all; }
.oss__name {
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.1; margin: 0;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.oss__blurb {
  color: var(--fg-dim); font-size: 14.5px; line-height: 1.6;
  margin: 0;
}
.oss__foot {
  margin-top: auto;
  display: flex; flex-direction: column; gap: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-2);
}
.oss__tags {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.oss__tag {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}
.oss__cta {
  color: var(--accent);
  letter-spacing: 0.16em; text-transform: uppercase;
  display: inline-flex; gap: 8px; align-items: center;
}
.oss__arrow { transition: transform .25s, color .2s; display: inline-block; }

@media (max-width: 760px) {
  .oss { grid-template-columns: 1fr; }
  .oss__card { padding: 24px 22px; }
}

/* =============== TOPNAV CTA =============== */
.topnav__right { display: flex; justify-content: flex-end; align-items: center; }
.topnav__cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background .2s, color .2s;
}
.topnav__cta:hover { background: var(--accent); color: var(--bg); }
.topnav__cta:hover .dim { color: var(--bg); }

/* =============== FLOATING ACTIONS =============== */
.fab {
  position: fixed;
  right: 20px; bottom: 20px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-2);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--fg);
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px; line-height: 1;
  z-index: 60;
  opacity: 0; transform: translateY(8px);
  pointer-events: none;
  transition: opacity .25s, transform .25s, border-color .2s, color .2s;
}
.fab.is-shown { opacity: 1; transform: translateY(0); pointer-events: auto; }
.fab:hover { border-color: var(--accent); color: var(--accent); }

.mobilebar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 55;
  gap: 4px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  transform: translateY(0);
  transition: transform .3s, opacity .3s;
}
.mobilebar.is-hidden { transform: translateY(110%); opacity: 0; pointer-events: none; }
.mobilebar__btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0;
  color: var(--fg);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.toast {
  position: fixed;
  left: 50%; bottom: 96px;
  transform: translateX(-50%);
  z-index: 70;
  padding: 10px 16px;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  color: var(--fg);
  white-space: nowrap;
  animation: toast-in .25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.mobilebar__btn:active { background: var(--bg-2); }
.mobilebar__icon {
  font-size: 15px;
  color: var(--accent);
  font-family: var(--mono);
}
.mobilebar__lbl { color: var(--fg-dim); }

@media (max-width: 1100px) {
  .mobilebar { display: flex; }
  .fab { bottom: 84px; }
}


/* =============== FEATURE BANNER (wild) =============== */
.features {
  margin: 36px 0 44px;
  display: flex; flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 24px 0;
}
.feature {
  display: flex; align-items: baseline; gap: 18px;
  position: relative;
  opacity: 0; transform: translateY(28px);
  transition: opacity 700ms cubic-bezier(.2,.8,.2,1), transform 700ms cubic-bezier(.2,.8,.2,1);
  cursor: default;
}
.feature--in { opacity: 1; transform: translateY(0); }
.feature__zh {
  font-size: clamp(28px, 3.4vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-weight: 600;
  font-style: italic;
  color: inherit;
  -webkit-text-stroke: 1.5px currentColor;
  -webkit-text-fill-color: transparent;
  transition: -webkit-text-fill-color 250ms, -webkit-text-stroke-width 250ms, transform 350ms cubic-bezier(.2,.8,.2,1);
  transform-origin: left center;
}
.feature__en {
  color: var(--dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 250ms, opacity 250ms;
  opacity: 0.55;
}
.feature:hover .feature__zh { -webkit-text-fill-color: currentColor; -webkit-text-stroke-width: 0; transform: translateX(8px); }
.feature:hover .feature__en { opacity: 1; color: currentColor; }

.feature--lime    { color: oklch(0.86 0.22 130); }
.feature--magenta { color: oklch(0.72 0.28 350); }
.feature--amber   { color: oklch(0.82 0.18 70); }
.feature--cyan    { color: oklch(0.82 0.15 200); }
.feature--violet  { color: oklch(0.78 0.20 305); }

@media (max-width: 760px) {
  .feature { flex-direction: column; gap: 2px; align-items: flex-start; }
  .feature__zh { font-size: clamp(26px, 7vw, 38px); }
}


/* =============== SECTION HEAD (big) =============== */
.sec-head {
  margin: 0 0 56px;
  display: flex; flex-direction: column; gap: 18px;
}
.sec-head__top {
  display: flex; align-items: center; gap: 16px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.sec-head__rule { flex: 0 0 60px; height: 1px; background: var(--line); }
.sec-head__zh {
  font-size: clamp(40px, 5vw, 72px);
  line-height: 0.95;
  margin: 0;
  letter-spacing: -0.02em;
  font-weight: 400;
}
.sec-head__sub { letter-spacing: 0.04em; }

/* Alternating section background — disabled (single bg) */
.sec--alt {
  background: transparent;
}

/* Hide the small tl-group head INSIDE split sections (the SectionHead replaces it) */
.sec > .timeline > .tl-group > .tl-group__head { display: none; }

/* Tighten the timeline inside split sections (no top spacing for the now-implicit group) */
.sec > .timeline { margin-top: 0; }

@media (max-width: 760px) {
  .sec-head { margin-bottom: 36px; gap: 12px; }
  .sec-head__zh { font-size: clamp(32px, 9vw, 48px); }
  .sec-head__rule { flex-basis: 32px; }
}
