/* Spezo Money Coaching
   One stylesheet, no framework.
   Sections: fonts, tokens, base, layout, header, buttons, components, pages, footer, small screens. */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --paper: #F5F7F6;
  --white: #FFFFFF;
  --ink: #10302A;
  --ink-soft: #40544F;
  --rule: #C9D5D0;
  --wash: #E3EBE7;
  --mark: #F4C430;          /* highlighter yellow */

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: clamp(1.875rem, 1.4rem + 1.9vw, 2.625rem);
  --step-4: clamp(2.5rem, 1.5rem + 4.4vw, 4.75rem);

  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --band: clamp(4rem, 9vw, 7.5rem);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 420;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); font-variation-settings: "opsz" 144; }
h2 { font-size: var(--step-3); font-variation-settings: "opsz" 96; }
h3 { font-size: var(--step-2); font-variation-settings: "opsz" 48; line-height: 1.2; letter-spacing: -0.005em; }

p { margin: 0 0 1em; max-width: 62ch; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--mark); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper); padding: 0.75rem 1rem; z-index: 20;
}
.skip:focus { left: 0; }

.lede { font-size: var(--step-1); line-height: 1.5; color: var(--ink-soft); max-width: 46ch; }
.soft { color: var(--ink-soft); }
.num  { font-variant-numeric: tabular-nums lining-nums; }

/* The highlighter: the one recurring brand device. Use it on figures, sparingly. */
.hl {
  background: linear-gradient(transparent 56%, var(--mark) 56%, var(--mark) 94%, transparent 94%);
  padding: 0 0.12em;
  margin: 0 -0.12em;
}

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 var(--gutter); }

.band { padding: var(--band) 0; }
.band-wash { background: var(--wash); }
.band-ink { background: var(--ink); color: var(--paper); }
.band-ink .soft, .band-ink .lede { color: #B9CBC4; }
.band-rule { border-top: 1px solid var(--rule); }

/* Margin heading on the left, content on the right, like a ledger with a wide margin. */
.split { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.split > :first-child h2 { position: sticky; top: 6.5rem; }
.split .stack > * + * { margin-top: 1.25rem; }

.page-head { padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(2.5rem, 5vw, 4rem); }
.page-head h1 { font-size: clamp(2.25rem, 1.4rem + 3.6vw, 4rem); max-width: 18ch; }
.page-head .lede { margin-top: 1.5rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 4.5rem; gap: 1.5rem; }

.logo { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--ink); }
.logo-mark { width: 2.25rem; height: 2.25rem; flex: none; }
.logo-mark path { fill: none; stroke: currentColor; stroke-width: 3.6; stroke-linecap: round; }
.logo-mark circle { fill: var(--mark); }
.logo-word {
  font-family: var(--serif); font-weight: 520; font-size: 1.75rem; line-height: 1;
  letter-spacing: 0.005em; font-variation-settings: "opsz" 144; padding-bottom: 0.18em;
}
.logo-light { color: var(--paper); }

.site-nav { display: flex; align-items: center; gap: 2rem; }
.site-nav ul { display: flex; gap: 1.75rem; }
.site-nav a:not(.btn) { text-decoration: none; font-size: 1rem; padding: 0.5rem 0; border-bottom: 2px solid transparent; }
.site-nav a:not(.btn):hover { border-bottom-color: var(--rule); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--mark); }

