/* ============ Mark Shi — Lab edition ============ */
:root {
  --bg: #07070a;
  --ink: #f2efe6;
  --dim: rgba(242, 239, 230, .55);
  --faint: rgba(242, 239, 230, .14);
  --lime: #d4ff3a;
  --violet: #8a6bff;
  --cyan: #5ee7ff;
  --display: "Clash Display", "Inter Tight", "PingFang SC", "Microsoft YaHei", sans-serif;
  --sans: "Inter Tight", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --gutter: clamp(16px, 3.2vw, 48px);
  --ease: cubic-bezier(.19, 1, .22, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0; font-family: var(--sans); background: var(--bg); color: var(--ink);
  overflow-x: hidden; line-height: 1.45;
}
body.is-loading { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--lime); color: #000; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
em { font-style: normal; }

@media (hover: hover) and (pointer: fine) {
  body, a, button { cursor: none; }
}

/* ---------- Background layers ---------- */
.bg-gl { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .09;
  background-image: 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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}
.grid-overlay {
  position: fixed; inset: 0 var(--gutter); z-index: 80; pointer-events: none;
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px;
  opacity: 0; transition: opacity .4s var(--ease);
}
.grid-overlay i { background: rgba(212, 255, 58, .06); border-inline: 1px solid rgba(212, 255, 58, .18); }
.grid-overlay.is-on { opacity: 1; }
@media (max-width: 720px) { .grid-overlay { grid-template-columns: repeat(4, 1fr); } .grid-overlay i:nth-child(n+5) { display: none; } }

main, .nav, .foot { position: relative; z-index: 2; }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 200; background: #050507;
  display: flex; flex-direction: column; justify-content: flex-end; padding: var(--gutter);
}
.loader-count {
  font-family: var(--display); font-weight: 600; line-height: .8;
  font-size: clamp(96px, 26vw, 420px); letter-spacing: -.04em; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.loader-line { height: 1px; background: var(--faint); margin: 24px 0 14px; overflow: hidden; }
.loader-line i { display: block; height: 100%; width: 100%; background: var(--lime); transform-origin: left; transform: scaleX(0); }
.loader-meta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--dim); letter-spacing: .08em; }

