/* Clearwrit site. Every colour, radius, space and motion value comes from the app's tokens (assets/tokens.css, synced)
   or from the few site tokens below, which are themselves made of app tokens. The build fails on an undefined var(). */
@font-face { font-family: 'Inter'; src: url('assets/fonts/inter-latin-wght.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --cw-page: var(--bg-dark);
  --cw-band: var(--bg-sidebar);
  --cw-action-bg: var(--brand-green-text);
  --cw-action-fg: var(--on-accent);
  --cw-mark: var(--brand-green-text);
  --cw-focus: 0 0 0 2px var(--cw-page), 0 0 0 4px var(--brand-green-text);
  --cw-max: 1120px;
  --cw-gutter: 16px;
  --cw-h1: clamp(2rem, 5vw, 3.25rem);
  --cw-h2: clamp(1.5rem, 3.2vw, 2.125rem);
  --cw-lead: 1.125rem;
  --cw-body: 1rem;
  --cw-section: clamp(56px, 9vw, 104px);
}
@media (prefers-color-scheme: dark) {
  :root { --cw-action-bg: var(--brand-green); --cw-action-fg: var(--brand-ink); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--cw-page); color: var(--text-primary);
  font-family: var(--font-sans); font-size: var(--cw-body); line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cw-mark); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: none; box-shadow: var(--cw-focus); border-radius: var(--radius-sm); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 var(--space-lg); }
h1 { font-size: var(--cw-h1); font-weight: 800; }
h2 { font-size: var(--cw-h2); font-weight: 750; }
h3 { font-size: 1.125rem; font-weight: 700; margin-bottom: var(--space-sm); }
p { margin: 0 0 var(--space-lg); }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: var(--space-lg); top: var(--space-lg); z-index: 10; background: var(--bg-card); padding: var(--space-sm) var(--space-md); }
.wrap { max-width: var(--cw-max); margin: 0 auto; padding: 0 var(--cw-gutter); }
@media (min-width: 720px) { :root { --cw-gutter: 32px; } }
.muted { color: var(--text-secondary); }
.small { font-size: var(--fs-sm); }
.mono { font-family: var(--font-mono); font-size: var(--fs-sm); word-break: break-all; }

/* header */
.site-head { position: sticky; top: 0; z-index: 5; background: var(--cw-page); border-bottom: 1px solid var(--border-subtle); }
.site-head .wrap { display: flex; align-items: center; gap: var(--space-lg); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: var(--space-sm); text-decoration: none; color: var(--text-primary); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; }
.brand img { width: 32px; height: 32px; }
.brand .writ { color: var(--cw-mark); }
.nav { display: flex; gap: var(--space-xl); margin-left: auto; align-items: center; }
.nav a { color: var(--text-secondary); text-decoration: none; font-size: var(--fs-md); font-weight: 600; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text-primary); }
.nav a.btn-primary, .nav a.btn-primary:hover { color: var(--cw-action-fg); }
@media (max-width: 760px) { .nav a.opt { display: none; } .nav { gap: var(--space-lg); } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm); min-height: 44px;
  padding: 0 var(--space-xl); border-radius: var(--radius-md); font: inherit; font-weight: 650; font-size: var(--fs-md);
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--cw-action-bg); color: var(--cw-action-fg); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-quiet { background: transparent; color: var(--text-primary); border-color: var(--border-strong); }
.btn-quiet:hover { background: var(--fg-04); }
.btn-sm { min-height: 36px; padding: 0 var(--space-lg); font-size: var(--fs-sm); }
.btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }

/* hero */
.hero { padding: clamp(40px, 7vw, 88px) 0 var(--space-2xl); }
.hero-grid { display: grid; gap: var(--space-2xl); align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 5fr 6fr; } }
.eyebrow { display: inline-flex; align-items: center; gap: var(--space-sm); font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: var(--space-lg); }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--cw-mark); }
.lead { font-size: var(--cw-lead); color: var(--text-secondary); max-width: 38em; }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-md); margin-top: var(--space-xl); }
.shot { border-radius: var(--radius-lg); border: 1px solid var(--border-strong); background: var(--bg-card); box-shadow: var(--shadow-deep); overflow: hidden; }
.shot img { width: 100%; }
figure { margin: 0; }
figcaption { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--space-sm); }

