/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --paper: #F2F4EF;
  --surface: #FFFFFF;
  --sunk: #E6EAE2;
  --ink: #17233B;
  --muted: #4F5A6E;
  --line: #D3D9CF;
  --action: #2346D0;
  --action-hover: #1A37AA;
  --action-ink: #FFFFFF;
  --mark: #FFE066;
  --mark-ink: #17233B;
  --ok: #1E7A4C;
  --err: #B3261E;
  --shadow: #17233B;

  --f-display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --f-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;

  --wrap: 1140px;
  --gutter: clamp(16px, 4vw, 40px);
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121A2B;
    --surface: #1A2438;
    --sunk: #212D45;
    --ink: #E9EDE5;
    --muted: #A7B0BF;
    --line: #2E3A53;
    --action: #93A8FF;
    --action-hover: #B3C2FF;
    --action-ink: #0E1630;
    --mark: #EFCF4F;
    --mark-ink: #17233B;
    --ok: #6FD3A0;
    --err: #FF8A80;
    --shadow: #05080F;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121A2B;
  --surface: #1A2438;
  --sunk: #212D45;
  --ink: #E9EDE5;
  --muted: #A7B0BF;
  --line: #2E3A53;
  --action: #93A8FF;
  --action-hover: #B3C2FF;
  --action-ink: #0E1630;
  --mark: #EFCF4F;
  --mark-ink: #17233B;
  --ok: #6FD3A0;
  --err: #FF8A80;
  --shadow: #05080F;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--action); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--action-hover); }
:focus-visible { outline: 3px solid var(--action); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.08; margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 820px; }
section { padding: clamp(64px, 10vw, 120px) 0; scroll-margin-top: 64px; }
.section-lede { color: var(--muted); max-width: 60ch; margin-top: 14px; font-size: 1.15rem; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: var(--r-sm); z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px;
  background: var(--action); color: var(--action-ink);
  font-family: var(--f-body); font-weight: 700; font-size: 1.05rem;
  border: 0; border-radius: 999px; text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, transform .15s ease;
}
.btn:hover { background: var(--action-hover); color: var(--action-ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-small { min-height: 42px; padding: 0 18px; font-size: .98rem; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 30px; height: 30px; }
.brand-mark rect { fill: var(--mark); stroke: var(--ink); stroke-width: 2.5; }
.brand-mark path { fill: none; stroke: var(--mark-ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font-family: var(--f-display); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink); text-decoration: none; font-size: 1rem; }
.nav-links a:hover { color: var(--action); text-decoration: underline; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle, .menu-btn {
  width: 42px; height: 42px; display: grid; place-items: center;
  background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}
.theme-toggle:hover, .menu-btn:hover { background: var(--sunk); }
.theme-toggle svg, .menu-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}
.menu-btn { display: none; }

@media (max-width: 920px) {
  .menu-btn { display: grid; }
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px;
    background: var(--paper); border-bottom: 1px solid var(--line);
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 12px 0; font-size: 1.1rem; }
}
@media (max-width: 480px) {
  .nav .btn-small { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding-top: clamp(48px, 8vw, 96px); }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(40px, 6vw, 80px); align-items: center; }
.hello { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; margin-bottom: 22px; }
.hello img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 2px var(--ink); }
.hero h1 { font-size: clamp(2.7rem, 6.4vw, 5rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.0; }
.lede { font-size: clamp(1.15rem, 1.6vw, 1.3rem); margin-top: 24px; max-width: 34em; }
.hero-cta { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.cta-note { margin: 0; color: var(--muted); font-size: 1rem; }
.where { margin-top: 28px; color: var(--muted); font-size: 1rem; max-width: 40em; }

/* The week: a notepad to-do list */
.week {
  margin: 0;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: 8px 8px 0 var(--shadow);
  padding: 26px 28px 22px;
  transform: rotate(1.2deg);
}
.week-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.week-title { font-family: var(--f-display); font-weight: 800; font-size: 1.6rem; letter-spacing: -0.02em; }
.week-sub { color: var(--muted); font-size: .95rem; }
.week-list { list-style: none; margin: 0; padding: 0; }
.chore {
  display: grid; grid-template-columns: 26px 1fr; column-gap: 14px; row-gap: 2px;
  align-items: start; padding: 13px 0; border-bottom: 1px dashed var(--line);
}
.chore:last-child { border-bottom: 0; }
.box {
  width: 24px; height: 24px; margin-top: 2px; border: 2px solid var(--ink); border-radius: 6px;
  position: relative; background: transparent; transition: background-color .25s ease;
}
.box::after {
  content: ""; position: absolute; left: 6px; top: 1px; width: 7px; height: 13px;
  border: solid var(--mark-ink); border-width: 0 3px 3px 0; transform: rotate(45deg) scale(0);
  transition: transform .25s cubic-bezier(.3,1.6,.6,1);
}
.txt {
  font-size: 1.08rem; line-height: 1.4; width: fit-content;
  background-image: linear-gradient(var(--mark), var(--mark));
  background-repeat: no-repeat; background-position: 0 58%; background-size: 0% 44%;
  transition: background-size .45s ease, color .3s ease;
}
.auto {
  grid-column: 2; font-size: .92rem; font-weight: 700; color: var(--ok);
  opacity: 0; transform: translateY(-4px); transition: opacity .3s ease .25s, transform .3s ease .25s;
}
.chore.done .box { background: var(--mark); }
.chore.done .box::after { transform: rotate(45deg) scale(1); }
.chore.done .txt {
  background-size: 100% 44%; color: var(--muted);
  text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--mark-ink) 55%, transparent);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.chore.done .auto { opacity: 1; transform: none; }
.chore.keep .txt { font-weight: 700; }
.week-foot { margin-top: 14px; padding-top: 14px; border-top: 2px solid var(--ink); font-size: .98rem; color: var(--muted); }

/* Dark mode: the highlighter covers the whole line so dark text stays readable */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chore.done .txt { color: var(--mark-ink); background-size: 100% 100%; }
}
:root[data-theme="dark"] .chore.done .txt { color: var(--mark-ink); background-size: 100% 100%; }