/* ---------- Cursor ---------- */
.cursor, .cursor-ring { position: fixed; left: 0; top: 0; z-index: 300; pointer-events: none; border-radius: 50%; }
.cursor { width: 8px; height: 8px; margin: -4px 0 0 -4px; background: var(--lime); mix-blend-mode: difference; }
.cursor-ring {
  width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 1px solid rgba(242, 239, 230, .5);
  display: grid; place-items: center;
  transition: width .45s var(--ease), height .45s var(--ease), margin .45s var(--ease), background .3s, border-color .3s;
}
.cursor-ring span { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: #000; opacity: 0; transform: scale(.6); transition: .3s var(--ease); }
.cursor-ring.is-big { width: 96px; height: 96px; margin: -48px 0 0 -48px; background: var(--lime); border-color: var(--lime); }
.cursor-ring.is-big span { opacity: 1; transform: none; }
.cursor-ring.is-hover { width: 64px; height: 64px; margin: -32px 0 0 -32px; border-color: var(--lime); }
.cursor-ring.is-down { width: 30px; height: 30px; margin: -15px 0 0 -15px; }
@media (hover: none), (pointer: coarse) { .cursor, .cursor-ring { display: none; } }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--gutter); mix-blend-mode: difference;
}
.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.nav-logo img { width: 34px; height: 34px; border-radius: 50%; filter: grayscale(1) contrast(1.1); }
.nav-logo em { font-family: var(--mono); font-size: 10px; vertical-align: super; margin-left: 2px; opacity: .6; }
.nav-links { display: flex; gap: clamp(14px, 2.4vw, 36px); font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.nav-links a { position: relative; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-right { display: flex; align-items: center; gap: 18px; }
.nav-clock { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; opacity: .7; }
.lang-toggle { display: flex; border: 1px solid currentColor; border-radius: 99px; padding: 3px; font-family: var(--mono); font-size: 11px; }
.lang-toggle span { padding: 4px 9px; border-radius: 99px; transition: .3s; }
.lang-toggle span.is-on { background: var(--ink); color: #000; }
@media (max-width: 720px) {
  .nav-links, .nav-clock { display: none; }
}

/* ---------- Sections common ---------- */
section { position: relative; padding: 0 var(--gutter); }
.section-tag { display: flex; gap: 10px; color: var(--dim); margin: 0 0 32px; }
.section-tag span:first-child { color: var(--lime); }

/* ---------- Hero ---------- */
.hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: space-between; padding-top: 96px; padding-bottom: 72px; }
.hero-top { display: flex; justify-content: space-between; color: var(--dim); }
.hero-top p { margin: 0; }
.hero-avail { display: flex; align-items: center; gap: 8px; }
.hero-avail i { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgba(212, 255, 58, .7); animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(212, 255, 58, .6); } 80%, 100% { box-shadow: 0 0 0 12px rgba(212, 255, 58, 0); } }

.hero-name {
  margin: 0; font-family: var(--display); font-weight: 600; text-transform: uppercase;
  font-size: clamp(88px, 23.5vw, 420px); line-height: .8; letter-spacing: -.045em;
  user-select: none;
}
.hero-row { display: block; overflow: hidden; padding-bottom: .04em; }
.hero-row--2 { text-align: right; }
.hero-word { display: inline-block; }
.hero-name .ch, .hero-name .chi { display: inline-block; }
.hero-name .chi { will-change: transform; transition: color .4s; }
.hero-name .chi:hover { color: var(--lime); }
.hero-name sup { font-size: .22em; vertical-align: top; position: relative; top: .35em; margin-left: .06em; color: var(--lime); display: inline-block; animation: spin 9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.hero-lede { max-width: 540px; margin: 0; font-size: clamp(18px, 1.8vw, 26px); line-height: 1.25; font-weight: 400; }
.hero-rotor { display: inline-block; color: #000; background: var(--lime); padding: 0 .28em; border-radius: 6px; font-family: var(--mono); font-size: .86em; min-width: 5.2ch; text-align: center; }
.hero-scroll { display: flex; align-items: center; gap: 10px; border: 1px solid var(--faint); padding: 12px 18px; border-radius: 99px; white-space: nowrap; }
.hero-scroll-dot { width: 6px; height: 14px; border: 1px solid currentColor; border-radius: 4px; position: relative; }
.hero-scroll-dot::after { content: ""; position: absolute; left: 1px; top: 2px; width: 2px; height: 3px; background: var(--lime); animation: wheel 1.6s infinite var(--ease); }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(6px); opacity: 0; } }
.hero-hint { position: absolute; left: var(--gutter); top: 50%; color: var(--dim); margin: 0; font-size: 11px; opacity: .8; }
@media (max-width: 720px) {
  .hero-hint { display: none; }
  .hero-name { font-size: 27vw; }
  .hero-bottom { flex-direction: column; align-items: flex-start; }
  .hero-top { flex-direction: column; gap: 6px; }
}

/* ---------- Manifesto ---------- */
.manifesto { padding-top: 22vh; padding-bottom: 16vh; }
.manifesto-text {
  margin: 0; max-width: 1400px; font-family: var(--display); font-weight: 500;
  font-size: clamp(30px, 4.8vw, 78px); line-height: 1.04; letter-spacing: -.02em;
}
.manifesto-text .w { display: inline-block; opacity: .12; transition: none; }
.manifesto-text .w.hl { color: var(--lime); }
html[lang="zh"] .manifesto-text { line-height: 1.22; letter-spacing: 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 14vh; border-top: 1px solid var(--faint); }
.stat { padding: 28px 24px 0 0; border-right: 1px solid var(--faint); margin-right: 24px; }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-family: var(--display); font-weight: 600; font-size: clamp(56px, 7vw, 120px); line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 10px; color: var(--dim); font-size: 14px; max-width: 22ch; }
@media (max-width: 820px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { border-right: 0; margin-right: 0; padding-bottom: 24px; border-bottom: 1px solid var(--faint); }
}

