/* nazuna.uk — v9 */

:root {
  --bg: #f4f1ea;
  --bg-2: #ebe6dc;
  --surface: #fbf9f5;
  --ink: #17171b;
  --ink-2: #3c3b3f;
  --muted: #74706a;
  --line: rgba(23, 23, 27, 0.11);
  --line-strong: rgba(23, 23, 27, 0.22);
  --accent: #2f6fc4;
  --accent-soft: rgba(72, 132, 214, 0.12);
  --accent-glow: #7fb0ec;
  --ok: #2c8a5a;
  --warn: #b7791f;
  --err: #c2413b;
  --shadow: 0 1px 2px rgba(23, 23, 27, 0.05), 0 12px 32px -12px rgba(23, 23, 27, 0.18);
  --radius: 18px;
  --radius-sm: 10px;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111215;
    --bg-2: #17181c;
    --surface: #1b1c21;
    --ink: #edebe6;
    --ink-2: #c9c6bf;
    --muted: #96938c;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.2);
    --accent: #8cb8f0;
    --accent-soft: rgba(140, 184, 240, 0.13);
    --accent-glow: #8cb8f0;
    --ok: #5cc28d;
    --warn: #e0a84a;
    --err: #ef7b74;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

html:not([data-language="zh"]) [data-lang-content="zh"],
html[data-language="zh"] [data-lang-content="en"] { display: none !important; }

[hidden] { display: none !important; }

img, video { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1, h2 { font-family: var(--serif); font-weight: 500; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

code, .mono { font-family: var(--mono); font-size: 0.86em; }

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

::selection { background: var(--accent-soft); }

.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 100;
  padding: 8px 14px; border-radius: 999px;
  background: var(--ink); color: var(--bg); text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 60px;
}

.wordmark {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--serif); font-size: 19px; text-decoration: none; letter-spacing: -0.01em;
}
.wordmark img { width: 22px; height: 22px; border-radius: 6px; }

.header-tools { display: flex; align-items: center; gap: 6px; }

.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
  padding: 6px 11px; border-radius: 999px;
  font-size: 14.5px; color: var(--ink-2); text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--line); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--line); }

.language-switch {
  display: inline-flex; align-items: center;
  margin-left: 6px; padding: 3px; border-radius: 999px;
  border: 1px solid var(--line);
}
.language-switch button {
  border: 0; background: transparent; color: var(--muted);
  font: 500 12.5px/1 var(--sans); padding: 6px 9px; border-radius: 999px; cursor: pointer;
}
.language-switch button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

@media (max-width: 640px) {
  .nav a.nav-optional { display: none; }
  .nav a { padding: 6px 8px; font-size: 14px; }
  .wordmark span { display: none; }
}

/* ---------- shared bits ---------- */

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 12.5px/1.2 var(--mono); letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; opacity: 0.6; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font: 500 12.5px/1.5 var(--mono);
  border: 1px solid var(--line-strong); color: var(--ink-2);
  white-space: nowrap;
}
.chip.is-accent { border-color: transparent; background: var(--accent-soft); color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 20px; border-radius: 999px;
  font: 500 15px/1 var(--sans); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink);
  cursor: pointer; transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: scale(0.98); }
.btn.is-primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.is-primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--accent)); }
.btn small { font: 400 12.5px/1 var(--mono); opacity: 0.7; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn .arrow { font-family: var(--sans); }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.text-link { color: var(--accent); text-decoration: none; font-weight: 500; }
.text-link:hover { text-decoration: underline; }

.section { padding-block: clamp(56px, 9vw, 112px); border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 14px; max-width: 760px; margin-bottom: clamp(28px, 5vw, 48px); }
.section-head h2 { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.12; }
.section-head p { color: var(--ink-2); font-size: 18px; }

.prose { display: grid; gap: 1em; color: var(--ink-2); max-width: 680px; }
.prose strong { color: var(--ink); font-weight: 600; }

.note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg-2); color: var(--ink-2); font-size: 14.5px; line-height: 1.55;
}
.note::before { content: "i"; flex: none; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; background: var(--ink); color: var(--bg); font: 600 12px/1 var(--serif); font-style: italic; }

.split { display: grid; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (min-width: 880px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split.is-wide-text { grid-template-columns: 1.25fr 1fr; }
  .split.is-reversed > :first-child { order: 2; }
}

.grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }

