/* Putter & Tweed: site styles.
   Copied as-is into dist/ by scripts/build_site.py. No build step, no framework.
   Colours live only in the theme blocks below; everything else reads the tokens. */

@font-face {
  font-family: "Gloock";
  src: url("fonts/gloock-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  --font-display: "Gloock", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
  --step-0: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-1: clamp(1.25rem, 1.15rem + 0.45vw, 1.5rem);
  --step-2: clamp(1.6rem, 1.4rem + 0.9vw, 2.1rem);
  --step-3: clamp(2rem, 1.6rem + 1.8vw, 3rem);
  --step-4: clamp(2.5rem, 1.6rem + 3.8vw, 4.6rem);

  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  --space-l: clamp(2.5rem, 2rem + 2vw, 4rem);
  --space-xl: clamp(3.5rem, 2.5rem + 4vw, 7rem);

  --wrap: 76rem;
  --measure: 42rem;
  --gutter: clamp(1.25rem, 0.8rem + 2vw, 2.5rem);
  --radius: 3px;
}

/* Clubhouse Linen, chosen 2026-09-30. Green-tinged linen, loden green, one rust accent. */
[data-theme="linen"] {
  --bg: #e8e6d3;
  --surface: #f2f0e2;
  --ink: #1c271f;
  --soft: #4e5a4f;
  --rule: #cdcab2;
  --green: #2e5539;
  --on-green: #e8e6d3;
  --accent: #a64b2a;
  --accent-ink: #a64b2a;
  --accent-on-green: #e9a27f;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--space-m);
}

body {
  margin: 0;
  background-color: var(--bg);
  /* Faint woven grain: a nod to cloth, too quiet to read as texture. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.005em;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0 0 1em; text-wrap: pretty; }

a {
  color: var(--green);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
a:hover { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

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

::selection { background: var(--green); color: var(--on-green); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--space-s);
  top: -4rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--green);
  color: var(--on-green);
  font-weight: 600;
}
.skip:focus { top: var(--space-s); }

.eyebrow {
  margin: 0 0 var(--space-s);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

/* ---------- Masthead ---------- */

.masthead { border-bottom: 1px solid var(--rule); }

.masthead__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-m);
  padding-block: var(--space-s);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 1.3rem + 1vw, 2rem);
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: var(--green); }
.wordmark svg { width: 0.8em; height: 1em; flex: none; }
.wordmark .flag { fill: var(--accent); }
.wordmark .pin { stroke: currentColor; }
.amp { color: var(--accent-ink); }

.nav ul {
  display: flex;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--accent); }

/* ---------- Home ---------- */

.hero {
  display: grid;
  gap: var(--space-l);
  align-items: center;
  padding-block: var(--space-l) var(--space-xl);
}
@media (min-width: 56rem) {
  .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
}
.hero__title { font-size: var(--step-4); margin-bottom: var(--space-m); }
.hero__lede { font-size: var(--step-1); line-height: 1.5; color: var(--soft); max-width: 34rem; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 48px;
  margin-top: var(--space-s);
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  background: var(--green);
  color: var(--on-green);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.button:hover { background: var(--ink); color: var(--on-green); }

.feature { position: relative; display: block; color: inherit; text-decoration: none; }
.feature::before {
  content: "";
  position: absolute;
  inset: 1.1rem -1.1rem -1.1rem 1.1rem;
  background: var(--green);
  border-radius: var(--radius);
}
.feature figure {
  position: relative;
  margin: 0;
  padding: 0.7rem 0.7rem 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.feature img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; }
.feature figcaption { padding-top: 0.8rem; }
.feature .eyebrow { margin-bottom: 0.25rem; }
.feature__title { font-family: var(--font-display); font-size: var(--step-1); line-height: 1.2; }
.feature:hover .feature__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

.section { padding-block: var(--space-l); }
.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-m);
  padding-bottom: var(--space-s);
  margin-bottom: var(--space-m);
  border-bottom: 1px solid var(--ink);
}
.section__head h2 { font-size: var(--step-3); }
.section__head p { margin: 0; color: var(--soft); max-width: 30rem; }

