/* SideTill — the app's own palette (src/ui/theme.ts), extended for the web.
   One design system: mustard, periwinkle, coral and olive on warm paper,
   thick ink outlines, hard offset shadows. Large type, one thing at a time. */

:root {
  --bg: #F2F0EB;
  --surface: #FFFFFF;
  --surface-alt: #E8E5DE;
  --ink: #16161A;
  --muted: #5E5B55;
  --line: #D3CFC6;
  --accent: #6070BA;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3E6F5;
  --accent-text: #4A5AA3;
  --mustard: #F5AE2C;
  --periwinkle-tint: #8E9BD3;
  --coral: #EE735C;
  --olive: #6E9C3B;
  --on-fill: #16161A;
  --danger: #B23A22;

  --stroke: 2.5px;
  --radius: 18px;
  --radius-pill: 999px;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --maxw: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17171C;
    --surface: #23232B;
    --surface-alt: #2C2C35;
    --ink: #F2F0EB;
    --muted: #B5B1A8;
    --line: #3A3A44;
    --accent-soft: #2A3050;
    --accent-text: #A9B4E8;
    --olive: #7FAE48;
    --danger: #F2937F;
    --shadow: 5px 5px 0 #000000;
    --shadow-sm: 3px 3px 0 #000000;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  font-size: 17px;
  line-height: 1.5;
  overflow-wrap: break-word;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

h1, h2, h3 {
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(2.1rem, 7vw, 3.2rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 4.5vw, 2rem); margin-top: 2.2em; }
h3 { font-size: 1.15rem; }
/* A top-level h3 needs air above it; one inside a card does not. */
main > h3 { margin-top: 1.9em; }
main > .grid + h3 { margin-top: 1.5em; }
p { margin: 0 0 1em; }
a { color: var(--accent-text); }

.lede { font-size: 1.15rem; color: var(--muted); margin-bottom: 1.6em; }
.small { font-size: 0.9rem; color: var(--muted); }
.tiny { font-size: 0.82rem; color: var(--muted); }

.label {
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 0.5em;
}

/* --- the header --- */
header.site {
  padding: 18px 0 26px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
header.site .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
header.site img { width: 44px; height: 44px; border-radius: 11px; display: block; }
header.site .name { font-weight: 900; font-size: 1.35rem; letter-spacing: -0.02em; }
header.site nav { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
header.site nav a { font-weight: 700; font-size: 0.95rem; text-decoration: none; }
header.site nav a:hover { text-decoration: underline; }

/* --- cards --- */
.card {
  background: var(--surface);
  border: var(--stroke) solid var(--ink);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.card.tight { padding: 18px; }
.card h3 { margin-top: 0; }

.grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid.two { grid-template-columns: 1fr 1fr; } }

/* --- the three pillars, in the app's fills --- */
.pillar { border: var(--stroke) solid var(--ink); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.pillar.mustard { background: var(--mustard); color: var(--on-fill); }
.pillar.coral { background: var(--coral); color: var(--on-fill); }
.pillar.olive { background: var(--olive); color: var(--on-fill); }
.pillar.periwinkle { background: var(--accent); color: var(--accent-ink); }
.pillar h3 { margin: 0 0 0.3em; }
.pillar p { margin: 0; font-size: 0.98rem; }

/* --- buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px;
  background: var(--accent); color: var(--accent-ink);
  border: var(--stroke) solid var(--ink); border-radius: var(--radius-pill);
  font-weight: 800; font-size: 1rem; text-decoration: none;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.btn:hover { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: none; }
.btn.mustard { background: var(--mustard); color: var(--on-fill); }
.btn.quiet { background: var(--surface); color: var(--ink); }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 1.6em 0; }

/* --- the calculator --- */
.calc { display: grid; gap: 16px; }
.calc .row { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .calc .row { grid-template-columns: 1fr 1fr 1fr; } }
.field label { display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 6px; }
.field .hint { display: block; font-weight: 500; font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; min-height: 52px; padding: 10px 14px;
  font: inherit; font-size: 1.15rem; font-weight: 700;
  color: var(--ink); background: var(--surface);
  border: var(--stroke) solid var(--ink); border-radius: 12px;
  font-variant-numeric: tabular-nums;
}
.field input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.result {
  margin-top: 22px; padding: 22px;
  background: var(--accent-soft);
  border: var(--stroke) solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.result .value { font-size: clamp(2.4rem, 9vw, 3.6rem); font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.result .what { font-weight: 700; color: var(--muted); margin-top: 6px; }
.result.warn { background: var(--mustard); color: var(--on-fill); }
.result.warn .what { color: var(--on-fill); opacity: 0.85; }

/* --- lists --- */
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 9px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
ul.checks { list-style: none; padding: 0; margin: 0 0 1em; }
ul.checks li { padding-left: 30px; position: relative; margin-bottom: 10px; }
ul.checks li::before {
  content: ""; position: absolute; left: 0; top: 0.35em;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--olive); border: 2px solid var(--ink);
}

/* --- the privacy note --- */
.note {
  border: var(--stroke) solid var(--ink); border-left-width: 8px;
  border-radius: 12px; padding: 16px 18px; background: var(--surface-alt);
  margin: 1.6em 0;
}
.note p:last-child { margin-bottom: 0; }

/* --- footer --- */
footer.site {
  margin-top: 56px; padding: 28px 0 44px;
  border-top: 2px solid var(--line);
}
footer.site .links { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
footer.site .links a { font-weight: 700; text-decoration: none; }
footer.site .links a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* --- landing page: wide hero, phone, steps, store band --- */
.wrap.wide { max-width: 1040px; }

.hero { display: grid; gap: 36px; align-items: center; padding: 8px 0 28px; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.15fr 0.85fr; gap: 48px; padding: 20px 0 40px; } }
.hero h1 { font-size: clamp(2.3rem, 7vw, 3.9rem); }
.hero h1 mark { background: var(--mustard); color: var(--on-fill); padding: 0 0.15em; border-radius: 8px; }
.hero .btn-row { margin-bottom: 1em; }
.hero .proof { font-size: 0.9rem; color: var(--muted); font-weight: 700; margin: 0; }

/* the phone: an example month drawn in the app's own style, not a screenshot */
.phone-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.phone {
  width: 100%; max-width: 290px; padding: 12px;
  background: var(--ink); border-radius: 40px; box-shadow: 8px 8px 0 var(--accent);
  transform: rotate(2deg);
}
.screen {
  background: #F2F0EB; color: #16161A; border-radius: 30px; padding: 22px 18px 20px;
  display: grid; gap: 12px;
}
.screen .month { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: #5E5B55; }
.screen .left { font-size: 2.6rem; font-weight: 900; letter-spacing: -0.03em; line-height: 1; color: #16161A; }
.screen .left small { display: block; font-size: 0.85rem; font-weight: 700; color: #5E5B55; letter-spacing: 0; margin-top: 6px; }
.screen .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.screen .mini {
  background: #fff; color: #16161A; border: 2.5px solid #16161A; border-radius: 14px; padding: 10px 12px;
  box-shadow: 3px 3px 0 #16161A; font-weight: 900; font-size: 1.15rem;
}
.screen .mini span { display: block; font-size: 0.7rem; font-weight: 700; color: #5E5B55; }
.screen .rate {
  background: var(--mustard); color: #16161A; border: 2.5px solid #16161A; border-radius: 14px;
  padding: 12px 14px; box-shadow: 3px 3px 0 #16161A; font-weight: 900; font-size: 1.5rem; line-height: 1.1;
}
.screen .rate span { display: block; font-size: 0.78rem; font-weight: 700; margin-top: 4px; }
.phone-stage .caption { font-size: 0.8rem; color: var(--muted); margin: 0; }

.strip {
  display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center;
  border: var(--stroke) solid var(--ink); border-radius: var(--radius-pill); background: var(--surface);
  padding: 12px 22px; font-weight: 800; font-size: 0.95rem; margin-bottom: 8px;
}

.section { padding-top: 24px; }
.section > h2:first-child { margin-top: 1em; }
.steps { counter-reset: step; }
.steps .pillar { position: relative; padding-top: 30px; }
.steps .pillar::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: -16px; left: 16px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 900;
  background: var(--surface); color: var(--ink); border: var(--stroke) solid var(--ink);
}
.steps { gap: 28px 18px; margin-top: 28px; }
@media (min-width: 900px) { .steps.two { grid-template-columns: repeat(4, 1fr); } }

.two-col { display: grid; gap: 28px; }
@media (min-width: 860px) { .two-col { grid-template-columns: 1fr 1fr; gap: 44px; align-items: start; } }

.band {
  background: var(--accent); color: var(--accent-ink); border: var(--stroke) solid var(--ink);
  border-radius: 28px; box-shadow: var(--shadow); padding: 34px 26px; margin: 3em 0 0; text-align: center;
}
.band h2 { margin-top: 0; }
.band .btn-row { justify-content: center; }
.band .small { color: var(--accent-ink); opacity: 0.9; }
.band .btn.quiet { background: var(--surface); color: var(--ink); }

/* --- tool pages: selects and the result breakdown --- */
.field select {
  width: 100%; min-height: 52px; padding: 10px 14px; font: inherit; font-size: 1rem; font-weight: 700;
  color: var(--ink); background: var(--surface); border: var(--stroke) solid var(--ink); border-radius: 12px;
}
.field select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.result ul.plain { margin-top: 14px; }
.result ul.plain:empty { display: none; }
.result ul.plain li { display: flex; justify-content: space-between; gap: 14px; border-bottom-color: rgba(128,128,128,0.35); }
.result .value { overflow-wrap: anywhere; }
.tools-grid { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 18px; }
@media (min-width: 640px) { .tools-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .tools-grid { grid-template-columns: repeat(3, 1fr); } }
.tools-grid a {
  display: block; padding: 16px 18px; background: var(--surface); color: var(--ink); text-decoration: none;
  border: var(--stroke) solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-sm); font-weight: 800;
}
.tools-grid a span { display: block; font-weight: 500; font-size: 0.9rem; color: var(--muted); margin-top: 4px; }
.tools-grid a:hover { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); }

/* --- copy-and-paste text pages --- */
.copyblock { margin-bottom: 16px; }
.copyblock pre {
  white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 12px; padding: 14px;
  font: inherit; font-size: 0.95rem; font-weight: 500; background: var(--surface-alt);
  border: 2px solid var(--line); border-radius: 12px;
}
.calc .copyblock { margin-top: 6px; }

/* --- do this in the app --- */
.apphint {
  margin: 0 0 1.6em; padding: 14px 18px; background: var(--mustard); color: var(--on-fill);
  border: var(--stroke) solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-sm); font-weight: 700;
}
.apphint a { color: var(--on-fill); }

/* --- checklists and printable sheets --- */
ul.tick { list-style: none; padding: 0; margin: 0 0 1em; }
ul.tick li { margin-bottom: 8px; }
ul.tick label { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
ul.tick input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--olive); }
.sheetmeta { font-size: 0.9rem; color: var(--muted); }
table.sheet { width: 100%; border-collapse: collapse; background: var(--surface); }
table.sheet th, table.sheet td { border: 1.5px solid var(--ink); padding: 0 8px; height: 30px; text-align: left; font-size: 0.8rem; }
table.sheet th { background: var(--surface-alt); }
table.sheet td.tot { font-weight: 800; text-align: right; }
.calc .btn { margin-top: 8px; justify-self: start; }

@media print {
  body { background: #fff; color: #000; }
  body * { visibility: hidden; }
  .printsheet, .printsheet * { visibility: visible; }
  .printsheet { position: absolute; left: 0; top: 0; width: 100%; }
  table.sheet { background: #fff; }
  table.sheet th, table.sheet td { border-color: #000; color: #000; }
  .noprint { display: none !important; }
}

/* inputs line up on one row even when a hint wraps to two lines */
.field { display: flex; flex-direction: column; }
.field input, .field select { margin-top: auto; }


/* --- blog --- */
.post h1 { margin-bottom: 0.2em; }
.post h2 { margin-top: 1.8em; }
.post p, .post li { line-height: 1.6; }
.post ul, .post ol { padding-left: 1.3em; margin: 0 0 1em; }
.post li { margin-bottom: 0.5em; }
.crumbs { font-size: 0.9rem; font-weight: 700; margin: 0 0 0.6em; }
.byline { font-size: 0.9rem; color: var(--muted); font-weight: 700; margin: 0 0 0.4em; }
.checked { font-size: 0.9rem; color: var(--muted); margin: 0 0 1.6em; }
.example {
  background: var(--surface); border: var(--stroke) solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 16px 18px; margin: 0 0 20px;
}
.example h3 { margin: 0 0 0.5em; }
.example table { width: 100%; border-collapse: collapse; margin-bottom: 0.6em; }
.example th, .example td { text-align: left; padding: 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 0.95rem; }
.example th { font-weight: 600; width: 44%; padding-right: 12px; }
.example td { font-weight: 800; }
.example tr:last-child th, .example tr:last-child td { border-bottom: 0; }
.example p { margin: 0; font-weight: 700; }
.postcard { margin: 0 0 28px; padding-bottom: 22px; border-bottom: 2px solid var(--line); }
.postcard h2 { margin: 0 0 0.2em; font-size: 1.4rem; }
.postcard h2 a { color: var(--ink); text-decoration: none; }
.postcard h2 a:hover { text-decoration: underline; }
.postcard p { margin: 0 0 0.6em; }
.related { background: var(--accent-soft); border: var(--stroke) solid var(--ink); border-radius: 14px; padding: 12px 16px; margin: 0 0 1.6em; }
