:root {
  --bg: #0a0a0c;
  --panel: #131317;
  --panel-2: #1b1b21;
  --line: #2a2a33;
  --text: #ecebf0;
  --muted: #9a99a6;
  --accent: #ff8a5c;
  --accent-ink: #1a0c06;
  --radius: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------ viewer (shared) */
.viewer {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "stage info" "strip strip";
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.stage {
  grid-area: stage;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 1 / 1;
  min-height: 0;
}
.stage img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  transition: opacity .25s ease;
}
.stage img.fading { opacity: 0; }
.stage .nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18); background: rgba(10,10,12,.55);
  cursor: pointer; display: grid; place-items: center;
  backdrop-filter: blur(4px);
}
.stage .nav:hover { background: rgba(10,10,12,.85); }
.stage .prev { left: 10px; }
.stage .next { right: 10px; }
.stage .count {
  position: absolute; left: 12px; bottom: 10px;
  font-size: 12px; color: var(--muted); letter-spacing: .04em;
  background: rgba(10,10,12,.6); padding: 3px 8px; border-radius: 99px;
}

.info { grid-area: info; display: flex; flex-direction: column; gap: 12px; min-width: 0; overflow: auto; }
.info .cat {
  align-self: flex-start; font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); border: 1px solid rgba(255,138,92,.35); padding: 3px 10px; border-radius: 99px;
}
.info h2 { margin: 0; font-size: clamp(22px, 3vw, 30px); line-height: 1.15; letter-spacing: -.01em; }
.info p.desc { margin: 0; color: #cfcdd8; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: 12px; color: var(--muted); background: var(--panel-2); padding: 3px 9px; border-radius: 99px; }
.controls-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.controls-list li { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.controls-list li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.info h3 { margin: 4px 0 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.specs { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.specs b { color: var(--text); font-weight: 600; }

.strip { grid-area: strip; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button {
  flex: none; cursor: pointer; font-size: 13px; padding: 5px 12px; border-radius: 99px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
}
.filters button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.thumbs {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.thumbs::-webkit-scrollbar { height: 6px; }
.thumbs::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.thumbs::-webkit-scrollbar-track { background: transparent; }
.thumbs button {
  flex: none; width: 64px; height: 64px; padding: 0; cursor: pointer; scroll-snap-align: start;
  border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: #000;
  opacity: .7; transition: opacity .15s, border-color .15s;
}
.thumbs button:hover { opacity: 1; }
.thumbs button[aria-current="true"] { border-color: var(--accent); opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------------------------------------------ embed page */
body.embed { height: 100vh; overflow: hidden; }
body.embed .viewer { height: 100vh; border: 0; border-radius: 0; }
body.embed .stage { aspect-ratio: auto; height: 100%; }
body.embed .brand {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 12px; color: var(--muted);
}
body.embed .brand a { color: var(--muted); text-decoration: none; }
body.embed .brand a:hover { color: var(--text); }

@media (max-width: 640px) {
  .viewer { grid-template-columns: 1fr; grid-template-rows: auto auto auto; grid-template-areas: "stage" "strip" "info"; }
  body.embed { height: auto; overflow: auto; }
  body.embed .viewer { height: auto; }
  body.embed .stage { aspect-ratio: 1 / 1; height: auto; }
  .info { overflow: visible; }
}

/* ------------------------------------------------------------------ full page */
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
header.top { padding: 18px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
header.top .logo { font-weight: 700; letter-spacing: .02em; }
header.top .logo span { color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600;
  padding: 10px 18px; border-radius: 99px; background: var(--accent); color: var(--accent-ink);
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn[hidden] { display: none; }

.hero { padding: 24px 0 8px; text-align: center; }
.hero h1 { font-size: clamp(34px, 6vw, 64px); line-height: 1.03; letter-spacing: -.02em; margin: 0 0 14px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: #cfcdd8; max-width: 640px; margin: 0 auto 22px; font-size: 18px; }
.hero .cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero-img { margin-top: 28px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 28px 0 0; }
.stats div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; }
.stats b { display: block; font-size: 24px; }
.stats span { color: var(--muted); font-size: 13px; }

section { padding: 56px 0 0; }
section > h2 { font-size: clamp(24px, 3.4vw, 36px); margin: 0 0 6px; letter-spacing: -.01em; }
section > p.lead { color: var(--muted); margin: 0 0 22px; max-width: 680px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.features div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.features h3 { margin: 0 0 6px; font-size: 16px; }
.features p { margin: 0; color: var(--muted); font-size: 14px; }

.figure { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.steps { counter-reset: s; display: grid; gap: 10px; padding: 0; list-style: none; }
.steps li { counter-increment: s; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 14px 56px; position: relative; }
.steps li::before {
  content: counter(s); position: absolute; left: 16px; top: 13px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.steps b { color: var(--text); }
.steps p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
kbd, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

table.ctl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.ctl th, table.ctl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.ctl th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }

details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 8px; }
summary { cursor: pointer; font-weight: 600; }
details p { color: var(--muted); margin: 8px 0 0; }

footer { padding: 56px 0 40px; color: var(--muted); font-size: 13px; text-align: center; }

@media (max-width: 760px) {
  .features { grid-template-columns: 1fr; }
  .pair { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero p { font-size: 16px; }
}
