/* theme-a.css — Direction A · The Document
 * Single source of truth for the Welldone visual system at comp stage.
 * All pages in /comp/ reference this stylesheet.
 *
 * Type   : Spectral (display) · Hanken Grotesk (body) · JetBrains Mono (meta)
 * Paper  : Warm cream
 * Ink    : Warm dark, never pure black
 * Primary: Deep evergreen — used only on primary CTAs and active state
 * Accent : Terracotta — reserved for rare editorial pulls (pull-quotes, errors)
 */

/* ─── Tokens ──────────────────────────────────────────────────────────── */

:root {
  /* Colour */
  --paper:        #fbfaf6;
  --paper-deep:   #f3efe6;
  --paper-dark:   #ebe6dc;
  --ink:          #1c1814;
  --body:         #2c2620;
  --muted:        #6b6258;
  --muted-soft:   #8a8174;
  --rule:         #dcd5c8;
  --rule-subtle:  #ebe6dc;
  --primary:      #1f4d3a;
  --primary-hover:#173b2c;
  --primary-ink:  #fbfaf6;
  --accent:       #b3614a;

  /* Type */
  --display: "Spectral", Georgia, "Times New Roman", serif;
  --body-font: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Spacing rhythm — 4px base, used as named values */
  --gap-1: 4px;
  --gap-2: 8px;
  --gap-3: 12px;
  --gap-4: 16px;
  --gap-5: 24px;
  --gap-6: 32px;
  --gap-7: 48px;
  --gap-8: 64px;
  --gap-9: 96px;
  --gap-10: 128px;

  /* Layout */
  --page-max: 1320px;
  --gutter: 48px;
  --gutter-mobile: 20px;

  /* Component-level */
  --radius-sm: 2px;
  --radius:    4px;
  --radius-lg: 6px;
  --rule-weight: 1px;
  --rule-heavy:  1.5px;
}

/* ─── Reset / base ────────────────────────────────────────────────────── */

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

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--body-font);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font-family: inherit; }

/* ─── Type primitives ─────────────────────────────────────────────────── */

.t-display {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.02;
  color: var(--ink);
}
.t-h1 { font-family: var(--display); font-weight: 600; font-size: clamp(40px, 5vw, 60px); line-height: 1.02; letter-spacing: -0.02em; color: var(--ink); margin: 0; }
.t-h2 { font-family: var(--display); font-weight: 600; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.08; letter-spacing: -0.015em; color: var(--ink); margin: 0; }
.t-h3 { font-family: var(--display); font-weight: 600; font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; color: var(--ink); margin: 0; }
.t-h4 { font-family: var(--display); font-weight: 600; font-size: 18px; line-height: 1.25; color: var(--ink); margin: 0; }

.t-lede { font-family: var(--body-font); font-weight: 400; font-size: clamp(17px, 1.4vw, 19px); line-height: 1.55; color: var(--body); }
.t-body { font-family: var(--body-font); font-weight: 400; font-size: 16px; line-height: 1.6; color: var(--body); }
.t-small { font-family: var(--body-font); font-weight: 400; font-size: 14px; line-height: 1.55; color: var(--body); }
.t-meta { font-family: var(--mono); font-weight: 400; font-size: 11px; line-height: 1.5; color: var(--muted); letter-spacing: 0.04em; }
.t-tag { font-family: var(--mono); font-weight: 500; font-size: 11px; line-height: 1.4; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.t-data { font-family: var(--mono); font-weight: 400; font-size: 13px; line-height: 1.5; color: var(--body); font-variant-numeric: tabular-nums; }

.t-eyebrow { font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--gap-4); display: block; }

p, ul, ol { margin: 0 0 var(--gap-4); }

/* ─── Layout primitives ──────────────────────────────────────────────── */

.container { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }

@media (max-width: 720px) {
  .container { padding: 0 var(--gutter-mobile); }
}

.stack { display: flex; flex-direction: column; }
.row { display: flex; flex-direction: row; }

.section { padding: var(--gap-9) 0; }
.section-tight { padding: var(--gap-7) 0; }
.section-loose { padding: var(--gap-10) 0; }

.rule { border: 0; border-top: var(--rule-weight) solid var(--rule); margin: 0; }
.rule-heavy { border: 0; border-top: var(--rule-heavy) solid var(--ink); margin: 0; }

/* ─── Buttons ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--body-font); font-weight: 600; font-size: 15px;
  line-height: 1.2;
  padding: 14px 22px;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-sm { padding: 9px 14px; font-size: 13px; }

/* ─── Links ───────────────────────────────────────────────────────────── */

.link {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--primary);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition: text-decoration-color 120ms ease, color 120ms ease;
}
.link:hover { color: var(--primary); }

