/* char — design tokens and styles.
   Concept: a city planning docket, printed for contractors. Paper, ruled lines, file numbers
   in mono, stamps for stages. The fish is the one friendly thing on the page: keep it rare.
   Every color and size below comes from these tokens; change them here, not in the pages. */

:root {
  /* Color: tinted paper and navy ink from the logo; fish blue for links, belly orange used rarely. */
  --paper: #F3F0E8;          /* page */
  --surface: #FBF9F4;        /* docket slips, inputs */
  --sunk: #ECE7DB;           /* quiet fills: stage guide, table heads */
  --ink: #1D2747;            /* wordmark navy */
  --ink-soft: #565D73;       /* secondary text (5.9:1 on paper) */
  --hairline: #D6CFBF;
  --rule: #1D2747;           /* heavy rules */
  --brand: #34509A;          /* fish blue: links, focus */
  --accent: #C25E2A;         /* belly orange: stamps, one CTA, highlights (4.6:1 on paper) */
  --tint: #C9D5F0;           /* fish spots: selection, quiet marks */
  --ok: #3A7350;
  --warn: #9A6418;
  --bad: #A83F2B;
  --on-ink: #F3F0E8;

  /* Type */
  --display: "Bricolage Grotesque", "Hanken Grotesk", sans-serif;
  --text: "Hanken Grotesk", "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --step--1: 0.8125rem;      /* 13 labels */
  --step-0: 1rem;            /* 16 body */
  --step-1: 1.1875rem;       /* 19 lead */
  --step-2: 1.5rem;          /* 24 */
  --step-3: clamp(1.75rem, 3.2vw, 2.5rem);     /* section heads */
  --step-4: clamp(2.5rem, 7.5vw, 6.25rem);     /* hero */
  --step-5: clamp(4rem, 18vw, 15rem);          /* footer wordmark, big numerals */

  /* Space (8-based) and layout */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px;
  --max: 1180px;
  --gutter: 16px;
  --radius: 3px;             /* printed paper corners; nothing pill-shaped except tags */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-stamp: 4px 4px 0 var(--ink);   /* the one shadow: a hard offset, like a slip on a desk */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121933; --surface: #18213F; --sunk: #1F2A4D; --ink: #EDE8DC; --ink-soft: #A9B0C6;
    --hairline: #2F3A60; --rule: #EDE8DC; --brand: #9DB2EC; --accent: #EA8D5B; --tint: #34509A;
    --ok: #7BC495; --warn: #E2B15C; --bad: #EE8A75; --on-ink: #121933; color-scheme: dark;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--step-0)/1.55 var(--text);
  /* paper grain: a very faint noise, so the page reads as stock rather than a screen */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.11 0 0 0 0 0.15 0 0 0 0 0.28 0 0 0 .035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: var(--tint); color: var(--ink); }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 1px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.02; text-wrap: balance; margin: 0; }
h2 { font-size: var(--step-3); margin-bottom: var(--s4); }
h3 { font-size: var(--step-1); letter-spacing: -0.01em; line-height: 1.2; }
p { text-wrap: pretty; }
em { font-style: italic; }
img, svg { max-width: 100%; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--ink-soft); }
.label, .acronym {
  font: 500 var(--step--1)/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft);
}
.num { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--on-ink); padding: var(--s2) var(--s3); z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- Header: logo, plain text nav, a status line ---------- */
header.site { border-bottom: 2px solid var(--rule); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s4) var(--s5); padding-top: var(--s3); padding-bottom: var(--s3); flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-height: 44px; }
.logo img { width: 46px; height: auto; display: block; }
.logo b { font: 800 30px/1 var(--display); letter-spacing: -0.04em; }
.logo:hover { color: var(--ink); }
.logo span { color: inherit; }
nav { display: flex; flex-wrap: wrap; gap: 0 var(--s5); }
nav a { color: var(--ink); text-decoration: none; font-weight: 500; padding: 10px 0; position: relative; }
nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 6px; height: 2px; background: var(--accent); transition: right .25s var(--ease); }
nav a:hover { color: var(--ink); }
nav a:hover::after, nav a.active::after { right: 0; }
.status { width: 100%; border-top: 1px solid var(--hairline); padding-top: var(--s2); display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
@media (max-width: 600px) { .status > span:first-child { display: none; } nav { gap: 0 var(--s4); } nav a { padding: 8px 0; } }

/* ---------- Sections ---------- */
section { padding: var(--s8) 0; }
section.alt { background: var(--surface); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
section.tight { padding: var(--s6) 0; }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2) var(--s6); align-items: end; margin-bottom: var(--s6); }
@media (min-width: 900px) { .section-head { grid-template-columns: 3fr 2fr; } }
.section-head p { margin: 0; max-width: 60ch; color: var(--ink-soft); }

