/* The Blokes' Book — phone prototype.
   Sibling of the "Getting out" site: same one-column layout, section colour blocks and card patterns.
   Identity taken from the printed book: kraft paper, ochre and rust, heavy condensed caps, brush lettering. */
:root {
  --bg: #fbf6ec;
  --panel: #ffffff;
  --fg: #2e2820;
  --muted: #6b6052;
  --brand: #B4521E;          /* rust — headings and links */
  --brand-ink: #ffffff;
  --kraft: #c8ac84;
  --line: #e2d6c0;
  --soft: #f3e9d7;
  --tip: #ecf0e4;
  --warn-bg: #fae5de;
  --warn-fg: #8a2c12;
  --urgent: #C0391B;
  --flag-bg: #fdf1ce;
  --flag-fg: #6d5208;
  --focus: #C8A317;
  --font: "Figtree", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --display: "Oswald", "Figtree", system-ui, sans-serif;
  --hand: "Caveat Brush", "Figtree", cursive;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.4rem;
  --step-4: 3.4rem;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17130e; --panel: #201a14; --fg: #efe6d6; --muted: #b0a28e; --brand: #E8914F; --brand-ink: #2a1206;
    --kraft: #5a4a35; --line: #3a3026; --soft: #241d16; --tip: #1e2419; --warn-bg: #3c1a11; --warn-fg: #ffb9a4;
    --urgent: #E4573A; --flag-bg: #382d0c; --flag-fg: #ffd97e; --focus: #ffd24d; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17130e; --panel: #201a14; --fg: #efe6d6; --muted: #b0a28e; --brand: #E8914F; --brand-ink: #2a1206;
  --kraft: #5a4a35; --line: #3a3026; --soft: #241d16; --tip: #1e2419; --warn-bg: #3c1a11; --warn-fg: #ffb9a4;
  --urgent: #E4573A; --flag-bg: #382d0c; --flag-fg: #ffd97e; --focus: #ffd24d; color-scheme: dark;
}
html.big { font-size: 118%; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: var(--step-0); line-height: 1.55; -webkit-text-size-adjust: 100%; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.12; text-wrap: balance; margin: 0; }
p { margin: 0; }
img { max-width: 100%; display: block; }
.wrap { max-width: 40rem; margin: 0 auto; padding-inline: 16px; }

/* Prototype ribbon */
.proto { background: var(--flag-bg); color: var(--flag-fg); font-size: var(--step--1); padding: 6px 16px; text-align: center; line-height: 1.35; }
.proto b { font-weight: 700; }

/* Header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 8px; min-height: 56px; }
.brand { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em; color: var(--brand); text-decoration: none; font-size: var(--step-1); margin-right: auto; white-space: nowrap; }
@media (max-width: 400px) { .brand { font-size: var(--step-0); } }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); color: var(--fg); font: inherit; font-size: var(--step--1); font-weight: 600; cursor: pointer; text-decoration: none; }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn.sos { background: var(--urgent); border-color: var(--urgent); color: #fff; }

/* Home hero — kraft panel, like the book cover */
.hero { margin-top: 18px; border-radius: var(--radius); padding: 26px 20px 22px; background: var(--kraft); color: #fff2dd; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; opacity: .18; pointer-events: none;
  background-image: repeating-linear-gradient(118deg, rgba(255,255,255,.5) 0 1px, transparent 1px 7px), repeating-linear-gradient(62deg, rgba(0,0,0,.22) 0 1px, transparent 1px 11px); }
