/* 제품 기획 문서 사이트의 레이아웃과 읽기 중심 시각 체계를 정의한다. */
:root {
  --paper: #f5f6f1;
  --surface: #ffffff;
  --surface-muted: #eceee7;
  --ink: #17211b;
  --ink-soft: #526058;
  --ink-faint: #78827b;
  --line: #d9ddd5;
  --line-strong: #bdc5bb;
  --accent: #ff5a36;
  --accent-soft: #fff0eb;
  --green: #1f6d4d;
  --green-soft: #e3f1e9;
  --yellow: #f1c94d;
  --sidebar-width: 294px;
  --toc-width: 244px;
  --header-height: 68px;
  --content-width: 820px;
  --font-sans: "Avenir Next", "SUIT Variable", SUIT, Pretendard, "Noto Sans KR", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 28px);
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(23, 33, 27, 0.022) 1px, transparent 1px) 0 0 / 36px 36px,
    var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 42%, transparent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.topbar {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  height: var(--header-height);
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(260px, 520px) 1fr;
  align-items: center;
  gap: 32px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  text-decoration: none;
}

.brand-mark {
  display: block;
  overflow: hidden;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(23, 33, 27, .12);
}

.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }

.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font-size: 12px; letter-spacing: .13em; }
.brand-copy small { margin-top: 4px; color: var(--ink-faint); font-size: 9px; font-weight: 700; letter-spacing: .16em; }

.search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 11px 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(23, 33, 27, .035);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.search-trigger:hover {
  border-color: var(--line-strong);
  box-shadow: 0 7px 20px rgba(23, 33, 27, .07);
  transform: translateY(-1px);
}

.search-trigger svg, .search-heading svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

kbd {
  min-width: 24px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink-faint);
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 19px;
  text-align: center;
}

.search-trigger kbd { margin-left: auto; }

.topbar-meta {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.topbar .menu-button { display: none; }

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}

.icon-button:hover { background: var(--surface-muted); color: var(--ink); }
.icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--toc-width);
  min-height: 100vh;
  padding-top: var(--header-height);
}

.sidebar {
  position: fixed;
  z-index: 80;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  scrollbar-width: thin;
}

