:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --ink: #15181e;
  --muted: #5a606c;
  --line: #e1e4ea;
  --accent: #a85e05;
  --accent-soft: #fbefd9;
  --shadow: 0 1px 2px rgba(21, 24, 30, .04), 0 12px 32px -12px rgba(21, 24, 30, .14);
  --shadow-up: 0 2px 4px rgba(21, 24, 30, .05), 0 28px 56px -20px rgba(21, 24, 30, .28);
  --r-lg: 28px;
  --r-md: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116;
    --surface: #161a21;
    --ink: #e9ecf1;
    --muted: #9aa1ad;
    --line: #262c36;
    --accent: #f5a524;
    --accent-soft: #2a2113;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .6);
    --shadow-up: 0 2px 4px rgba(0, 0, 0, .3), 0 28px 56px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1116; --surface: #161a21; --ink: #e9ecf1; --muted: #9aa1ad; --line: #262c36;
  --accent: #f5a524; --accent-soft: #2a2113; color-scheme: dark;
}
/* logo mark: each dot carries its light (--ml) and dark (--md) colour */
.brand-mark { height: 26px; width: auto; flex: none; }
.brand-mark circle { fill: var(--ml); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-mark circle { fill: var(--md); } }
:root[data-theme="dark"] .brand-mark circle { fill: var(--md); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 "Instrument Sans", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.lang-zh { line-height: 1.7; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* nav */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; gap: 16px; }
.brand { font-weight: 600; text-decoration: none; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 9px; }
.nav nav { display: flex; gap: 22px; font-size: 15px; }
.nav nav a { text-decoration: none; color: var(--muted); transition: color .2s; }
.nav nav a:hover { color: var(--ink); }
.nav .lang { border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; }

/* hero */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 40px; padding: 72px 0 56px; }
.hero h1 { margin: 0; line-height: .92; letter-spacing: -.045em; font-weight: 700; }
.h-name { display: block; font-size: clamp(64px, 11vw, 136px); }
.h-handle { display: block; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: clamp(22px, 3.1vw, 36px); font-weight: 700; letter-spacing: -.02em; color: var(--muted); margin-top: 16px; }
.h-handle .exe { color: var(--accent); }
.intro { font-size: clamp(19px, 2vw, 22px); line-height: 1.45; max-width: 30ch; margin: 28px 0 22px; }
.lang-zh .intro { max-width: 22em; }
.hero-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.hero-links a, .btn {
  text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  transition: border-color .2s, transform .2s var(--ease);
}
.hero-links a:hover, .btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { transform: translateY(-1px); }
.btn.soon { color: var(--muted); background: transparent; border-style: dashed; cursor: not-allowed; display: inline-flex; align-items: center; gap: 8px; }
.btn.soon:hover { border-color: var(--line); }
.soon-tag { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }

.signal { width: 100%; height: auto; overflow: visible; }
.signal .axis { stroke: var(--line); stroke-width: 2; }
.stem line { stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; opacity: .55; }
.stem circle { fill: var(--accent); }
.stem { transform-box: fill-box; }
@media (prefers-reduced-motion: no-preference) {
  .stem line { stroke-dasharray: 300; stroke-dashoffset: 300; animation: draw .9s var(--ease) forwards; animation-delay: calc(var(--i) * 32ms + .25s); }
  .stem circle { opacity: 0; transform: scale(.2); transform-box: fill-box; transform-origin: center; animation: pop .5s var(--ease) forwards; animation-delay: calc(var(--i) * 32ms + .55s); }
  .hero-text > * { opacity: 0; transform: translateY(14px); animation: rise .8s var(--ease) forwards; }
  .hero-text > :nth-child(2) { animation-delay: .12s; }
  .hero-text > :nth-child(3) { animation-delay: .22s; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { opacity: 1; transform: scale(1); } }
@keyframes rise { to { opacity: 1; transform: none; } }

/* announcement board */
.board-wrap { margin-bottom: 72px; }
.board { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 26px 30px 10px; border: 1px solid var(--line); }
.board-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.board-head h2 { margin: 0; font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 10px; color: var(--accent); }
.board-head a { font-size: 15px; color: var(--muted); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); position: relative; }
@media (prefers-reduced-motion: no-preference) {
  .pulse::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--accent); animation: ping 2.4s var(--ease) infinite; }
}
@keyframes ping { 0% { opacity: .7; transform: scale(.4); } 80%, 100% { opacity: 0; transform: scale(1.6); } }
.board-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; }
.update { display: grid; grid-template-columns: 120px 1fr; gap: 18px; padding: 18px 0; border-top: 1px solid var(--line); }
.board-list .update { grid-template-columns: 1fr; gap: 4px; border-top: 0; padding: 16px 0 18px; align-content: start; }
.update time { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.update h3 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.01em; }
.update p { margin: 0 0 6px; color: var(--muted); max-width: 60ch; }
.update-proj { font-size: 14px; color: var(--accent); text-decoration: none; }
.update-proj:hover { text-decoration: underline; }

/* projects */
.section-h { font-size: clamp(32px, 4.4vw, 48px); letter-spacing: -.035em; margin: 0 0 24px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 96px; }
.card {
  position: relative; display: flex; flex-direction: column; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.card.featured { grid-column: 1 / -1; flex-direction: row-reverse; border-radius: 34px; }
.card-visual { overflow: hidden; background: var(--accent-soft); }
.card-visual.shot { aspect-ratio: 16 / 10; }
.card.featured .card-visual { flex: 1.35; aspect-ratio: 16 / 9; align-self: center; }
.card-visual img { width: 100%; height: 100%; object-fit: cover; object-position: center top; transition: transform .8s var(--ease); }
.card-visual.stat { aspect-ratio: 16 / 10; display: flex; flex-direction: column; justify-content: flex-end; padding: 22px 24px; gap: 6px; }
.stat-num { font-size: 76px; font-weight: 700; letter-spacing: -.05em; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; transition: transform .6s var(--ease); transform-origin: left bottom; }
.stat-label { font-size: 14px; color: var(--muted); max-width: 30ch; }
.card-visual.glyph { aspect-ratio: 16 / 10; display: grid; place-items: center; }
.card-visual.glyph span { font-size: 84px; font-weight: 600; color: var(--accent); letter-spacing: -.04em; transition: transform .6s var(--ease); }
.card-text { padding: 22px 24px 24px; flex: 1; display: flex; flex-direction: column; }
.card.featured .card-text { flex: 1; padding: 40px 40px; justify-content: center; }
.status { font-size: 13px; color: var(--muted); }
.card h3 { margin: 6px 0 8px; font-size: 24px; letter-spacing: -.025em; line-height: 1.15; display: flex; align-items: center; gap: 10px; }
.card.featured h3 { font-size: clamp(36px, 4.6vw, 56px); letter-spacing: -.045em; }
.icon { border-radius: 22%; }
.card.featured .icon { width: 48px; height: 48px; }
.tagline { margin: 0; color: var(--muted); }
.card.featured .tagline { font-size: 20px; line-height: 1.45; color: var(--ink); max-width: 30ch; }
.lang-zh .card.featured .tagline { max-width: 20em; }

/* hover / tap reveal */
.more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease); }
.more > div { overflow: hidden; }
.more p { margin: 14px 0 10px; font-size: 15px; color: var(--muted); opacity: 0; transform: translateY(8px); transition: opacity .4s, transform .5s var(--ease); }
.more-cta { font-size: 15px; font-weight: 600; color: var(--accent); display: inline-block; opacity: 0; transition: opacity .4s .05s; }
.card.open .more, .card:focus-visible .more { grid-template-rows: 1fr; }
.card.open .more p, .card.open .more-cta, .card:focus-visible .more p, .card:focus-visible .more-cta { opacity: 1; transform: none; }
.card.open::after { content: attr(data-tap); position: absolute; top: 14px; right: 14px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--ink); color: var(--bg); }
@media (hover: hover) {
  .card:hover { transform: translateY(-6px); box-shadow: var(--shadow-up); }
  .card:hover .card-visual img { transform: scale(1.04); }
  .card:hover .stat-num, .card:hover .card-visual.glyph span { transform: scale(1.06); }
  .card:hover .more { grid-template-rows: 1fr; }
  .card:hover .more p, .card:hover .more-cta { opacity: 1; transform: none; }
}