/* ---------- Work (horizontal) ---------- */
.work { padding: 0; }
.work-pin { height: 100vh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.work-head { display: flex; align-items: flex-end; justify-content: space-between; padding: 0 var(--gutter); margin-bottom: 4vh; gap: 20px; }
.work-head .section-tag { margin: 0; }
.work-title { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(44px, 7vw, 120px); line-height: .9; letter-spacing: -.04em; text-transform: uppercase; }
.work-title em { color: transparent; -webkit-text-stroke: 1px var(--ink); margin-left: .25em; }
.work-progress { color: var(--dim); margin: 0; font-variant-numeric: tabular-nums; }
.work-progress span { color: var(--lime); }
.work-track { display: flex; gap: clamp(18px, 2.4vw, 36px); padding: 0 var(--gutter); width: max-content; will-change: transform; }

.card {
  position: relative; flex: 0 0 auto; width: clamp(300px, 34vw, 560px);
  display: flex; flex-direction: column; gap: 18px;
  transform-style: preserve-3d; perspective: 900px;
}
.card-media {
  position: relative; aspect-ratio: 4 / 3.1; overflow: hidden; border-radius: 14px;
  background: #111; border: 1px solid var(--faint);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s var(--ease);
  clip-path: inset(0 round 14px);
}
.card-media img, .card-media canvas { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12) translateX(var(--px, 0)); transition: transform 1s var(--ease), filter .6s; filter: saturate(.85); }
.card:hover .card-media img { transform: scale(1.02) translateX(var(--px, 0)); filter: saturate(1.1); }
.card-glare {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .28), transparent 45%);
  mix-blend-mode: overlay;
}
.card:hover .card-glare { opacity: 1; }
.card-live { position: absolute; left: 14px; top: 14px; color: var(--lime); font-size: 11px; background: rgba(0, 0, 0, .6); padding: 5px 9px; border-radius: 99px; }
.card-info { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; row-gap: 8px; align-items: baseline; }
.card-no { color: var(--lime); grid-row: span 3; }
.card-info h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(26px, 2.4vw, 38px); letter-spacing: -.02em; line-height: 1; }
.card-info p { margin: 0; color: var(--dim); font-size: 15px; max-width: 44ch; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card-tags span { border: 1px solid var(--faint); border-radius: 99px; padding: 4px 10px; font-size: 10px; color: var(--dim); }
.card--end {
  width: clamp(260px, 26vw, 400px); aspect-ratio: 4 / 3.1; align-self: flex-start;
  justify-content: center; align-items: flex-start; padding: 32px; border-radius: 14px;
  border: 1px dashed rgba(212, 255, 58, .4); color: var(--dim);
}
.card--end strong { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 3vw, 48px); color: var(--lime); line-height: 1; letter-spacing: -.02em; }

@media (max-width: 820px) {
  .work-pin { height: auto; overflow: visible; padding: 14vh 0 6vh; }
  .work-track { flex-direction: column; width: auto; }
  .card, .card--end { width: 100%; }
  .work-progress { display: none; }
}

/* ---------- Marquee ---------- */
.marquee { padding: 16vh 0 10vh; overflow: hidden; }
.marquee-row { display: flex; white-space: nowrap; font-family: var(--display); font-weight: 600; text-transform: uppercase; font-size: clamp(48px, 8vw, 140px); line-height: 1.02; letter-spacing: -.03em; }
.marquee-row--rev { color: transparent; -webkit-text-stroke: 1px rgba(242, 239, 230, .5); }
.marquee-inner { display: flex; align-items: center; flex-shrink: 0; padding-right: .4em; gap: .4em; will-change: transform; }
.marquee-inner i { font-style: normal; color: var(--lime); -webkit-text-stroke: 0; font-size: .5em; }
.marquee-row--rev .marquee-inner i { color: var(--violet); }

