/* ==========================================================================
   Wells Law Firm interim site — single stylesheet.
   Tokens and rules per wells-site-design.md §4–§7 (decisions D17–D19).
   No framework. No animation anywhere (design §11: prefers-reduced-motion
   is satisfied by construction — the page has no motion to reduce).
   ========================================================================== */

/* Self-hosted fonts, SIL OFL 1.1. Licenses: fonts/OFL-Alegreya.txt,
   fonts/OFL-Atkinson-Hyperlegible.txt. No font CDN. */
@font-face {
  font-family: "Alegreya";
  src: url("/fonts/alegreya-500-latin.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-700-latin.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Color (design §4 / D17) */
  --color-mist: #F1F2EF;
  --color-pine-ink: #182B22;
  --color-spruce: #2E5A44;
  --color-sage: #57685E;
  --color-snow: #FFFFFF;
  --color-brick: #A63D2F; /* errors only, never decorative */

  /* Type scale (design §6) — nothing below 1rem */
  --text-phone: clamp(2.25rem, 11vw, 3.25rem);
  --text-h1: clamp(1.625rem, 4.5vw + 0.75rem, 2.5rem);
  --text-h2: 1.375rem;
  --text-lead: 1.25rem;
  --text-body: 1.125rem;
  --text-small: 1rem;

  /* Spacing scale (design §7) */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  --radius: 2px;

  --font-serif: "Alegreya", Georgia, serif;
  --font-sans: "Atkinson Hyperlegible", Verdana, system-ui, sans-serif;

  --gutter: 1.25rem;         /* 2.5rem from the desktop breakpoint up */
  --callbar-h: 4rem;         /* 64 px sticky call bar */
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--color-mist);
  color: var(--color-pine-ink);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.6;
}

/* Focus (design §7): never removed, never color-only */
:focus-visible {
  outline: 3px solid var(--color-pine-ink);
  outline-offset: 2px;
}

/* Links: Spruce, underlined, never color alone */
a {
  color: var(--color-spruce);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--color-pine-ink); }

/* --------------------------------------------------------------------------
   Page frame: letterhead column, max 72rem, one gutter edge
   -------------------------------------------------------------------------- */
body > header,
body > main,
body > footer {
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Hairline 1 of 3: under the header */
.site-header {
  padding-top: var(--space-m);
  padding-bottom: var(--space-m);
  border-bottom: 1px solid var(--color-sage);
}

h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: var(--text-h1);
  line-height: 1.2;
  margin: 0 0 var(--space-3xs);
  text-wrap: balance;
}

.subline {
  margin: 0;
  color: var(--color-sage);
  font-size: var(--text-small);
  line-height: 1.5;
}

/* On /privacy the wordmark is a <p>, not the page's h1 */
.wordmark {
  margin: 0 0 var(--space-3xs);
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: var(--text-h1);
  line-height: 1.2;
}

h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: var(--text-h2);
  line-height: 1.3;
  margin: 0 0 var(--space-s);
}

/* --------------------------------------------------------------------------
   Rail: status line, phone band, hours, practice areas
   -------------------------------------------------------------------------- */
.status {
  margin: var(--space-l) 0;
  max-width: 34rem;
  font-size: var(--text-lead);
  line-height: 1.5;
}

/* The anchor (design §9.1). Full-bleed Spruce band; the whole band is one
   tel: link; the largest interactive element on the page. */
.phone-band {
  display: block;
  margin-inline: calc(-1 * var(--gutter)); /* full bleed on mobile */
  padding: var(--space-m) var(--gutter);
  background: var(--color-spruce);
  color: var(--color-snow);
  text-decoration: none;
}
.phone-band:hover { color: var(--color-snow); }
.phone-band:focus-visible {
  outline: 3px solid var(--color-snow); /* Snow inset on Spruce */
  outline-offset: -4px;
}
.phone-label {
  display: block;
  font-size: var(--text-small);
  line-height: 1.5;
}
.phone-number {
  display: block;
  font-weight: 700;
  font-size: var(--text-phone);
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.phone-note {
  display: block;
  margin-top: var(--space-3xs);
  font-size: var(--text-small);
  line-height: 1.5;
}

/* Hours: run-in caption bound to the number (design §9.1) */
.hours { margin: var(--space-l) 0 0; font-size: var(--text-small); line-height: 1.5; }
.hours-label { display: block; font-weight: 700; }

.practices { margin-top: var(--space-xl); }

.practice-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 36rem;
  font-size: var(--text-body);
  line-height: 1.6;
}
.practice-list li { margin-top: var(--space-2xs); }
.practice-list li:first-child { margin-top: 0; }

/* Q5a qualifier (deck §1.5 primary proposal): quieter, still 4.5:1+ */
.practice-note {
  margin: var(--space-s) 0 0;
  max-width: 36rem;
  color: var(--color-sage);
  font-size: var(--text-small);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Form
   -------------------------------------------------------------------------- */
.intake { margin-top: var(--space-xl); }

.intake-intro {
  margin: 0 0 var(--space-m);
  max-width: 36rem;
  font-size: var(--text-body);
  line-height: 1.6;
}

.field { margin-top: var(--space-s); max-width: 32rem; }
.field:first-child { margin-top: 0; }

.field-label,
legend.field-label {
  display: block;
  font-weight: 700;
  font-size: var(--text-small);
  line-height: 1.5;
  margin-bottom: var(--space-3xs);
  padding: 0;
}

.field-help {
  margin: 0 0 var(--space-3xs);
  color: var(--color-sage);
  font-size: var(--text-small);
  line-height: 1.5;
}

.input {
  width: 100%;
  min-height: 3rem; /* 48 px tap target */
  padding: var(--space-xs);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.4;
  color: var(--color-pine-ink);
  background: var(--color-snow);
  border: 1px solid var(--color-sage);
  border-radius: var(--radius);
}
.input:focus-visible {
  outline: 3px solid var(--color-pine-ink);
  outline-offset: 2px;
}
.input[aria-invalid="true"] { border-color: var(--color-brick); }

.textarea {
  max-width: 36rem;
  min-height: 10rem;
  resize: vertical;
}

fieldset.field {
  border: 0;
  padding: 0;
  margin-inline: 0;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-m);
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3xs);
  min-height: 3rem; /* whole label row is the tap target */
  padding: var(--space-2xs) 0;
  font-size: var(--text-small);
  line-height: 1.5;
  cursor: pointer;
}
.choice input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--color-spruce);
}
.choice input[type="checkbox"] { margin-top: 0.1875rem; }

