/* Pikkola Lottie: cream paper, ink and one violet accent from the lab, with the
   animation plate left quiet enough that its own colours are the only bright
   thing on the page. Weights stay at 400 to 700. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/tools/lottie/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/lottie/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"] h1,
html[lang="ja"] h2,
html[lang="ja"] h3,
html[lang="ja"] p,
html[lang="ja"] li,
html[lang="ja"] summary { line-break: strict; overflow-wrap: break-word; word-break: auto-phrase; }
html[lang="ja"] .hero h1 { max-width: 15ch; font-size: clamp(1.95rem, 3.9vw, 3.1rem); }

html[data-theme="light"] {
  --bg: #f2f0e8;
  --bg-2: #e9e6dc;
  --surface: #fdfcf7;
  --surface-2: #f6f4ec;
  --ink: #15181a;
  --ink-2: #444a4d;
  --ink-3: #767c7e;
  --line: #dedacd;
  --line-2: #c6c1b2;
  --accent: #4b3a72;
  --accent-ink: #faf8ff;
  --accent-soft: #e8e3f3;
  --hot: #b6432e;
  --hot-soft: #f4ded6;
  --ok: #2f6b4f;
  --ok-soft: #e2efe7;
  --paper: #ffffff;
  --shadow: 0 24px 60px -32px rgba(22, 30, 26, 0.38);
  --shadow-sm: 0 10px 24px -18px rgba(22, 30, 26, 0.42);
  --header: rgba(242, 240, 232, 0.86);
  --funnel-bg: #1b1812;
  --funnel-ink: #f6f0e3;
  --funnel-line: rgba(246, 240, 227, 0.18);
  --checker-a: #ffffff;
  --checker-b: #e8e5da;
}
html[data-theme="dark"] {
  --bg: #101314;
  --bg-2: #171b1c;
  --surface: #1a1f20;
  --surface-2: #202627;
  --ink: #eef1ec;
  --ink-2: #c0c8c4;
  --ink-3: #8e9793;
  --line: #2b3233;
  --line-2: #3d4647;
  --accent: #c2b3ea;
  --accent-ink: #141024;
  --accent-soft: #241f36;
  --hot: #e08169;
  --hot-soft: #3a241f;
  --ok: #8fd0aa;
  --ok-soft: #1d2f26;
  --paper: #fbfaf6;
  --shadow: 0 28px 70px -30px rgba(0, 0, 0, 0.8);
  --shadow-sm: 0 12px 28px -18px rgba(0, 0, 0, 0.8);
  --header: rgba(16, 19, 20, 0.86);
  --funnel-bg: #231f18;
  --funnel-ink: #f3ecdd;
  --funnel-line: rgba(243, 236, 221, 0.16);
  --checker-a: #22282a;
  --checker-b: #1a1f20;
}
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

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

html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.66;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(720px 460px at 88% -8%, rgba(75, 58, 114, 0.10), transparent 70%),
    radial-gradient(560px 380px at 2% 6%, rgba(75, 58, 114, 0.05), transparent 72%);
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
svg { display: block; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.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: 16px; top: -60px; z-index: 40;
  background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: var(--r-sm); text-decoration: none; font-size: 14px;
}
.skip-link:focus { top: 14px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

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

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--header);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 26px; height: 66px; }
.brand { display: inline-flex; align-items: baseline; gap: 7px; text-decoration: none; font-weight: 600; letter-spacing: -0.02em; }
.brand-mark { width: 26px; height: 26px; color: var(--accent); align-self: center; }
.brand-name { font-size: 17px; }
.brand-tool {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); border-left: 1px solid var(--line-2); padding-left: 8px;
}
.site-nav { display: flex; gap: 20px; margin-left: auto; font-size: 14px; }
.site-nav a { text-decoration: none; color: var(--ink-2); padding: 4px 0; border-bottom: 1px solid transparent; }
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--ink-3); }
.header-tools { display: flex; align-items: center; gap: 10px; }
.lang-field { position: relative; display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); }
.lang-globe { width: 16px; height: 16px; margin-left: 6px; pointer-events: none; position: absolute; left: 0; }
.lang-field select {
  appearance: none; background: transparent; border: 1px solid var(--line-2); border-radius: 999px;
  color: var(--ink-2); font-size: 12.5px; padding: 6px 10px 6px 26px; cursor: pointer;
}
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.icon-btn svg { width: 17px; height: 17px; }
html[data-theme="light"] .ico-sun { display: none; }
html[data-theme="dark"] .ico-moon { display: none; }

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

.hero {
  display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 46px; align-items: center;
  padding-top: 72px; padding-bottom: 60px;
}
.eyebrow {
  font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 14px;
}
.hero h1 { font-size: clamp(2.1rem, 4.3vw, 3.4rem); line-height: 1.03; letter-spacing: -0.035em; max-width: 16ch; }
.hero-lede { margin-top: 22px; font-size: 17px; color: var(--ink-2); max-width: 54ch; }
.hero-note { margin-top: 22px; font-size: 11px; letter-spacing: 0.03em; color: var(--ink-3); }
.facts { display: flex; gap: 34px; margin: 34px 0 0; padding: 0; flex-wrap: wrap; }
.facts div { display: flex; flex-direction: column; gap: 2px; }
.facts dt { font-family: var(--mono); font-size: 22px; font-weight: 500; color: var(--ink); }
.facts dd { margin: 0; font-size: 12px; color: var(--ink-3); letter-spacing: 0.02em; }

.hero-art { position: relative; display: grid; place-items: center; min-height: 340px; padding-bottom: 30px; }
.art-block {
  width: min(430px, 100%); padding: 22px 22px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: var(--shadow); transform: rotate(-0.8deg);
}
.art-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.art-head .art-tag { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; color: var(--ink-3); text-transform: uppercase; }
.art-cidr { font-family: var(--mono); font-size: 19px; color: var(--ink); letter-spacing: -0.02em; }
.art-foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.art-foot span { font-size: 10px; letter-spacing: 0.06em; color: var(--ink-3); }
.lot-plate-stage {
  height: 208px; border-radius: 4px; overflow: hidden;
  background: radial-gradient(120% 100% at 50% 0%, var(--surface-2), var(--paper));
  border: 1px solid var(--line);
}
.lot-plate-stage > div { width: 100%; height: 100%; }
.lot-plate-palette { display: flex; align-items: center; gap: 7px; margin-top: 12px; }
.swatch { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.12); display: inline-block; }
.sw-violet { background: #4b3a72; }
.sw-clay { background: #b6432e; }
.lot-plate-note { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-left: auto; }

/* ---------- sections ---------- */

