/* Yarned design system.
   One family (Bricolage Grotesque, self-hosted), deep kawakawa green ink on a cool sea-mist ground,
   kōwhai yellow reserved for the "thread" and primary buttons. No inline styles anywhere (strict CSP). */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/static/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --ink: #10372b;
  --ink-soft: #56675f;
  --ground: #f3f6f4;
  --surface: #ffffff;
  --line: #d6dfda;
  --kowhai: #f2b72e;
  --kowhai-deep: #d99a0b;
  --danger: #b42318;
  --focus: #1d6fe0;

  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --measure: 38rem;
  --radius-s: 0.5rem;
  --radius-l: 1.25rem;
  --shadow-note: 0 1px 0 rgba(16, 55, 43, 0.06), 0 24px 48px -24px rgba(16, 55, 43, 0.35);
  color-scheme: light;
}


* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variation-settings: "opsz" 14;
  color: var(--ink);
  background: var(--ground);
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
p { margin: 0 0 1rem; max-width: var(--measure); }

/* ---- type ---------------------------------------------------------------- */
h1, h2, h3 {
  font-weight: 720;
  font-stretch: 82%;
  font-variation-settings: "opsz" 96;
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0 0 1rem;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 6.4vw, 5.25rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
h3 { font-size: 1.35rem; font-stretch: 90%; line-height: 1.15; }
.lead { font-size: clamp(1.15rem, 1.6vw, 1.35rem); line-height: 1.5; color: var(--ink-soft); max-width: 34rem; }
.muted { color: var(--ink-soft); }

/* ---- layout -------------------------------------------------------------- */
.wrap { width: min(72rem, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(30rem, 100% - 2.5rem); margin-inline: auto; }
main { display: block; }
.band { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.band + .band { border-top: 1px solid var(--line); }

/* ---- header / footer ----------------------------------------------------- */
.site-header { padding-block: 1.1rem; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; }
.logo svg { width: 2.1rem; height: 2.1rem; }
.logo-word { font-size: 1.6rem; font-weight: 760; font-stretch: 85%; letter-spacing: -0.03em; line-height: 1; }
.bubble { stroke: var(--ink); }
.nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.nav a { text-decoration: none; font-weight: 520; }
.nav a:hover { text-decoration: underline; }
.nav form { margin: 0; }

.site-footer { border-top: 1px solid var(--line); padding-block: 2rem 2.5rem; color: var(--ink-soft); font-size: 0.95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; justify-content: space-between; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.25rem; }

/* ---- buttons ------------------------------------------------------------- */
.button, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: inherit; font-weight: 650; font-stretch: 92%;
  padding: 0.8rem 1.35rem; border-radius: 999px; border: 2px solid transparent;
  background: var(--kowhai); color: #10372b; text-decoration: none; cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.button:hover, button:hover { background: var(--kowhai-deep); text-decoration: none; }
.button:active, button:active { transform: translateY(1px); }
.button.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.button.ghost:hover { border-color: var(--ink); background: transparent; }
.button.small { padding: 0.5rem 1rem; font-size: 0.95rem; }
button.link { background: none; border: 0; padding: 0; color: inherit; font-weight: 520; text-decoration: underline; }
button.link:hover { background: none; text-decoration-thickness: 2px; }

/* ---- hero ---------------------------------------------------------------- */
.hero { position: relative; padding-block: clamp(2rem, 5vw, 4rem) clamp(3rem, 6vw, 4.5rem); overflow: hidden; }
.hero .wrap { display: grid; gap: 3rem; align-items: start; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.hero-fine { margin-top: 1rem; font-size: 0.95rem; color: var(--ink-soft); }
.thread { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; display: none; }
.thread path { fill: none; stroke: var(--kowhai); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw 1.8s 0.3s cubic-bezier(.6,.05,.25,1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

@media (min-width: 60rem) {
  .hero .wrap { grid-template-columns: 1.1fr 0.9fr; gap: 4rem; }
  .hero-copy { padding-top: 2.5rem; }
  .thread { display: block; }
}

/* the example note: the product's actual output */
.note {
  position: relative; z-index: 1;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
  box-shadow: var(--shadow-note); padding: 1.5rem 1.6rem 1.4rem; font-size: 0.98rem;
}
.note-head { display: flex; gap: 0.85rem; align-items: center; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.note-head svg { width: 2.4rem; height: 2.4rem; flex: none; }
.note-title { font-weight: 680; font-size: 1.08rem; line-height: 1.2; margin: 0; }
.note-meta { color: var(--ink-soft); font-size: 0.9rem; margin: 0.15rem 0 0; }
.note h3 { font-size: 1rem; font-stretch: 95%; font-weight: 680; margin: 1.1rem 0 0.4rem; letter-spacing: 0; }
.note ul { margin: 0; padding-left: 1.1rem; }
.note li { margin: 0.2rem 0; }
.note li::marker { color: var(--kowhai-deep); }
.note .transcript { color: var(--ink-soft); border-left: 3px solid var(--kowhai); padding-left: 0.85rem; margin: 0; }
@media (min-width: 60rem) { .note { margin-top: 3.5rem; } }

/* ---- how it works (a real sequence) -------------------------------------- */
.steps { list-style: none; counter-reset: step; margin: 2.5rem 0 0; padding: 0; display: grid; gap: 2.25rem; }
.steps li { counter-increment: step; position: relative; padding-top: 3.4rem; }
.steps li::before {
  content: counter(step); position: absolute; top: 0; left: 0;
  font-size: 2.6rem; font-weight: 760; font-stretch: 80%; line-height: 1;
  color: var(--ink); border-bottom: 3px solid var(--kowhai); padding-bottom: 0.1rem;
}
.steps p { color: var(--ink-soft); }
@media (min-width: 52rem) { .steps { grid-template-columns: repeat(3, 1fr); gap: 3rem; } }

/* ---- privacy ------------------------------------------------------------- */
.facts { margin: 2.5rem 0 0; display: grid; gap: 1.75rem; }
.facts dt { font-weight: 680; font-size: 1.15rem; font-stretch: 92%; }
.facts dd { margin: 0.25rem 0 0; color: var(--ink-soft); max-width: 30rem; }
@media (min-width: 52rem) { .facts { grid-template-columns: repeat(3, 1fr); gap: 3rem; } }

/* ---- pricing ------------------------------------------------------------- */
.plan { margin-top: 2.5rem; display: grid; gap: 2rem; align-items: center;
  background: var(--ink); color: var(--ground); border-radius: var(--radius-l); padding: clamp(1.75rem, 4vw, 3rem); }
.plan .price { font-size: clamp(2.6rem, 5vw, 3.8rem); font-weight: 760; font-stretch: 80%; line-height: 1; margin: 0; }
.plan .price small { font-size: 1rem; font-weight: 500; font-stretch: 100%; opacity: 0.8; }
.plan ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.55rem; }
.plan li { padding-left: 1.6rem; position: relative; }
.plan li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 0.9rem; height: 3px; background: var(--kowhai); border-radius: 2px; }
.plan p { color: inherit; opacity: 0.85; }
@media (min-width: 52rem) { .plan { grid-template-columns: 1fr 1fr; } }

/* ---- FAQ ----------------------------------------------------------------- */
.faq { margin-top: 2rem; max-width: 46rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 1.1rem 2rem 1.1rem 0; font-weight: 640; font-size: 1.1rem; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.25rem; top: 0.9rem; font-size: 1.4rem; font-weight: 500; color: var(--ink-soft); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--ink-soft); }

.closer { text-align: left; }
.closer .wrap { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between; }
.closer h2 { margin: 0; }

/* ---- app pages: forms, panels, messages ---------------------------------- */
.page { padding-block: clamp(2rem, 6vw, 4rem) 4rem; }
.page h1 { font-size: clamp(2.1rem, 4.5vw, 3rem); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: clamp(1.25rem, 4vw, 2rem); margin: 1.25rem 0; }
.panel h2 { font-size: 1.5rem; }
.panel > :last-child { margin-bottom: 0; }

label { display: block; font-weight: 620; margin: 1.15rem 0 0.35rem; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--radius-s); padding: 0.7rem 0.85rem;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-soft); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--ink); }
form > button:not(.link), form .actions { margin-top: 1.5rem; }
.actions { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; }
.hint { color: var(--ink-soft); font-size: 0.92rem; margin: 0.35rem 0 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-l); padding: 0.5rem 1.25rem 1.25rem; margin: 1.5rem 0 0; }
legend { font-weight: 680; padding: 0 0.4rem; }
.choice { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 620; margin: 1rem 0 0; }
.choice input { width: auto; margin-top: 0.35rem; accent-color: var(--ink); }
.choice-hint { margin: 0.2rem 0 0 1.6rem; }
.choice-hint strong { color: var(--ink); }

