/* ============================================================
   roycestanfill.com — main.css
   Identity: "The Ledger & The Letter"
   Two voices with a hard boundary:
     — the LETTER: serif prose (Source Serif 4)
     — the LEDGER: monospace data (IBM Plex Mono)
   UI chrome (nav, labels, buttons): Inter.
   Palette (4, never more): paper, ink, grey, rust.
   No dark mode. No decorative motion.
   ============================================================ */

/* ---------- Fonts (self-hosted, latin subset only) ---------- */
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --paper: #FAF9F6;
  --ink: #161512;
  --grey: #6B6660;        /* secondary text — 5.4:1 on paper */
  --rule: #E4E1DB;        /* hairlines */
  --rust: #C4501B;        /* accents, large type, rules only (4.42:1) */
  --rust-text: #A33F12;   /* link/button rust — 6.09:1 on paper */
  --field-border: #CFCAC2;
  --field-bg: #FFFFFF;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --measure: 40rem;             /* ≈ 70ch of 19px serif */
  --line: 1.55rem;              /* base rhythm unit ≈ one text line */
  --pad-inline: 1.25rem;
}

/* ---------- Reset (minimal) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;         /* 19px */
  line-height: 1.55;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }

/* ---------- Layout ---------- */
.wrap {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--pad-inline);
}

/* ---------- Focus & selection ---------- */
:focus-visible {
  outline: 2px solid var(--rust-text);
  outline-offset: 3px;
  border-radius: 1px;
}
::selection { background: #EFD9CC; color: var(--ink); }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.9375rem;
  padding: 0.6rem 1rem;
  z-index: 10;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* ---------- Header ---------- */
.site-header { padding-top: 1.6rem; }
.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.wordmark {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: var(--ink); }
.site-nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: 1.4rem;
  align-items: baseline;
}
.site-nav a {
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--ink);
  text-decoration: none;
  padding-block: 0.2rem;
}
.site-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--rust);
  text-decoration-thickness: 2px;
}
.site-nav .nav-contact { color: var(--rust-text); font-weight: 500; }

@media (max-width: 34rem) {
  .site-header .wrap { flex-direction: column; gap: 0.6rem; }
  .site-nav ul { gap: 1.1rem; }
}

/* ---------- Section rules & indices (the ledger's wayfinding) ---------- */
.sec { padding-top: calc(var(--line) * 2.4); padding-bottom: calc(var(--line) * 2.4); }
.sec-rule {
  border-top: 1px solid var(--rule);
  padding-top: 0.55rem;
  margin-bottom: calc(var(--line) * 1.4);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.idx {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--grey);
}
.sec-label {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

/* ---------- The letter voice ---------- */
.prose p { margin-bottom: var(--line); max-width: 65ch; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { font-weight: 600; }
.prose em { font-style: italic; }
.prose a {
  color: var(--rust-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.prose a:hover { text-decoration-thickness: 2px; }

.lede { font-size: 1.25rem; line-height: 1.5; }

h1.statement {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 5.4vw, 2.9rem);
  line-height: 1.18;
  letter-spacing: -0.012em;
  max-width: 21ch;
  margin-bottom: var(--line);
}
h1.page-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 4.5vw, 2.3rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: var(--line);
}
h2.sub {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin: calc(var(--line) * 1.6) 0 calc(var(--line) * 0.6);
}
h2.sub:first-child { margin-top: 0; }

/* ---------- The ledger voice ---------- */
.mono, .meta {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}
.meta { color: var(--grey); }
.price {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--rust);
  white-space: nowrap;
}

/* ---------- Offers (editorial, not cards) ---------- */
.offer {
  border-top: 1px solid var(--rule);
  padding-top: 0.7rem;
  margin-top: calc(var(--line) * 1.1);
}
.offer-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}
.offer-name {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}
.offer-terms {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--grey);
  margin-top: 0.55rem;
}
.offer p { max-width: 65ch; }

/* ---------- Hero ---------- */
.hero {
  /* Sized so the section-02 rule is visible at the bottom of a small
     phone viewport (header ~80px + hero + sec padding < 667px). */
  min-height: 78vh;
  min-height: 78svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: calc(var(--line) * 2);
  padding-bottom: calc(var(--line) * 2);
}
.hero .tagline {
  font-size: 1.1875rem;
  color: var(--ink);
  max-width: 34rem;
  margin-bottom: calc(var(--line) * 1.2);
}
.hero .tagline .locale { color: var(--grey); }

/* ---------- CTA ---------- */
.cta {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.0625rem;
  color: var(--rust-text);
  text-decoration: none;
  border-bottom: 2px solid var(--rust);
  padding-bottom: 0.15rem;
}
.cta:hover { color: var(--rust); }
.cta .arrow { font-family: var(--serif); }

/* ---------- Principal ---------- */
.principal-plate {
  margin-top: calc(var(--line) * 1.2);
}
.principal-plate .plate-rule {
  width: 5.5rem;
  border-top: 2px solid var(--rust);
  margin-bottom: 0.5rem;
}
.principal-plate figcaption,
.plate-caption {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  color: var(--grey);
}
.principal-photo { max-width: 17rem; margin-bottom: 0.6rem; }

/* ---------- Index lists (work page, future notes) ---------- */
.record-list { list-style: none; padding: 0; margin: 0; }
.record-list li {
  border-top: 1px solid var(--rule);
  padding: 0.9rem 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

/* ---------- Forms (stationery, not app) ---------- */
form { max-width: 34rem; }
.field { margin-bottom: calc(var(--line) * 1.1); }
.field label {
  display: block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.35rem;
}
.field .hint {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--grey);
  margin: 0 0 0.5rem;
  max-width: 60ch;
}
.field .optional {
  font-weight: 400;
  color: var(--grey);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 1.0625rem; /* ≥16px: prevents iOS zoom */
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 2px;
  padding: 0.7rem 0.8rem;
}
textarea { min-height: 9rem; resize: vertical; }
input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--rust-text);
  outline-offset: 1px;
  border-color: var(--rust-text);
}
input[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--rust-text);
}
.field-error {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--rust-text);
  margin-top: 0.35rem;
}
.field-error:empty { display: none; }

/* Honeypot — hidden from humans, present for bots */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

button[type="submit"] {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--paper);
  background: var(--rust-text);
  border: none;
  border-radius: 2px;
  padding: 0.85rem 1.6rem;
  cursor: pointer;
}
button[type="submit"]:hover { background: var(--rust); }
button[type="submit"]:disabled { opacity: 0.6; cursor: default; }

.form-note {
  margin-top: calc(var(--line) * 1.2);
  max-width: 60ch;
}
.form-status { margin-top: var(--line); max-width: 60ch; }
.form-status .confirm {
  font-family: var(--serif);
  font-size: 1.1875rem;
  border-top: 1px solid var(--rule);
  padding-top: var(--line);
}
.form-status .error-msg {
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--rust-text);
}
.form-status:empty { display: none; }

/* ---------- Footer (colophon) ---------- */
.site-footer {
  margin-top: calc(var(--line) * 2);
  padding-top: calc(var(--line) * 1.2);
  padding-bottom: calc(var(--line) * 2.4);
}
.site-footer .wrap { border-top: 1px solid var(--rule); padding-top: var(--line); }
.site-footer p {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--grey);
  margin: 0 0 0.45rem;
}
.site-footer a { color: var(--grey); text-decoration: underline; text-underline-offset: 3px; }
.site-footer a:hover { color: var(--ink); }

/* ---------- Motion discipline ---------- */
a, button { transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .cta, form { display: none; }
  body { font-size: 11pt; }
}