@media (prefers-reduced-motion: reduce) {
  .box, .box::after, .txt, .auto { transition: none !important; }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .week { transform: none; box-shadow: 6px 6px 0 var(--shadow); max-width: 560px; }
}

/* ---------- Questions (chat) ---------- */
.questions { background: var(--sunk); }
.thread { margin-top: 48px; display: grid; gap: 44px; }
.qa { display: grid; gap: 14px; }
.ask {
  justify-self: start; max-width: 82%;
  background: var(--surface); border: 1px solid var(--line);
  padding: 14px 18px; border-radius: 20px 20px 20px 6px;
  font-size: 1.12rem; margin: 0;
}
.reply { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: end; justify-self: end; max-width: 88%; }
.face { width: 36px; height: 36px; border-radius: 50%; order: 2; }
.reply { grid-template-columns: 1fr 36px; }
.bubble {
  background: var(--ink); color: var(--paper);
  padding: 18px 20px; border-radius: 20px 20px 6px 20px;
}
.bubble .lead { font-family: var(--f-display); font-weight: 700; font-size: 1.22rem; line-height: 1.3; letter-spacing: -0.01em; margin-bottom: .55em; }
.bubble p { color: inherit; }
.bubble p:not(.lead) { opacity: .9; }
.thread-end { margin-top: 48px; font-size: 1.1rem; }