/* Hero */
.hero { padding-top: var(--s7); padding-bottom: var(--s8); }
.hero h1 { font-size: var(--step-4); line-height: 0.95; letter-spacing: -0.035em; max-width: 11.5ch; margin: var(--s3) 0 var(--s5); }
.hero h1 em { font-weight: 500; font-style: italic; color: var(--accent); }
.hero p.lead { font-size: var(--step-1); max-width: 58ch; margin: 0 0 var(--s6); color: var(--ink); }
.hero-grid { display: grid; gap: var(--s7); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 980px) { .hero-grid { grid-template-columns: 7fr 5fr; } }

/* Buttons: ink rectangles; the orange one is used once per page */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px;
       background: var(--ink); color: var(--on-ink); border: 2px solid var(--ink); border-radius: var(--radius);
       font: 600 var(--step-0)/1.1 var(--text); text-decoration: none; cursor: pointer;
       transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease); }
.btn:hover { color: var(--on-ink); transform: translate(-2px, -2px); box-shadow: var(--shadow-stamp); }
.btn:active { transform: none; box-shadow: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #FBF9F4; }
.btn.primary:hover { color: #FBF9F4; }
.btn.secondary { background: transparent; color: var(--ink); }
.btn.secondary:hover { color: var(--ink); background: var(--surface); }
.btn.small { min-height: 40px; padding: 7px 14px; font-size: var(--step--1); border-width: 1.5px; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: progress; transform: none; box-shadow: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s3); }

/* Generic grid and card: square-cornered slips with a hairline, no soft shadows */
.grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: var(--s5); }
section.alt .card { background: var(--paper); }
.stat { font: 700 clamp(2.4rem, 6vw, 4rem)/1 var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--ink); }

/* Ledger: numbers set on ruled lines instead of a row of stat cards */
.ledger { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); border-top: 2px solid var(--rule); }
.ledger > div { padding: var(--s4) var(--s4) var(--s5) 0; border-bottom: 1px solid var(--hairline); }
.ledger > div + div { padding-left: var(--s4); }
@media (min-width: 700px) { .ledger > div + div { border-left: 1px solid var(--hairline); } }
.ledger .stat { margin: var(--s2) 0 var(--s1); }
.ledger p { margin: 0; color: var(--ink-soft); font-size: var(--step--1); max-width: 28ch; }

/* Numbered steps: big numerals in the margin */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; grid-template-columns: minmax(0, 1fr); border-top: 2px solid var(--rule); }
@media (min-width: 900px) { .steps { grid-template-columns: 1fr 1fr; column-gap: var(--s7); } }
.steps li { counter-increment: step; display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); gap: var(--s3); padding: var(--s5) 0; border-bottom: 1px solid var(--hairline); }
.steps li::before { content: counter(step, decimal-leading-zero); font: 500 1.6rem/1 var(--mono); color: var(--accent); padding-top: 2px; }
.steps li b { display: block; font: 700 var(--step-1)/1.2 var(--display); margin-bottom: var(--s1); }

/* Definition list used for feature explanations */
.defs { margin: 0; border-top: 2px solid var(--rule); }
.defs > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s1) var(--s5); padding: var(--s4) 0; border-bottom: 1px solid var(--hairline); }
@media (min-width: 640px) { .defs > div { grid-template-columns: 11rem minmax(0, 1fr); } }
.defs dt { font: 700 var(--step-0)/1.3 var(--display); }
.defs dd { margin: 0; color: var(--ink-soft); }