.sidebar-intro { padding: 28px 24px 20px; }
.sidebar-intro p:last-child { margin: 8px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.eyebrow { margin: 0; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .16em; }

.nav-home,
.guide-link,
.document-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav-home {
  gap: 10px;
  margin: 0 12px 18px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.nav-home::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  border: 1.5px solid currentColor;
}

.nav-home:hover, .nav-home[aria-current="page"] { background: var(--surface); color: var(--ink); }

.guide-links { display: grid; gap: 3px; margin: 0 12px 24px; }
.guide-link { padding: 7px 12px; border-radius: 8px; color: var(--ink-soft); font-size: 12px; }
.guide-link:hover, .guide-link[aria-current="page"] { color: var(--ink); background: var(--surface-muted); }

.nav-group { margin: 0 12px 22px; }
.nav-group-title { margin: 0 12px 8px; color: var(--ink-faint); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.nav-domain { border-radius: 9px; }
.nav-domain + .nav-domain { margin-top: 2px; }
.nav-domain summary {
  display: grid;
  grid-template-columns: 28px 1fr 16px;
  align-items: center;
  min-height: 38px;
  padding: 5px 8px;
  border-radius: 9px;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  list-style: none;
}

.nav-domain summary::-webkit-details-marker { display: none; }
.nav-domain summary:hover, .nav-domain[open] summary { background: var(--surface); color: var(--ink); }
.nav-domain summary::after { content: "+"; color: var(--ink-faint); font-size: 15px; font-weight: 400; text-align: center; }
.nav-domain[open] summary::after { content: "−"; }
.domain-number { color: var(--ink-faint); font-family: var(--font-mono); font-size: 9px; font-weight: 500; }
.document-links { position: relative; display: grid; gap: 1px; margin: 3px 0 7px 35px; padding-left: 11px; }
.document-links::before { content: ""; position: absolute; inset: 4px auto 5px 0; width: 1px; background: var(--line); }
.document-link { position: relative; min-height: 30px; padding: 4px 8px; border-radius: 7px; color: var(--ink-faint); font-size: 11px; }
.document-link:hover { color: var(--ink); }
.document-link[aria-current="page"] { background: var(--accent-soft); color: #a52f19; font-weight: 750; }

.sidebar-footer {
  display: flex;
  justify-content: space-between;
  margin: 28px 24px 0;
  padding: 18px 0 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
}

.sidebar-scrim { display: none; }

main { grid-column: 2; min-width: 0; }
#page { width: min(100%, calc(var(--content-width) + 96px)); margin: 0 auto; padding: 62px 48px 120px; }

.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: center;
  gap: 54px;
  min-height: 510px;
  padding: 34px 22px 48px 0;
  border-bottom: 1px solid var(--line-strong);
}

.home-kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 24px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.home-kicker::before { content: ""; width: 24px; height: 1px; background: currentColor; }
.home-hero h1 { max-width: 680px; margin: 0; font-size: clamp(42px, 6vw, 76px); font-weight: 720; letter-spacing: -.065em; line-height: 1.03; }
.home-hero h1 span { color: var(--accent); }
.home-description { max-width: 600px; margin: 28px 0 0; color: var(--ink-soft); font-size: 16px; line-height: 1.8; word-break: keep-all; }
.hero-index { position: absolute; top: 35px; right: 0; color: var(--line-strong); font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; writing-mode: vertical-rl; }

.home-device-stage {
  position: relative;
  min-height: 430px;
  isolation: isolate;
}

.hero-phone,
.screen-card {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
}

.hero-phone {
  position: absolute;
  width: 166px;
  filter: drop-shadow(0 18px 24px rgba(23, 33, 27, .14));
  transition: transform .2s ease, filter .2s ease;
}

.hero-phone:hover { filter: drop-shadow(0 24px 32px rgba(23, 33, 27, .2)); }
.hero-phone-1 { z-index: 3; top: 18px; left: 86px; transform: rotate(1.5deg); }
.hero-phone-1:hover { transform: translateY(-5px) rotate(1.5deg); }
.hero-phone-2 { z-index: 2; top: 74px; left: 0; transform: rotate(-5deg) scale(.88); }
.hero-phone-2:hover { transform: translateY(-5px) rotate(-5deg) scale(.88); }
.hero-phone-3 { z-index: 1; top: 62px; right: 0; transform: rotate(5deg) scale(.9); }
.hero-phone-3:hover { transform: translateY(-5px) rotate(5deg) scale(.9); }

.device-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1080 / 2340;
  border: 5px solid #202521;
  border-radius: 27px;
  background: #111;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.device-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0 0 64px; background: var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.stat { padding: 24px 20px; background: var(--paper); }
.stat strong { display: block; font-size: 28px; letter-spacing: -.04em; line-height: 1; }
.stat span { display: block; margin-top: 8px; color: var(--ink-faint); font-size: 11px; font-weight: 650; letter-spacing: .06em; }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.section-heading p { margin: 0; color: var(--ink-faint); font-size: 12px; }
.section-heading > div { display: grid; gap: 5px; }

.screen-library { margin: 0 0 72px; }
.screen-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: -4px 0 18px;
}

.screen-filter {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.screen-filter:hover { border-color: var(--line-strong); color: var(--ink); }
.screen-filter[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: white; }
.screen-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(190px, 218px);
  gap: 14px;
  overflow-x: auto;
  margin-inline: -8px;
  padding: 8px 8px 20px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.screen-card {
  display: grid;
  align-content: start;
  gap: 13px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  text-align: left;
  scroll-snap-align: start;
  box-shadow: 0 6px 18px rgba(23, 33, 27, .045);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.screen-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 12px 28px rgba(23, 33, 27, .09);
}

.screen-card .device-frame { width: 100%; border-width: 4px; border-radius: 24px; }
.screen-card-copy { display: grid; gap: 4px; }
.screen-card-copy strong { font-size: 13px; letter-spacing: -.015em; }
.screen-card-copy small { min-height: 3.2em; color: var(--ink-faint); font-size: 10px; line-height: 1.55; word-break: keep-all; }

.domain-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); }
.domain-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: start;
  gap: 14px;
  min-height: 132px;
  padding: 22px 16px 20px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background .18s ease, padding .18s ease;
}
.domain-card:nth-child(odd) { padding-right: 28px; border-right: 1px solid var(--line); }
.domain-card:nth-child(even) { padding-left: 28px; }
.domain-card:hover { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.domain-card-number { color: var(--accent); font-family: var(--font-mono); font-size: 10px; }
.domain-card h3 { margin: -3px 0 7px; font-size: 16px; letter-spacing: -.02em; }
.domain-card p { margin: 0; color: var(--ink-faint); font-size: 11px; line-height: 1.5; }
.domain-card-arrow { width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink-faint); font-size: 13px; line-height: 21px; text-align: center; transition: transform .18s ease, border-color .18s ease; }
.domain-card:hover .domain-card-arrow { transform: translate(2px, -2px); border-color: var(--ink-soft); color: var(--ink); }