/* ---------- Tools / physics ---------- */
.tools { padding-top: 12vh; padding-bottom: 8vh; }
.tools-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 12px 24px; margin-bottom: 28px; }
.tools-head .section-tag { grid-column: 1 / -1; margin-bottom: 0; }
.tools-head h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(40px, 5.6vw, 96px); line-height: .92; letter-spacing: -.035em; }
.tools-head h2 em { color: var(--lime); }
.tools-note { color: var(--dim); margin: 0; max-width: 32ch; text-align: right; }
.tools-box {
  position: relative; height: clamp(420px, 62vh, 640px); border-radius: 22px; overflow: hidden;
  border: 1px solid var(--faint);
  background:
    radial-gradient(ellipse at 50% 120%, rgba(138, 107, 255, .22), transparent 60%),
    linear-gradient(rgba(242, 239, 230, .04) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(242, 239, 230, .04) 1px, transparent 1px) 0 0 / 40px 40px,
    rgba(10, 10, 14, .7);
  touch-action: none;
}
.body {
  position: absolute; left: 0; top: 0; border-radius: 50%; display: grid; place-items: center;
  background: #16161c; border: 1px solid rgba(242, 239, 230, .18); user-select: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 18px 30px -12px rgba(0, 0, 0, .8);
  will-change: transform; cursor: grab;
}
.body:active { cursor: grabbing; }
.body:has(img) { overflow: hidden; background: #000; border: 0; }
.body img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; pointer-events: none; -webkit-user-drag: none; }
.body::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), inset 0 10px 18px rgba(255, 255, 255, .08); pointer-events: none; }
.body--heavy span { font-size: 22px; }
.body--word { background: var(--ink); color: #000; border: 0; }
.body--word span { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: -.01em; pointer-events: none; }
.body--lime { background: var(--lime); }
.body--violet { background: var(--violet); color: #fff; }
@media (max-width: 720px) { .tools-head { grid-template-columns: 1fr; } .tools-note { text-align: left; } }

/* ---------- Experience ---------- */
.exp { padding-top: 16vh; padding-bottom: 12vh; }
.exp-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--faint); }
.exp-list li {
  position: relative; display: grid; grid-template-columns: 160px 1.2fr 1fr; align-items: baseline; gap: 8px 24px;
  padding: 30px 0; border-bottom: 1px solid var(--faint); transition: padding .6s var(--ease), color .4s;
}
.exp-list li::before { content: ""; position: absolute; inset: 0; background: var(--lime); transform: scaleY(0); transform-origin: bottom; transition: transform .6s var(--ease); z-index: -1; }
.exp-list li:hover { color: #000; padding-left: 20px; padding-right: 20px; }
.exp-list li:hover::before { transform: scaleY(1); transform-origin: top; }
.exp-list li:hover .exp-year, .exp-list li:hover .exp-desc { color: rgba(0, 0, 0, .7); }
.exp-year { color: var(--dim); }
.exp-co { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 4.2vw, 64px); line-height: 1; letter-spacing: -.03em; }
.exp-role { font-size: 18px; text-align: right; }
.exp-desc { grid-column: 2 / -1; margin: 0; color: var(--dim); max-width: 70ch; max-height: 0; overflow: hidden; transition: max-height .6s var(--ease), margin .6s var(--ease); }
.exp-list li:hover .exp-desc { max-height: 120px; margin-top: 8px; }
.exp-float {
  position: fixed; left: 0; top: 0; z-index: 50; width: 150px; height: 150px; margin: -75px 0 0 -75px;
  pointer-events: none; border-radius: 18px; background: #0b0b0f; overflow: hidden;
  display: grid; place-items: center; opacity: 0; transform: scale(.4); transition: opacity .3s, transform .4s var(--ease);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8);
}
.exp-float.is-on { opacity: 1; transform: scale(1); }
.exp-float img { width: 64%; height: 64%; object-fit: contain; }
@media (max-width: 820px) {
  .exp-list li { grid-template-columns: 1fr; }
  .exp-role { text-align: left; }
  .exp-desc { grid-column: 1; max-height: none; margin-top: 6px; }
  .exp-float { display: none; }
}