/* Stage track: four stations on a line, like a transit map */
.track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); position: relative; }
@media (min-width: 900px) { .track { grid-template-columns: repeat(4, 1fr); } }
.track li { position: relative; padding: 0 var(--s5) var(--s5) var(--s6); }
.track li::before { content: ""; position: absolute; left: 7px; top: 22px; bottom: 0; width: 3px; background: var(--ink); }
.track li:last-child::before { display: none; }
.track .stop { position: absolute; left: 0; top: 4px; width: 17px; height: 17px; border-radius: 50%; background: var(--paper); border: 4px solid var(--c); }
@media (min-width: 900px) {
  .track li { padding: var(--s6) var(--s5) 0 0; }
  .track li::before { left: 18px; right: 0; top: 7px; bottom: auto; width: auto; height: 3px; }
  .track li:last-child::before { display: block; right: 60%; }
  .track .stop { top: 0; }
}
.track h3 { font-size: var(--step-1); margin: 0 0 var(--s1); }
.track .when { font: 500 var(--step--1)/1.4 var(--mono); color: var(--ink-soft); margin-bottom: var(--s2); }
.track p { margin: 0; }

/* ---------- Project slips ---------- */
.project { display: flex; flex-direction: column; position: relative; }
.project h3 { font-size: var(--step-1); margin: 0 0 var(--s1); }
.project .meta { color: var(--ink-soft); font-size: var(--step--1); }
.project .size { font: 600 var(--step-0)/1.3 var(--mono); color: var(--ink); margin: var(--s2) 0 var(--s1); letter-spacing: -0.01em; }
.project .stage { font: 500 var(--step--1)/1.4 var(--mono); color: var(--ink-soft); margin-top: var(--s3); }
.project .guide { background: var(--sunk); border-radius: var(--radius); padding: var(--s3); margin: var(--s3) 0 var(--s2); border-left-width: 4px; border-left-style: solid; }
.project .guide .muted { font-size: var(--step--1); }
.project .dot, .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.project .team { margin: var(--s3) 0; font-size: var(--step--1); }
.team-h { font: 500 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: var(--s1); }
.project .team-row { display: flex; justify-content: space-between; gap: var(--s3); padding: 5px 0; border-bottom: 1px dotted var(--hairline); }
.project .team-row b { text-align: right; font-weight: 600; }
.project .related { font-size: var(--step--1); margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--hairline); }
.project .related ul { margin: var(--s1) 0 var(--s2); padding-left: 18px; }
.project .actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: auto; padding-top: var(--s4); }
.btn.follow.on { background: var(--tint); border-color: var(--brand); color: var(--ink); }
.tag { display: inline-block; font: 500 11px/1.4 var(--mono); letter-spacing: .03em; color: var(--ink-soft); border: 1px solid var(--hairline); border-radius: 99px; padding: 2px 8px; margin: 6px 4px 0 0; }
.locked { display: flex; flex-direction: column; justify-content: center; text-align: left; border: 2px dashed var(--hairline); background: transparent; }
.locked .stat { color: var(--accent); }

/* The showcased slip sits on the desk: stamped shadow, slightly off the grid */
.slip { box-shadow: var(--shadow-stamp); border-color: var(--ink); }
@media (min-width: 980px) { .slip { transform: rotate(-0.6deg); } }
.stamp { display: inline-block; font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
         border: 2px solid currentColor; padding: 5px 8px 4px; transform: rotate(-3deg); border-radius: 2px; }

/* Docket list in the hero */
.docket { border: 2px solid var(--ink); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-stamp); }
.docket header { display: flex; justify-content: space-between; align-items: baseline; padding: var(--s3) var(--s4); border-bottom: 2px solid var(--ink); }
.docket ol { list-style: none; margin: 0; padding: 0; }
.docket li { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--hairline); }
.docket li:last-child { border-bottom: 0; }
.docket .n { font: 500 var(--step--1)/1.6 var(--mono); color: var(--ink-soft); }
.docket b { display: block; font-weight: 600; line-height: 1.25; }
.docket .m { font-size: var(--step--1); color: var(--ink-soft); }
.docket footer { padding: var(--s3) var(--s4); border-top: 2px solid var(--ink); font: 500 var(--step--1)/1.4 var(--mono); }