.card {
  position: relative; display: grid; align-content: start; gap: 8px;
  padding: 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
}
.card h3 { font-size: 17px; }
.card p { color: var(--ink-2); font-size: 15.5px; line-height: 1.6; }
.card .card-mark { font: 500 12px/1 var(--mono); color: var(--accent); letter-spacing: 0.04em; }

.list-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.list-check li { position: relative; padding-left: 28px; color: var(--ink-2); }
.list-check li::before {
  content: ""; position: absolute; left: 2px; top: 0.55em;
  width: 12px; height: 7px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg) translateY(-3px);
}
.list-check li strong { color: var(--ink); font-weight: 600; }

/* screenshots */
.shot {
  margin: 0; display: grid; gap: 10px; justify-items: center;
}
.shot img {
  border-radius: 28px; border: 1px solid var(--line);
  box-shadow: var(--shadow); background: var(--surface);
}
.shot.is-phone img { width: min(340px, 78vw); }
.shot.is-wide img { border-radius: var(--radius); width: 100%; }
.shot figcaption { font-size: 13.5px; color: var(--muted); text-align: center; max-width: 40ch; }
[data-lightbox] { cursor: zoom-in; }

/* ---------- home ---------- */

.home-hero { position: relative; padding-top: clamp(8px, 2vw, 24px); }
.home-hero .art {
  position: relative; margin: 0 auto; width: min(1280px, 100%);
  aspect-ratio: 3701 / 2081; max-height: 72vh;
  overflow: hidden;
}
.home-hero .art img {
  width: 100%; height: 100%; object-fit: contain; object-position: center bottom;
  mix-blend-mode: multiply;
}
.home-hero .art::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 30%;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}
@media (prefers-color-scheme: dark) {
  .home-hero .art { width: min(1080px, 100% - 2 * var(--gutter)); border-radius: 28px; background: #f4f1ea; margin-top: 12px; }
  .home-hero .art::after { display: none; }
}

.home-intro {
  display: grid; gap: 20px; justify-items: start;
  margin-top: clamp(-80px, -6vw, -24px); position: relative;
}
@media (prefers-color-scheme: dark) { .home-intro { margin-top: 40px; } }
.home-intro h1 { font-size: clamp(56px, 10vw, 112px); line-height: 0.95; letter-spacing: -0.03em; }
.home-intro h1 span { color: var(--accent-glow); }
.home-intro .lede { font-size: clamp(19px, 2.2vw, 23px); line-height: 1.5; color: var(--ink-2); max-width: 34em; }

.projects { display: grid; gap: 14px; }
@media (min-width: 760px) { .projects { grid-template-columns: repeat(6, 1fr); } }

.project {
  position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: 14px;
  padding: 24px; border-radius: 22px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.project:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.project h3 { font-family: var(--serif); font-weight: 500; font-size: 26px; line-height: 1.15; letter-spacing: -0.01em; }
.project h3 small { font-family: var(--sans); font-size: 15px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.project p { color: var(--ink-2); font-size: 15.5px; line-height: 1.6; }
.project .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.project .go { position: absolute; top: 22px; right: 22px; color: var(--muted); transition: transform 0.2s, color 0.2s; }
.project:hover .go { color: var(--ink); transform: translate(2px, -2px); }
.project .icon { width: 56px; height: 56px; border-radius: 14px; }

@media (min-width: 760px) {
  .project { grid-column: span 2; }
  .project.is-featured { grid-column: span 6; grid-template-columns: auto 1fr auto; grid-template-rows: auto; align-items: center; gap: 28px; padding: 32px; }
  .project.is-featured .icon { width: 96px; height: 96px; border-radius: 22px; }
  .project.is-featured h3 { font-size: 38px; }
  .project.is-featured p { font-size: 17px; max-width: 44em; }
  .project.is-featured .body { display: grid; gap: 10px; }
  .project.is-featured .go { position: static; font-size: 22px; }
  .project.is-half { grid-column: span 3; }
}
.project.is-featured { background: linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--surface) 88%, var(--accent-glow))); }

/* ---------- project pages ---------- */