/* ---------- Contact ---------- */
.contact { padding-top: 18vh; padding-bottom: 12vh; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.contact-big { margin: 0 0 6vh; font-family: var(--display); font-weight: 600; font-size: clamp(52px, 10.5vw, 190px); line-height: .88; letter-spacing: -.045em; }
.contact-line { display: block; overflow: hidden; padding-bottom: .05em; }
.contact-line > * { display: inline-block; }
.contact-big em { color: var(--lime); }
.contact-mail {
  align-self: flex-start; position: relative; display: inline-flex; flex-direction: column; gap: 6px; text-align: left;
  padding: 26px 34px; border-radius: 999px; background: var(--ink); color: #000;
  font-family: var(--display); font-weight: 600; font-size: clamp(22px, 3vw, 44px); letter-spacing: -.02em;
  transition: background .3s;
}
.contact-mail:hover { background: var(--lime); }
.contact-mail-tip { font-size: 11px; color: rgba(0, 0, 0, .55); }
.contact-links { display: flex; flex-wrap: wrap; gap: 14px 34px; margin-top: 7vh; color: var(--dim); }
.contact-links a:hover { color: var(--lime); }

.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 24px var(--gutter) 64px; color: var(--dim); border-top: 1px solid var(--faint); font-size: 11px; }

