/* Pikkola protobuf: ink on warm paper, one burgundy accent, and a monospace
   column for anything the wire says. The tree, the hex dump and the encoder
   share one row grammar so a field number reads the same in all three.
   Weights stay at 400 to 700. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/tools/protobuf/fonts/inter.woff2) format("woff2-variations");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/tools/protobuf/fonts/jetbrains-mono.woff2) format("woff2");
}

:root {
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1180px;
  --r: 14px;
  --r-sm: 8px;
}
html[lang="ko"] {
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  word-break: keep-all;
}
html[lang="ja"] {
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  word-break: normal;
}
html[lang="ja"] .hero h1 { max-width: 16ch; }

html[data-theme="light"] {
  --bg: #f3f0e6;
  --bg-2: #eae5d7;
  --surface: #fcfaf3;
  --surface-2: #f6f2e7;
  --ink: #171b21;
  --ink-2: #414850;
  --ink-3: #767c84;
  --line: #dcd6c6;
  --line-2: #c9c2af;
  --accent: #7a2438;
  --accent-ink: #fdf5f3;
  --accent-soft: #f2dde1;
  --hot: #a33f2a;
  --hot-soft: #f6ded7;
  --ok: #2c6647;
  --ok-soft: #e0efe6;
  --shadow: 0 1px 2px rgba(23, 27, 33, .05), 0 18px 40px -28px rgba(23, 27, 33, .35);
  --tk-c: #8d9189;
  --tk-t: #2f4a6b;
  --tk-k: #7a2438;
  --tk-s: #8a5a22;
  --tk-n: #9a3b2a;
  --tk-p: #5c4ba8;
  --hl: #f4dfc4;
}
html[data-theme="dark"] {
  --bg: #101413;
  --bg-2: #161b1a;
  --surface: #181d1c;
  --surface-2: #1e2423;
  --ink: #eae6da;
  --ink-2: #b6b8ae;
  --ink-3: #868e87;
  --line: #2a312e;
  --line-2: #3b443f;
  --accent: #e9a3b2;
  --accent-ink: #2a0b13;
  --accent-soft: #2f1b21;
  --hot: #e2907a;
  --hot-soft: #3b211a;
  --ok: #7fd6a8;
  --ok-soft: #14301f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 24px 50px -30px rgba(0, 0, 0, .8);
  --tk-c: #6f7a82;
  --tk-t: #9db4d6;
  --tk-k: #e9a3b2;
  --tk-s: #e0b174;
  --tk-n: #ef9b83;
  --tk-p: #b3a4ee;
  --hl: #4a3a1e;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.022em; line-height: 1.16; }
p { margin: 0; }
a { color: inherit; }
img, svg { max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
code { font-family: var(--mono); font-size: .92em; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}
.mono { font-family: var(--mono); }

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 60;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r-sm);
  text-decoration: none;
  font-size: 13px;
}
.skip-link:focus { top: 12px; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  flex: none;
}
.brand-mark { width: 26px; height: 26px; color: var(--accent); flex: none; }
.brand-name { font-weight: 600; font-size: 15.5px; letter-spacing: -0.015em; }
.brand-tool {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  font-size: 13px;
}
.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--line-2); }
.header-tools { display: flex; align-items: center; gap: 8px; }
.lang-field { position: relative; display: inline-flex; align-items: center; }
.lang-globe { position: absolute; left: 8px; width: 14px; height: 14px; color: var(--ink-3); pointer-events: none; }
.lang-field select {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 7px;
  padding: 6px 8px 6px 26px;
  font-size: 12px;
  cursor: pointer;
}
.lang-field select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 17px; height: 17px; }
.ico-sun { display: none; }
html[data-theme="dark"] .ico-sun { display: block; }
html[data-theme="dark"] .ico-moon { display: none; }

/* -------------------------------------------------------------------- hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 46px;
  align-items: center;
  padding-top: 58px;
  padding-bottom: 46px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1.5px;
  background: var(--accent);
  display: inline-block;
}
html[lang="ko"] .eyebrow,
html[lang="ja"] .eyebrow { letter-spacing: .06em; }
.hero h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.35rem);
  letter-spacing: -0.035em;
  max-width: 18ch;
}
.hero-lede {
  margin-top: 18px;
  max-width: 58ch;
  font-size: 16px;
  line-height: 1.62;
  color: var(--ink-2);
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin: 26px 0 0;
}
.facts div { display: grid; gap: 1px; }
.facts dt { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.facts dd { margin: 0; font-size: 11.5px; color: var(--ink-3); }
.hero-note { margin-top: 20px; font-size: 10.5px; color: var(--ink-3); letter-spacing: .02em; }

.hero-card {
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-card-head,
.hero-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 9.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--surface-2);
}
.hero-card-head { border-bottom: 1px solid var(--line); }
.hero-card-foot { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hero-card-foot svg { width: 15px; height: 15px; color: var(--accent); }
.hero-card-body {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--ink-2);
}
.tk-c { color: var(--tk-c); font-style: italic; }
.tk-t, .tk-k { color: var(--tk-k); }
.tk-s { color: var(--tk-s); }
.tk-n { color: var(--tk-n); }
.tk-p { color: var(--tk-p); }

/* ------------------------------------------------------------------ layout */