.page-hero { padding-block: clamp(40px, 8vw, 96px) clamp(40px, 6vw, 72px); }
.page-hero .wrap { display: grid; gap: clamp(32px, 6vw, 64px); align-items: center; }
@media (min-width: 900px) { .page-hero.has-aside .wrap { grid-template-columns: 1.2fr 1fr; } }
.page-hero .copy { display: grid; gap: 20px; justify-items: start; }
.page-hero h1 { font-size: clamp(48px, 8vw, 88px); line-height: 1; letter-spacing: -0.03em; }
.page-hero h1 em { display: inline-block; white-space: nowrap; font-style: normal; color: var(--muted); font-size: 0.42em; letter-spacing: 0; margin-left: 0.3em; vertical-align: 0.5em; }
.page-hero .lede { font-size: clamp(19px, 2.2vw, 23px); line-height: 1.5; color: var(--ink-2); max-width: 32em; }
.page-hero .app-icon { width: 88px; height: 88px; border-radius: 22px; box-shadow: var(--shadow); }
.page-hero .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.page-hero .platform-note { font-size: 13.5px; color: var(--muted); }

/* flow diagram */
.flow {
  display: grid; gap: 10px; align-items: stretch;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) { .flow { grid-template-columns: 1fr auto 1fr auto 1fr; } }
