/* Rindero public site. Tokens mirror the Rindero design system (tokens.json),
   which mirrors the app's src/index.css. Warm stone paper, near-black ink,
   gold reserved for one figure per page. Rules, not boxes. */

@font-face { font-family: 'Instrument Sans'; src: url('/assets/fonts/instrument-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/assets/fonts/instrument-sans-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/assets/fonts/instrument-sans-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Spline Sans Mono'; src: url('/assets/fonts/spline-sans-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Spline Sans Mono'; src: url('/assets/fonts/spline-sans-mono-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --bg: #e5e1d8; --surface: #f7f5f0; --surface-2: #d9d3c6; --surface-3: #eeebe3;
  --ink: #211d18; --muted: #5e564c; --faint: #6b6257; --line: #cac2b3; --line-soft: #ded8cc;
  --accent: #2a251e; --on-accent: #f7f5f0; --link: #1a5378; --link-soft: #dce6ee;
  --gold: #785500; --gold-soft: #f0e5c9;
  --good: #2f6b3a; --warn: #8a5a12; --bad: #a33a28; --good-wash: #dfeadd; --warn-wash: #f4e7ce; --bad-wash: #f4e1dc;
  --ui: 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Spline Sans Mono', 'SF Mono', Menlo, Consolas, monospace;
  --measure: 68ch;
  --r-sm: 7px; --r-md: 11px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17130f; --surface: #211c17; --surface-2: #2d2721; --surface-3: #1b1712;
    --ink: #ede7dc; --muted: #a79c8c; --faint: #99907f; --line: #38312a; --line-soft: #2a2420;
    --accent: #ede7dc; --on-accent: #211c17; --link: #8cbbdd; --link-soft: #1c2c38;
    --gold: #d9ab4c; --gold-soft: #332813;
    --good: #6dbb7c; --warn: #d9a94e; --bad: #e08672; --good-wash: #152a18; --warn-wash: #31260f; --bad-wash: #33201b;
    color-scheme: dark;
  }
}
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .logo-light { display: none; }
  .logo-dark { display: inline; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--ui); font-size: 17px; line-height: 1.62; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 12px; top: 12px; background: var(--surface); padding: 8px 12px; border-radius: var(--r-sm); z-index: 10; }

.wrap { max-width: 72rem; margin: 0 auto; padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 18px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.top .logo { display: inline-flex; line-height: 0; }
.top .logo img { height: 28px; width: auto; }
.top nav { display: flex; gap: 4px 16px; align-items: center; flex-wrap: wrap; margin-left: auto; font-size: 15px; font-weight: 600; }
@media (max-width: 640px) { .top nav { margin-left: 0; width: 100%; gap: 4px 14px; } .top .langs { margin-left: auto; } }
.top nav a { color: var(--ink); text-decoration: none; padding: 6px 2px; }
.top nav a:hover { text-decoration: underline; }
.top nav a[aria-current='page'] { text-decoration: underline; text-decoration-thickness: 2px; }
.top nav .app { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 5px 11px; font-weight: 500; }
.langs { display: flex; gap: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.langs a { color: var(--faint); text-decoration: none; }
.langs a[aria-current='true'] { color: var(--ink); text-decoration: underline; }

/* type */
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.025em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 700; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); font-weight: 700; }
h3 { font-size: 1.12rem; font-weight: 700; letter-spacing: -0.015em; }
.eyebrow { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.lbl { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.lede { font-size: 1.18rem; color: var(--muted); max-width: 46ch; margin: 0; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* breadcrumbs */
.crumbs { font-size: 14px; color: var(--faint); padding-top: 22px; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.crumbs li + li::before { content: '/'; margin-right: 8px; color: var(--line); }
.crumbs a { color: var(--muted); }

/* article */
.page-head { display: flex; flex-direction: column; gap: 14px; padding: 18px 0 26px; border-bottom: 2px solid var(--ink); }
.meta { font-family: var(--mono); font-size: 12.5px; color: var(--faint); letter-spacing: 0.02em; display: flex; gap: 6px 18px; flex-wrap: wrap; }
.article-grid { display: block; padding: 30px 0 56px; }
@media (min-width: 1040px) { .article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 56px; align-items: start; } }
.prose { max-width: var(--measure); min-width: 0; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 { margin-top: 2em; padding-top: 0.6em; border-top: 1px solid var(--line); }
.prose h3 { margin-top: 1.5em; }
.prose p, .prose li { max-width: var(--measure); }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: 0.35em; }
.prose li::marker { color: var(--faint); }
.prose strong { font-weight: 700; }
.prose blockquote { margin-left: 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--line); color: var(--muted); }
.prose code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); padding: 0.08em 0.35em; border-radius: 3px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 28rem; }
.prose th { text-align: left; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); padding: 9px 12px; border-bottom: 1px solid var(--line); }
.prose td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; font-variant-numeric: tabular-nums; }
.prose tr:last-child td { border-bottom: none; }
aside.side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 22px; font-size: 15px; }
@media (max-width: 1039px) { aside.side { position: static; margin-top: 40px; } }
.toc { border-left: 1px solid var(--line); padding-left: 14px; display: flex; flex-direction: column; gap: 7px; }
.toc a { color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--ink); text-decoration: underline; }