.nav-toggle {
  display: none; font: inherit; font-size: 1rem; color: var(--ink);
  background: none; border: 1px solid var(--ink); border-radius: 6px; padding: 0.45rem 0.9rem; cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font-family: var(--sans); font-weight: 600; font-size: 1.0625rem; line-height: 1;
  padding: 1rem 1.5rem; border-radius: 6px; text-decoration: none;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  transition: background-color 0.15s, color 0.15s;
}
.btn:hover { background: #1B463D; }
.btn-small { padding: 0.7rem 1.1rem; font-size: 1rem; }
.btn-light { background: var(--mark); color: var(--ink); border-color: var(--mark); }
.btn-light:hover { background: #FFD659; }
.text-link { font-weight: 600; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 1.75rem; margin-top: 2.25rem; }

/* ---------- Hero ---------- */
.hero { padding: clamp(3.5rem, 8vw, 7rem) 0 var(--band); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2.5rem, 6vw, 5rem); align-items: center; }
.hero h1 { max-width: 13ch; }
.hero .lede { margin-top: 1.75rem; }

/* The statement: ordinary spending, blurred, coming into focus once on load. */
.statement {
  background: var(--white); border: 1px solid var(--rule); border-radius: 4px;
  padding: 1.75rem 1.75rem 1.5rem; box-shadow: 0 24px 48px -32px rgba(16, 48, 42, 0.45);
  transform: rotate(1.2deg);
}
.statement-head { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--step--1); color: var(--ink-soft); padding-bottom: 0.9rem; border-bottom: 1px solid var(--ink); }
.statement li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.62rem 0; border-bottom: 1px solid var(--wash); font-size: 1rem; }
.statement li span:last-child { font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.statement .total { border-bottom: 0; padding-top: 1rem; font-weight: 700; }
.statement-note { margin-top: 1.5rem; font-size: var(--step--1); color: var(--ink-soft); max-width: 40ch; }

@media (prefers-reduced-motion: no-preference) {
  .statement li { animation: focus-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .statement li:nth-child(1) { animation-delay: 0.35s; }
  .statement li:nth-child(2) { animation-delay: 0.50s; }
  .statement li:nth-child(3) { animation-delay: 0.65s; }
  .statement li:nth-child(4) { animation-delay: 0.80s; }
  .statement li:nth-child(5) { animation-delay: 0.95s; }
  .statement li:nth-child(6) { animation-delay: 1.10s; }
  .statement li:nth-child(7) { animation-delay: 1.45s; }
  @keyframes focus-in {
    from { filter: blur(7px); opacity: 0.55; }
    to   { filter: blur(0);   opacity: 1; }
  }
}

/* ---------- See / Save / Spend ---------- */
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3.5rem); margin-top: 3.5rem; }
.pillars h3 { font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.5rem); font-variation-settings: "opsz" 144; font-style: italic; font-weight: 380; line-height: 1; margin-bottom: 1rem; }
.pillars > div { border-top: 1px solid var(--ink); padding-top: 1.25rem; }

/* ---------- Steps (a real sequence, so it is numbered) ---------- */
.steps { counter-reset: step; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 0 1.25rem; padding: 1.75rem 0; border-top: 1px solid var(--rule); }
.steps > li:last-child { border-bottom: 1px solid var(--rule); }
.steps > li::before { content: counter(step); font-family: var(--serif); font-size: 2.5rem; line-height: 1; font-variation-settings: "opsz" 144; font-weight: 380; }
.steps h3 { margin-bottom: 0.5rem; }
.steps .meta { display: block; margin-top: 0.75rem; font-size: var(--step--1); color: var(--ink-soft); }
.band-ink .steps > li, .band-ink .steps > li:last-child { border-color: #2C5148; }
.band-ink .steps .meta { color: #B9CBC4; }

/* ---------- Ledger (services and prices as rows, not cards) ---------- */
.ledger > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem 2rem; padding: 1.75rem 0; border-top: 1px solid var(--rule); align-items: baseline; }
.ledger > li:first-child { border-top-color: var(--ink); }
.ledger > li:last-child { border-bottom: 1px solid var(--ink); }
.ledger h3 a { text-decoration: none; }
.ledger h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.ledger p { grid-column: 1; color: var(--ink-soft); margin: 0; }
.ledger .amount { grid-column: 2; grid-row: 1; text-align: right; font-family: var(--serif); font-size: var(--step-2); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.ledger .amount small { display: block; font-family: var(--sans); font-size: var(--step--1); color: var(--ink-soft); }

/* ---------- Service detail ---------- */
.offer { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(2rem, 6vw, 5rem); padding: clamp(2.75rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--ink); }
.offer-price { font-family: var(--serif); font-size: var(--step-3); font-variant-numeric: tabular-nums lining-nums; line-height: 1.1; margin-top: 1.25rem; }
.offer-terms { font-size: var(--step--1); color: var(--ink-soft); margin-top: 0.5rem; max-width: 32ch; }
.offer h3.sub { font-family: var(--sans); font-size: 1rem; font-weight: 700; letter-spacing: 0; margin: 2rem 0 0.75rem; }

.ticks li { position: relative; padding: 0.55rem 0 0.55rem 1.75rem; border-bottom: 1px solid var(--rule); max-width: 62ch; }
.ticks li::before { content: ""; position: absolute; left: 0.1rem; top: 1.05rem; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--mark); }
.ticks.no li::before { background: none; border: 1.5px solid var(--ink-soft); }

.fit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 4rem); }
.fit h3 { margin-bottom: 1.25rem; }