.document-header { margin-bottom: 48px; padding-bottom: 30px; border-bottom: 1px solid var(--line-strong); }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; color: var(--ink-faint); font-size: 11px; font-weight: 650; }
.breadcrumbs span + span::before { content: "/"; margin-right: 8px; color: var(--line-strong); }
.document-header h1 { max-width: 700px; margin: 0; font-size: clamp(34px, 5vw, 54px); font-weight: 720; letter-spacing: -.055em; line-height: 1.14; word-break: keep-all; }
.document-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 22px; color: var(--ink-faint); font-size: 11px; }
.type-pill { padding: 4px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-weight: 750; }
.type-pill.improvement { background: var(--accent-soft); color: #a52f19; }
.document-tabs { display: flex; gap: 6px; margin-top: 24px; }
.document-tab { padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); font-size: 11px; font-weight: 650; text-decoration: none; }
.document-tab:hover { border-color: var(--line-strong); background: var(--surface); }
.document-tab[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: white; }

.document-screens {
  margin: -16px 0 68px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 72%, var(--paper));
}

.screen-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.screen-section-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.035em; }
.screen-section-heading > span { color: var(--ink-faint); font-family: var(--font-mono); font-size: 9px; white-space: nowrap; }
.document-screen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 12px;
}
.document-screen-grid .screen-card { padding: 10px; border-radius: 15px; }
.document-screen-grid .screen-card-copy small { display: none; }