/* sections */
.section { padding: var(--cw-section) 0; }
.band { background: var(--cw-band); border-block: 1px solid var(--border-subtle); }
.head { max-width: 720px; margin-bottom: var(--space-2xl); }
.head p { color: var(--text-secondary); font-size: var(--cw-lead); }
.grid { display: grid; gap: var(--space-lg); }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: var(--space-xl); box-shadow: var(--shadow-card); }
.card p:last-child { margin-bottom: 0; }
.card p { color: var(--text-secondary); }
.icon { width: 40px; height: 40px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--success-10); color: var(--cw-mark); margin-bottom: var(--space-lg); }
.icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* drawn illustrations (text variant): every fill and stroke is a token */
.art { border-radius: var(--radius-lg); background: var(--cw-band); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-premium); padding: clamp(8px, 2vw, 20px); }
.art svg { display: block; width: 100%; height: auto; font-family: var(--font-sans); }
.art .a-bg { fill: var(--bg-elevated); stroke: var(--border-subtle); }
.art .a-card { fill: var(--bg-card); stroke: var(--border-strong); stroke-width: 1.5; }
.art .a-card-accent { stroke: var(--cw-mark); }
.art .a-col { fill: var(--fg-04); stroke: var(--border-subtle); }
.art .a-ink { fill: var(--fg-24); }
.art .a-ink-soft { fill: var(--fg-10); }
.art .a-line { fill: var(--border-strong); }
.art .a-accent { fill: var(--cw-action-bg); }
.art .a-soft-accent { fill: var(--success-24); stroke: var(--cw-mark); stroke-width: 3; }
.art .a-on { fill: none; stroke: var(--cw-action-fg); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.art .a-stroke { fill: none; stroke: var(--text-secondary); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.art .a-stroke-accent { fill: none; stroke: var(--cw-mark); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.art .a-arrow { fill: none; stroke: var(--text-muted); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.art .a-node { fill: var(--bg-card); stroke: var(--border-strong); stroke-width: 2; }
.art .a-dot { fill: var(--fg-36); }
.art .a-chip { fill: var(--success-16); }
.art .a-chip-warn { fill: var(--warning-24); }
.art .a-button { fill: var(--cw-action-bg); }
.art .a-slot-a { fill: var(--danger-24); }
.art .a-slot-b { fill: var(--info-24); }
.art .a-slot-c { fill: var(--success-24); }
.art .a-slot-d { fill: var(--warning-24); }
.art .a-text { fill: var(--text-primary); font-size: 15px; font-weight: 650; }
.art .a-title { fill: var(--text-primary); font-size: 18px; font-weight: 750; letter-spacing: -0.01em; }
.art .a-small { fill: var(--text-secondary); font-size: 13px; font-weight: 600; }

/* step diagram: numbered steps joined by a line (text variant adds an icon per step) */
.steps .step-icon { width: 44px; height: 44px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--success-10); color: var(--cw-mark); margin-bottom: var(--space-md); }
.steps .step-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 960px) {
  .steps.joined li:not(:last-child)::after { content: ""; position: absolute; top: calc(var(--space-xl) + 14px); left: calc(var(--space-xl) + 36px); right: calc(-1 * var(--space-lg) - 1px); height: 2px; background: var(--border-strong); }
}
.steps.joined li::before { z-index: 1; }

/* steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-lg); counter-reset: s; }
@media (min-width: 960px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { counter-increment: s; position: relative; padding: var(--space-xl); padding-top: calc(var(--space-xl) + 36px); background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); }
.steps li::before { content: counter(s); position: absolute; top: var(--space-xl); left: var(--space-xl); width: 28px; height: 28px; border-radius: var(--radius-pill); display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm); background: var(--cw-action-bg); color: var(--cw-action-fg); }
.steps p { color: var(--text-secondary); margin: 0; }

/* feature rows with a screenshot */
.feature { display: grid; gap: var(--space-2xl); align-items: center; padding: var(--space-2xl) 0; }
@media (min-width: 960px) { .feature { grid-template-columns: 1fr 1.35fr; } .feature.flip > :first-child { order: 2; } }
.ticks { list-style: none; padding: 0; margin: 0 0 var(--space-lg); }
.ticks li { position: relative; padding-left: 28px; margin-bottom: var(--space-sm); color: var(--text-secondary); }
.ticks li::before { content: ""; position: absolute; left: 4px; top: 0.45em; width: 12px; height: 7px; border-left: 2px solid var(--cw-mark); border-bottom: 2px solid var(--cw-mark); transform: rotate(-45deg); }

/* pricing */
.tiers { display: grid; gap: var(--space-lg); }
@media (min-width: 860px) { .tiers { grid-template-columns: repeat(3, 1fr); } }
.tier { display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: var(--space-xl); box-shadow: var(--shadow-card); }
.tier.first { border-color: var(--cw-mark); }
.tier .tname { font-size: var(--fs-sm); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: var(--space-md); }
.tier .from { font-size: var(--fs-sm); color: var(--text-muted); }
.tier .amount { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.tier .per { color: var(--text-secondary); font-size: var(--fs-md); margin-bottom: var(--space-lg); }
.tier .ticks { margin-top: auto; }
.badge { display: inline-block; font-size: var(--fs-xs); font-weight: 700; padding: 2px var(--space-sm); border-radius: var(--radius-pill); background: var(--success-10); color: var(--success-text); margin-left: var(--space-sm); letter-spacing: 0; text-transform: none; }
.table-wrap { overflow-x: auto; margin-top: var(--space-xl); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-card); }
table { border-collapse: collapse; width: 100%; min-width: 480px; }
caption { text-align: left; padding: var(--space-lg) var(--space-xl) 0; font-weight: 700; }
th, td { text-align: left; padding: var(--space-md) var(--space-xl); border-bottom: 1px solid var(--border-subtle); font-size: var(--fs-md); }
thead th { color: var(--text-secondary); font-size: var(--fs-sm); font-weight: 650; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
.note { color: var(--text-muted); font-size: var(--fs-sm); margin-top: var(--space-lg); }

/* faq */
.faq { max-width: 820px; }
.faq details { border-bottom: 1px solid var(--border-subtle); }
.faq summary { cursor: pointer; list-style: none; padding: var(--space-lg) 0; font-weight: 650; display: flex; justify-content: space-between; gap: var(--space-lg); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-muted); font-weight: 400; font-size: 1.25rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--text-secondary); padding-bottom: var(--space-lg); margin: 0; }

/* contact form */
.form { display: grid; gap: var(--space-lg); }
@media (min-width: 640px) { .form .two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); } }
label { display: block; font-weight: 600; font-size: var(--fs-md); margin-bottom: var(--space-xs); }
input, select, textarea { width: 100%; font: inherit; color: var(--text-primary); background: var(--bg-input); border: 1px solid var(--border-strong); border-radius: var(--radius-md); padding: var(--space-md); min-height: 44px; }
textarea { min-height: 120px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--cw-mark); }
.notice { border: 1px solid var(--border-strong); border-left: 4px solid var(--warning); background: var(--bg-card); border-radius: var(--radius-md); padding: var(--space-lg) var(--space-xl); }
.notice.good { border-left-color: var(--cw-mark); }
.notice.bad { border-left-color: var(--danger); }
.notice p:last-child { margin-bottom: 0; }

