/* Retrace site. Dark, with the app's indigo and lane colours. */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #090a12;
  --bg-2: #0e1020;
  --panel: #12142a;
  --line: rgb(255 255 255 / 0.08);
  --line-2: rgb(255 255 255 / 0.14);
  --fg: #eceef8;
  --muted: #a3a8c3;
  --faint: #6f7594;
  --accent: #8f98ff;
  --accent-deep: #4b57d6;
  --ok: #86c45a;
  --no: #f07a7a;
  --lane-0: #8f98ff;
  --lane-1: #3cc4c4;
  --lane-2: #e3a33b;
  --lane-3: #f07aa8;
  --lane-4: #86c45a;
  --lane-5: #b48cff;
  --lane-6: #9aa4ae;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 "Inter", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
:lang(zh-CN) body, html:lang(zh-CN) { font-family: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
::selection { background: rgb(143 152 255 / 0.35); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 14px clamp(16px, 4vw, 40px);
  backdrop-filter: saturate(140%) blur(14px);
  background: linear-gradient(to bottom, rgb(9 10 18 / 0.85), rgb(9 10 18 / 0.55));
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.nav.scrolled { border-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.01em; }
.brand img { border-radius: 7px; }
.nav-links { display: flex; gap: 22px; margin-left: 12px; font-size: 14px; color: var(--muted); }
.nav-links a:hover { color: var(--fg); }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang {
  height: 32px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--line-2); color: var(--muted); font-size: 13px;
}
.lang:hover { color: var(--fg); border-color: var(--faint); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 22px; border-radius: 12px;
  font-weight: 600; font-size: 15px; letter-spacing: -0.005em;
  transition: transform 0.15s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn svg.gh { fill: currentColor; stroke: none; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, #9ea6ff, #6f79f2);
  color: #0b0d1c;
  box-shadow: 0 8px 30px -8px rgb(143 152 255 / 0.65), inset 0 1px 0 rgb(255 255 255 / 0.4);
}
.btn.primary:hover { box-shadow: 0 10px 40px -6px rgb(143 152 255 / 0.85), inset 0 1px 0 rgb(255 255 255 / 0.4); }
.btn.ghost { border: 1px solid var(--line-2); background: rgb(255 255 255 / 0.03); }
.btn.ghost:hover { border-color: var(--faint); background: rgb(255 255 255 / 0.06); }
.btn.small { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 9px; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center;
  padding: 96px clamp(16px, 5vw, 72px) 64px;
  background:
    radial-gradient(60% 50% at 20% 30%, rgb(75 87 214 / 0.22), transparent 70%),
    radial-gradient(40% 40% at 85% 70%, rgb(180 140 255 / 0.10), transparent 70%),
    var(--bg);
  overflow: hidden;
}
.graph-wrap {
  position: absolute; inset: 0 50% 0 0;
  mask-image: linear-gradient(to right, #000 55%, transparent 98%), linear-gradient(to bottom, transparent, #000 12%, #000 85%, transparent);
  mask-composite: intersect;
  -webkit-mask-composite: source-in;
}
#graph { width: 100%; height: 100%; display: block; }
#graph text { font: 12.5px var(--mono); fill: var(--faint); }
#graph .pill rect { fill-opacity: 0.16; }
#graph .pill text { font: 600 11.5px "Inter", sans-serif; }
#graph .row { animation: rise 0.6s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.hero-copy { grid-column: 2; position: relative; z-index: 1; max-width: 620px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }
h1 {
  margin: 0; font-size: clamp(44px, 6.4vw, 88px); line-height: 1.02; font-weight: 700; letter-spacing: -0.035em;
}
h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--lane-1), var(--lane-0) 35%, var(--lane-5) 65%, var(--lane-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% 100%; animation: shimmer 8s ease-in-out infinite alternate;
}
@keyframes shimmer { to { background-position: 100% 0; } }
.lede { margin: 26px 0 0; max-width: 540px; font-size: clamp(17px, 1.4vw, 19px); color: var(--muted); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.cta.center { justify-content: center; }
.meta { margin: 20px 0 0; font-size: 13px; color: var(--faint); }
.scroll-hint {
  position: absolute; left: 50%; bottom: 22px; width: 22px; height: 34px; margin-left: -11px;
  border: 1.5px solid var(--line-2); border-radius: 12px;
}
.scroll-hint span { position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--muted); animation: wheel 1.8s infinite; }
@keyframes wheel { 60% { transform: translateY(9px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- sections ---------- */
section { position: relative; }
.section-title {
  margin: 0; text-align: center; font-size: clamp(34px, 4.6vw, 60px); line-height: 1.06; font-weight: 700; letter-spacing: -0.03em;
}
.section-title span { color: var(--faint); }
.section-lede { margin: 18px auto 0; max-width: 620px; text-align: center; color: var(--muted); font-size: 18px; }

.window-section { padding: 120px clamp(16px, 4vw, 48px) 40px; }
.stage { perspective: 1800px; margin: 56px auto 0; max-width: 1240px; }
.mac {
  position: relative; margin: 0; border-radius: 14px; overflow: visible;
  transform-origin: 50% 0;
  transform: rotateX(var(--tilt, 22deg)) scale(var(--scale, 0.9));
  box-shadow: 0 50px 120px -30px rgb(0 0 0 / 0.8), 0 0 0 1px var(--line-2), 0 0 120px -40px rgb(143 152 255 / 0.45);
  transition: transform 0.08s linear;
}
.mac .shot { border-radius: 14px; }
.lights { position: absolute; left: 0.97%; top: 1.55%; display: flex; gap: 0.56%; width: 3.6%; }
.lights i { flex: 1; aspect-ratio: 1; border-radius: 50%; background: #ff5f57; box-shadow: inset 0 0 0 0.5px rgb(0 0 0 / 0.3); }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }
.pin {
  position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; padding: 0; border: 0; cursor: pointer;
  border-radius: 50%; background: var(--accent); color: #0b0d1c; font: 700 13px "Inter", sans-serif;
  box-shadow: 0 0 0 4px rgb(143 152 255 / 0.25);
}
.pin::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent);
  animation: ping 2.4s ease-out infinite;
}
.pin b { position: relative; }
@keyframes ping { 70%, 100% { transform: scale(1.9); opacity: 0; } }
.pin.on, .pin:hover { background: #fff; }
.legend {
  list-style: none; padding: 0; margin: 40px auto 0; max-width: 1080px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
}
.legend li {
  display: flex; gap: 12px; padding: 16px; border-radius: 12px; border: 1px solid var(--line);
  background: rgb(255 255 255 / 0.02); font-size: 14px; color: var(--muted); transition: border-color 0.2s, background 0.2s;
}
.legend li b {
  flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; background: rgb(143 152 255 / 0.18); color: var(--accent);
}
.legend li strong { color: var(--fg); font-weight: 600; }
.legend li.on { border-color: rgb(143 152 255 / 0.5); background: rgb(143 152 255 / 0.07); }

.numbers {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 1080px; margin: 80px auto; padding: 0 24px;
}
.numbers div { padding: 10px 24px; border-left: 1px solid var(--line); }
.numbers div:first-child { border-left: 0; }
.numbers b { display: block; font-size: clamp(40px, 5vw, 64px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.numbers div:nth-child(1) b { color: var(--lane-1); }
.numbers div:nth-child(2) b { color: var(--lane-5); }
.numbers div:nth-child(3) b { color: var(--lane-2); }
.numbers div:nth-child(4) b { color: var(--lane-4); }
.numbers span { color: var(--muted); font-size: 15px; }

.features { padding: 80px clamp(16px, 4vw, 48px); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 1120px; margin: 56px auto 0; }
.card {
  position: relative; padding: 28px; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.035), rgb(255 255 255 / 0.01));
  overflow: hidden; transition: border-color 0.25s, transform 0.25s;
}
.card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), color-mix(in oklab, var(--c) 22%, transparent), transparent 45%);
}
.card:hover { border-color: color-mix(in oklab, var(--c) 45%, transparent); transform: translateY(-2px); }
.card:hover::before { opacity: 1; }
.card svg { width: 44px; height: 44px; fill: none; stroke: var(--c); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.card svg circle { fill: var(--c); stroke: none; }
.card svg .dim { opacity: 0.4; }
.card svg .ln { stroke-width: 1.8; opacity: 0.7; }
.card svg .s1 { stroke: var(--lane-1); }
.card svg .s2 { stroke: var(--lane-3); }
.card h3 { margin: 18px 0 8px; font-size: 19px; letter-spacing: -0.015em; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

.readonly {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 56px; align-items: center;
  max-width: 1120px; margin: 0 auto; padding: 100px clamp(16px, 4vw, 48px);
}
.readonly .section-title, .readonly .section-lede { text-align: left; margin-left: 0; }
.term { border-radius: var(--radius); border: 1px solid var(--line-2); background: #0b0c18; overflow: hidden; box-shadow: 0 40px 80px -40px rgb(0 0 0 / 0.8); }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a3d52; }
.term-bar span { margin-left: 10px; font-size: 12px; color: var(--faint); }
.term ol { list-style: none; margin: 0; padding: 14px 20px 20px; font: 14px/1 var(--mono); }
.term li { display: flex; align-items: baseline; gap: 14px; padding: 9px 0; }
.term li::before { content: "$"; color: var(--faint); }
.term code { position: relative; color: var(--fg); white-space: nowrap; }
.term em { margin-left: auto; font-style: normal; font-size: 12.5px; text-align: right; }
.term .no em { color: var(--no); }
.term .yes em { color: var(--ok); }
.term .no code::after {
  content: ""; position: absolute; left: -2px; right: -2px; top: 52%; height: 2px; border-radius: 2px;
  background: var(--no); transform: scaleX(0); transform-origin: left; transition: transform 0.45s cubic-bezier(0.6, 0, 0.2, 1);
}
.term .no code { transition: color 0.45s; }
.term.play .no code { color: var(--faint); }
.term.play .no code::after { transform: scaleX(1); }
.term .yes { opacity: 0.35; transition: opacity 0.5s; }
.term.play .yes { opacity: 1; }
.term .yes code { color: var(--ok); }

.gallery { padding: 80px clamp(16px, 4vw, 48px); }
.tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 36px auto 26px; }
.tabs button {
  height: 38px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 14px;
}
.tabs button[aria-selected="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.frame { margin: 0 auto; max-width: 1160px; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--line-2), 0 40px 100px -40px rgb(0 0 0 / 0.9); }
.frame img { transition: opacity 0.25s; }
.frame img.fade { opacity: 0; }
.caption { text-align: center; color: var(--muted); margin: 18px 0 0; }

.keys { padding: 80px clamp(16px, 4vw, 48px); }
.caps { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 40px auto 0; max-width: 820px; }
.cap {
  display: inline-flex; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer;
}
.cap kbd {
  min-width: 56px; height: 56px; padding: 0 14px; display: grid; place-items: center; border-radius: 12px;
  font: 600 18px "Inter", sans-serif; color: var(--fg);
  background: linear-gradient(180deg, #23263d, #171a2c); border: 1px solid var(--line-2);
  box-shadow: 0 4px 0 #0c0e1a, 0 8px 20px -8px rgb(0 0 0 / 0.8);
  transition: transform 0.08s, box-shadow 0.08s, background 0.2s, color 0.2s;
}
.cap.hit kbd {
  transform: translateY(3px); box-shadow: 0 1px 0 #0c0e1a, 0 0 30px -4px rgb(143 152 255 / 0.7);
  background: linear-gradient(180deg, #a5acff, #7a83f5); color: #0b0d1c;
}
.keys-out { min-height: 28px; margin: 30px 0 0; text-align: center; font-size: 18px; color: var(--fg); }
.keys-out b { color: var(--accent); font-weight: 600; }

.download { padding: 110px 24px 120px; text-align: center; background: radial-gradient(50% 60% at 50% 40%, rgb(75 87 214 / 0.25), transparent 70%); }
.dl-icon { margin: 0 auto 26px; border-radius: 20px; filter: drop-shadow(0 20px 40px rgb(75 87 214 / 0.6)); }
.download .section-title .version { color: var(--accent); }
.note { margin: 22px auto 0; max-width: 520px; color: var(--faint); font-size: 14px; }
.note strong { color: var(--muted); }
.note code { font: 12.5px var(--mono); color: var(--muted); background: rgb(255 255 255 / 0.06); padding: 2px 6px; border-radius: 6px; white-space: nowrap; }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding: 28px clamp(16px, 4vw, 48px); border-top: 1px solid var(--line); color: var(--faint); font-size: 14px;
}
.foot a:hover { color: var(--fg); }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- small screens ---------- */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { grid-column: 1; }
  .graph-wrap { inset: 0; opacity: 0.35; }
  .legend, .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .numbers div:nth-child(3) { border-left: 0; }
  .grid { grid-template-columns: 1fr; }
  .readonly { grid-template-columns: 1fr; }
  .term em { display: none; }
  .pin { width: 22px; height: 22px; margin: -11px 0 0 -11px; font-size: 11px; }
}

@media (max-width: 600px) {
  .graph-wrap { opacity: 0.2; }
  .legend { grid-template-columns: 1fr; }
  .cta .btn { flex: 1; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .mac { transform: none; }
}
