:root {
  --bg: #f3efe6;
  --bg-2: #ebe5d8;
  --surface: #fffdf8;
  --ink: #14161c;
  --ink-2: #3a3f4b;
  --muted: #6b7180;
  --line: #ddd5c6;
  --brass: #9a7b4f;
  --brass-2: #b8955f;
  --good: #2f6b55;
  --bad: #a6403a;
  --focus: #2a5bd7;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 22, 28, .05), 0 12px 32px rgba(20, 22, 28, .08);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111318;
    --bg-2: #171a21;
    --surface: #1b1f27;
    --ink: #f1ece2;
    --ink-2: #cfc8bb;
    --muted: #979cab;
    --line: #2c313c;
    --brass: #d1ad74;
    --brass-2: #e2c08a;
    --good: #6cc3a0;
    --bad: #ef8a80;
    --focus: #8fb0ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.mono, code, pre, textarea { font-family: var(--mono); }
code { font-size: .9em; background: var(--bg-2); padding: .1em .35em; border-radius: 5px; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* nav */
.nav { position: sticky; top: 0; z-index: 5; backdrop-filter: saturate(1.2) blur(10px); background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: inline-flex; gap: 8px; align-items: center; font: 600 20px/1 var(--serif); text-decoration: none; letter-spacing: .01em; }
.logo svg { width: 22px; height: 22px; fill: none; stroke: var(--brass); stroke-width: 1.6; }
.nav nav { display: flex; gap: 22px; font-size: 14px; }
.nav nav a { text-decoration: none; color: var(--ink-2); }
.nav nav a:hover { color: var(--ink); }
.nav .gh { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; }

/* type */
.eyebrow { margin: 0 0 10px; font: 600 12px/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--brass); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.012em; margin: 0; }
h1 { font-size: clamp(36px, 4.6vw, 56px); line-height: 1.05; }
h1 em { font-style: italic; color: var(--brass); }
.section-title { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; margin-bottom: 28px; }
.lead { font-size: 19px; line-height: 1.55; color: var(--ink-2); max-width: 36em; margin: 22px 0 0; }
.lead.small { font-size: 17px; margin-top: 0; }
.fine { font-size: 13px; color: var(--muted); max-width: 60em; margin-top: 18px; }
.opt { font-weight: 400; color: var(--muted); font-size: 13px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: transform .12s ease, background .2s ease, border-color .2s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--brass)); }
.btn.primary:disabled { opacity: .35; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink-2); }
.btn.wide { width: 100%; }
.btn:disabled, .btn.is-disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.link { background: none; border: 0; padding: 0; color: var(--brass); font: 600 14px var(--sans); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* hero */
.hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; align-items: center; padding: 72px 0 56px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.trust { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 14px; color: var(--muted); }
.trust li { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }

.hero-art { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.hero-art figcaption { font-size: 13px; color: var(--muted); }
.fan { position: relative; width: min(440px, 100%); aspect-ratio: 1 / .86; }
.mini { position: absolute; left: 50%; top: 52%; width: 56%; aspect-ratio: 5 / 6.4; margin: calc(-56% * 6.4 / 5 / 2) 0 0 -28%; background: #fffdf8; color: #14161c; border-radius: 10px; box-shadow: 0 2px 4px rgba(20,22,28,.08), 0 18px 40px rgba(20,22,28,.18); padding: 6% 7%; transform-origin: 50% 120%; transition: transform .6s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; border: 1px solid #e7e0d2; }
.mini header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1.5px solid #14161c; padding-bottom: 6px; font: 600 13px var(--serif); }
.mini header span:last-child { font: 700 10px var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.mini .mini-qr { margin: 9% auto 6%; width: 74%; }
.mini .mini-qr svg { width: 100%; height: auto; display: block; }
.mini .mini-rows { font: 9px/1.6 var(--mono); letter-spacing: .06em; color: #5d6472; white-space: pre; overflow: hidden; }
.fan:hover .mini { transition-duration: .4s; }

/* problem */
.problem { padding: 40px 0 24px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.tile h3 { font-size: 21px; margin-bottom: 8px; }
.tile p { margin: 0; color: var(--ink-2); font-size: 15px; }
.tile-tag { font: 600 12px var(--sans) !important; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 10px !important; }
.tile.bad .tile-tag { color: var(--bad); }
.tile.good { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 25%, transparent); }
.tile.good .tile-tag { color: var(--good); }

/* app */
.app { padding: 72px 0 24px; scroll-margin-top: 70px; }
.app-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; }
.app-head .section-title { margin-bottom: 18px; }
.tabs { display: inline-flex; padding: 4px; background: var(--bg-2); border-radius: 999px; margin-bottom: 18px; }
.tabs button { border: 0; background: none; color: var(--ink-2); font: 600 14px var(--sans); padding: 10px 18px; border-radius: 999px; cursor: pointer; min-height: 40px; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: clamp(18px, 3vw, 34px); }

.field { display: flex; flex-direction: column; gap: 8px; margin: 0 0 22px; border: 0; padding: 0; min-width: 0; }
.field > label, legend { font-weight: 600; font-size: 15px; padding: 0; }
.field-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.field-head label:first-child { font-weight: 600; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
input[type="text"], input[type="number"], textarea, select { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; line-height: 1.55; font-size: 14px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }

.secret-box { position: relative; }
.secret-box textarea { padding-right: 48px; }
textarea.masked { -webkit-text-security: disc; }
.icon-btn { position: absolute; right: 8px; top: 8px; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { color: var(--ink); background: var(--bg-2); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.icon-btn[aria-pressed="true"] { color: var(--brass); }

.seg { display: inline-flex; background: var(--bg-2); border-radius: 999px; padding: 3px; }
.seg label { position: relative; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg label { padding: 5px 12px; border-radius: 999px; }
.seg label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--focus); }

.kn { display: grid; grid-template-columns: auto auto 1fr; gap: 0 22px; align-items: start; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); }
.stepper button { width: 44px; height: 46px; border: 0; background: none; font-size: 20px; color: var(--ink); cursor: pointer; }
.stepper button:hover { background: var(--bg-2); }
.stepper input { width: 56px; text-align: center; border: 0; border-radius: 0; background: transparent; font-weight: 700; font-size: 18px; padding: 0; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper input:focus { box-shadow: none; }
.kn-visual { padding-top: 26px; }
.pips { display: flex; flex-wrap: wrap; gap: 6px; }
.pip { width: 22px; height: 28px; border-radius: 4px; border: 1.5px solid var(--line); background: var(--bg); position: relative; transition: background .2s, border-color .2s; }
.pip.need { background: var(--ink); border-color: var(--ink); }
.pip::after { content: ""; position: absolute; left: 4px; right: 4px; top: 5px; height: 6px; border-radius: 1px; background: currentColor; opacity: .25; }
.pip.need::after { background: var(--bg); opacity: .6; }
#kn-text { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }

.holders { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.holder { position: relative; }
.holder span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font: 700 12px var(--mono); color: var(--brass); }
.holder input { padding-left: 38px; }

.advanced { margin: 0 0 22px; border-top: 1px solid var(--line); padding-top: 14px; }
.advanced summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.adv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; margin-top: 16px; align-items: center; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; grid-column: 1 / -1; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }

.error { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); font-size: 14px; font-weight: 600; }
.warn { margin: 14px 0; font-size: 14px; color: var(--ink-2); padding: 10px 14px; border-left: 3px solid var(--brass); background: color-mix(in srgb, var(--brass) 9%, transparent); border-radius: 0 10px 10px 0; }

.output { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 26px; }
.summary { display: flex; justify-content: space-between; gap: 18px; align-items: center; flex-wrap: wrap; }
.summary-line { margin: 0; font-size: 15px; color: var(--ink-2); }
.summary-actions { display: flex; gap: 10px; flex-wrap: wrap; }
#preview { width: 100%; height: 760px; border: 1px solid var(--line); border-radius: 14px; background: #ece8df; }

.recover-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 28px; align-items: start; }
.recover-grid .field { margin: 0; }
.scan-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.file-btn { position: relative; }
#camera { width: 100%; border-radius: 12px; margin-top: 10px; background: #000; max-height: 340px; object-fit: cover; }
.status { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.progress { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--brass), var(--brass-2)); border-radius: 99px; transition: width .35s ease; }
.bar.full { background: var(--good); }
.progress-text { margin: 10px 0 12px; font-size: 14px; color: var(--ink-2); }
.chips { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 6px; }
.chip { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.chip b { font-family: var(--mono); }
.chip.ok::before { content: "✓"; color: var(--good); font-weight: 700; }
.chip.bad { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.chip.bad::before { content: "✗"; color: var(--bad); font-weight: 700; }
.chip .meta { color: var(--muted); }
.result { margin-top: 18px; }
.secret-out { position: relative; }
#secret-out { margin: 0; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; white-space: pre-wrap; word-break: break-word; font-size: 15px; min-height: 52px; transition: filter .25s; }
#secret-out.blurred { filter: blur(7px); user-select: none; }
.reveal { position: absolute; inset: 0; border: 0; background: transparent; font: 600 14px var(--sans); color: var(--ink); cursor: pointer; }
.result-actions { display: flex; gap: 10px; margin: 12px 0 8px; flex-wrap: wrap; }

/* how */
.how { padding: 80px 0 24px; scroll-margin-top: 70px; }
.how-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.curve-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }
#curve { width: 100%; height: auto; display: block; }
.curve-controls { display: flex; align-items: center; gap: 12px; justify-content: center; font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 18px; }
.steps li { counter-increment: s; position: relative; padding-left: 46px; color: var(--ink-2); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 14px var(--serif); border: 1.5px solid var(--brass); color: var(--brass); }
.steps b { color: var(--ink); display: block; font-family: var(--serif); font-size: 18px; }

/* hood */
.hood { padding: 72px 0 24px; }
.hood-grid .tile h3 { font-size: 19px; }

/* cli */
.cli { display: grid; grid-template-columns: .8fr 1.2fr; gap: 40px; align-items: center; padding: 80px 0 24px; scroll-margin-top: 70px; }
.terminal { margin: 0; background: #0f1116; color: #e8e3d8; border-radius: 16px; padding: 22px 24px; font-size: 13.5px; line-height: 1.7; overflow-x: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25); border: 1px solid #262a33; }
.terminal .p { color: #d1ad74; }
.terminal .ok { color: #6cc3a0; }
.terminal .d { color: #8a8f9c; }

/* faq */
.faq { padding: 80px 0 64px; max-width: 820px; scroll-margin-top: 70px; }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font: 600 18px var(--serif); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::after { content: "+"; color: var(--brass); font-family: var(--sans); font-size: 22px; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { color: var(--ink-2); margin: 10px 0 0; }

.foot { border-top: 1px solid var(--line); padding: 26px 0; font-size: 14px; color: var(--muted); }
.foot-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .hero, .how-grid, .cli, .recover-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 40px; gap: 28px; }
  .grid3 { grid-template-columns: 1fr; }
  .nav nav a:not(.gh) { display: none; }
  .kn { grid-template-columns: auto auto; }
  .kn-visual { grid-column: 1 / -1; padding-top: 0; margin-bottom: 18px; }
  #preview { height: 620px; }
}
@media (max-width: 480px) {
  .adv-grid { grid-template-columns: 1fr; }
  .summary-actions .btn { flex: 1 1 auto; }
  .lead { font-size: 17px; }
}
