/* Kaytey: black on white, set in the system's own sans. */
:root {
  --ink: #0a0a0a;
  --paper: #ffffff;
  --soft: #f5f5f4;
  --line: #e4e4e2;
  --line-strong: #c9c9c6;
  --muted: #5f5f5c;
  --accent: #0a0a0a;
  --ok: #1a7f37;
  --warn: #8a6100;
  --err: #c0271d;
  --radius: 14px;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; }
img { max-width: 100%; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 28px; }
.wrap.narrow { max-width: 800px; }

/* Header */
.top { display: flex; align-items: center; gap: 28px; max-width: 1120px; margin: 0 auto; padding: 18px 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo { width: 34px; height: auto; display: block; }
.wordmark { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; }
.wordmark-light { font-weight: 400; }
.wordmark, .credits, .account button { white-space: nowrap; }
.nav { display: flex; gap: 24px; font-size: 15px; }
.nav a, .footer-nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .footer-nav a:hover { color: var(--ink); }
.credits { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); }

/* Type */
h1, h2, h3 { letter-spacing: -0.025em; }
h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); line-height: 1; font-weight: 800; letter-spacing: -0.045em; margin: 0 0 20px; max-width: 12ch; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.75rem); line-height: 1.08; font-weight: 750; margin: 0 0 28px; }
h3 { font-size: 18px; line-height: 1.3; margin: 0 0 8px; }
.eyebrow { font: 500 13px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 16px; }
.lead { font-size: clamp(1.1rem, 1.8vw, 1.3rem); line-height: 1.5; color: var(--muted); max-width: 40em; margin: 0 0 28px; }

/* Hero */
.hero { padding: 40px 0 8px; }
.flow { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 0; margin: 0 0 32px; font-size: 14px; color: var(--muted); }
.flow li { display: inline-flex; align-items: center; gap: 8px; }
.flow-mark { display: inline-grid; place-items: center; min-width: 44px; height: 30px; padding: 0 8px; border: 1.5px solid var(--ink); border-radius: 8px; font: 600 13px/1 var(--mono); color: var(--ink); }
.flow-arrow { color: var(--line-strong); font-size: 18px; }
.assurances { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 0; margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.assurances li::before { content: "✓"; margin-right: 8px; color: var(--ink); font-weight: 700; }

/* Tool card and workspace */
.step { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 22px; }
.tool { border: 1.5px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); margin: 0; }
.workspace { margin-top: 32px; }
.workspace:not(:has(.step:not([hidden]))) { display: none; }
.step h2 { font-size: 20px; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; letter-spacing: -0.015em; }
.num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 0; }
.row { display: flex; gap: 24px; align-items: stretch; flex-wrap: wrap; }
.copy { flex: 1; min-width: 260px; }
.copy p { margin: 0 0 10px; color: var(--muted); }
.suggest { font-size: 14px; }
.privacy { font-size: 13px; margin-top: 4px; }
.drop { cursor: pointer; position: relative; flex: 0 0 240px; min-height: 240px; border: 1.5px dashed var(--line-strong); border-radius: 10px; background: var(--soft); display: grid; place-items: center; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--ink); background: #ececea; }
.drop-hint { margin: 0; padding: 12px; font-size: 14px; color: var(--muted); text-align: center; }
.thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: 9px; background: var(--soft); }
img.thumb:not([src]) { display: none; }