.section { padding: 60px 0; border-top: 1px solid var(--line); }
.section-head { max-width: 70ch; }
.section-head h2 {
  font-size: clamp(1.45rem, 2.6vw, 1.95rem);
  letter-spacing: -0.028em;
  margin-bottom: 10px;
}
.section-lede { font-size: 14.5px; line-height: 1.62; color: var(--ink-2); }
.section-note {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--ink-3);
  max-width: 80ch;
}
#studio, #how, #wire, #faq, #watch { scroll-margin-top: 74px; }

/* ------------------------------------------------------------------ studio */

.studio { background: var(--bg-2); }
.studio-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 18px;
}
.studio-head .eyebrow { margin-bottom: 10px; }
.studio-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-bottom: 4px; }

.preset-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r) var(--r) 0 0;
  border-bottom: 0;
  background: var(--surface);
}
.pane-label {
  font-size: 9.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
html[lang="ko"] .pane-label,
html[lang="ja"] .pane-label { letter-spacing: .04em; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sample-note { font-size: 12px; color: var(--ink-3); margin-left: auto; text-align: right; }

.studio-grid {
  display: grid;
  grid-template-columns: minmax(330px, 400px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.left-col, .result-column { display: grid; gap: 16px; min-width: 0; }

.pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.pane-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.grow { flex: 1; }

.mini {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
}
.mini:hover { border-color: var(--accent); color: var(--accent); }
.mini:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mini:disabled { opacity: .45; cursor: default; border-color: var(--line); color: var(--ink-3); }

.format-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.fmt {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
}
.fmt:hover { color: var(--ink); }
.fmt.on { background: var(--accent); color: var(--accent-ink); }
.fmt:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.editor-shell { display: flex; flex: 1; min-height: 0; background: var(--surface); }
#bytesInput,
#protoInput,
#jsonInput {
  width: 100%;
  border: 0;
  outline: none;
  resize: vertical;
  padding: 12px 14px;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  tab-size: 2;
}
#bytesInput { min-height: 176px; }
#protoInput { min-height: 268px; font-size: 12px; }
#bytesInput:focus-visible,
#protoInput:focus-visible,
#jsonInput:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-soft); }
#bytesInput::placeholder,
#protoInput::placeholder,
#jsonInput::placeholder { color: var(--ink-3); }

.pane-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  min-height: 34px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
}
.pane-foot .stats { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schema-foot { gap: 10px; }
.type-row {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.type-field { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; }
.type-label {
  flex: none;
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
html[lang="ko"] .type-label,
html[lang="ja"] .type-label { letter-spacing: .03em; }
.type-field select {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 6px;
  padding: 5px 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  cursor: pointer;
}
.type-field select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.validation-state.ok { color: var(--ok); }
.validation-state.bad { color: var(--hot); }
.validation-state.warn { color: var(--tk-s); }

.grpc-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 11.5px;
}
.grpc-strip button { margin-left: auto; }

/* ------------------------------------------------------------------ result */

.result-pane { min-height: 660px; }
.result-head { gap: 10px; }
.mode-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.mode {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 11px;
  border-radius: 5px;
  cursor: pointer;
  letter-spacing: .02em;
}
.mode:hover { color: var(--ink); }
.mode.on { background: var(--accent); color: var(--accent-ink); }
.mode:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.tabs { display: inline-flex; gap: 2px; margin-left: auto; }
.tab {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 12px;
  padding: 5px 9px;
  border-radius: 5px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--ink); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.summary {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 14px;
  min-height: 34px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.summary .count {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .01em;
  color: var(--accent);
}
.summary .types { font-size: 11.5px; color: var(--ink-3); }
.summary .timing { margin-left: auto; font-size: 10.5px; color: var(--ink-3); }

.result-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  max-height: 660px;
}
.view { padding: 10px 12px 14px; }
.view-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 8px;
}
.view-note { font-size: 11.5px; color: var(--ink-3); }
.empty { padding: 26px 12px; font-size: 13px; color: var(--ink-3); max-width: 64ch; }
.result-foot .hint-text { text-align: right; }

/* -------------------------------------------------------------------- tree */

.tree-wrap { min-height: 120px; }
.tree { list-style: none; margin: 0; padding: 0; }
.tree .tree { padding-left: 17px; border-left: 1px solid var(--line); margin-left: 6px; }
.tnode { margin: 0; }
.trow {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  padding: 3px 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  text-align: left;
  cursor: pointer;
  flex-wrap: nowrap;
}
.trow:hover { background: var(--surface-2); }
.trow:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.trow.is-sel { background: var(--accent-soft); }
.tcaret {
  flex: none;
  width: 11px;
  color: var(--ink-3);
  font-size: 9px;
  transition: transform .12s ease;
  transform-origin: 45% 55%;
}
.trow[aria-expanded="true"] .tcaret { transform: rotate(90deg); }
.tnode.leaf .tcaret { visibility: hidden; }
.tnum { flex: none; min-width: 24px; color: var(--accent); }
.tname { flex: none; color: var(--ink); font-weight: 500; }
.tname.dim { color: var(--ink-3); font-weight: 400; }
.ttype {
  flex: none;
  font-size: 10px;
  letter-spacing: .01em;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
  line-height: 1.55;
}
.tval {
  flex: 1;
  min-width: 0;
  color: var(--ink-2);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.tend { display: flex; align-items: baseline; gap: 6px; flex: none; }
.tval.str { color: var(--tk-s); }
.tval.num { color: var(--tk-n); }
.tval.msg { color: var(--ink-3); }
.tmeta { flex: none; font-size: 10px; color: var(--ink-3); }
.tview {
  flex: none;
  border: 1px dashed var(--line-2);
  background: transparent;
  color: var(--ink-3);
  border-radius: 4px;
  padding: 0 5px;
  font-family: var(--mono);
  font-size: 9.5px;
  cursor: pointer;
}
.tview:hover { color: var(--accent); border-color: var(--accent); }
.tkids { list-style: none; margin: 0; padding: 0; }
.tkids[hidden] { display: none !important; }
.tmore { padding: 6px 8px 2px 30px; font-size: 11px; color: var(--ink-3); }

/* --------------------------------------------------------------- hex dump */

.hexdump {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.7;
  overflow-x: auto;
  padding-bottom: 4px;
}
.hexrow {
  display: grid;
  grid-template-columns: 62px minmax(300px, 1fr) 132px;
  gap: 12px;
  padding: 0 4px;
  border-radius: 4px;
}
.hexrow .off { color: var(--ink-3); }
.hexrow .hb { color: var(--ink-2); letter-spacing: .06em; white-space: pre; }
.hexrow .ha { color: var(--ink-3); white-space: pre; }
.hexrow .b { border-radius: 2px; }
.hexrow .b.hl { background: var(--hl); color: var(--ink); }
.hexrow .b.zero { color: var(--ink-3); }

/* ---------------------------------------------------------------- encoder */

.encode-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}
.subpane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  overflow: hidden;
}
.subhead {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.subhead.second { border-top: 1px solid var(--line); }
#jsonInput { min-height: 260px; }
pre.code {
  margin: 0;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.62;
  color: var(--ink);
  overflow: auto;
  white-space: pre;
  background: var(--surface);
  tab-size: 2;
}
pre.code.small { font-size: 11px; line-height: 1.55; min-height: 74px; max-height: 180px; white-space: pre-wrap; overflow-wrap: anywhere; }
#jsonOut { min-height: 200px; max-height: 560px; }

.warnlist {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.warnlist li {
  font-size: 12px;
  color: var(--ink-2);
  padding: 7px 10px;
  border-left: 2px solid var(--tk-s);
  background: var(--surface-2);
  border-radius: 0 5px 5px 0;
}
.warnlist .wpath { font-family: var(--mono); font-size: 11px; color: var(--ink-3); display: block; }

.errbox {
  margin: 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--hot) 42%, var(--line));
  border-left-width: 3px;
  border-radius: var(--r-sm);
  background: var(--hot-soft);
  overflow: auto;
}
.err-title {
  font-size: 9.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--hot);
  margin-bottom: 6px;
}
.err-msg { font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.err-hint { margin-top: 7px; font-size: 11.5px; color: var(--ink-2); }

/* --------------------------------------------------------------- privacy */

.privacy-strip {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.privacy-strip svg { width: 22px; height: 22px; flex: none; color: var(--accent); margin-top: 2px; }
.privacy-strip strong { display: block; font-size: 13.5px; margin-bottom: 3px; }
.privacy-strip p { font-size: 12.5px; color: var(--ink-2); max-width: 74ch; }

/* ------------------------------------------------------------------ cards */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}
.card {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.card .num {
  display: block;
  font-size: 10.5px;
  letter-spacing: .14em;
  color: var(--accent);
  margin-bottom: 10px;
}
.card h3 { font-size: 15.5px; margin-bottom: 8px; }
.card p { font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.card code { background: var(--surface-2); padding: 1px 4px; border-radius: 4px; font-size: 11.5px; }

/* ------------------------------------------------------------- wire table */

.wire-table-wrap {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: auto;
  background: var(--surface);
}
.wire-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 13px;
}
.wire-table th {
  text-align: left;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-weight: 500;
}
.wire-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: top;
}
.wire-table tr:last-child td { border-bottom: 0; }
.wire-table td:first-child { color: var(--accent); width: 62px; }
.wire-table b { font-weight: 600; color: var(--ink); }

/* -------------------------------------------------------------------- faq */

.faq-list { margin-top: 22px; border-top: 1px solid var(--line); }
.faq { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 15px 0;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+";
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  flex: none;
  width: 12px;
}
.faq[open] summary::before { content: "−"; }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.faq p {
  padding: 0 0 17px 24px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 82ch;
}

/* --------------------------------------------------------------- related */

.related {
  border-top: 1px solid var(--line);
  padding: 34px 0 44px;
}
.related-head h2 { font-size: 15px; letter-spacing: -0.01em; }
.related-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.related-link {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  text-decoration: none;
  transition: border-color .18s ease, transform .18s ease;
}
.related-link:hover { border-color: var(--accent); transform: translateY(-1px); }
.related-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.related-tag {
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.related-title { display: block; font-size: 14.5px; font-weight: 600; margin: 6px 0 4px; }
.related-body { display: block; font-size: 12.5px; color: var(--ink-2); }

/* ------------------------------------------------------------ watch, funnel */

.watch-section { padding-top: 56px; padding-bottom: 0; border-top: 0; }
.watch-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, .7fr);
  gap: 34px;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  padding: 32px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
}
.watch-tag { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.watch-copy h2 { margin-top: 10px; font-size: clamp(1.35rem, 2.4vw, 1.75rem); max-width: 24ch; }
.watch-copy p { margin-top: 12px; font-size: 14px; color: var(--ink-2); max-width: 56ch; }
.watch-points { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.watch-points li { position: relative; padding-left: 16px; }
.watch-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--accent);
}
.watch-buy { border-left: 1px solid var(--line); padding-left: 30px; }
.watch-price { display: flex; align-items: baseline; gap: 8px; }
.watch-price-main { font-size: 2.4rem; font-weight: 700; letter-spacing: -0.04em; }
.watch-price-alt { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.watch-buy .btn { width: 100%; margin-top: 16px; text-align: center; }
.watch-fine { margin-top: 10px; font-size: 11px; color: var(--ink-3); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.btn:hover { opacity: .9; }

.funnel { padding: 56px 28px 10px; }
.funnel-head {
  margin: 0 0 12px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.funnel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.funnel-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color .18s ease, background-color .18s ease;
}
.funnel-card:hover, .funnel-card:focus-visible { border-color: var(--accent); background: var(--surface-2); }
.funnel-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.funnel-kicker { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.funnel-title { font-size: 16.5px; font-weight: 600; line-height: 1.3; word-break: keep-all; }
.funnel-sub { max-width: 36ch; font-size: 13.5px; line-height: 1.55; color: var(--ink-3); word-break: keep-all; }
.funnel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; }
.funnel-price {
  flex: none;
  padding: 3px 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
}
.funnel-cta { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--accent); }
.funnel-arrow { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

html[lang="ko"] .funnel-head,
html[lang="ja"] .funnel-head,
html[lang="ko"] .funnel-kicker,
html[lang="ja"] .funnel-kicker,
html[lang="ko"] .watch-tag,
html[lang="ja"] .watch-tag { letter-spacing: .02em; }

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

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding: 40px 0 34px;
}
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, .6fr) minmax(0, .6fr);
  gap: 30px;
  align-items: start;
}
.footer-brand .brand { margin-bottom: 10px; }
.footer-brand p { font-size: 12.5px; color: var(--ink-2); max-width: 40ch; }
.footer-links h3 {
  font-size: 9.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
  font-weight: 500;
}
.footer-links ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-links a { font-size: 13px; color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-note {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-3);
}