/* Small cards: the description floats up over the picture instead of growing the card. */
.card:not(.featured) .more {
  position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 16 / 10;
  display: flex; align-items: flex-end; padding: 22px 24px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .4s var(--ease), transform .5s var(--ease);
}
.card:not(.featured) .more > div { overflow: visible; }
.card:not(.featured) .more p { margin: 0 0 10px; color: var(--ink); }
.card:not(.featured).open .more, .card:not(.featured):focus-visible .more { opacity: 1; transform: none; }
@media (hover: hover) { .card:not(.featured):hover .more { opacity: 1; transform: none; } }

/* scroll reveal (JS adds .js to html) */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
  .js .reveal.in { opacity: 1; transform: none; }
  .js .card.reveal.in { transition: opacity .8s var(--ease), transform .5s var(--ease), box-shadow .5s var(--ease); }
}

/* detail */
.detail { max-width: 760px; padding: 32px 0 96px; }
.back { font-size: 15px; color: var(--muted); text-decoration: none; }
.back::before { content: "‹ "; }
.back:hover { color: var(--ink); }
.detail-head { margin: 28px 0 32px; }
.detail-head h1 { font-size: clamp(40px, 6vw, 64px); letter-spacing: -.045em; line-height: 1.02; margin: 6px 0 14px; display: flex; align-items: center; gap: 14px; }
.detail-head .tagline { font-size: 21px; line-height: 1.45; color: var(--ink); }
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.detail-shot { margin: 0 0 40px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.prose { max-width: 62ch; }
.prose h2 { font-size: 26px; letter-spacing: -.025em; margin: 40px 0 8px; }
.prose p, .prose li { color: var(--ink); }
.prose li { margin: 6px 0; }
.prose code { font-size: .9em; background: var(--accent-soft); padding: 1px 6px; border-radius: 6px; }
.prose a { color: var(--accent); }
.detail-updates { margin-top: 56px; }
.detail-updates h2 { font-size: 20px; margin: 0 0 8px; }
.update-feed .update:first-child { border-top: 0; }

/* footer */
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 28px 0 40px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.foot-links { display: flex; gap: 18px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 40px 0 32px; gap: 28px; }
  .grid { grid-template-columns: 1fr 1fr; }
  .card.featured { flex-direction: column; }
  .card.featured .card-visual { min-height: 0; aspect-ratio: 16 / 10; }
  .card.featured .card-text { padding: 26px 24px 28px; }
  .board-list { grid-template-columns: 1fr; }
  .board-list .update + .update { border-top: 1px solid var(--line); }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .nav nav { gap: 14px; }
  .nav nav a:not(.lang) { display: none; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .board { padding: 20px 20px 6px; border-radius: 22px; }
  .card, .card.featured { border-radius: 22px; }
  .update { grid-template-columns: 1fr; gap: 2px; }
  .stat-num { font-size: 64px; }
}
.card-visual.logo img { width: 120px; height: 120px; border-radius: 28px; transition: transform .6s var(--ease); }
@media (hover: hover) { .card:hover .card-visual.logo img { transform: scale(1.06) rotate(-3deg); } }
.hero { touch-action: pan-y; }
.hero-art { cursor: crosshair; }