/* Bid section: one big number set against a checklist */
.bignum { font: 700 var(--step-5)/0.85 var(--display); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; color: var(--ink); }
.split { display: grid; gap: var(--s6) var(--s7); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: 5fr 7fr; } }
.checklist { list-style: none; padding: 0; margin: 0 0 var(--s5); border-top: 2px solid var(--rule); }
.checklist li { padding: var(--s3) 0 var(--s3) 30px; position: relative; border-bottom: 1px solid var(--hairline); }
.checklist li::before { content: ""; position: absolute; left: 2px; top: 19px; width: 12px; height: 7px; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg); }

/* Pricing: a receipt */
.receipt { max-width: 560px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: var(--s6) var(--s5);
           position: relative; font-size: var(--step--1); }
.receipt::after { content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px;
                  background: linear-gradient(-45deg, transparent 6px, var(--surface) 0) 0 0/12px 10px, linear-gradient(45deg, transparent 6px, var(--surface) 0) 0 0/12px 10px; }
.receipt .line { display: flex; justify-content: space-between; gap: var(--s4); padding: 6px 0; border-bottom: 1px dotted var(--hairline); }
.receipt .line span:last-child { font-family: var(--mono); white-space: nowrap; }
.price { font: 700 clamp(3rem, 8vw, 5rem)/1 var(--display); letter-spacing: -0.04em; margin: var(--s2) 0; }
.price small { font: 500 var(--step-0)/1 var(--mono); color: var(--ink-soft); letter-spacing: 0; }
.plan ul { padding-left: 18px; }
.plan.featured { border: 2px solid var(--ink); }