/* ---------- HUD ---------- */
.hud {
  position: fixed; right: var(--gutter); bottom: 18px; z-index: 100; display: flex; gap: 14px;
  font-size: 10px; color: var(--dim); padding: 8px 12px; border: 1px solid var(--faint); border-radius: 99px;
  background: rgba(7, 7, 10, .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-variant-numeric: tabular-nums;
}
.hud b { color: var(--ink); font-weight: 500; }
@media (max-width: 720px) { .hud { display: none; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .grain, .hero-name sup, .hero-avail i { animation: none; }
  .manifesto-text .w { opacity: 1; }
}

/* ---------- AI-native additions ---------- */
.loader-log { position: absolute; left: var(--gutter); top: var(--gutter); color: var(--dim); font-size: 11px; line-height: 1.8; text-transform: none; }
.loader-log b { color: var(--lime); font-weight: 400; }

.hero-copy { display: flex; flex-direction: column; gap: 18px; }
.hero-prompt {
  display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; margin: 0;
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--faint);
  background: rgba(7, 7, 10, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  text-transform: none; font-size: 13px; max-width: 100%;
}
.hero-prompt-tag { color: var(--lime); flex: none; }
.hero-prompt [data-prompt] { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.caret { display: inline-block; width: 7px; height: 15px; background: var(--lime); animation: blink 1s steps(2) infinite; flex: none; }
@keyframes blink { 50% { opacity: 0; } }

.pipe { padding-top: 16vh; padding-bottom: 12vh; }
.pipe-head { display: grid; grid-template-columns: 1fr minmax(260px, 420px); gap: 16px 40px; align-items: end; margin-bottom: 7vh; }
.pipe-head .section-tag { grid-column: 1 / -1; margin: 0; }
.pipe-head h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(48px, 7.4vw, 128px); line-height: .88; letter-spacing: -.04em; }
.pipe-head h2 em { color: var(--lime); }
.pipe-note { margin: 0; color: var(--dim); font-size: 17px; }

.pipe-flow { position: relative; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items: stretch; gap: 0; }
.pipe-wire { position: absolute; left: 0; right: 0; top: 29px; height: 1px; background: linear-gradient(90deg, transparent, rgba(212, 255, 58, .45) 8%, rgba(138, 107, 255, .45) 92%, transparent); overflow: visible; }
.pipe-wire i { position: absolute; top: -2px; width: 60px; height: 5px; border-radius: 4px; background: linear-gradient(90deg, transparent, var(--lime)); filter: drop-shadow(0 0 6px var(--lime)); animation: packet 3.2s linear infinite; }
.pipe-wire i:nth-child(2) { animation-delay: -1.07s; }
.pipe-wire i:nth-child(3) { animation-delay: -2.14s; }
@keyframes packet { from { left: -60px; } to { left: 100%; } }
.pipe-node {
  position: relative; padding: 52px 20px 22px; border-radius: 16px; border: 1px solid var(--faint);
  background: rgba(10, 10, 14, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; flex-direction: column; gap: 10px; transition: border-color .4s, box-shadow .5s, transform .6s var(--ease);
}
.pipe-dot { position: absolute; top: 22px; left: 20px; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--dim); background: var(--bg); transition: .4s; }
.pipe-no { position: absolute; top: 22px; right: 20px; color: var(--dim); }
.pipe-node h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(22px, 1.9vw, 30px); letter-spacing: -.02em; line-height: 1; }
.pipe-node p { margin: 0; color: var(--dim); font-size: 14px; flex: 1; }
.pipe-out { color: var(--lime); font-size: 11px; }
.pipe-node.is-active { border-color: var(--lime); box-shadow: 0 0 0 1px var(--lime), 0 30px 80px -30px rgba(212, 255, 58, .5); transform: translateY(-6px); }
.pipe-node.is-active .pipe-dot { background: var(--lime); border-color: var(--lime); box-shadow: 0 0 0 6px rgba(212, 255, 58, .2); }
.pipe-node.is-done .pipe-dot { background: var(--ink); border-color: var(--ink); }
.pipe-gate { position: relative; width: clamp(34px, 3.4vw, 56px); display: flex; justify-content: center; }
.pipe-gate::before { content: ""; position: absolute; top: 22px; width: 14px; height: 14px; transform: rotate(45deg); border: 1px solid var(--violet); background: var(--bg); transition: .3s; }
.pipe-gate span { position: absolute; top: 48px; writing-mode: vertical-rl; font-size: 10px; color: var(--violet); letter-spacing: .14em; opacity: .75; }
.pipe-gate.is-active::before { background: var(--violet); box-shadow: 0 0 0 7px rgba(138, 107, 255, .25); }
.pipe-gate.is-active span { opacity: 1; color: #fff; }

.pipe-run { display: grid; grid-template-columns: minmax(240px, 360px) 1fr; gap: 24px; margin-top: 44px; }
.pipe-briefs { display: flex; flex-direction: column; gap: 10px; }
.pipe-briefs-label { color: var(--dim); margin: 0 0 4px; }
.brief {
  display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px 18px; border-radius: 12px;
  border: 1px solid var(--faint); background: rgba(10, 10, 14, .6); transition: border-color .3s, background .3s, transform .4s var(--ease);
}
.brief span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--faint); flex: none; }
.brief b { font-weight: 500; font-size: 15px; }
.brief:hover { border-color: rgba(212, 255, 58, .5); transform: translateX(4px); }
.brief.is-on { border-color: var(--lime); background: rgba(212, 255, 58, .08); }
.brief.is-on span { background: var(--lime); color: #000; border-color: var(--lime); }
.term { border-radius: 14px; border: 1px solid var(--faint); background: rgba(4, 4, 6, .86); overflow: hidden; min-height: 330px; display: flex; flex-direction: column; }
.term-bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--faint); color: var(--dim); font-size: 11px; text-transform: none; }
.term-dots { display: flex; gap: 6px; }
.term-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(242, 239, 230, .18); }
.term-status { margin-left: auto; color: var(--lime); }
.term-body { padding: 16px 18px; font-size: 12.5px; line-height: 1.75; text-transform: none; letter-spacing: 0; flex: 1; }
.term-line { display: flex; gap: 12px; }
.term-line .t-tag { flex: none; min-width: 23ch; color: var(--violet); }
.term-line.is-stage .t-tag { color: var(--lime); }
.term-line.is-human .t-tag { color: #fff; }
.term-line.is-human .t-txt { color: #d9d1ff; }
.term-line.is-done .t-tag, .term-line.is-done .t-txt { color: var(--lime); }
.term-line .t-txt { color: var(--ink); }

@media (max-width: 1020px) {
  .pipe-flow { grid-template-columns: 1fr; gap: 14px; }
  .pipe-wire, .pipe-gate { display: none; }
  .pipe-head, .pipe-run { grid-template-columns: 1fr; }
  .term-line { flex-direction: column; gap: 0; }
  .term-line .t-tag { min-width: 0; }
}

.card-ai { margin: 0; color: var(--lime); font-size: 11px; text-transform: none; }
.card-info h3 + p { grid-column: 2; }
.card-info .card-ai, .card-info .card-tags { grid-column: 2; }
.card--end { gap: 14px; }
.card--end > a { display: block; }
.card-end-sub { color: var(--dim); font-size: 11px; }
.card-end-sub:hover { color: var(--ink); }
.card-no { grid-row: 1 / span 5; }

/* ---------- Hero v3: one-line name + promo player ---------- */
.hero { gap: 3vh; }
.hero-name { font-size: clamp(64px, 15.2vw, 270px); line-height: .82; white-space: nowrap; }
.hero-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 32px clamp(24px, 4vw, 64px); align-items: end; }
.hero-bottom .promo { order: 2; justify-self: end; }
.hero-copy .hero-scroll { align-self: flex-start; margin-top: 6px; }
.promo {
  position: relative; width: 100%; max-width: calc((100svh - 13vw - 250px) * 16 / 9); min-width: min(100%, 420px);
  aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #050507;
  border: 1px solid var(--faint); box-shadow: 0 50px 120px -40px rgba(0, 0, 0, .9), 0 0 0 1px rgba(212, 255, 58, .06);
  isolation: isolate;
}
.promo-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; object-fit: cover; background: #07070a; }
.promo:fullscreen .promo-canvas { object-fit: contain; }
.promo-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .5; transition: opacity .6s; pointer-events: none; }
.promo.is-ready .promo-poster { opacity: 0; }
.promo-badge { position: absolute; left: 14px; bottom: 58px; font-size: 10px; color: var(--lime); opacity: 0; transition: opacity .4s; pointer-events: none; }
.promo-ui {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .75)); font-size: 11px; color: var(--dim);
  opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s var(--ease);
}
.promo:hover .promo-ui, .promo:hover .promo-badge, .promo:not(.is-playing) .promo-ui, .promo:not(.is-playing) .promo-badge { opacity: 1; transform: none; }
.promo-btn { height: 28px; min-width: 28px; padding: 0 8px; border-radius: 99px; border: 1px solid rgba(242, 239, 230, .25); display: grid; place-items: center; color: var(--ink); font-size: 11px; background: rgba(0, 0, 0, .35); }
.promo-btn:hover { border-color: var(--lime); color: var(--lime); }
.promo-ico { width: 0; height: 0; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; margin-left: 2px; }
.promo.is-playing .promo-ico { width: 8px; height: 10px; border: 0; margin: 0; border-left: 2.5px solid currentColor; border-right: 2.5px solid currentColor; }
.promo-bar { position: relative; flex: 1; height: 16px; cursor: pointer; touch-action: none; }
.promo-bar::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 2px; background: rgba(242, 239, 230, .2); border-radius: 2px; }
.promo-fill { position: absolute; left: 0; right: 0; top: 7px; height: 2px; background: var(--lime); transform-origin: left; transform: scaleX(0); border-radius: 2px; }
.promo-tick { position: absolute; top: 5px; width: 1px; height: 6px; background: rgba(242, 239, 230, .45); }
.promo-time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.promo:fullscreen { border-radius: 0; max-width: none; width: 100vw; height: 100vh; aspect-ratio: auto; }
@media (max-width: 900px) {
  .hero-bottom { grid-template-columns: 1fr; }
  .hero-bottom .promo { order: 0; justify-self: stretch; max-width: none; min-width: 0; }
}
@media (max-width: 720px) { .hero-name { font-size: 16.5vw; } .promo-dl { display: none; } }