.section { padding-top: 62px; padding-bottom: 62px; border-top: 1px solid var(--line); }
.section[id] { scroll-margin-top: 84px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; margin-bottom: 30px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.5rem, 2.7vw, 2.05rem); }
.section-lede { max-width: 46ch; color: var(--ink-2); font-size: 15.5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: 9px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--ink);
  font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--ink-3); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 88%, var(--bg)); }
.btn.small { height: 34px; font-size: 12px; padding: 0 12px; }
.btn.tiny { height: 28px; font-size: 11px; padding: 0 9px; border-radius: 7px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ---------- the studio shell ---------- */

.tool-shell {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 20px 22px 24px; box-shadow: var(--shadow); position: relative;
}
.lot-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.lot-samples { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.seg-label {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3);
  font-family: var(--mono); margin-right: 4px;
}
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-2); font-size: 12px; cursor: pointer;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip-n { font-size: 9px; letter-spacing: 0.08em; opacity: 0.65; }
.lot-bar-actions { display: flex; gap: 7px; margin-left: auto; }

.lot-grid {
  display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.42fr) minmax(0, 0.86fr);
  gap: 14px; align-items: stretch;
}
.lot-grid-low { grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr); margin-top: 14px; }
.lot-col, .lot-panel {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 14px 12px; display: flex; flex-direction: column; min-width: 0;
}
.lot-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.lot-head h3 { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.lot-size { font-size: 10.5px; color: var(--ink-3); }
.lot-hint { font-size: 12px; color: var(--ink-3); line-height: 1.55; margin-bottom: 10px; }
.mini { font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); }