/* ---------- Forms: a request form ---------- */
form .row { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin-bottom: var(--s4); }
label { font: 600 var(--step--1)/1.3 var(--text); display: block; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; font: 400 var(--step-0)/1.3 var(--text); color: var(--ink);
  background: var(--surface); border: 1px solid var(--hairline); border-bottom: 2px solid var(--ink); border-radius: var(--radius) var(--radius) 0 0;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
textarea { min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: none; border-bottom-color: var(--accent); background: var(--paper); }
input:user-invalid, select:user-invalid { border-bottom-color: var(--bad); }
input[type=checkbox] { width: 20px; min-height: 20px; height: 20px; margin: 0 8px 0 0; accent-color: var(--brand); }
.checks { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
.checks label { font-weight: 400; display: flex; align-items: center; margin: 0; min-height: 44px; font-size: var(--step-0); }
.form-paper { background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); padding: var(--s6) var(--s5); }
.form-paper .form-head { display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; border-bottom: 1px solid var(--hairline); padding-bottom: var(--s3); margin-bottom: var(--s5); }
select { max-width: 100%; text-overflow: ellipsis; }

/* ---------- Calculator ---------- */
.calc-layout { display: grid; gap: var(--s5); grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 860px) { .calc-layout { grid-template-columns: minmax(0, 1fr); } }
.calc-layout > * { min-width: 0; }
@media (max-width: 600px) {
  #h-jobs tr:first-child { display: none; }
  #h-jobs, #h-jobs tbody, #h-jobs tr, #h-jobs td { display: block; width: 100%; }
  #h-jobs tr { border: 1px solid var(--hairline); border-radius: var(--radius); padding: var(--s2) var(--s3); margin-bottom: var(--s2); background: var(--paper); }
  #h-jobs td { padding: 2px 0; text-align: left !important; }
  #h-jobs td[data-l]:not([data-l="Job"])::before { content: attr(data-l) ": "; color: var(--ink-soft); font-size: 12px; }
}
.calc-section { margin-bottom: var(--s5); }
.calc-section h3 { margin: 0 0 var(--s3); font-size: var(--step-2); }
table.lines { width: 100%; border-collapse: collapse; }
table.lines th { text-align: left; font: 500 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); padding: 6px 4px; border-bottom: 1px solid var(--hairline); }
table.lines td { padding: 5px 4px; vertical-align: middle; }
table.lines td.amt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: var(--step--1); }
table.lines button.x { background: none; border: 0; color: var(--ink-soft); cursor: pointer; font-size: 20px; min-width: 36px; min-height: 36px; }
table.lines button.x:hover { color: var(--bad); }
.forgot { display: grid; grid-template-columns: 1fr 120px 70px; gap: 6px 10px; align-items: center; font-size: var(--step--1); }
.forgot .hdr { font: 500 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.summary { position: sticky; top: 12px; }
.summary .card { border: 2px solid var(--ink); }
.summary .line { display: flex; justify-content: space-between; gap: var(--s3); font-variant-numeric: tabular-nums; padding: 4px 0; }
.summary .line span:last-child, .summary .line b:last-child { font-family: var(--mono); }
.summary .total { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: var(--s2); font: 700 var(--step-2)/1.2 var(--display); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.good { color: var(--ok); }
.alerts { padding-left: 18px; }
.alerts li { margin-bottom: 8px; font-size: var(--step--1); }

/* ---------- Developer profiles ---------- */
.dev { margin-bottom: var(--s5); scroll-margin-top: var(--s5); }
.dev h2 { font-size: var(--step-2); }
.dev .nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0; margin: var(--s4) 0; border-top: 2px solid var(--rule); }
.dev .nums div { padding: var(--s3) var(--s3) var(--s3) 0; border-bottom: 1px solid var(--hairline); }
.dev .nums b { display: block; font: 700 var(--step-2)/1.1 var(--display); font-variant-numeric: tabular-nums; }
.dev .nums span { font: 500 11px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.dev ul { margin: var(--s2) 0 0; padding-left: 18px; font-size: var(--step--1); }
.dev ul li { margin-bottom: 4px; }
.dev:target { border-color: var(--ink); box-shadow: var(--shadow-stamp); }

/* ---------- Footer: the wordmark as the design moment ---------- */
footer.site { border-top: 2px solid var(--rule); padding: var(--s7) 0 var(--s5); color: var(--ink-soft); font-size: var(--step--1); overflow: hidden; }
footer.site .foot-grid { display: grid; gap: var(--s5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 800px) { footer.site .foot-grid { grid-template-columns: 2fr 1fr 1fr; } }
footer.site nav { display: grid; gap: 2px; }
footer.site nav a { padding: 6px 0; font: 500 var(--step--1)/1.3 var(--mono); }
footer.site nav a::after { bottom: 2px; }
.wordmark { font: 800 var(--step-5)/0.8 var(--display); letter-spacing: -0.06em; color: var(--ink); margin: var(--s6) 0 0; display: flex; align-items: flex-end; gap: 0.06em; }
.wordmark img { width: 0.62em; height: auto; margin-bottom: 0.05em; }

/* ---------- Motion: one hero sequence and the stamp; nothing else moves on scroll ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes stamp { 0% { opacity: 0; transform: rotate(-3deg) scale(1.6); } 60% { opacity: 1; transform: rotate(-3deg) scale(.96); } 100% { transform: rotate(-3deg) scale(1); } }
.hero .reveal { animation: rise .7s var(--ease) both; }
.hero .reveal:nth-child(2) { animation-delay: .08s; } .hero .reveal:nth-child(3) { animation-delay: .16s; } .hero .reveal:nth-child(4) { animation-delay: .24s; }
.docket { animation: rise .8s .3s var(--ease) both; }
.docket .stamp { animation: stamp .5s 1s var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  body { background: #fff; }
  header.site nav, .status, footer.site, .no-print { display: none !important; }
  .calc-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
}

/* ---------- Guided tour (tour.html): a phone on the left, the step on the right ---------- */
.tour-section { padding: var(--s7) 0 var(--s8); }
.tour-title { font-size: var(--step-3); margin-top: var(--s2); }
.tour { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s6); align-items: start; }
@media (min-width: 860px) { .tour { grid-template-columns: 340px minmax(0, 1fr); gap: var(--s8); } }

.phone { position: relative; width: 100%; max-width: 340px; margin: 0 auto; aspect-ratio: 340 / 600;
  background: var(--ink); border-radius: 34px; padding: 12px; box-shadow: var(--shadow-stamp); }
.phone-top { position: absolute; top: 12px; left: 12px; right: 12px; height: 34px; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; font: 600 11px/1 var(--mono); color: #1D2747; background: #FBF9F4; border-radius: 24px 24px 0 0; }
.phone-top .island { width: 84px; height: 20px; background: #1D2747; border-radius: 12px; }
.phone-top .bars { letter-spacing: -2px; font-size: 8px; }
/* The screen is always light: it's a picture of the app, not page chrome. */
.screen { --i: #1D2747; --s: #565D73; --h: #D6CFBF; --f: #ECE7DB;
  height: 100%; overflow: hidden; background: #FBF9F4; color: var(--i); border-radius: 24px; padding: 46px 16px 16px;
  font: 400 13px/1.45 var(--text); }
.screen.in > * { animation: tour-in .5s var(--ease) both; animation-delay: var(--d, 0s); }
.screen.in > *:nth-child(2) { --d: .08s; } .screen.in > *:nth-child(3) { --d: .16s; } .screen.in > *:nth-child(4) { --d: .24s; }
@keyframes tour-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.m-app { display: flex; justify-content: space-between; font: 600 11px/1 var(--mono); color: var(--s); text-transform: uppercase; letter-spacing: .06em; }
.m-from::before { content: ""; display: inline-block; width: 18px; height: 11px; margin-right: 6px; vertical-align: -1px;
  background: url(assets/logo-mark.svg) center / contain no-repeat; }
.m-subject { font: 700 18px/1.15 var(--display); margin: 10px 0 6px; letter-spacing: -0.01em; }
.m-summary { color: var(--s); margin-bottom: 10px; }
.m-stats { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--h); border-radius: 3px; margin: 10px 0; }
.m-stats div { padding: 8px; border-left: 1px solid var(--h); } .m-stats div:first-child { border-left: 0; }
.m-stats b { display: block; font: 700 20px/1 var(--display); }
.m-stats span { font: 500 9px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--s); }
.m-card { border: 1px solid var(--h); border-left: 3px solid #34509A; border-radius: 3px; padding: 8px 10px; margin-top: 8px; background: #fff; }
.m-card b { display: block; font-weight: 600; line-height: 1.25; }
.m-card span { font-size: 11px; color: var(--s); }
.m-back { font: 500 11px/1.2 var(--mono); color: #34509A; margin-bottom: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; justify-content: space-between; align-items: center; }
.m-ex { color: #9A6418; background: #F6EBD6; padding: 3px 6px; border-radius: 3px; text-transform: uppercase; letter-spacing: .05em; font-size: 9px; }
.m-title { font: 700 19px/1.15 var(--display); letter-spacing: -0.01em; }
.m-meta { color: var(--s); font-size: 12px; margin-top: 4px; }
.m-size { font: 600 13px/1.3 var(--mono); margin: 10px 0; }
.m-guide { background: var(--f); border-left: 4px solid; border-radius: 3px; padding: 10px; margin: 10px 0; font-size: 12px; }
.m-guide b { font-size: 13px; }
.m-when { font: 500 11px/1.4 var(--mono); color: var(--s); margin: 4px 0; }
.m-link { color: #34509A; font-size: 12px; text-decoration: underline; }
.m-h { font: 600 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--s); margin: 14px 0 6px; }
.m-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--h); font-size: 12px; }
.m-row span { color: var(--s); } .m-row b { text-align: right; font-weight: 600; }
.m-row.target b { color: #34509A; text-decoration: underline; }
.m-note { font-size: 11px; color: var(--s); margin-top: 10px; }
.m-note b { color: var(--i); }
.m-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.m-btn { border: 1.5px solid var(--i); border-radius: 3px; padding: 8px 12px; font-weight: 600; font-size: 12px; transition: background .25s, color .25s; }
.m-btn.dark { background: var(--i); color: #FBF9F4; }
.m-btn.on { background: #C25E2A; border-color: #C25E2A; color: #FBF9F4; }
.m-field { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--h); background: #fff; border-radius: 3px; padding: 8px 10px; margin-bottom: 6px; }
.m-field span { color: var(--s); font-size: 12px; }
.m-field b { font: 600 13px/1 var(--mono); min-height: 13px; }
.m-field .type:empty::after, .m-field .type:not(:empty)::after { content: ""; }
.m-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--i); margin-top: 10px; padding-top: 8px; }
.m-total b { font: 700 22px/1 var(--display); }
.m-flag { background: #F6EBD6; color: #7A4F12; border-radius: 3px; padding: 7px 9px; font-size: 11px; margin-top: 8px; }
.m-done { margin-top: 12px; color: #3A7350; font-weight: 600; font-size: 12px; opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s var(--ease); }
.screen.shared .m-done { opacity: 1; transform: none; }
.screen .pressed { transform: scale(.97); transition: transform .15s; }

.tap { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; pointer-events: none; z-index: 3; opacity: 0;
  background: rgba(194, 94, 42, .25); border: 2px solid #C25E2A; }
.tap.go { animation: tap .9s var(--ease) forwards; }
@keyframes tap { 0% { opacity: 0; transform: scale(1.6); } 30% { opacity: 1; transform: scale(.8); } 60% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.8); } }
.toast { position: absolute; left: 50%; bottom: 30px; transform: translate(-50%, 12px); background: #1D2747; color: #FBF9F4; font-size: 12px; font-weight: 600;
  padding: 8px 14px; border-radius: 3px; opacity: 0; transition: opacity .3s, transform .3s var(--ease); white-space: nowrap; z-index: 3; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.tour-copy h2 { font-size: var(--step-3); margin: var(--s3) 0 var(--s4); min-height: 2.1em; }
.tour-copy h2:focus { outline: none; }
.tour-copy > p { font-size: var(--step-1); max-width: 52ch; margin: 0 0 var(--s4); }
.tour-tip { font-size: var(--step-0) !important; color: var(--ink-soft); border-left: 3px solid var(--accent); padding-left: var(--s3); }
.tour-bar { height: 4px; background: var(--sunk); border-radius: 2px; overflow: hidden; margin: var(--s5) 0 var(--s4); }
.tour-bar span { display: block; height: 100%; width: 0; background: var(--accent); }
.tour-controls { display: flex; gap: var(--s2); flex-wrap: wrap; }
.tour-steps { list-style: none; padding: 0; margin: var(--s5) 0 0; border-top: 1px solid var(--hairline); }
.tour-steps button { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: var(--s2);
  width: 100%; padding: var(--s2) 0; border-bottom: 1px solid var(--hairline); color: var(--ink-soft); font-size: var(--step--1); }
.tour-steps button span { font: 500 var(--step--1)/1.5 var(--mono); }
.tour-steps button:hover { color: var(--ink); }
.tour-steps button:focus-visible { outline: 2px solid var(--brand); }
.tour-steps button.on { color: var(--ink); font-weight: 600; }
.tour-steps button.on span { color: var(--accent); }
@media (max-width: 859px) { .tour-copy h2 { min-height: 0; } .tour-steps { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .screen.in > *, .tap.go { animation: none; }
  .m-done, .toast, .m-btn { transition: none; }
}

/* ---------- Terms and privacy pages ---------- */
.legal { padding: var(--s7) 0 var(--s8); }
.legal .wrap { max-width: 760px; }
.legal h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); line-height: 1.05; margin: var(--s2) 0 var(--s4); }
.legal .lead { font-size: var(--step-1); color: var(--ink-soft); margin-bottom: var(--s6); }
.legal h2 { font-size: var(--step-2); margin: var(--s7) 0 var(--s3); padding-top: var(--s4); border-top: 1px solid var(--hairline); scroll-margin-top: 24px; }
.legal p, .legal li { line-height: 1.65; max-width: 68ch; }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: var(--s2); }
.legal .caps { font-size: var(--step--1); text-transform: uppercase; letter-spacing: .02em; }
.legal-toc { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: var(--s4); background: var(--sunk); border-radius: 3px; font-size: var(--step--1); }
.legal-toc a { min-height: 0; padding: 3px 0; line-height: 1.4; }