/* faq */
.faq { margin-top: 2.4em; border-top: 1px solid var(--line); padding-top: 0.6em; }
.faq details { border-bottom: 1px solid var(--line-soft); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--mono); color: var(--faint); }
.faq details[open] summary::after { content: '−'; }
.faq details p { margin: 8px 0 0; color: var(--muted); }

/* call to action: an object you act on, so it earns a box */
.cta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.cta h2, .cta .cta-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; margin: 0; border: none; padding: 0; }
.cta p { margin: 0; color: var(--muted); font-size: 15.5px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 11px 18px; border-radius: var(--r-md); background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 15.5px; text-decoration: none; border: none; cursor: pointer; font-family: inherit; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); font-weight: 500; }
.btn:active { opacity: 0.62; }

/* lists of guides: ruled rows */
.rows { list-style: none; padding: 0; margin: 0; }
.rows li { border-top: 1px solid var(--line-soft); }
.rows li:first-child { border-top: 1px solid var(--line); }
.rows a { display: flex; justify-content: space-between; gap: 14px; padding: 13px 0; color: var(--ink); text-decoration: none; }
.rows a:hover .t { text-decoration: underline; }
.rows .t { font-weight: 600; letter-spacing: -0.01em; }
.rows .d { display: block; font-size: 14.5px; color: var(--muted); font-weight: 400; letter-spacing: 0; margin-top: 2px; }
.rows .arrow { color: var(--faint); font-family: var(--mono); flex: none; }
.related { margin-top: 3em; }
.related h2 { border-top: 2px solid var(--ink); padding-top: 0.6em; margin-bottom: 0.4em; }

/* hubs */
.hub-head { padding: 40px 0 28px; display: flex; flex-direction: column; gap: 14px; border-bottom: 2px solid var(--ink); }
.clusters { display: grid; grid-template-columns: 1fr; gap: 0 48px; padding: 18px 0 60px; }
@media (min-width: 900px) { .clusters { grid-template-columns: 1fr 1fr; } }
.cluster { padding: 22px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cluster h2 a { color: var(--ink); text-decoration: none; }
.cluster h2 a:hover { text-decoration: underline; }
.cluster .count { font-family: var(--mono); font-size: 12px; color: var(--faint); letter-spacing: 0.06em; text-transform: uppercase; }
.cluster ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 15.5px; }
.cluster li a { color: var(--muted); }