/* source */

.lot-code {
  width: 100%; flex: 1; min-height: 150px; max-height: 230px; resize: vertical;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 10px; color: var(--ink-2); font-family: var(--mono); font-size: 10.5px; line-height: 1.55;
  white-space: pre; overflow: auto; tab-size: 2;
}
.lot-code:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.lot-source-foot { display: flex; gap: 6px; margin-top: 8px; }
.lot-drop {
  margin-top: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 13px 10px; border: 1px dashed var(--line-2); border-radius: 10px;
  cursor: pointer; background: transparent; text-align: center;
}
.lot-drop:hover, .lot-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.lot-drop-title { font-size: 12px; color: var(--ink-2); }
.lot-drop-sub { font-size: 10.5px; color: var(--ink-3); }
.lot-error { margin-top: 10px; border: 1px solid var(--hot); background: var(--hot-soft); border-radius: 9px; padding: 9px 10px; }
.lot-error-title { font-size: 11.5px; font-weight: 600; color: var(--hot); }
.lot-error-text { font-size: 11px; color: var(--ink-2); margin-top: 3px; font-family: var(--mono); line-height: 1.5; word-break: break-word; }

/* stage */

.lot-col-stage { gap: 0; }
.lot-stage-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 10.5px; color: var(--ink-3); }
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px;
  border-radius: 999px; border: 1px solid var(--line-2); font-family: var(--mono); font-size: 9.5px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); background: var(--surface);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.pill.is-ready .dot { background: var(--ok); }
.pill.is-play .dot { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.pill.is-bad .dot { background: var(--hot); }

.lot-stage {
  position: relative; height: 342px; border-radius: 11px; border: 1px solid var(--line);
  overflow: hidden; flex: 1 1 auto; min-height: 220px;
  display: grid; place-items: center;
}
.lot-bg-paper { background: var(--paper); }
.lot-bg-dark { background: #15181a; }
.lot-bg-checker {
  background-color: var(--checker-a);
  background-image:
    linear-gradient(45deg, var(--checker-b) 25%, transparent 25%, transparent 75%, var(--checker-b) 75%),
    linear-gradient(45deg, var(--checker-b) 25%, transparent 25%, transparent 75%, var(--checker-b) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 9px 9px;
}
.lot-host { position: absolute; inset: 0; }
.lot-host canvas { display: block; width: 100% !important; height: 100% !important; }
.lot-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); font-size: 13px; }
.lot-warn {
  display: flex; align-items: flex-start; gap: 7px; margin-top: 8px;
  border: 1px solid color-mix(in srgb, var(--hot) 45%, var(--line)); background: var(--hot-soft);
  border-radius: 8px; padding: 7px 9px; font-size: 11px; color: var(--ink-2); line-height: 1.5;
}
.lot-warn-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--hot); margin-top: 6px; flex: 0 0 auto; }