/* ---------- Promise ---------- */
.promise { font-family: var(--serif); font-size: var(--step-3); line-height: 1.2; font-variation-settings: "opsz" 96; max-width: 24ch; letter-spacing: -0.01em; }
.band-ink .hl { color: var(--ink); background: var(--mark); padding: 0 0.18em; margin: 0; border-radius: 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* ---------- About ---------- */
.portrait {
  aspect-ratio: 4 / 5; background: var(--wash); border: 1px solid var(--rule); border-radius: 4px;
  display: grid; place-items: center; color: var(--ink-soft); font-size: var(--step--1); text-align: center; padding: 1.5rem;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }
.prose > * + * { margin-top: 1.1rem; }
.prose h2 { margin-top: 3rem; font-size: var(--step-2); }

/* ---------- Legal documents (privacy.php, terms.php) ---------- */
.legal { max-width: 46rem; }
.legal > h2:first-child { margin-top: 0; }
.legal h3 { font-family: var(--sans); font-size: 1rem; font-weight: 700; letter-spacing: 0; margin-top: 2rem; }
.legal p { max-width: none; margin-bottom: 0; }
.legal ul, .legal ol { padding-left: 1.4rem; }
.legal ul { list-style: disc; }
.legal ol { list-style: decimal; }
.legal li + li { margin-top: 0.4rem; }
.legal-table { overflow-x: auto; }
.legal table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 0.7rem 1rem 0.7rem 0; border-top: 1px solid var(--rule); }
.legal th { font-weight: 700; border-top: 1px solid var(--ink); }
.legal-version { margin-top: 0.75rem; font-size: var(--step--1); }
.legal-note { max-width: 46rem; margin-bottom: 2.5rem; padding: 0.9rem 1.1rem; background: var(--wash); border-left: 4px solid var(--mark); }
.legal-history { max-width: 46rem; margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.legal-history h2 { font-size: var(--step-1); margin-bottom: 0.75rem; }

/* ---------- FAQ ---------- */
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1.5rem; align-items: baseline;
  padding: 1.4rem 0; font-family: var(--serif); font-size: var(--step-1); font-variation-settings: "opsz" 36; line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--sans); font-size: 1.5rem; line-height: 1; flex: none; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 0 1.6rem; color: var(--ink-soft); }
.faq-group + .faq-group { margin-top: 3.5rem; }
.faq-group h2 { font-size: var(--step-2); margin-bottom: 1.25rem; }

/* ---------- Contact ---------- */
.contact-ways > li { padding: 2rem 0; border-top: 1px solid var(--rule); }
.contact-ways > li:first-child { border-top-color: var(--ink); }
.contact-ways h3 { margin-bottom: 0.6rem; }
.contact-ways .btn { margin-top: 1.25rem; }
.big-link { font-family: var(--serif); font-size: var(--step-2); font-variation-settings: "opsz" 48; }

/* ---------- Closing call to action ---------- */
.closing { background: var(--ink); color: var(--paper); padding: clamp(3.5rem, 7vw, 5.5rem) 0; }
.closing-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2rem; }
.closing h2 { max-width: 20ch; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #B9CBC4; font-size: 1rem; border-top: 1px solid #2C5148; padding: 3.5rem 0 2.5rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 4fr); gap: 2.5rem; }
.footer-brand p { margin-top: 1rem; max-width: 34ch; }
.site-footer li { padding: 0.3rem 0; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: var(--paper); }
.footer-fine { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid #2C5148; font-size: var(--step--1); }
.footer-fine p { max-width: 80ch; margin-bottom: 0.5rem; }

/* ---------- Small screens ---------- */
@media (max-width: 860px) {
  .hero-grid, .split, .offer, .fit, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .split > :first-child h2 { position: static; }
  .pillars { grid-template-columns: minmax(0, 1fr); }
  .statement { transform: none; }
  .hero h1 { max-width: 14ch; }

  .js .nav-toggle { display: inline-block; }
  .js .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    flex-direction: column; align-items: flex-start; gap: 1.25rem; padding: 1.25rem var(--gutter) 1.75rem;
  }
  .js .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0.25rem; width: 100%; }
  .site-nav a:not(.btn) { display: block; font-size: 1.125rem; padding: 0.6rem 0; }
  html:not(.js) .header-row { flex-wrap: wrap; padding-block: 0.75rem; }
  html:not(.js) .site-nav { flex-wrap: wrap; gap: 1rem; }
  html:not(.js) .site-nav ul { flex-direction: row; flex-wrap: wrap; gap: 1rem; }
}

@media (max-width: 520px) {
  .ledger > li { grid-template-columns: minmax(0, 1fr); }
  .ledger .amount { grid-column: 1; grid-row: auto; text-align: left; }
  .steps > li { grid-template-columns: 2.5rem minmax(0, 1fr); }
  .steps > li::before { font-size: 2rem; }
  .statement { padding: 1.25rem; }
  .closing .btn { width: 100%; text-align: center; }
}

@media print {
  .site-header, .closing, .nav-toggle { display: none; }
  body { background: #fff; }
}
