/* Pikkola Color Studio: a measuring bench for colour.
   Light is white paper, dark is a darkroom. The accent is ink, so a swatch is the
   only saturated thing on the page. Weights stay at 400, 500, 600 and 700. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/fonts/inter.woff2) format("woff2-variations");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/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: 9px;
}

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[data-theme="light"] {
  --bg: #fbfbfc;
  --bg-2: #f4f4f6;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --ink: #14151a;
  --ink-2: #4b4d56;
  --ink-3: #797c87;
  --line: #e6e6ea;
  --line-2: #d2d3d9;
  --accent: #14151a;
  --accent-ink: #ffffff;
  --accent-soft: #ececef;
  --ok: #0d6b48;
  --ok-soft: #e4f3ec;
  --bad: #a9261c;
  --bad-soft: #fbe9e7;
  --warn: #8a5a00;
  --shadow: 0 1px 2px rgba(20, 21, 26, .05), 0 24px 48px -40px rgba(20, 21, 26, .45);
  --grid: rgba(20, 21, 26, .05);
}
html[data-theme="dark"] {
  --bg: #0b0c0e;
  --bg-2: #101114;
  --surface: #131417;
  --surface-2: #1a1b1f;
  --ink: #f3f3f5;
  --ink-2: #b9bbc2;
  --ink-3: #868994;
  --line: #24262b;
  --line-2: #34373e;
  --accent: #f3f3f5;
  --accent-ink: #0b0c0e;
  --accent-soft: #23252a;
  --ok: #58d3a4;
  --ok-soft: #12261f;
  --bad: #ff9d92;
  --bad-soft: #2a1715;
  --warn: #e0b062;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 30px 60px -40px rgba(0, 0, 0, .8);
  --grid: rgba(255, 255, 255, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 60;
  padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--bg);
  font-size: 13.5px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

/* ---------------- header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.brand-mark { width: 26px; height: 26px; color: var(--ink); }
.brand-name { font-weight: 600; letter-spacing: -0.015em; }
.brand-tool {
  margin-left: 2px; padding-left: 9px; border-left: 1px solid var(--line-2);
  color: var(--ink-3); font-size: 13.5px; letter-spacing: 0.02em;
}
.site-nav { display: flex; gap: 22px; margin-left: 8px; }
.site-nav a {
  color: var(--ink-2); font-size: 13.5px; text-decoration: none; letter-spacing: 0.01em;
  padding: 6px 0; 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: 10px; margin-left: auto; }
.lang-field { position: relative; display: inline-flex; align-items: center; }
.lang-globe { position: absolute; left: 9px; width: 15px; height: 15px; color: var(--ink-3); pointer-events: none; }
.lang-field select {
  appearance: none; padding: 7px 26px 7px 28px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); font-size: 12.5px; letter-spacing: 0.02em;
}
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.icon-btn svg { width: 17px; height: 17px; }
html[data-theme="dark"] .ico-moon, html[data-theme="light"] .ico-sun { display: none; }

/* ---------------- hero ---------------- */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(30px, 5vw, 64px); padding: clamp(48px, 8vw, 92px) 0 clamp(36px, 6vw, 68px); align-items: start; }
.eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-3);
}
.hero h1 { margin-top: 16px; font-size: clamp(2.6rem, 5.6vw, 4.4rem); letter-spacing: -0.035em; }
.hero-lede { max-width: 44ch; margin-top: 18px; color: var(--ink-2); font-size: 17px; line-height: 1.62; }
.hero-actions { display: flex; align-items: center; gap: 18px; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px;
  border: 1px solid var(--accent); border-radius: 999px; background: var(--accent);
  color: var(--accent-ink); font-size: 14px; font-weight: 600; text-decoration: none;
}
.btn:hover { opacity: .9; }
.btn.small { padding: 9px 15px; font-size: 13px; }
.hero-note { font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.facts { display: grid; grid-template-columns: repeat(4, auto); gap: 26px; margin: 34px 0 0; }
.facts dt { font-family: var(--mono); font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.facts dd { margin: 2px 0 0; font-size: 12px; color: var(--ink-3); letter-spacing: 0.02em; }

.specimen { margin: 0; }
.specimen-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.specimen-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.mono-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-3); }
.specimen-badge { padding: 3px 9px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 11.5px; }
.specimen-plate { background: #f7f3e8; color: #2a2119; padding: 24px 22px 22px; }
.specimen-aa {
  margin: 0; color: #2a2119;
  font-size: 74px; font-weight: 600; line-height: 1; letter-spacing: -0.04em;
}
.specimen-line { margin-top: 8px; color: #5d4630; font-size: 13.5px; line-height: 1.55; max-width: 38ch; }
.specimen-checks { margin: 0; padding: 14px 18px 16px; list-style: none; display: grid; gap: 7px; border-top: 1px solid var(--line); }
.specimen-checks li { display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink-2); }
.specimen-checks b { font-size: 11.5px; font-weight: 500; color: var(--ok); }
.tick { width: 16px; height: 16px; border-radius: 50%; background: var(--ok-soft); position: relative; }
.tick::after {
  content: ""; position: absolute; left: 5px; top: 3.6px; width: 5px; height: 8px;
  border-right: 1.6px solid var(--ok); border-bottom: 1.6px solid var(--ok); transform: rotate(38deg);
}
.specimen-swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
.specimen-swatches span { height: 44px; border-radius: 8px; background: var(--c); border: 1px solid rgba(0, 0, 0, .08); }
.specimen figcaption { margin-top: 20px; font-size: 13px; color: var(--ink-3); max-width: 38ch; }

/* ---------------- section furniture ---------------- */
.section-head { max-width: 720px; margin-bottom: 28px; }
.section-head h2 { margin-top: 12px; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.section-lede { margin-top: 12px; color: var(--ink-2); font-size: 15.5px; max-width: 62ch; }
.studio { padding: clamp(28px, 5vw, 48px) 0 clamp(20px, 4vw, 40px); }

.tabs {
  display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface-2); margin-bottom: 22px; flex-wrap: wrap;
}
.tab {
  padding: 8px 16px; border: 0; border-radius: 999px; background: transparent;
  color: var(--ink-2); font-size: 13.5px; font-weight: 500;
}
.tab:hover { color: var(--ink); }
.tab.is-on { background: var(--ink); color: var(--bg); }
.panel[hidden] { display: none; }

/* ---------------- contrast ---------------- */
.pair-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 14px; }
.field-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 16px 18px 18px; }
.field-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.field-label { font-size: 13px; font-weight: 600; letter-spacing: 0.01em; }
.field-tag { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.field-main { display: flex; align-items: center; gap: 14px; }
.swatch-wrap { position: relative; flex: none; width: 74px; height: 74px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); }
.swatch-wrap input[type="color"] { position: absolute; inset: -12px; width: 140%; height: 140%; border: 0; padding: 0; background: none; cursor: pointer; opacity: 0; }
.swatch-face { position: absolute; inset: 0; background: var(--sw, #2a2119); }
.swatch-face::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.field-inputs { flex: 1; min-width: 0; display: grid; gap: 5px; }
.hex-input {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2); font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase;
}
.hex-input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.field-sub { font-size: 11.5px; color: var(--ink-3); }
.swap {
  align-self: center; display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink-2);
}
.swap:hover { color: var(--ink); border-color: var(--line-2); }
.swap svg { width: 19px; height: 19px; }