.errors { color: var(--danger); margin: 0 0 1rem; padding-left: 1.1rem; }
p.errors { padding-left: 0; }
.flash { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--kowhai); padding: 0.8rem 1rem; border-radius: var(--radius-s); max-width: none; }
.below { margin-top: 1.5rem; color: var(--ink-soft); }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.checklist li { display: flex; gap: 0.7rem; align-items: center; }
.tick { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; }
.tick.done { background: var(--kowhai); border-color: var(--kowhai); }
.tick.done::after { content: ""; width: 0.38rem; height: 0.7rem; border: solid #10372b; border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }

.prose { max-width: var(--measure); }

@media (prefers-reduced-motion: reduce) {
  .thread path { animation: none; stroke-dashoffset: 0; }
  .button, button { transition: none; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- admin ---------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-weight: 650; color: var(--ink-soft); }
.table form { display: inline; margin: 0 0.5rem 0 0; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.25rem; margin: 0; }
.details dt { font-weight: 620; }
.details dd { margin: 0; }
.panel form + form { margin-top: 0.75rem; }

/* ---- mobile verification -------------------------------------------------- */
.verify-code { font-size: clamp(2.6rem, 9vw, 3.6rem); font-weight: 760; font-stretch: 80%; letter-spacing: 0.08em; line-height: 1; margin: 0.5rem 0 1.25rem; }
.status-line.problem { color: var(--danger); }

/* ---- contacts: list + profile --------------------------------------------- */
.contacts { display: grid; gap: 1.25rem; align-items: start; margin-top: 1.25rem; }
.contacts .panel { margin: 0; }
.contact-pane { padding: 0.75rem; }
.contact-search input { margin: 0; }
.contact-list { list-style: none; margin: 0.5rem 0 0; padding: 0; max-height: 70vh; overflow-y: auto; }
.contact-list a { display: grid; grid-template-columns: 1fr auto; gap: 0 0.75rem; padding: 0.7rem 0.6rem;
  border-radius: var(--radius-s); text-decoration: none; }
.contact-list a:hover { background: var(--ground); }
.contact-list a[aria-current] { background: var(--ground); box-shadow: inset 3px 0 0 var(--kowhai); }
.contact-label { min-width: 0; font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-when, .contact-number { color: var(--ink-soft); font-size: 0.9rem; }
.contact-when { text-align: right; }
.contact-none { padding: 0.7rem 0.6rem; }
.contact-profile h2 { margin-bottom: 0.25rem; overflow-wrap: anywhere; }
.contact-profile h3 { margin: 1.25rem 0 0; }
.contact-profile h3.contact-calls { margin: 2rem 0 0.5rem; }
.contact-tel a { color: inherit; }
.contact-back { display: none; margin-bottom: 0.75rem; font-weight: 520; text-decoration: none; }
.contact-delete { margin-top: 1.25rem; }
.contact-delete summary { cursor: pointer; color: var(--danger); font-weight: 520; }
.contact-empty { display: grid; place-items: center; min-height: 12rem; }
.contact-empty p { margin: 0; }
.table tr.call:has(+ tr.call-extra) td { border-bottom: 0; padding-bottom: 0.2rem; }
.call-extra td { padding-top: 0; }
.call-extra p { margin: 0.35rem 0 0; }
.call-notes summary { cursor: pointer; font-weight: 620; padding: 0.35rem 0; }
.call-notes-body { padding: 0.25rem 0 0.5rem; }
.call-summary { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--ground); padding: 0.75rem;
  border-radius: var(--radius-s); }
.call-downloads { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.call-downloads a { font-weight: 520; }
.table form.call-move { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.5rem 0 0; }
.call-move label { margin: 0; font-weight: 620; }
.call-move select { width: auto; max-width: 100%; margin: 0; font-size: 1rem; }   /* 16px: no iOS zoom */
form.call-move > button:not(.link) { margin-top: 0; }
@media (min-width: 45rem) {
  .contacts { grid-template-columns: minmax(15rem, 20rem) 1fr; }
}
@media (max-width: 44.99rem) {
  .contacts.has-profile .contact-pane, .contacts:not(.has-profile) .contact-profile { display: none; }
  .contact-back { display: inline-block; }
}