.link-meta {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.link-meta:hover { color: var(--primary); }

/* ─── Tags ────────────────────────────────────────────────────────────── */

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 5px 10px;
  border: 1px solid var(--rule);
  background: transparent;
  border-radius: 0;
}
.tag-filled { background: var(--paper-deep); border-color: transparent; color: var(--ink); }

/* ─── Photo placeholder (Direction A style) ───────────────────────────── */

.photo {
  position: relative;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  overflow: hidden;
}
.photo::before {
  content: ''; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg, transparent 0 16px, var(--rule) 16px 17px);
  opacity: 0.55;
  pointer-events: none;
}
.photo .photo-id {
  position: absolute; top: 14px; left: 14px;
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
  background: var(--paper); padding: 4px 8px;
  border: 1px solid var(--rule);
}
.photo .photo-caption {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 500;
  font-size: 22px; color: var(--muted-soft);
  text-align: center; padding: 0 var(--gap-5);
  line-height: 1.25;
}

/* ─── Inputs ──────────────────────────────────────────────────────────── */

.input, .select, .textarea {
  width: 100%;
  font-family: var(--body-font); font-size: 16px; line-height: 1.4;
  padding: 11px 14px;
  background: var(--paper); color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,77,58,0.18); }
.textarea { min-height: 110px; resize: vertical; }
.label { display: block; font-family: var(--body-font); font-weight: 500; font-size: 14px; color: var(--ink); margin-bottom: 6px; }
.helper { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ─── Tables ──────────────────────────────────────────────────────────── */

.table { width: 100%; border-collapse: collapse; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.table th, .table td { padding: 12px 14px; text-align: left; vertical-align: baseline; }
.table thead th { font-family: var(--mono); font-weight: 500; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--ink); }
.table tbody tr { border-top: 1px solid var(--rule-subtle); }
.table tbody tr:first-child { border-top: 0; }
.table .num { text-align: right; font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.table .num-large { text-align: right; font-family: var(--display); font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.table tr.total { border-top: 1.5px solid var(--ink); background: var(--paper-deep); }

/* ─── Pull-quote ──────────────────────────────────────────────────────── */

.pull {
  padding: var(--gap-5) 0 var(--gap-5) var(--gap-5);
  border-left: 3px solid var(--primary);
}
.pull .pull-text { font-family: var(--display); font-style: italic; font-weight: 500; font-size: 24px; line-height: 1.3; color: var(--ink); }
.pull .pull-attr { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--muted); margin-top: var(--gap-3); }

/* ─── Header / footer / nav ───────────────────────────────────────────── */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(8px);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; padding-bottom: 16px;
  gap: var(--gap-5);
}
.site-header .brand { display: flex; align-items: center; gap: var(--gap-4); flex-shrink: 0; }
.site-header .brand img { height: 30px; }
.site-header nav { display: flex; gap: var(--gap-6); flex: 1; justify-content: center; }
.site-header nav a {
  font-family: var(--body-font); font-size: 14px; font-weight: 500;
  color: var(--body); text-decoration: none;
  transition: color 120ms ease;
  position: relative;
  padding: 4px 0;
}
.site-header nav a:hover { color: var(--ink); }
.site-header nav a[aria-current="page"] {
  color: var(--ink);
}
.site-header nav a[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1.5px;
  background: var(--primary);
}
.site-header .actions { display: flex; align-items: center; gap: var(--gap-4); flex-shrink: 0; }

@media (max-width: 980px) {
  .site-header nav { display: none; }
  .site-header .brand img { height: 26px; }
}

.site-footer { background: var(--paper-deep); border-top: 1px solid var(--rule); padding: var(--gap-8) 0 var(--gap-6); margin-top: var(--gap-10); }
.site-footer .footer-grid { display: grid; grid-template-columns: 1fr 1fr 1.2fr 1.2fr; gap: var(--gap-6); }
.site-footer h6 { font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--gap-4); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.site-footer a, .site-footer p { font-family: var(--body-font); font-size: 14px; color: var(--body); text-decoration: none; margin: 0; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--primary); }
.site-footer .footer-meta { display: flex; flex-direction: column; gap: 4px; }
.site-footer .footer-bottom { border-top: 1px solid var(--rule); margin-top: var(--gap-6); padding-top: var(--gap-4); display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--muted); }

@media (max-width: 720px) {
  .site-footer .footer-grid { grid-template-columns: 1fr 1fr; }
  .site-footer .footer-bottom { flex-direction: column; gap: 8px; }
}

/* ─── Utility ─────────────────────────────────────────────────────────── */

.text-muted { color: var(--muted); }
.text-ink { color: var(--ink); }
.text-primary { color: var(--primary); }
.text-right { text-align: right; }
.tabular { font-variant-numeric: tabular-nums; }
.italic { font-style: italic; }
.max-prose { max-width: 660px; }
.max-prose-wide { max-width: 760px; }