.hero h1 { position: relative; z-index: 1; font-family: var(--display); font-size: var(--step-4); font-weight: 700; text-transform: uppercase; letter-spacing: 0.005em; line-height: 0.88; color: #fff; text-shadow: 0 2px 6px rgba(60,40,15,.35); }
.hero .tag { position: relative; z-index: 1; margin-top: 12px; font-family: var(--hand); font-size: var(--step-2); line-height: 1.1; color: #fff4e2; }
.hero .sub { position: relative; z-index: 1; margin-top: 10px; font-size: var(--step--1); color: #fff; opacity: .92; max-width: 26rem; }

.now { margin-top: 16px; background: var(--urgent); color: #fff; border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; }
.now h2 { font-family: var(--display); text-transform: uppercase; font-size: var(--step-1); font-weight: 600; letter-spacing: .02em; }
.now .row { display: flex; flex-wrap: wrap; gap: 8px; }
.now a { color: #fff; }
.callbtn-big { display: inline-flex; flex-direction: column; background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.45); border-radius: 8px; padding: 8px 12px; text-decoration: none; min-width: 0; flex: 1 1 8.5rem; }
.callbtn-big b { font-size: 1.15rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.callbtn-big span { font-size: var(--step--1); opacity: 0.95; }
.now .more { font-weight: 700; font-size: var(--step--1); }

.first { margin-top: 16px; display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: var(--radius); background: var(--brand); color: var(--brand-ink); text-decoration: none; }
.first svg { width: 40px; height: 40px; flex: none; }
.first b { display: block; font-family: var(--display); text-transform: uppercase; font-weight: 600; font-size: var(--step-1); letter-spacing: .02em; }
.first span { font-size: var(--step--1); }

.hlabel { font-family: var(--display); font-size: var(--step-0); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; margin: 28px 0 10px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 8.5rem; padding: 14px; border-radius: var(--radius); text-decoration: none; background: var(--c); color: var(--ink, #fff); }
.tile svg { width: 34px; height: 34px; }
.tile b { font-family: var(--display); text-transform: uppercase; font-weight: 600; font-size: 1.05rem; line-height: 1.1; letter-spacing: .02em; display: block; }
.tile span { font-size: 0.8rem; line-height: 1.3; opacity: 0.93; display: block; margin-top: 4px; }

/* Section page */
.band { background: var(--c); color: var(--ink, #fff); }
.band .wrap { padding-block: 22px 26px; display: grid; gap: 14px; }
.band svg.big { width: 46px; height: 46px; }
.band h1 { font-family: var(--display); text-transform: uppercase; font-size: var(--step-3); font-weight: 700; letter-spacing: 0.005em; }
.band .kicker { font-family: var(--hand); font-size: var(--step-1); opacity: .95; margin-bottom: -6px; }
.crumb { color: inherit; font-size: var(--step--1); font-weight: 600; text-decoration: none; opacity: 0.9; }

/* The book's hand-lettered cartoon cards */
figure.art { margin: 18px 0 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--soft); }
figure.art img { width: 100%; height: auto; }
figure.art figcaption { font-size: 0.78rem; color: var(--muted); padding: 7px 12px; line-height: 1.35; }

.intro { display: grid; gap: 10px; padding-block: 18px 4px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-block: 12px; scrollbar-width: thin; }
.chips a { flex: none; padding: 7px 12px; border-radius: 18px; background: var(--soft); color: var(--fg); text-decoration: none; font-size: var(--step--1); font-weight: 600; border: 1px solid var(--line); }
.topic { padding-block: 22px; border-top: 1px solid var(--line); display: grid; gap: 12px; scroll-margin-top: 70px; }
.topic h2 { font-family: var(--display); text-transform: uppercase; font-size: var(--step-2); font-weight: 600; color: var(--brand); letter-spacing: .01em; }
.topic ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.tip, .warn { border-radius: 8px; padding: 12px 14px; font-weight: 600; }
.tip { background: var(--tip); }
.warn { background: var(--warn-bg); color: var(--warn-fg); }
.seealso { font-weight: 600; }

/* Pull quote in the book's brush lettering */
.quote { background: var(--soft); border-left: 5px solid var(--c, var(--brand)); border-radius: 8px; padding: 14px 16px; display: grid; gap: 6px; }
.quote q { font-family: var(--hand); font-size: var(--step-2); line-height: 1.15; quotes: none; }
.quote cite { font-style: normal; font-weight: 700; font-size: var(--step--1); color: var(--muted); }

details.orig > summary { cursor: pointer; color: var(--muted); font-size: var(--step--1); font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; }
details.orig > summary::-webkit-details-marker { display: none; }
details.orig > summary::before { content: "+"; display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--muted); border-radius: 50%; font-size: 13px; line-height: 1; }
details.orig[open] > summary::before { content: "\2212"; }
details.orig .otext { font-size: var(--step--1); color: var(--muted); border-left: 3px solid var(--line); padding: 4px 0 4px 12px; margin-top: 4px; }

/* Service cards */
.svcs { display: grid; gap: 10px; }
.svc { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 8px; background: var(--panel); }
.svc h3 { font-size: var(--step-1); font-weight: 700; }
.svc .about { color: var(--fg); }
.svc .meta { font-size: var(--step--1); color: var(--muted); display: grid; gap: 4px; }
.svc .meta div { display: flex; gap: 8px; align-items: flex-start; min-width: 0; overflow-wrap: anywhere; }
.svc .meta svg { width: 16px; height: 16px; flex: none; margin-top: 3px; }
.calls { display: flex; flex-wrap: wrap; gap: 8px; }
.call { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 22px; background: var(--brand); color: var(--brand-ink); text-decoration: none; font-weight: 700; min-height: 44px; }
.call svg { width: 18px; height: 18px; }
.call small { font-weight: 500; opacity: 0.9; font-size: 0.78rem; }
.call .num { font-variant-numeric: tabular-nums; }
.call.alt { background: var(--soft); color: var(--fg); border: 1px solid var(--line); }
.area-h { font-family: var(--display); font-size: var(--step-0); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; margin-top: 6px; }

/* Reviewer flags (hidden unless reviewer mode) */
.flag { display: none; background: var(--flag-bg); color: var(--flag-fg); border-radius: 6px; padding: 8px 10px; font-size: var(--step--1); }
.clin { display: none; }
html.review .flag, html.review .clin { display: block; }
.clin { background: var(--flag-bg); color: var(--flag-fg); border-radius: 6px; padding: 8px 10px; font-size: var(--step--1); font-weight: 600; }

/* Checklist */
.plan { display: grid; gap: 14px; }
.plan fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0; background: var(--panel); }
.plan legend { font-family: var(--display); text-transform: uppercase; font-weight: 600; padding: 0 6px; color: var(--brand); }
.plan label { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.plan label:last-child { border-bottom: 0; }
.plan input[type=checkbox] { width: 24px; height: 24px; flex: none; margin: 1px 0 0; accent-color: var(--brand); }
.plan input:checked + span { text-decoration: line-through; color: var(--muted); }
.progress { height: 8px; background: var(--soft); border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .3s; }
.note { font-size: var(--step--1); color: var(--muted); }

/* Appointments */
.appt-form { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); }
.appt-form label { display: grid; gap: 4px; font-weight: 600; font-size: var(--step--1); }
.appt-form input { font: inherit; padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); min-width: 0; }
.btn { font: inherit; font-weight: 700; padding: 10px 16px; border-radius: 22px; border: 0; background: var(--brand); color: var(--brand-ink); cursor: pointer; min-height: 44px; justify-self: start; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.appts { display: grid; gap: 8px; }
.appt { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--panel); }
.appt div { min-width: 0; overflow-wrap: anywhere; }

/* F.A.S.T. model */
.fast { display: grid; gap: 10px; }
.fast-step { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 14px; display: grid; gap: 8px; }
.fast-step h4 { margin: 0; font-family: var(--display); text-transform: uppercase; font-size: var(--step-1); font-weight: 600; color: var(--brand); letter-spacing: .03em; display: flex; align-items: baseline; gap: 10px; }
.fast-step h4 i { font-style: normal; font-family: var(--font); font-size: 0.72rem; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.fast-step ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; font-size: var(--step--1); }
.askbox { background: var(--soft); border: 2px dashed var(--brand); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 4px; }
.askbox p:first-child { font-family: var(--hand); font-size: var(--step-2); line-height: 1.1; color: var(--brand); }

/* Stat strip */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 8px; }
.stat { background: var(--soft); border-radius: 8px; padding: 12px 14px; }
.stat b { display: block; font-family: var(--display); font-size: var(--step-2); font-weight: 700; color: var(--brand); line-height: 1; }
.stat span { font-size: var(--step--1); color: var(--muted); display: block; margin-top: 4px; }

/* First week out */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: s; }
.steps > li { counter-increment: s; display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 12px; align-items: start; }
.steps > li::before { content: counter(s); display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-family: var(--display); font-weight: 600; font-size: var(--step-1); }
.steps h3 { font-family: var(--display); text-transform: uppercase; font-size: var(--step-1); font-weight: 600; letter-spacing: .02em; }
.steps .body { display: grid; gap: 8px; }

/* Search */
.search { padding-block: 16px; display: grid; gap: 12px; }
.search input { font: inherit; font-size: var(--step-1); padding: 12px 14px; border-radius: 10px; border: 2px solid var(--brand); background: var(--panel); color: var(--fg); width: 100%; }
.results { display: grid; gap: 8px; }
.result { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--fg); background: var(--panel); }
.result b { color: var(--brand); display: block; }
.result span { font-size: var(--step--1); color: var(--muted); }

/* Footer */
footer { margin-top: 36px; background: var(--soft); border-top: 1px solid var(--line); }
footer .wrap { padding-block: 22px 40px; display: grid; gap: 12px; font-size: var(--step--1); color: var(--muted); }
footer .tagline { font-family: var(--hand); color: var(--brand); font-size: var(--step-2); }
.toggles { display: flex; flex-wrap: wrap; gap: 8px; }

/* Quick exit */
.qexit { position: fixed; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 30; background: #2e2820; color: #fff; border: 2px solid #fff; border-radius: 24px; padding: 10px 16px; font: inherit; font-weight: 800; text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,.3); }

@media (min-width: 560px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