/* download */
.release { display: grid; gap: var(--space-xl); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-sm) var(--space-xl); margin: 0 0 var(--space-xl); }
.facts dt { color: var(--text-muted); font-size: var(--fs-sm); }
.facts dd { margin: 0; }
.status { display: inline-flex; align-items: center; gap: var(--space-sm); font-weight: 650; font-size: var(--fs-sm); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--text-muted); }
.status.ok::before { background: var(--cw-mark); }
.status.warn::before { background: var(--warning); }
.status.bad::before { background: var(--danger); }
[hidden] { display: none !important; }

/* footer */
.site-foot { border-top: 1px solid var(--border-subtle); padding: var(--space-2xl) 0; color: var(--text-muted); font-size: var(--fs-sm); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: var(--space-lg); justify-content: space-between; align-items: center; }
.site-foot a { color: var(--text-secondary); }
.site-foot nav { display: flex; gap: var(--space-lg); flex-wrap: wrap; }

/* phones: a header that fits on one row, a table that fits without sideways scrolling */
.btn { white-space: nowrap; }
@media (max-width: 480px) {
  .nav a.opt-sm { display: none; }
  .site-head .wrap { gap: var(--space-sm); }
  table { min-width: 0; }
  th, td { padding: var(--space-sm) var(--space-md); font-size: var(--fs-sm); }
  caption { padding: var(--space-md) var(--space-md) 0; }
}