.contrast-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 14px; margin-top: 14px; }
.preview-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; justify-content: center;
  min-height: 250px; padding: 30px 30px 28px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--bg-prev, #f7f3e8); color: var(--fg-prev, #2a2119);
}
.preview-tag { position: absolute; left: 14px; top: 12px; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; opacity: .55; }
.preview-h { font-size: 24px; font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; }
.preview-t { font-size: 16px; line-height: 1.6; max-width: 46ch; }
.preview-s { font-size: 13px; line-height: 1.55; opacity: .9; }
.preview-btn {
  align-self: flex-start; margin-top: 6px; padding: 9px 16px; border-radius: 999px;
  border: 1.5px solid currentColor; font-size: 13.5px; font-weight: 600;
}
.result-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 20px 22px 18px; }
.ratio-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.ratio-label { font-size: 12px; color: var(--ink-3); letter-spacing: 0.02em; }
.ratio-value { font-size: clamp(2.2rem, 4vw, 2.9rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; margin-top: 2px; }
.verdict {
  flex: none; padding: 6px 13px; border-radius: 999px; font-size: 12px; font-weight: 600;
  letter-spacing: 0.06em; background: var(--ink); color: var(--bg);
}
.verdict.is-fail { background: var(--bad-soft); color: var(--bad); }
.verdict.is-ok { background: var(--ok-soft); color: var(--ok); }
.checks { list-style: none; margin: 6px 0 0; padding: 0; }
.check { display: grid; grid-template-columns: 1fr auto 58px; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; color: var(--ink-2); }
.check:last-child { border-bottom: 0; }
.check-min { font-size: 11.5px; color: var(--ink-3); }
.check-flag { font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-align: right; color: var(--ink-3); }
.check.is-pass .check-flag { color: var(--ok); }
.check.is-fail .check-flag { color: var(--bad); }
.hint { margin-top: 12px; font-size: 12px; line-height: 1.55; color: var(--ink-3); }

.fix-card { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; margin-top: 14px; padding: 18px 22px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.fix-copy h3 { font-size: 14.5px; }
.fix-copy p { margin-top: 4px; font-size: 12.5px; color: var(--ink-3); max-width: 52ch; }
.fix-btns { display: flex; gap: 10px; }
.fix-btn {
  display: grid; grid-template-columns: 26px auto; grid-template-rows: auto auto; align-items: center;
  gap: 2px 10px; padding: 9px 13px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); text-align: left;
}
.fix-btn:hover { border-color: var(--ink); }
.fix-swatch { grid-row: 1 / 3; width: 26px; height: 26px; border-radius: 6px; background: var(--sw); border: 1px solid rgba(0, 0, 0, .1); }
.fix-hex { font-size: 12.5px; letter-spacing: 0.04em; }
.fix-ratio { font-size: 11px; color: var(--ink-3); }
.lum-line { margin-top: 12px; font-size: 11.5px; color: var(--ink-3); letter-spacing: 0.03em; }

/* ---------------- convert ---------------- */
.convert-top { display: grid; grid-template-columns: 1.05fr .95fr; gap: 14px; }
.convert-input-card, .slider-card, .format-card, .export-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 18px 20px; }
.convert-input-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.convert-chip { flex: none; width: 46px; height: 46px; border-radius: 10px; background: var(--sw, #1d46c4); border: 1px solid rgba(0, 0, 0, .12); }
.convert-input-row input {
  flex: 1; min-width: 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2); font-size: 16px; letter-spacing: 0.04em;
}
.convert-input-row input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.field-error { min-height: 18px; margin-top: 8px; font-size: 12.5px; color: var(--bad); }
.slider-card { display: grid; gap: 14px; align-content: start; }
.slider-row { display: grid; grid-template-columns: 84px 1fr 52px; align-items: center; gap: 12px; }
.slider-row label { font-size: 12.5px; color: var(--ink-2); }
.slider-row output { font-size: 12px; text-align: right; color: var(--ink-3); }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 999px;
  background: var(--line-2); outline-offset: 6px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--ink); cursor: grab;
}
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); }
.format-card { margin-top: 14px; }
.format-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.format-head h3 { font-size: 14.5px; }
.link-btn { border: 0; background: none; padding: 2px 0; color: var(--ink-2); font-size: 12.5px; font-weight: 500; border-bottom: 1px solid var(--line-2); }
.link-btn:hover { color: var(--ink); border-bottom-color: var(--ink); }
.format-list { list-style: none; margin: 0; padding: 0; }
.format-list li {
  display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.format-list li:last-child { border-bottom: 0; }
.fmt-name { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.fmt-value { font-family: var(--mono); font-size: 13.5px; letter-spacing: 0.01em; overflow-wrap: anywhere; }
.fmt-copy { border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); padding: 4px 9px; font-size: 11px; color: var(--ink-2); }
.fmt-copy:hover { border-color: var(--ink); color: var(--ink); }
.measure-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.measure { display: grid; gap: 3px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.measure span { font-size: 11.5px; color: var(--ink-3); }
.measure b { font-size: 15px; font-weight: 500; }
.measure b.is-pass { color: var(--ok); }
.measure b.is-fail { color: var(--bad); }

/* ---------------- palette ---------------- */
.palette-bar { display: grid; grid-template-columns: 1fr 260px; gap: 14px; margin-bottom: 16px; }
.palette-base, .palette-harmony { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 14px 16px; }
.palette-harmony select {
  width: 100%; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface-2); font-size: 13.5px;
}
.convert-input-row.small { margin-top: 10px; }
.swatch-wrap.small { width: 44px; height: 44px; border-radius: 9px; }
.convert-input-row.small input { font-size: 14.5px; padding: 9px 11px; }
.palette-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.pal { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); text-align: left; padding: 0; display: block; width: 100%; }
.pal-color { display: block; height: 132px; background: var(--sw); border-bottom: 1px solid rgba(0, 0, 0, .08); position: relative; }
.pal-color span { position: absolute; right: 8px; bottom: 7px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.05em; padding: 2px 6px; border-radius: 999px; background: rgba(255, 255, 255, .82); color: #14151a; }
.pal-meta { display: grid; gap: 1px; padding: 9px 10px 10px; }
.pal-hex { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em; }
.pal-ratios { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.02em; }
.export-card { margin-top: 16px; }
.export-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.export-tabs { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.mini-tab { border: 0; border-radius: 999px; background: none; padding: 6px 12px; font-size: 12px; color: var(--ink-2); }
.mini-tab.is-on { background: var(--ink); color: var(--bg); }
.code-block {
  margin: 0; padding: 14px 16px; border-radius: var(--r-sm); background: var(--surface-2);
  border: 1px solid var(--line); font-size: 12.5px; line-height: 1.65; overflow-x: auto;
  white-space: pre; color: var(--ink-2);
}

/* ---------------- image ---------------- */
.image-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.drop-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 320px; padding: 28px 22px; border: 1.5px dashed var(--line-2); border-radius: var(--r);
  background: var(--surface-2); text-align: center;
}
.drop-card.is-over { border-color: var(--ink); background: var(--surface); }
.drop-icon { width: 40px; height: 40px; color: var(--ink-3); margin-bottom: 4px; }
.drop-title { font-size: 16px; font-weight: 600; }
.drop-sub { font-size: 13px; color: var(--ink-3); max-width: 34ch; }
.drop-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.drop-status { margin-top: 8px; font-size: 11.5px; color: var(--ink-3); min-height: 16px; }
.image-side { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.image-canvas { width: 100%; max-height: 180px; object-fit: contain; border-radius: var(--r-sm); background: var(--surface-2); display: block; }
.image-palette { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.img-swatch { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.img-swatch:hover { border-color: var(--line-2); }
.img-chip { width: 34px; height: 30px; border-radius: 6px; background: var(--sw); border: 1px solid rgba(0, 0, 0, .1); }
.img-meta { display: grid; gap: 0; text-align: left; }
.img-hex { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em; }
.img-share { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.img-ratio { font-family: var(--mono); font-size: 10px; color: var(--ink-3); text-align: right; }
.image-export { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-btn { border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); padding: 7px 13px; font-size: 12px; }
.mini-btn:hover { border-color: var(--ink); }
.empty-note { font-size: 12.5px; color: var(--ink-3); }

/* ---------------- maths ---------------- */
.math { padding: clamp(48px, 8vw, 88px) 0; border-top: 1px solid var(--line); }
.math-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 4vw, 48px); align-items: start; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 16px; }
.steps li { position: relative; padding-left: 44px; counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 12px; color: var(--ink-2);
}
.steps b { display: block; font-size: 15px; font-weight: 600; }
.steps span { display: block; margin-top: 3px; font-size: 14px; color: var(--ink-2); max-width: 52ch; }
.threshold-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.threshold-table caption { text-align: left; padding-bottom: 10px; font-size: 12px; color: var(--ink-3); }
.threshold-table th, .threshold-table td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); }
.threshold-table th { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.threshold-table td:last-child, .threshold-table th:last-child { text-align: right; }
.math-note { margin-top: 28px; max-width: 76ch; font-size: 14px; color: var(--ink-2); }

/* ---------------- why, privacy, faq ---------------- */
.why { padding: clamp(40px, 7vw, 76px) 0; border-top: 1px solid var(--line); }
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.why-card { padding: 22px 22px 24px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.why-card h3 { font-size: 15.5px; }
.why-card p { margin-top: 9px; font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }
.priv-strip { padding: 0 0 clamp(40px, 7vw, 72px); }
.priv-inner {
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  padding: 28px 30px; border-radius: var(--r); background: var(--ink); color: var(--bg);
}
.priv-inner h2 { font-size: clamp(1.3rem, 2.4vw, 1.75rem); }
.priv-inner p { margin-top: 8px; font-size: 14px; opacity: .8; max-width: 60ch; }
.priv-inner .text-link { color: var(--bg); border-color: currentColor; }
.text-link { font-size: 13.5px; font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--line-2); padding-bottom: 1px; white-space: nowrap; }
.faq { padding: 0 0 clamp(40px, 7vw, 72px); }
.faq-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.qa { border-bottom: 1px solid var(--line); padding: 16px 0; }
.qa summary { cursor: pointer; list-style: none; font-size: 15px; font-weight: 600; display: flex; align-items: baseline; gap: 12px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; margin-left: auto; font-family: var(--mono); font-weight: 400; color: var(--ink-3); }
.qa[open] summary::after { content: "–"; }
.qa p { margin-top: 10px; font-size: 14px; line-height: 1.7; color: var(--ink-2); max-width: 78ch; }

/* ---------------- footer ---------------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 40px 0 44px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr .9fr .9fr auto; gap: 28px; align-items: start; }
.footer-brand .brand { margin-bottom: 10px; }
.footer-brand p { font-size: 13px; color: var(--ink-3); max-width: 30ch; }
.footer-links h3 { font-size: 10.5px; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.footer-links ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, auto); gap: 6px 16px; }
.footer-links li a { font-size: 13px; color: var(--ink-2); text-decoration: none; }
.footer-links li a:hover { color: var(--ink); text-decoration: underline; }
.footer-note { font-size: 11.5px; color: var(--ink-3); letter-spacing: 0.04em; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); z-index: 80;
  padding: 9px 16px; border-radius: 999px; background: var(--ink); color: var(--bg);
  font-size: 12.5px; opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- responsive ---------------- */
@media (max-width: 1000px) {
  .site-nav { display: none; }
  .hero { grid-template-columns: 1fr; }
  .specimen { max-width: 520px; }
  .contrast-grid, .convert-top, .math-grid, .image-grid { grid-template-columns: 1fr; }
  .fix-card { grid-template-columns: 1fr; }
  .palette-bar { grid-template-columns: 1fr; }
  .measure-row { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .wrap { width: min(100% - 28px, var(--wrap)); }
  .header-inner { height: 58px; gap: 12px; }
  .brand-tool { display: none; }
  .facts { grid-template-columns: repeat(2, 1fr); gap: 16px 20px; }
  .pair-row { grid-template-columns: 1fr; }
  .swap { justify-self: center; transform: rotate(90deg); }
  .preview-h { font-size: 21px; }
  .check { grid-template-columns: 1fr auto 50px; }
  .format-list li { grid-template-columns: 1fr auto; row-gap: 3px; }
  .fmt-name { grid-column: 1 / 2; }
  .fmt-value { grid-column: 1 / 2; }
  .fmt-copy { grid-row: 1 / 3; grid-column: 2 / 3; align-self: center; }
  .palette-strip { grid-template-columns: repeat(2, 1fr); }
  .pal-strip .pal:nth-child(5) { grid-column: 1 / -1; }
  .palette-strip .pal:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .priv-inner { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links ul { grid-template-columns: repeat(3, auto); }
  .tabs { width: 100%; justify-content: space-between; }
  .tab { padding: 7px 11px; font-size: 12.5px; }
  .image-canvas { max-height: 150px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------------- document pages (about, privacy, terms, 404) ---------------- */
main.narrow { max-width: 780px; padding: clamp(36px, 6vw, 64px) 0 clamp(48px, 7vw, 80px); }
.doc h1 { font-size: clamp(1.9rem, 4vw, 2.5rem); letter-spacing: -0.03em; }
.doc .updated { margin-top: 10px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.lede-doc { margin-top: 14px; font-size: 17px; line-height: 1.6; color: var(--ink-2); }
.doc h2 { margin-top: 34px; font-size: 1.12rem; }
.doc p { margin-top: 10px; font-size: 15px; line-height: 1.72; color: var(--ink-2); }
.doc ul { margin: 10px 0 0; padding-left: 20px; font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.doc li { margin-top: 4px; }
.doc code, .doc .mono { font-family: var(--mono); font-size: 0.92em; }
.doc a { color: inherit; }
.doc a:hover { color: var(--ink); }

/* Pikkola funnel: one book, one coffee, placed after the tool.
   Uses each site's own tokens with fallbacks so it inherits the local palette. */

.funnel {
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem);
}

.funnel-head {
  margin: 0 0 1rem;
  font-family: var(--sans, var(--font, inherit));
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint, var(--muted, var(--ink-3, currentColor)));
}

.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(--border, var(--line, rgba(127, 127, 127, 0.25)));
  border-radius: var(--radius, var(--r, 10px));
  background: var(--surface, var(--panel, transparent));
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.funnel-card:hover,
.funnel-card:focus-visible {
  border-color: var(--accent, currentColor);
  background: var(--surface-2, var(--panel-2, var(--accent-soft, transparent)));
}

.funnel-card:focus-visible {
  outline: 2px solid var(--accent, currentColor);
  outline-offset: 2px;
}

.funnel-kicker {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted, var(--ink-3, currentColor));
}

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

.funnel-title {
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
  word-break: keep-all;
}

.funnel-sub {
  max-width: 36ch;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted, var(--ink-3, currentColor));
  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(--border, var(--line, rgba(127, 127, 127, 0.25)));
  border-radius: 999px;
  font-family: var(--mono, monospace);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.funnel-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent, currentColor);
}

.funnel-card-coffee .funnel-cta {
  font-family: var(--mono, monospace);
  font-size: 11.5px;
  font-weight: 500;
  word-break: normal;
  overflow-wrap: anywhere;
}

.funnel-arrow {
  flex: none;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s ease;
}

.funnel-card:hover .funnel-arrow {
  transform: translateX(2px);
}

@media (max-width: 760px) {
  .funnel-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .funnel-card,
  .funnel-arrow {
    transition: none;
  }
}