/* The card: the index laid out like a scorecard. */
.scorecard {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
}
.scorecard th, .scorecard td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  vertical-align: baseline;
}
.scorecard thead th {
  background: var(--green);
  color: var(--on-green);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.scorecard td.hole, .scorecard th.hole {
  width: 4.5rem;
  text-align: center;
}
.scorecard tbody .hole {
  font-family: var(--font-display);
  font-size: var(--step-1);
  text-align: center;
  border-right: 1px solid var(--rule);
  color: var(--accent-ink);
}
.scorecard .year { width: 6rem; text-align: right; }
.scorecard tbody .year { color: var(--soft); }
.scorecard td a { font-weight: 600; text-decoration: none; color: var(--ink); }
.scorecard td a:hover { text-decoration: underline; color: var(--green); }
.scorecard tbody tr:hover { background: color-mix(in srgb, var(--surface) 70%, var(--rule)); }
.scorecard tbody tr:last-child td, .scorecard tbody tr:last-child th { border-bottom: 0; }
@media (max-width: 30rem) {
  .scorecard th, .scorecard td { padding: 0.65rem 0.6rem; }
  .scorecard .hole { width: 3rem; }
  .scorecard .year { width: 3.75rem; }
}

.grid {
  display: grid;
  gap: var(--space-l) var(--space-m);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.5rem), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}