/* home */
.hero { padding: 54px 0 40px; display: grid; grid-template-columns: 1fr; gap: 34px; align-items: center; border-bottom: 2px solid var(--ink); }
@media (min-width: 960px) { .hero { grid-template-columns: 1.15fr 0.85fr; } }
.hero h1 { font-size: clamp(2.4rem, 6.5vw, 4rem); line-height: 1.02; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.figure-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.figure-card .fig { font-family: var(--mono); font-size: 2.6rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1; color: var(--gold); }
.figure-card .was { font-family: var(--mono); color: var(--faint); text-decoration: line-through; }
.figure-card .rowline { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line-soft); font-size: 15px; }
.figure-card .rowline .num { white-space: nowrap; }
.section { padding: 46px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
.three { display: grid; grid-template-columns: 1fr; gap: 26px; }
@media (min-width: 860px) { .three { grid-template-columns: repeat(3, 1fr); } }
.three > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.three p { margin: 0; color: var(--muted); }
.note { font-size: 14px; color: var(--faint); }

/* footer */
.foot { background: var(--surface); border-top: 1px solid var(--line); margin-top: 40px; font-size: 14.5px; color: var(--muted); }
.foot .wrap { display: grid; grid-template-columns: 1fr; gap: 26px; padding-block: 34px; }
@media (min-width: 860px) { .foot .wrap { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.foot h2 { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin: 0 0 8px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.foot a { color: var(--muted); }
.foot p { margin: 0 0 8px; max-width: 36ch; }

/* calculator */
.calc { display: grid; grid-template-columns: 1fr; gap: 30px; padding: 28px 0 56px; align-items: start; }
@media (min-width: 1000px) { .calc { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); } }
.calc fieldset { border: none; margin: 0; padding: 0 0 22px; border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.calc legend { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); padding: 0; margin-bottom: 4px; }
.calc label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; min-width: 0; }
.calc .hint { font-weight: 400; color: var(--faint); font-size: 13px; }
.calc input, .calc select { font: inherit; font-size: 16px; font-weight: 400; color: var(--ink); background: var(--surface-3); border: 1px solid var(--faint); border-radius: var(--r-md); padding: 9px 11px; min-height: 44px; width: 100%; min-width: 0; }
.calc input.n { font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.calc .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.calc .grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.ing { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.ing .row { display: grid; grid-template-columns: 1fr 1fr 5.2rem; gap: 8px; align-items: end; }
.ing .head { display: flex; gap: 8px; align-items: end; }
.ing .head label { flex: 1; }
.ing .del { min-height: 44px; min-width: 44px; border-radius: var(--r-md); border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font: inherit; }
.ing .err { color: var(--bad); font-size: 13px; }
.ing .cost { font-family: var(--mono); font-size: 13px; color: var(--muted); text-align: right; }
.result { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; }
.result .figure-card .fig { font-size: 2.3rem; }
.result .out { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line-soft); font-size: 15px; }
.result .out .num { white-space: nowrap; }
.result .out.strong { font-weight: 700; border-top: 1.5px solid var(--ink); }
.result .verdict { padding: 12px; border-radius: var(--r-md); font-size: 14.5px; }
.result .verdict.good { background: var(--good-wash); color: var(--ink); }
.result .verdict.warn { background: var(--warn-wash); color: var(--ink); }
.result .verdict.bad { background: var(--bad-wash); color: var(--ink); }
.result .verdict b { display: block; margin-bottom: 2px; }
.share { display: flex; flex-wrap: wrap; gap: 8px; }
.copied { font-size: 13px; color: var(--good); }

/* free tools: same form and result styles as the calculator, plus these */
.calc .err { color: var(--bad); font-size: 13px; font-weight: 500; }
.calc input[aria-invalid] { border-color: var(--bad); }
.calc label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; }
.calc label.check input { width: 22px; height: 22px; min-height: 0; padding: 0; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.ing .row.r2 { grid-template-columns: 1fr 5.2rem; }
.ttable { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.ttable th { text-align: left; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); }
.ttable td { padding: 7px 8px 7px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; overflow-wrap: anywhere; }
.ttable td + td, .ttable th + th { text-align: right; }
@media (max-width: 999px) { .calc.tool { grid-template-columns: minmax(0, 1fr); } }
.ttable tr:last-child td { border-bottom: none; }
.tool-text { padding-top: 8px; }
.tool-cards { list-style: none; padding: 26px 0 40px; margin: 0; display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 680px) { .tool-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1020px) { .tool-cards { grid-template-columns: repeat(3, 1fr); } }
.tool-cards a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink); text-decoration: none; }
.tool-cards a:hover .t { text-decoration: underline; }
.tool-cards .t { font-weight: 700; letter-spacing: -0.01em; font-size: 1.08rem; }
.tool-cards .d { color: var(--muted); font-size: 14.5px; flex: 1; }
.tool-cards .go { font-family: var(--mono); font-size: 12px; color: var(--link); letter-spacing: 0.04em; }
.tool-cards .main a { border-color: var(--ink); }