.lot-transport { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 10px; }
.lot-play { height: 32px; padding: 0 12px; font-size: 12px; }
.lot-play .ico-pause { display: none; }
.lot-play[aria-pressed="true"] .ico-play { display: none; }
.lot-play[aria-pressed="true"] .ico-pause { display: block; }
.lot-restart { width: 30px; height: 30px; }
.lot-clock { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-2); }
.lot-clock-sep { color: var(--ink-3); }
.lot-field { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.select-wrap { position: relative; display: inline-flex; }
.select {
  appearance: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: 7px;
  color: var(--ink); font-family: var(--mono); font-size: 11px; padding: 4px 20px 4px 8px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 11px) 52%, calc(100% - 7px) 52%;
  background-size: 4px 4px, 4px 4px; background-repeat: no-repeat;
}
.lot-check { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); cursor: pointer; }
.lot-check input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--accent); margin: 0; }
.lot-scrub { display: flex; align-items: center; gap: 9px; margin-top: 8px; }
.lot-scrub input[type="range"] { flex: 1; accent-color: var(--accent); height: 16px; }
.lot-frame { font-size: 10.5px; color: var(--ink-3); min-width: 62px; text-align: right; }
.lot-bg-row { display: flex; align-items: center; gap: 9px; margin-top: 9px; flex-wrap: wrap; }
.lot-bg-note { font-size: 10.5px; color: var(--ink-3); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button {
  background: transparent; border: 0; padding: 4px 10px; font-size: 11px; color: var(--ink-2); cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.is-on { background: var(--ink); color: var(--bg); }

/* palette and layers */

.lot-tabs { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; }
.lot-tabs button { background: transparent; border: 0; padding: 4px 10px; font-size: 10.5px; color: var(--ink-2); cursor: pointer; }
.lot-tabs button.is-on { background: var(--accent); color: var(--accent-ink); }
.lot-tab-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.lot-palette, .lot-layers { list-style: none; margin: 0; padding: 0; overflow: auto; max-height: 296px; flex: 1; }
.pal-row {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 5px 2px; border-bottom: 1px solid var(--line);
}
.pal-row:last-child { border-bottom: 0; }
.pal-swatch {
  width: 22px; height: 22px; padding: 0; border: 1px solid var(--line-2); border-radius: 6px;
  background: transparent; cursor: pointer; overflow: hidden; position: relative;
}
.pal-swatch input[type="color"] {
  position: absolute; inset: -6px; width: 40px; height: 40px; border: 0; padding: 0; cursor: pointer; background: transparent;
}
.pal-meta { min-width: 0; }
.pal-hex {
  width: 100%; background: transparent; border: 1px solid transparent; border-radius: 5px;
  font-family: var(--mono); font-size: 11px; color: var(--ink); padding: 2px 4px;
}
.pal-hex:hover { border-color: var(--line); }
.pal-hex:focus { border-color: var(--accent); outline: none; background: var(--surface); }
.pal-kinds { font-size: 9.5px; color: var(--ink-3); letter-spacing: 0.02em; }
.pal-count { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.lot-palette-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.lot-palette-foot .mono { flex: 1 1 100%; font-size: 10px; color: var(--ink-3); }
.lot-palette-foot .btn { margin-left: auto; }

.lay-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 7px; align-items: center; padding: 5px 2px; border-bottom: 1px solid var(--line); }
.lay-row:last-child { border-bottom: 0; }
.lay-row.is-hidden .lay-name { text-decoration: line-through; color: var(--ink-3); }
.lay-eye { width: 20px; height: 20px; display: grid; place-items: center; background: transparent; border: 0; color: var(--ink-3); cursor: pointer; }
.lay-eye:hover { color: var(--ink); }
.lay-eye svg { width: 14px; height: 14px; }
.lay-name { font-size: 11.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lay-type { font-family: var(--mono); font-size: 9px; letter-spacing: 0.05em; color: var(--ink-3); text-transform: uppercase; }

/* weight and export */

.lot-panel h3 { font-size: 12px; }
.lot-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px 10px; margin-bottom: 12px; }
.lot-check-num { gap: 5px; }
.lot-num {
  width: 46px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px;
  padding: 2px 5px; font-family: var(--mono); font-size: 11px; color: var(--ink);
}
.lot-weight { margin-top: auto; }
.lot-weight-bar { height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; }
.lot-weight-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--ok)); border-radius: 999px; transition: width 0.35s ease; }
.lot-weight-nums { display: flex; align-items: baseline; gap: 7px; margin: 7px 0 12px; font-size: 11px; color: var(--ink-2); }
.lot-arrow { color: var(--ink-3); }
.lot-saved { margin-left: auto; color: var(--ok); }
.lot-panel .btn { align-self: flex-start; }

.lot-export-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px solid var(--line); }
.lot-export-last { border-bottom: 0; padding-bottom: 0; }
.lot-export-row .mini { flex: 1 1 160px; }
.lot-export-row .select { padding-top: 3px; padding-bottom: 3px; }
.lot-inline { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--ink-3); }
.lot-sheet-note { font-size: 10px; color: var(--ink-3); padding: 5px 0 0; }