.prose { color: #263229; font-size: 15px; line-height: 1.84; }
.prose > *:first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4 { position: relative; color: var(--ink); scroll-margin-top: calc(var(--header-height) + 28px); word-break: keep-all; }
.prose h2 { margin: 72px 0 22px; padding-top: 8px; font-size: 25px; letter-spacing: -.035em; line-height: 1.35; }
.prose h2::before { content: ""; position: absolute; top: -20px; left: 0; width: 28px; height: 3px; background: var(--accent); }
.prose h3 { margin: 42px 0 14px; font-size: 18px; letter-spacing: -.02em; line-height: 1.45; }
.prose h4 { margin: 30px 0 10px; font-size: 15px; }
.heading-anchor { margin-left: 8px; color: var(--line-strong); font-size: .7em; font-weight: 500; text-decoration: none; opacity: 0; transition: opacity .15s ease; }
.prose h2:hover .heading-anchor, .prose h3:hover .heading-anchor, .prose h4:hover .heading-anchor, .heading-anchor:focus { opacity: 1; }
.prose p { margin: 0 0 18px; }
.prose strong { color: var(--ink); font-weight: 750; }
.prose a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose ul, .prose ol { margin: 14px 0 22px; padding-left: 25px; }
.prose li { margin: 7px 0; padding-left: 4px; }
.prose li::marker { color: var(--accent); font-weight: 700; }
.prose blockquote { margin: 24px 0; padding: 17px 20px; border-left: 3px solid var(--yellow); background: #fff9e8; color: #5d563e; }
.prose blockquote p { margin: 0; }
.prose hr { height: 1px; margin: 48px 0; border: 0; background: var(--line); }
.prose code { padding: 2px 5px; border: 1px solid #dce0d8; border-radius: 5px; background: var(--surface-muted); color: #944128; font-family: var(--font-mono); font-size: .87em; }
.prose pre { overflow-x: auto; margin: 24px 0; padding: 20px; border: 1px solid #303b34; border-radius: 12px; background: #202a23; color: #e8eee8; line-height: 1.65; box-shadow: 0 10px 28px rgba(23, 33, 27, .11); }
.prose pre code { padding: 0; border: 0; background: transparent; color: inherit; font-size: 12px; }
.table-scroll { overflow-x: auto; margin: 24px 0 32px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 4px 14px rgba(23, 33, 27, .025); }
.prose table { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 1.55; }
.prose th { padding: 11px 14px; border-bottom: 1px solid var(--line-strong); background: var(--surface-muted); color: var(--ink); font-weight: 750; text-align: left; white-space: nowrap; }
.prose td { min-width: 110px; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover { background: #fafbf8; }
.source-note { margin-top: 72px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink-faint); font-family: var(--font-mono); font-size: 10px; }

.toc {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  width: var(--toc-width);
  overflow-y: auto;
  padding: 54px 28px 48px 24px;
}
.toc:empty { display: none; }
.toc-title { margin: 0 0 14px; color: var(--ink-faint); font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.toc-list { position: relative; display: grid; gap: 2px; margin: 0; padding: 0 0 0 12px; list-style: none; }
.toc-list::before { content: ""; position: absolute; inset: 4px auto 4px 0; width: 1px; background: var(--line); }
.toc a { display: block; padding: 5px 8px; border-radius: 6px; color: var(--ink-faint); font-size: 10px; line-height: 1.45; text-decoration: none; transition: color .15s ease, background .15s ease; }
.toc a:hover, .toc a.active { background: var(--surface-muted); color: var(--ink); }
.toc .level-3 { padding-left: 16px; }

.search-dialog {
  width: min(680px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 42px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(20, 28, 23, .22);
}
.search-dialog::backdrop { background: rgba(22, 30, 25, .42); backdrop-filter: blur(3px); }
.search-panel { display: flex; flex-direction: column; max-height: inherit; }
.search-heading { display: grid; grid-template-columns: 24px 1fr 36px; align-items: center; gap: 10px; padding: 14px 15px 8px 20px; color: var(--ink-soft); }
.search-heading label { color: var(--ink); font-size: 13px; font-weight: 750; }
#search-input { width: calc(100% - 40px); margin: 4px 20px 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font-size: 14px; }
#search-input::placeholder { color: #919a93; }
.search-help { margin: 8px 21px 10px; color: var(--ink-faint); font-size: 10px; }
.search-results { min-height: 140px; overflow-y: auto; padding: 5px 10px 12px; border-top: 1px solid var(--line); }
.search-result { display: grid; width: 100%; padding: 13px 12px; border: 0; border-radius: 9px; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.search-result:hover, .search-result[aria-selected="true"] { background: var(--surface-muted); }
.search-result-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.search-result-title { font-size: 13px; font-weight: 750; }
.search-result-type { flex: none; color: var(--ink-faint); font-size: 9px; }
.search-result p { margin: 5px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.search-result mark { padding: 0 2px; border-radius: 2px; background: #ffe49a; color: inherit; }
.search-empty { display: grid; place-items: center; min-height: 160px; color: var(--ink-faint); font-size: 12px; text-align: center; }
.search-footer { display: flex; gap: 16px; padding: 10px 20px; border-top: 1px solid var(--line); color: var(--ink-faint); font-size: 9px; }
.search-footer span { display: flex; align-items: center; gap: 4px; }
.search-footer kbd { min-width: 20px; padding: 0 4px; font-size: 9px; line-height: 16px; }

.screen-dialog {
  width: min(1060px, calc(100vw - 32px));
  max-width: none;
  max-height: min(900px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid #313a34;
  border-radius: 22px;
  background: #18201b;
  color: white;
  box-shadow: 0 30px 90px rgba(12, 17, 14, .42);
}

.screen-dialog[open] { display: grid; grid-template-columns: minmax(0, 1fr) 330px; }
.screen-dialog::backdrop { background: rgba(17, 23, 19, .72); backdrop-filter: blur(5px); }
.screen-dialog-media {
  display: grid;
  place-items: center;
  min-height: min(82vh, 780px);
  padding: 24px;
  background: #101612;
}
.screen-dialog-media img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(82vh, 780px);
  border-radius: 24px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, .36);
}
.screen-dialog-copy { display: flex; flex-direction: column; min-width: 0; padding: 24px; }
.screen-dialog-top { display: flex; align-items: center; justify-content: flex-end; }
.screen-dialog-close { color: #b9c2bc; }
.screen-dialog-close:hover { background: #2a342d; color: white; }
.screen-dialog-index { margin: auto 0 12px; color: #879189; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; }
.screen-dialog h2 { margin: 0; font-size: 30px; letter-spacing: -.045em; line-height: 1.2; }
.screen-dialog-copy > p:not(.screen-dialog-index) { margin: 16px 0 28px; color: #b9c2bc; font-size: 13px; line-height: 1.75; word-break: keep-all; }
.screen-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.screen-dialog-actions button {
  min-height: 44px;
  border: 1px solid #3c4840;
  border-radius: 10px;
  background: transparent;
  color: #d5dcd7;
  font-size: 12px;
  cursor: pointer;
}
.screen-dialog-actions button:hover { border-color: #69766d; background: #222c25; color: white; }

.not-found { max-width: 520px; margin: 100px auto; text-align: center; }
.not-found .code { color: var(--accent); font-family: var(--font-mono); font-size: 12px; }
.not-found h1 { margin: 14px 0; font-size: 40px; letter-spacing: -.05em; }
.not-found p { color: var(--ink-soft); }
.not-found a { display: inline-block; margin-top: 15px; padding: 9px 14px; border-radius: 8px; background: var(--ink); color: white; text-decoration: none; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1180px) {
  :root { --toc-width: 0px; }
  .app-shell { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .toc { display: none; }
}

@media (max-width: 820px) {
  .topbar { grid-template-columns: 38px auto 1fr; gap: 10px; padding: 0 16px; }
  .topbar .menu-button { display: grid; }
  .brand-copy { display: none; }
  .search-trigger { justify-self: end; width: 42px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger kbd, .topbar-meta { display: none; }
  .app-shell { display: block; }
  .sidebar {
    width: min(86vw, 320px);
    visibility: hidden;
    transform: translateX(-102%);
    background: var(--paper);
    box-shadow: 18px 0 60px rgba(20, 28, 23, .16);
    transition: transform .22s ease, visibility .22s;
  }
  body.menu-open { overflow: hidden; }
  body.menu-open .sidebar { visibility: visible; transform: translateX(0); }
  .sidebar-scrim { position: fixed; z-index: 70; inset: var(--header-height) 0 0; border: 0; background: rgba(22, 30, 25, .35); }
  body.menu-open .sidebar-scrim { display: block; }
  main { width: 100%; }
  #page { padding: 34px 22px 90px; }
  .home-hero { grid-template-columns: 1fr; gap: 18px; min-height: 0; padding: 28px 0 34px; }
  .home-hero h1 { font-size: 48px; }
  .home-device-stage { min-height: 400px; width: min(100%, 400px); margin-inline: auto; }
  .hero-phone { width: 156px; }
  .hero-phone-1 { left: 50%; transform: translateX(-50%) rotate(1.5deg); }
  .hero-phone-1:hover { transform: translateX(-50%) translateY(-5px) rotate(1.5deg); }
  .hero-index { display: none; }
  .domain-grid { grid-template-columns: 1fr; }
  .domain-card, .domain-card:nth-child(odd), .domain-card:nth-child(even) { padding: 20px 4px 18px; border-right: 0; }
  .document-header h1 { font-size: 38px; }
  .document-screens { padding: 20px; }
  .screen-dialog[open] { grid-template-columns: minmax(0, 1fr) 280px; }
}

@media (max-width: 520px) {
  .home-hero h1 { font-size: 40px; }
  .home-description { font-size: 14px; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 4px; }
  .stat strong { font-size: 24px; }
  .stat span { margin: 0; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .screen-filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: -12px; padding: 0 12px 6px; scrollbar-width: none; }
  .screen-filter { flex: 0 0 auto; }
  .screen-rail { grid-auto-columns: 178px; }
  .screen-card { padding: 10px; }
  .screen-card .device-frame { border-radius: 20px; }
  .screen-card-copy small { display: none; }
  .document-screens { margin-inline: -8px; padding: 18px 12px; border-radius: 16px; }
  .screen-section-heading { align-items: start; }
  .document-screen-grid { display: flex; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
  .document-screen-grid .screen-card { flex: 0 0 148px; scroll-snap-align: start; }
  .screen-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); border-radius: 16px; }
  .screen-dialog[open] { display: flex; flex-direction: column; }
  .screen-dialog-media { min-height: 0; height: calc(100vh - 230px); padding: 12px; }
  .screen-dialog-media img { max-height: calc(100vh - 254px); border-radius: 18px; }
  .screen-dialog-copy { padding: 14px 16px 16px; }
  .screen-dialog-index { margin: 14px 0 6px; }
  .screen-dialog h2 { font-size: 22px; }
  .screen-dialog-copy > p:not(.screen-dialog-index) { margin: 7px 0 12px; font-size: 11px; line-height: 1.55; }
  .document-tabs { display: grid; grid-template-columns: repeat(3, 1fr); }
  .document-tab { padding-inline: 5px; text-align: center; }
  .prose { font-size: 14px; }
  .prose h2 { font-size: 22px; }
  .search-footer { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