/* -------------------------------------------------------------- plain pages */

.doc { max-width: 74ch; padding: 54px 0 70px; }
.doc h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); letter-spacing: -0.03em; margin-bottom: 8px; }
.doc .updated {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 20px;
}
.doc-lede { font-size: 16px; color: var(--ink-2); margin-bottom: 26px; }
.doc h2 {
  font-size: 1.15rem;
  margin: 30px 0 10px;
  letter-spacing: -0.02em;
}
.doc p, .doc li { font-size: 14px; color: var(--ink-2); line-height: 1.68; }
.doc p + p { margin-top: 12px; }
.doc ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.doc a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-soft); }
.doc a:hover { border-bottom-color: var(--accent); }
.doc-foot { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; }
.doc table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px; }
.doc th, .doc td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.doc code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

.notfound { padding: 90px 0 110px; max-width: 60ch; }
.notfound h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: 12px; }
.notfound p { color: var(--ink-2); font-size: 15px; margin-bottom: 24px; }

/* -------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hero-card { max-width: 560px; }
  .studio-grid { grid-template-columns: minmax(0, 1fr); }
  .result-pane { min-height: 520px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .encode-grid { grid-template-columns: minmax(0, 1fr); }
  #protoInput { min-height: 200px; }
}

@media (max-width: 720px) {
  .wrap { padding: 0 18px; }
  .header-inner { gap: 12px; flex-wrap: wrap; padding: 8px 0; }
  .site-nav { order: 3; width: 100%; gap: 14px; overflow-x: auto; padding-bottom: 2px; }
  .header-tools { margin-left: auto; }
  .brand-tool { display: none; }
  .hero { padding-top: 34px; padding-bottom: 30px; }
  .section { padding: 42px 0; }
  .studio-head { flex-direction: column; align-items: flex-start; }
  .sample-note { margin-left: 0; text-align: left; flex-basis: 100%; }
  .result-pane { min-height: 440px; }
  .result-body { max-height: 520px; }
  .summary { gap: 6px 10px; }
  .summary .timing { margin-left: 0; }
  .tabs { width: 100%; margin-left: 0; overflow-x: auto; }
  .hexrow { grid-template-columns: 54px minmax(230px, 1fr); }
  .hexrow .ha { display: none; }
  .related-row { grid-template-columns: minmax(0, 1fr); }
  .watch-card { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 24px; }
  .watch-buy { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 20px; }
  .watch-buy .btn { width: auto; }
  .funnel { padding: 44px 18px 0; }
  .funnel-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .trow { font-size: 11.5px; gap: 6px; }
  .tmeta { display: none; }
  .pane-foot { flex-wrap: wrap; row-gap: 4px; }
  .pane-foot .stats { flex-basis: 100%; white-space: normal; }
}

@media (max-width: 400px) {
  .wrap { padding: 0 14px; }
  .funnel { padding: 40px 14px 0; }
  .mini { padding: 5px 8px; font-size: 11px; }
  .mode { padding: 5px 8px; font-size: 10.5px; }
  .tab { padding: 5px 7px; font-size: 11.5px; }
  .tname { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