/* sample cards */

.lot-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.lot-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px; display: flex; flex-direction: column; gap: 7px;
}
.lot-card-art { height: 96px; display: grid; place-items: center; background: var(--surface-2); border-radius: 9px; margin-bottom: 4px; }
.lot-card-art svg { width: 84px; height: 84px; }
.card-num { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: var(--accent); }
.lot-card h3 { font-size: 15px; }
.lot-card p { font-size: 12.5px; color: var(--ink-2); }
.lot-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.lot-card-actions .mono { font-size: 10px; color: var(--ink-3); }

/* ---------- rules ---------- */

.rule-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rule-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.rule-card .rule-num { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: 0.1em; }
.rule-card h3 { margin-top: 8px; font-size: 16px; }
.rule-card p { margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }

.format-table { margin-top: 22px; overflow-x: auto; }
.format-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.format-table caption { text-align: left; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 10px; }
.format-table th, .format-table td { text-align: left; padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.format-table thead th { border-top: 0; border-bottom: 1px solid var(--line-2); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.format-table td { color: var(--ink-2); font-size: 12.5px; }
.format-table td:first-child { font-family: var(--mono); color: var(--ink); white-space: nowrap; }
.format-table tbody tr:hover { background: var(--surface-2); }
.lot-legal { margin-top: 18px; font-size: 12px; color: var(--ink-3); max-width: 78ch; }

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

.faq-section { padding-top: 54px; }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; padding: 18px 30px 18px 0; font-size: 15.5px; font-weight: 500;
  list-style: none; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 16px; color: var(--ink-3);
}
.faq details[open] summary::after { content: "−"; color: var(--accent); }
.faq details p { padding: 0 0 20px; color: var(--ink-2); font-size: 14.5px; max-width: 78ch; }

/* ---------- funnel ---------- */

.funnel {
  background: var(--funnel-bg);
  color: var(--funnel-ink);
  padding: clamp(44px, 5.5vw, 64px) 0;
  border-top: 1px solid var(--line);
}
.funnel-head { font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.55; margin-bottom: 18px; }
.funnel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.funnel-card {
  display: flex; flex-direction: column; gap: 9px; padding: 22px;
  border-radius: 14px; border: 1px solid var(--funnel-line);
  color: var(--funnel-ink); text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.funnel-card:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.34); }
.funnel-kicker { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.14em; opacity: 0.6; }
.funnel-title { font-size: 1.42rem; font-weight: 500; letter-spacing: -0.015em; line-height: 1.2; }
.funnel-sub { font-size: 0.84rem; opacity: 0.72; line-height: 1.6; max-width: 44ch; }
.funnel-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.funnel-price { font-family: var(--mono); font-size: 0.9rem; }
.funnel-cta { display: inline-flex; align-items: center; gap: 7px; font-size: 0.82rem; padding-bottom: 2px; border-bottom: 1px solid var(--funnel-line); }
.funnel-arrow { width: 15px; height: 15px; }

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

.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rel-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px; text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.rel-card:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.rel-kicker { font-size: 10px; letter-spacing: 0.1em; color: var(--accent); }
.rel-card h3 { font-size: 16px; }
.rel-card p { font-size: 13px; color: var(--ink-3); }
.rel-open { margin-top: auto; font-size: 12px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px; }
.rel-open::after { content: "→"; font-family: var(--mono); }

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