.tile { display: block; color: inherit; text-decoration: none; }
.tile__img {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.tile img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: top;
  transition: transform 0.4s ease;
}
.tile:hover img { transform: scale(1.03); }
.tile .eyebrow { margin: var(--space-s) 0 0.35rem; }
.tile h3 { font-size: var(--step-1); line-height: 1.2; margin-bottom: 0.5rem; }
.tile:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.tile p {
  margin: 0;
  color: var(--soft);
  font-size: var(--step--1);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Explainer ---------- */

.crumbs { font-size: var(--step--1); color: var(--soft); margin-bottom: var(--space-m); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.crumbs li + li::before { content: "/"; margin-right: 0.4rem; color: var(--rule); }
.crumbs a { color: var(--soft); }

.explainer__head { padding-block: var(--space-l) var(--space-m); }
.explainer__head > * { max-width: 52rem; }
.explainer__head h1 { font-size: var(--step-4); margin-bottom: var(--space-s); }
.era { color: var(--soft); font-size: var(--step--1); margin: 0 0 var(--space-m); }
.lede { font-size: var(--step-1); line-height: 1.5; max-width: var(--measure); }

.plate {
  margin: 0 0 var(--space-m);
  padding: clamp(0.6rem, 0.3rem + 1.2vw, 1.25rem);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.plate img { margin-inline: auto; max-height: min(78vh, 46rem); width: auto; }
.plate figcaption { margin-top: 0.8rem; font-size: 0.82rem; line-height: 1.5; color: var(--soft); }
.plate figcaption a { color: var(--soft); }
.lead { margin-bottom: var(--space-l); }

.explainer__body { display: grid; gap: var(--space-m) var(--space-xl); }
@media (min-width: 64rem) {
  .explainer__body { grid-template-columns: 13rem minmax(0, var(--measure)); }
  .toc { position: sticky; top: var(--space-m); align-self: start; }
}

.toc {
  font-size: var(--step--1);
  padding: var(--space-s) 0;
  border-top: 2px solid var(--ink);
}
.toc p { margin: 0 0 0.5rem; }
.toc ol { margin: 0; padding: 0; list-style: none; columns: 2 11rem; column-gap: var(--space-m); }
@media (min-width: 64rem) { .toc ol { columns: 1; } }
.toc a {
  display: block;
  padding: 0.4rem 0;
  color: var(--ink);
  text-decoration: none;
  break-inside: avoid;
}
.toc a:hover { color: var(--green); text-decoration: underline; }

.prose section + section { margin-top: var(--space-l); }
.prose h2 { font-size: var(--step-3); margin-bottom: var(--space-m); }
.prose h3 { font-size: var(--step-1); margin: var(--space-m) 0 var(--space-s); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }
.prose .plate { margin-block: var(--space-m); }

.refs { font-size: 0.7em; line-height: 0; margin-left: 0.15em; }
.refs a { text-decoration: none; font-weight: 600; }

.icons { display: grid; gap: var(--space-m); margin: 0; padding: 0; list-style: none; }
@media (min-width: 40rem) { .icons { grid-template-columns: 1fr 1fr; } }
.icons li { margin: 0; padding-top: var(--space-s); border-top: 2px solid var(--ink); }
.icons h3 { font-size: var(--step-1); margin: 0 0 0.5rem; }
.icons p { margin: 0; font-size: var(--step--1); line-height: 1.6; }

.tips { margin: 0; padding: 0; list-style: none; counter-reset: tip; }
.tips li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: var(--space-s);
  padding-block: var(--space-s);
  border-bottom: 1px solid var(--rule);
  counter-increment: tip;
}
.tips li:first-child { border-top: 1px solid var(--rule); }
.tips li::before {
  content: counter(tip, decimal-leading-zero);
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1;
  color: var(--accent-ink);
}

.shops { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 var(--space-s); padding: 0; list-style: none; }
.shops a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.shops a:hover { background: var(--green); border-color: var(--green); color: var(--on-green); }
.note { font-size: 0.82rem; color: var(--soft); }

.sources { padding-left: 1.4rem; font-size: 0.85rem; line-height: 1.55; color: var(--soft); }
.sources li { padding: 0.2rem 0.4rem; border-radius: var(--radius); }
.sources li:target { background: var(--surface); outline: 1px solid var(--accent); }
.updated { margin-top: var(--space-m); font-size: 0.82rem; color: var(--soft); }

.pager {
  display: grid;
  gap: var(--space-s);
  margin-top: var(--space-xl);
  padding-top: var(--space-m);
  border-top: 1px solid var(--ink);
}
@media (min-width: 40rem) { .pager { grid-template-columns: 1fr 1fr; } }
.pager a {
  display: block;
  padding: var(--space-m);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.pager a:hover { border-color: var(--green); }
.pager .next { text-align: right; }
.pager .eyebrow { margin-bottom: 0.3rem; }
.pager span.title { display: block; font-family: var(--font-display); font-size: var(--step-1); line-height: 1.2; }

/* ---------- Footer ---------- */

.colophon {
  margin-top: var(--space-xl);
  padding-block: var(--space-l);
  background: var(--green);
  color: var(--on-green);
  font-size: var(--step--1);
}
.colophon .wrap { display: grid; gap: var(--space-m); }
@media (min-width: 48rem) { .colophon .wrap { grid-template-columns: 1.2fr 1fr; align-items: end; } }
.colophon .wordmark { color: var(--on-green); font-size: var(--step-2); }
.colophon .amp, .colophon .wordmark .flag { color: var(--accent-on-green); fill: var(--accent-on-green); }
.colophon p { margin: 0.75rem 0 0; max-width: 32rem; opacity: 0.92; }
.colophon a { color: var(--on-green); }
.colophon a:hover { text-decoration-color: var(--accent-on-green); }
.colophon :focus-visible { outline-color: var(--on-green); }

/* ---------- Preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .tile:hover img { transform: none; }
}

@media (forced-colors: active) {
  .feature::before { display: none; }
  .tips li::before, .scorecard .hole { color: CanvasText; }
}

@media print {
  body { background: #fff; color: #000; }
  .masthead nav, .toc, .pager, .colophon, .skip { display: none; }
  a { color: #000; }
}