button, .file, .button { font: inherit; font-weight: 600; font-size: 15px; border: 0; border-radius: 10px; padding: 11px 18px; background: var(--ink); color: #fff; cursor: pointer; text-decoration: none; display: inline-block; line-height: 1.4; }
button:hover:not(:disabled), .file:hover, .button:hover { background: #2a2a2a; }
button:disabled { opacity: .4; cursor: not-allowed; }
button:focus-visible, .button:focus-visible, a:focus-visible, .file:focus-within { outline: 2px solid var(--ink); outline-offset: 3px; }
button.secondary { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
button.secondary:hover:not(:disabled) { background: var(--soft); }
.file { position: relative; overflow: hidden; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 16px 0 12px; }
.family, .language, .format { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.language { margin-top: 14px; }
input:not([type]), input[type="text"], select { font: inherit; font-size: 15px; color: var(--ink); padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--paper); }
input:not([type]):focus, select:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.family input { width: 12em; }

.kind { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kind legend { float: left; padding: 0; margin-right: 6px; color: var(--muted); font-size: 14px; }
.kind label { position: relative; cursor: pointer; }
.kind input { position: absolute; opacity: 0; pointer-events: none; }
.kind span { display: inline-block; padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--line-strong); background: var(--paper); }
.kind input:checked + span { background: var(--ink); color: #fff; box-shadow: none; }
.kind input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.languages-note { margin: 8px 0 0; min-height: 1.2em; }
.error { color: var(--err); font-size: 14px; margin: 0; }
.error:empty { display: none; }

.pipeline { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.sheets { display: grid; gap: 12px; flex: 2 1 480px; min-width: 0; align-content: start; }
.sheets:empty { display: none; }
.check { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; }
.log { flex: 1 1 260px; margin: 0; padding: 12px 16px 12px 32px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; font: 13px/1.7 var(--mono); }
.log .ok { color: var(--ok); }
.log .err { color: var(--err); font-weight: 600; }
.log .warn { color: var(--warn); font-weight: 600; }
.preview { font-size: 52px; line-height: 1.3; padding: 18px 20px; border: 1px dashed var(--line-strong); border-radius: 10px; min-height: 120px; white-space: pre-wrap; outline: none; overflow-wrap: anywhere; }
.preview:focus { border-color: var(--ink); }
.actions { margin: 14px 0 0; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.hint { color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.hint:empty { display: none; }
.step h3 { font-size: 14px; color: var(--muted); font-weight: 600; margin: 22px 0 8px; letter-spacing: 0; }
.step h3 small { font-weight: 400; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.gcell { font: inherit; padding: 0; color: inherit; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); position: relative; display: grid; place-items: center; cursor: pointer; }
.gcell:hover, .gcell:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; background: var(--paper); }
.gcell canvas { display: block; }
.gcell span { position: absolute; top: 2px; left: 5px; font-size: 10px; color: var(--muted); }
.gcell.derived { background: #fafaf9; }
.gcell.generated { background: var(--soft); border-style: dashed; border-color: var(--line-strong); }
.gcell.accent { background: #fafaf9; }
.gcell.edited::after { content: "edited"; position: absolute; bottom: 2px; right: 5px; font-size: 9px; font-weight: 600; color: var(--ink); }

/* Content sections */
.section, .band { padding: 96px 0; }
.band { background: var(--soft); border-block: 1px solid var(--line); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.step-num { display: block; font: 600 14px/1 var(--mono); margin-bottom: 36px; }
.steps p, .card p, .plan p { color: var(--muted); margin: 0; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card { border-top: 2px solid var(--ink); padding-top: 20px; }
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 56px; margin: 0; }
.features div { border-top: 1px solid var(--line-strong); padding-top: 18px; }
.features dt { font-weight: 700; font-size: 18px; letter-spacing: -0.015em; margin-bottom: 6px; }
.features dd { margin: 0; color: var(--muted); }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 36px; }
.plan { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.plan:first-child { border: 1.5px solid var(--ink); }
.plan h3 { font: 500 13px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 18px; }
.plan-price { font-size: 44px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; color: var(--ink) !important; margin-bottom: 14px !important; }
.plan-price span { font-size: 16px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.packs { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.packs li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; font-weight: 600; }
.packs li span { color: var(--muted); font-weight: 500; }
.price-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.price-table caption { text-align: left; font-weight: 700; font-size: 18px; letter-spacing: -0.015em; padding-bottom: 10px; }
.price-table th { text-align: left; font-weight: 400; padding: 12px 0; border-top: 1px solid var(--line); }
.price-table td { text-align: right; font-weight: 600; padding: 12px 0 12px 16px; border-top: 1px solid var(--line); white-space: nowrap; }
.faq details { border-top: 1px solid var(--line-strong); }
.faq details:last-child { border-bottom: 1px solid var(--line-strong); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 40px 20px 0; font-weight: 650; font-size: 18px; letter-spacing: -0.01em; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font: 400 26px/1 var(--sans); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 22px; color: var(--muted); max-width: 44em; }
.cta { text-align: center; }
.cta h2 { max-width: 16ch; margin-inline: auto; }
.button { padding: 14px 26px; font-size: 16px; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 32px 0 40px; }
.footer-row { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.footer .logo { width: 26px; }
.footer .wordmark { font-size: 17px; }
.footer-nav { display: flex; gap: 20px; font-size: 14px; }
.footer-note { margin: 0 0 0 auto; font-size: 14px; color: var(--muted); }

/* Letter editor */
.editor { border: 0; border-radius: var(--radius); padding: 0; width: min(780px, 96vw); max-height: 96vh; color: var(--ink); }
.editor::backdrop { background: rgba(10, 10, 10, .5); }
.ed-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 20px 0; }
.ed-head h2 { margin: 0 0 4px; font-size: 22px; }
.ed-head form { margin: 0; }
.close { background: transparent; color: var(--muted); padding: 4px 8px; font-size: 18px; }
.close:hover:not(:disabled) { background: var(--soft); color: var(--ink); }
.badge { font-size: 12px; color: var(--muted); background: var(--soft); border-radius: 999px; padding: 2px 10px; }
.ed-body { display: grid; grid-template-columns: minmax(0, 400px) 1fr; gap: 18px; padding: 14px 20px; }
.ed-stage { min-width: 0; }
.ed-frame { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; line-height: 0; }
.ed-canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.ed-zoom { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ed-zoom button { padding: 4px 12px; font-size: 14px; background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.ed-zoom button:hover:not(:disabled) { background: var(--paper); box-shadow: inset 0 0 0 1px var(--ink); }
.ed-zoom output { min-width: 52px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.ed-zoom-hint { flex-basis: 100%; font-size: 11px; color: var(--muted); }
.ed-tools fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; margin: 0 0 10px; }
.ed-tools legend { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.ed-tools output { font-weight: 400; }
.ed-tools button { padding: 7px 10px; font-size: 13px; background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.ed-tools button:hover:not(:disabled) { background: var(--paper); box-shadow: inset 0 0 0 1px var(--ink); }
.ed-tools button[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.pair.three { grid-template-columns: 1fr 1fr 1fr; }
.nudge { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.nudge #ed-up { grid-column: 2; grid-row: 1; }
.nudge #ed-left { grid-column: 1; grid-row: 2; }
.nudge #ed-centre { grid-column: 2; grid-row: 2; }
.nudge #ed-right { grid-column: 3; grid-row: 2; }
.nudge #ed-down { grid-column: 2; grid-row: 3; }
.ed-canvas[data-tool="hand"] { cursor: grab; }
.ed-canvas[data-tool="hand"].grabbing { cursor: grabbing; }
.ed-canvas.can-pan { cursor: grab; }
.ed-canvas.panning { cursor: grabbing; }
.slider { display: grid; gap: 2px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.slider input { width: 100%; accent-color: var(--ink); }
.ed-foot { display: flex; gap: 10px; align-items: center; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
#ed-note { margin-right: auto; color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .steps, .plans { grid-template-columns: 1fr; }
  .step-num { margin-bottom: 16px; }
}
@media (max-width: 700px) {
  .wrap, .top { padding-inline: 16px; }
  .top { gap: 12px; padding-block: 14px; }
  .logo { width: 28px; }
  .brand { gap: 8px; }
  .wordmark { font-size: 17px; }
  .account { gap: 8px; }
  .credits { padding: 5px 10px; font-size: 12px; }
  .account button.small { padding: 6px 12px; }
  .nav { display: none; }
  .hero { padding-top: 20px; }
  .flow { gap: 10px 16px; }
  .flow .flow-arrow { display: none; }
  .step { padding: 18px; }
  .tool { box-shadow: 5px 5px 0 var(--ink); }
  .drop { flex-basis: 100%; min-height: 180px; }
  .section, .band { padding: 64px 0; }
  .cards, .features { grid-template-columns: 1fr; }
  .preview { font-size: 36px; }
  .ed-body { grid-template-columns: 1fr; }
  .footer-note { margin-left: 0; flex-basis: 100%; }
}
@media (max-width: 380px) {
  .wordmark-light { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