/* demo snippets inside replies */
.demo { margin-top: 16px; background: var(--paper); color: var(--ink); border-radius: var(--r-md); padding: 12px 14px; font-size: .98rem; }
.inbox .row { display: flex; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.inbox .row:last-child { border-bottom: 0; }
.inbox .dim { color: var(--muted); }
.tag { flex: none; font-size: .8rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.t-now { background: #FFD8D2; color: #7A1D12; }
.t-soon { background: #FFE9A8; color: #5E4500; }
.t-draft { background: #D5E0FF; color: #1A2F86; }
.t-filed { background: var(--sunk); color: var(--muted); }
.call .call-meta { color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
.call .line { margin: 0 0 6px; }
.call .line b { display: inline-block; min-width: 82px; }
.call .call-result { margin: 10px 0 0; font-weight: 700; color: var(--ok); }
.flow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flow .node { background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--r-sm); padding: 6px 10px; font-weight: 700; font-size: .92rem; }
.flow .pipe { flex: 0 0 34px; height: 2px; background: var(--ink); position: relative; }
.flow .pipe::after { content: ""; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--ink); border-right: 0; }
.flow .outs { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .ask { max-width: 94%; }
  .reply { max-width: 100%; grid-template-columns: 1fr; }
  .face { display: none; }
  .call .line b { min-width: 0; margin-right: 6px; }
}

/* ---------- Services ---------- */
.services-head { max-width: 680px; }
.svc { margin: 48px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); column-gap: clamp(32px, 5vw, 72px); }
.svc > div { padding: 22px 0; border-top: 2px solid var(--ink); }
.svc dt { font-family: var(--f-display); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.01em; }
.svc dd { margin: 6px 0 0; color: var(--muted); max-width: 46ch; }
@media (max-width: 720px) { .svc { grid-template-columns: 1fr; } }

/* ---------- Estimator ---------- */
.estimate { background: var(--ink); color: var(--paper); }
.estimate .section-lede { color: color-mix(in srgb, var(--paper) 78%, transparent); }
.est-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.est-form {
  background: var(--surface); color: var(--ink); border-radius: var(--r-lg); padding: clamp(22px, 3vw, 34px);
  display: grid; gap: 10px;
}
.est-form label { display: flex; justify-content: space-between; gap: 16px; font-weight: 700; margin-top: 8px; }
.est-form output { font-family: var(--f-display); font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.est-form input[type="range"] { width: 100%; accent-color: var(--action); height: 28px; }
.est-result { margin: 18px 0 8px; padding: 18px 20px; background: var(--mark); color: var(--mark-ink); border-radius: var(--r-md); }
.est-result p { margin: 0; }
.est-result .big { font-family: var(--f-display); font-weight: 800; font-size: 2.6rem; line-height: 1; letter-spacing: -0.03em; margin-right: 4px; }
.est-result p + p { margin-top: 6px; }
.est-form .btn { justify-self: start; }
@media (max-width: 860px) { .est-grid { grid-template-columns: 1fr; } }

/* ---------- How ---------- */
.steps { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 48px); counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-top: 74px; }
.steps li::before {
  content: counter(step); position: absolute; top: 0; left: 0;
  width: 54px; height: 54px; display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 800; font-size: 1.6rem;
  background: var(--mark); color: var(--mark-ink); border: 2px solid var(--ink); border-radius: 50%;
}
.steps li:not(:last-child)::after {
  content: ""; position: absolute; top: 27px; left: 66px; right: -12px; border-top: 2px dashed var(--line);
}
.steps p { color: var(--muted); margin-top: 10px; }
@media (max-width: 820px) {
  .steps { grid-template-columns: 1fr; }
  .steps li { padding: 0 0 0 76px; min-height: 54px; }
  .steps li:not(:last-child)::after { top: 62px; bottom: -22px; left: 27px; right: auto; border-top: 0; border-left: 2px dashed var(--line); }
}

/* ---------- About ---------- */
.about { background: var(--sunk); }
.about-grid { display: grid; grid-template-columns: 380px 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.portrait img { border-radius: var(--r-lg); border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--shadow); width: 100%; aspect-ratio: 1; object-fit: cover; }
.about-copy h2 { margin-bottom: 22px; }
.about-copy > p { max-width: 62ch; }
.promises { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.promises li { padding-left: 36px; position: relative; max-width: 60ch; }
.promises li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 22px; height: 22px; border-radius: 6px;
  background: var(--mark); border: 2px solid var(--ink);
}
.promises li::after {
  content: ""; position: absolute; left: 8px; top: 6px; width: 6px; height: 11px;
  border: solid var(--mark-ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 320px; }
}

/* ---------- FAQ ---------- */
.faq h2 { margin-bottom: 32px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 44px 20px 0; position: relative;
  font-family: var(--f-display); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 14px; height: 14px; margin-top: -9px;
  border: solid var(--ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { color: var(--muted); padding: 0 0 22px; max-width: 64ch; margin: 0; }
@media (prefers-reduced-motion: reduce) { .faq summary::after { transition: none; } }

/* ---------- Contact ---------- */
.contact { border-top: 1px solid var(--line); }
.contact-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.contact-copy h2 { margin-bottom: 18px; font-size: clamp(2.1rem, 4.4vw, 3.3rem); font-weight: 800; }
.contact-copy p { max-width: 42ch; }
.direct { color: var(--muted); }
.contact-form {
  background: var(--surface); border: 2px solid var(--ink); border-radius: var(--r-lg);
  box-shadow: 8px 8px 0 var(--shadow); padding: clamp(22px, 3vw, 34px); display: grid; gap: 18px;
}
.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label { font-weight: 700; font-size: 1rem; }
.opt { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 1.05rem; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--action); box-shadow: 0 0 0 3px color-mix(in srgb, var(--action) 30%, transparent); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--err); }
.field textarea::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-form .btn { justify-self: start; }
.form-status { margin: 0; min-height: 1.6em; font-weight: 700; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--err); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } .contact-form { box-shadow: 5px 5px 0 var(--shadow); } }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .95rem; }
.foot-inner { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.foot p { margin: 0; }