.choice-ack { max-width: 32rem; }

/* Honeypot: invisible to people and assistive technology, present for bots */
.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.char-counter {
  margin: var(--space-3xs) 0 0;
  max-width: 36rem;
  color: var(--color-sage);
  font-size: var(--text-small);
  line-height: 1.5;
  text-align: right;
}

.field-error {
  margin: var(--space-3xs) 0 0;
  color: var(--color-brick);
  font-size: var(--text-small);
  line-height: 1.5;
}

/* Turnstile: the only third-party visual on the page */
.turnstile-wrap { margin-top: var(--space-m); max-width: 32rem; }

/* Hairline 2 of 3: above the §8.3 disclaimer, which sits adjacent to the
   submit control, not in a footer (spec §8.3) */
.disclaimer-block {
  margin-top: var(--space-m);
  padding-top: var(--space-m);
  border-top: 1px solid var(--color-sage);
}

.disclaimer {
  margin: 0;
  max-width: 32rem;
  font-size: var(--text-small);
  line-height: 1.5;
}
.disclaimer a { font-weight: 700; }

.submit {
  display: block;
  width: 100%;
  max-width: 32rem;
  min-height: 3.5rem; /* 56 px */
  margin-top: var(--space-m);
  padding: var(--space-xs) var(--space-m);
  background: var(--color-spruce);
  color: var(--color-snow);
  border: 0;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: var(--text-body);
  line-height: 1.4;
  cursor: pointer;
}
.submit:hover { background: var(--color-pine-ink); }
.submit:focus-visible {
  outline: 3px solid var(--color-snow); /* Snow inset on Spruce */
  outline-offset: -4px;
}
.submit[disabled] {
  background: var(--color-sage);
  cursor: default;
}

/* Submission states (design §8.3) */
.form-summary { margin-top: var(--space-m); max-width: 32rem; }
.form-summary h3,
.form-success h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 0 0 var(--space-3xs);
}
.form-summary p { margin: 0; }
.summary-list { margin: var(--space-s) 0 0; padding-left: 1.25rem; }
.summary-list li { margin-top: var(--space-3xs); }

.form-success {
  margin-top: var(--space-m);
  max-width: 32rem;
  padding-left: var(--space-s);
  border-left: 3px solid var(--color-spruce);
}
.form-success p { margin: 0; }

/* --------------------------------------------------------------------------
   Footer (deck §5): each item on its own line, no middle-dot meta strings
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: var(--space-3xl);
  padding-bottom: calc(var(--callbar-h) + env(safe-area-inset-bottom, 0px) + var(--space-l));
  color: var(--color-sage);
  font-size: var(--text-small);
  line-height: 1.5;
}
.site-footer p { margin: 0 0 var(--space-3xs); }
.site-footer a { color: var(--color-spruce); }

/* --------------------------------------------------------------------------
   Sticky mobile call bar (design §9.2): present from first paint, quiet
   -------------------------------------------------------------------------- */
.call-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  min-height: var(--callbar-h);
  padding: var(--space-2xs) var(--gutter);
  padding-bottom: calc(var(--space-2xs) + env(safe-area-inset-bottom, 0px));
  background: var(--color-snow);
  border-top: 1px solid var(--color-sage); /* hairline 3 of 3 */
  color: var(--color-pine-ink);
  text-decoration: none;
}
.call-bar:hover { color: var(--color-pine-ink); }
.call-bar-label { font-size: var(--text-small); line-height: 1.5; }
.call-bar-number {
  font-weight: 700;
  font-size: var(--text-body);
  line-height: 1.4;
  color: var(--color-spruce);
}

/* --------------------------------------------------------------------------
   Privacy notice (/privacy)
   -------------------------------------------------------------------------- */
.notice { max-width: 36rem; }
.notice h2 { margin-top: var(--space-m); }
.notice p { margin: 0 0 var(--space-s); }
.notice .notice-intro { margin-bottom: var(--space-m); }

/* --------------------------------------------------------------------------
   Desktop: single breakpoint at 56rem. Content and order are identical;
   only the grid changes (design §8.2).
   -------------------------------------------------------------------------- */
@media (min-width: 56rem) {
  :root { --gutter: 2.5rem; }

  body > main {
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: 0 var(--space-xl);
    align-items: start;
  }

  .rail {
    position: sticky;
    top: var(--space-l);
  }

  .status { margin-top: var(--space-l); }

  /* Band contained to the rail; no longer full bleed */
  .phone-band { margin-inline: 0; }

  .practices { margin-top: var(--space-2xl); }

  .intake { margin-top: var(--space-2xl); }

  .site-footer { margin-top: var(--space-3xl); }

  /* Anchor pinned in the rail: sticky call bar is hidden */
  .call-bar { display: none; }

  .site-footer { padding-bottom: var(--space-l); }
}