.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); margin-top: 40px; padding: 40px 0 46px; position: relative; z-index: 1; }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 30px; align-items: start; }
.footer-brand .brand-name { font-weight: 600; font-size: 16px; }
.footer-brand .brand-tool { margin-left: 8px; }
.footer-tagline { margin-top: 10px; font-size: 13px; color: var(--ink-3); max-width: 46ch; }
.footer-note { margin-top: 10px; font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.04em; }
.footer-links { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.footer-legal { font-size: 12px; color: var(--ink-3); }

/* ---------- toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 14px);
  background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: 999px; font-size: 13.5px;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.6);
  opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease; z-index: 120;
  max-width: calc(100vw - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.noscript { padding: 30px 0; color: var(--ink-2); font-size: 14px; }

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

.doc { max-width: 780px; padding: 56px 0 70px; }
.doc h1 { font-size: clamp(1.9rem, 3.4vw, 2.5rem); }
.doc .updated { margin-top: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--ink-3); text-transform: uppercase; }
.doc-lede { margin-top: 20px; font-size: 17px; color: var(--ink-2); }
.doc h2 { margin-top: 36px; font-size: 1.22rem; }
.doc h3 { margin-top: 24px; font-size: 1.02rem; }
.doc p, .doc li { font-size: 15px; color: var(--ink-2); }
.doc p { margin-top: 12px; }
.doc ul { margin: 12px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; }
.doc a { color: var(--accent); text-underline-offset: 3px; }
.doc code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.doc .doc-foot { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }

.notfound { padding: 96px 0 110px; max-width: 620px; }
.notfound h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
.notfound p { margin-top: 16px; color: var(--ink-2); }
.notfound .btn { margin-top: 26px; text-decoration: none; }

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

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; gap: 30px; padding-top: 52px; padding-bottom: 48px; }
  .hero-art { min-height: 280px; order: -1; }
  .lot-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
  .lot-col-palette { grid-column: 1 / -1; }
  .lot-palette, .lot-layers { max-height: 220px; }
  .lot-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rule-cards { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 22px; }
  .footer-links { flex-direction: row; flex-wrap: wrap; gap: 16px; }
}
@media (max-width: 860px) {
  .lot-grid, .lot-grid-low { grid-template-columns: minmax(0, 1fr); }
  .lot-col-palette { grid-column: auto; }
  .funnel-grid { grid-template-columns: minmax(0, 1fr); }
  .related-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 18px; }
  .site-nav { display: none; }
  .header-inner { height: 60px; }
  .header-tools { margin-left: auto; }
  .section { padding-top: 44px; padding-bottom: 44px; }
  .section-head { gap: 12px; margin-bottom: 22px; }
  .section-lede { font-size: 14.5px; }
  .hero h1 { max-width: none; }
  .facts { gap: 24px; }
  .tool-shell { padding: 14px 12px 18px; border-radius: 16px; }
  .lot-bar-actions { margin-left: 0; }
  .lot-stage { height: 264px; }
  .lot-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lot-cards { grid-template-columns: 1fr; }
  .lot-export-row .mini { flex: 1 1 100%; }
  .art-block { transform: none; }
  .doc { padding: 36px 0 54px; }
}
@media (max-width: 460px) {
  .lot-stage-meta { gap: 6px; }
  .lot-stage-meta .mono:nth-of-type(3), .lot-stage-meta .mono:nth-of-type(4) { display: none; }
  .lot-field { margin-left: 0; }
  .lot-opts { grid-template-columns: 1fr; }
  .format-table th, .format-table td { padding: 8px 8px; font-size: 12px; }
  .funnel-title { font-size: 1.22rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* the hidden instance that draws an export, and the canvases the player makes */
.lot-export-stage {
  position: fixed; left: -20000px; top: 0; pointer-events: none; opacity: 0;
  overflow: hidden; z-index: -1;
}
.lot-canvas { display: block; }

/* the one click palettes above the colour list */
.lot-quick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.lot-quick .mini { margin-right: 2px; }
.quick-dot {
  display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 7px 0 5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  font-size: 10.5px; color: var(--ink-2); cursor: pointer;
}
.quick-dot:hover { border-color: var(--ink-3); color: var(--ink); }
.quick-dot i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.quick-dot span { margin-left: 3px; }
.sw-sage { background: #2f6b4f; }
.sw-forest { background: #2f6b4f; }
.sw-moss { background: #7a8b3a; }
.sw-bark { background: #b6432e; }
.sw-ink { background: #15181a; }
.sw-slate { background: #6b6f70; }
.sw-stone { background: #c6c1b2; }