.flow .node {
  display: grid; gap: 4px; padding: 18px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
}
.flow .node > span { font: 500 12px/1 var(--mono); color: var(--muted); letter-spacing: 0.04em; }
.flow .node strong { font-family: var(--serif); font-weight: 500; font-size: 22px; }
.flow .node small { color: var(--ink-2); font-size: 14px; }
.flow .node.is-core { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.flow .node.is-core > span, .flow .node.is-core > small { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.flow .arrow { display: grid; place-items: center; color: var(--muted); font-size: 20px; }
@media (max-width: 759px) { .flow .arrow { transform: rotate(90deg); height: 20px; } }

.vendor-list { display: flex; flex-wrap: wrap; gap: 8px; }
.vendor-list span {
  padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 14.5px;
}
.vendor-list span b { font-weight: 600; }
.vendor-list span i { font-style: normal; color: var(--muted); margin-left: 6px; font-size: 13px; }

/* what's new */
.changes { display: grid; gap: 0; border-top: 1px solid var(--line); }
.changes > div {
  display: grid; gap: 6px 24px; padding: 18px 0; border-bottom: 1px solid var(--line);
}
@media (min-width: 760px) { .changes > div { grid-template-columns: 220px 1fr; } }
.changes dt { font-weight: 600; }
.changes dd { margin: 0; color: var(--ink-2); }
.changes .stat { font-family: var(--mono); font-size: 0.92em; color: var(--accent); white-space: nowrap; }

/* download block */
.downloads { display: grid; gap: 12px; }
@media (min-width: 640px) { .downloads { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1120px) { .downloads { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.dl {
  display: grid; grid-template-rows: auto auto 1fr auto auto auto; gap: 10px;
  padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
}
.dl header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.dl h3 { font-size: 19px; }
.dl .ver { font: 500 13px/1 var(--mono); color: var(--muted); }
.dl .req { font-size: 14px; color: var(--muted); }
.dl .hint { font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.dl .btn { width: 100%; }
.dl .alt { font-size: 13.5px; color: var(--muted); }
.dl .alt a { color: var(--ink-2); }
.hash { font: 400 11.5px/1.5 var(--mono); color: var(--muted); word-break: break-all; }

/* download page rows */
.release-row {
  display: grid; gap: 16px; padding: 28px 0; border-bottom: 1px solid var(--line);
}
@media (min-width: 860px) { .release-row { grid-template-columns: 280px 1fr auto; align-items: center; } }
.release-row h2 { font-size: 28px; }
.release-row h2 small { font-family: var(--sans); font-size: 15px; color: var(--muted); margin-left: 6px; }
.release-row p { color: var(--ink-2); }
.release-row .kind { font: 500 12px/1 var(--mono); color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 8px; }

/* architecture / steps */
.stack { display: grid; gap: 10px; }
@media (min-width: 900px) { .stack { grid-template-columns: repeat(4, 1fr); } }
.stack > div {
  display: grid; gap: 4px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
}
.stack > div > span { font: 500 12px/1 var(--mono); color: var(--muted); }
.stack > div strong { font-weight: 600; }
.stack > div small { font: 400 13px/1.45 var(--mono); color: var(--ink-2); }
.stack > div.is-key { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: step; }
.steps li {
  counter-increment: step; display: grid; grid-template-columns: 44px 1fr; gap: 4px 14px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.steps li::before {
  content: counter(step, decimal-leading-zero); grid-row: span 2;
  font: 500 13px/1.9 var(--mono); color: var(--accent);
}
.steps li strong { font-weight: 600; }
.steps li p { color: var(--ink-2); font-size: 15.5px; }

/* timeline (unraveller) */
.timeline {
  margin: 0; padding: 20px; border-radius: var(--radius);
  background: #15161a; color: #e9e7e1; font: 400 13.5px/1.5 var(--mono);
  box-shadow: var(--shadow);
}
.timeline header { display: flex; justify-content: space-between; color: #8c8a85; font-size: 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 8px; }
.timeline ol { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { display: grid; grid-template-columns: 74px 10px 64px 1fr; gap: 10px; align-items: center; padding: 7px 0; }
.timeline time { color: #8c8a85; }
.timeline i { width: 8px; height: 8px; border-radius: 50%; background: #5d5b57; }
.timeline i.blue { background: #8cb8f0; box-shadow: 0 0 10px #8cb8f0; }
.timeline i.green { background: #5cc28d; }
.timeline i.amber { background: #e0a84a; }
.timeline li > span { color: #b9b6af; }
.timeline li.is-marker { color: #8cb8f0; }

/* pair (luonnatar / unraveller) */
.pair { display: grid; gap: 14px; }
@media (min-width: 760px) { .pair { grid-template-columns: 1fr 1fr; } }
.pair a, .pair div {
  display: grid; gap: 6px; padding: 26px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); text-decoration: none;
}
.pair strong { font-family: var(--serif); font-weight: 500; font-size: 30px; }
.pair > * > span { color: var(--ink-2); }
.pair .is-here { background: transparent; border-style: dashed; }

/* gallery */
.gallery { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: start; }
.gallery .shot img { width: 100%; border-radius: 22px; }

/* photo luonnotar */
.pl-icon-story { display: grid; gap: 28px; align-items: center; }
@media (min-width: 760px) { .pl-icon-story { grid-template-columns: 220px 1fr; } }
.pl-icon-story img { width: 220px; border-radius: 48px; box-shadow: var(--shadow); }
.pl-icon-story blockquote { margin: 0; font-family: var(--serif); font-size: clamp(24px, 3vw, 34px); line-height: 1.3; }
.pl-icon-story p { color: var(--muted); margin-top: 12px; }

/* CTA band */
.cta-band {
  display: grid; gap: 20px; padding: clamp(28px, 5vw, 48px); border-radius: 28px;
  background: var(--ink); color: var(--bg);
}
@media (min-width: 860px) { .cta-band { grid-template-columns: 1fr auto; align-items: center; } }
.cta-band h2 { font-size: clamp(28px, 3.6vw, 40px); }
.cta-band p { opacity: 0.75; margin-top: 8px; }
.cta-band .btn { border-color: color-mix(in srgb, var(--bg) 35%, transparent); color: var(--bg); }
.cta-band .btn:hover { border-color: var(--bg); }
.cta-band .btn.is-primary { background: var(--bg); color: var(--ink); border-color: var(--bg); }

/* ---------- footer ---------- */

.site-footer { margin-top: clamp(56px, 9vw, 112px); border-top: 1px solid var(--line); }
.site-footer .wrap {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding-block: 28px 40px; font-size: 14px; color: var(--muted);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}

/* ---------- lightbox ---------- */

.lightbox {
  border: 0; padding: 0; margin: auto; background: transparent; max-width: 96vw; max-height: 96vh;
}
.lightbox::backdrop { background: rgba(10, 10, 12, 0.86); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 18px; }
.lightbox figure { margin: 0; display: grid; gap: 10px; justify-items: center; }
.lightbox figcaption { color: #cfccc5; font-size: 14px; text-align: center; max-width: 60ch; }
.lightbox button {
  position: fixed; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,0.14); color: #fff; font-size: 22px; cursor: pointer;
}

/* ---------- Alive Web tool ---------- */

.tool {
  display: grid; gap: 18px; padding: clamp(18px, 3vw, 28px); border-radius: 24px;
  background: var(--surface); border: 1px solid var(--line);
}
.tool-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.tool-head h3 { font-size: 20px; }
.tool-head p { color: var(--muted); font-size: 14.5px; }

.picker { position: relative; }
.picker input[type="file"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.picker label {
  display: grid; justify-items: center; gap: 6px; padding: 34px 20px; text-align: center;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius); cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.picker:hover label, .picker:focus-within label { border-color: var(--accent); background: var(--accent-soft); }
.picker .plus { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-size: 22px; }
.picker strong { font-weight: 600; }
.picker small { color: var(--muted); font-size: 14px; }

.status { font: 400 13.5px/1.5 var(--mono); color: var(--muted); min-height: 1.5em; }
.status[data-state="ok"] { color: var(--ok); }
.status[data-state="warn"] { color: var(--warn); }
.status[data-state="error"] { color: var(--err); }
.status[data-state="working"] { color: var(--accent); }

.badge {
  font: 600 11.5px/1 var(--mono); letter-spacing: 0.06em; padding: 7px 10px; border-radius: 999px;
  background: var(--bg-2); color: var(--muted);
}
.badge[data-state="ok"] { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.badge[data-state="error"] { background: color-mix(in srgb, var(--err) 16%, transparent); color: var(--err); }
.badge[data-state="working"] { background: var(--accent-soft); color: var(--accent); }

.viewer { display: grid; gap: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.viewer-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.viewer-top h3 { font-size: 18px; word-break: break-all; }
.viewer-grid { display: grid; gap: 18px; }
@media (min-width: 860px) { .viewer-grid { grid-template-columns: 1.1fr 1fr; } }
.media-preview { display: grid; gap: 10px; }
.media-preview .frame { border-radius: 14px; overflow: hidden; background: var(--bg-2); min-height: 120px; display: grid; place-items: center; }
.media-preview .frame p { padding: 20px; color: var(--muted); font-size: 14px; text-align: center; }
.media-preview video { width: 100%; border-radius: 14px; background: #000; }

.meta-list { display: grid; gap: 0; margin: 0; align-content: start; }
.meta-list div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; word-break: break-word; }

.hashes { display: grid; gap: 8px; }
.hashes div { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); }
.hashes > div > span { font: 500 11.5px/1 var(--mono); color: var(--muted); letter-spacing: 0.04em; }
.hashes code { font-size: 12.5px; word-break: break-all; }

.manifest { margin: 0; padding: 16px; border-radius: 12px; background: #15161a; color: #e9e7e1; font: 12.5px/1.55 var(--mono); overflow: auto; max-height: 420px; }

.pair-files { display: grid; gap: 12px; }
@media (min-width: 760px) { .pair-files { grid-template-columns: 1fr 1fr; } }
.pair-file {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center;
  padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg);
}
.pair-file .letter { grid-row: span 2; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); font: 600 14px/1 var(--mono); }
.pair-file strong { font-weight: 600; font-size: 15px; }
.pair-file p { font-size: 14px; color: var(--ink-2); word-break: break-all; }
.pair-file small { display: block; color: var(--muted); font-size: 12.5px; font-family: var(--mono); }
.pair-file input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pair-file label { grid-column: 1 / -1; margin-top: 8px; justify-self: start; }

.fields { display: grid; gap: 14px; }
@media (min-width: 760px) { .fields { grid-template-columns: 1fr 1fr 1fr; } }
.fields label { display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.fields input {
  font: 400 15px/1.4 var(--sans); color: var(--ink); background: var(--bg);
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong);
  min-width: 0; width: 100%;
}
.fields input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.fields small { color: var(--muted); font-size: 12.5px; }

.build-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }

.result { display: grid; gap: 14px; padding: 18px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 6%, transparent); }
.result-title { display: flex; align-items: center; gap: 12px; }
.result-title strong { display: block; word-break: break-all; }
.result-title small { color: var(--muted); font-family: var(--mono); font-size: 12.5px; }

.format-map { display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .format-map { grid-template-columns: 1fr 2fr 3fr 3fr 3fr; } }
.format-map > div { display: grid; gap: 4px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.format-map > div > span { font: 500 11.5px/1 var(--mono); color: var(--muted); }
.format-map strong { font: 600 14px/1.3 var(--mono); }
.format-map small { color: var(--ink-2); font-size: 13px; }
.format-map .is-payload { background: var(--accent-soft); border-color: transparent; }
@media (max-width: 759px) { .format-map > div:nth-child(3) { grid-column: span 2; } }
