/* Who Owns The Town — styles */

:root {
  --paper: #F4EFE6;
  --paper-warm: #EFE8DA;
  --paper-deep: #E6DDCA;
  --ink: #1A1714;
  --ink-soft: #3A332D;
  --ink-faded: #6E6359;
  --rule: #C9BDA8;
  --terracotta: #B8462C;
  --terracotta-deep: #8F3217;
  --moss: #3D5239;
  --moss-deep: #263421;
  --gold: #C89B3C;
  --red-urgent: #8F1A14;

  --serif-display: "Fraunces", "Playfair Display", Georgia, serif;
  --serif-body: "Newsreader", "Iowan Old Style", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif-body);
  font-size: 19px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "onum";
}

/* Paper grain — very subtle noise */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='280' height='280'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.09 0 0 0 0 0.08 0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

main, section, header, footer, nav, article { position: relative; z-index: 2; }

/* Type */
h1, h2, h3, h4 { font-family: var(--serif-display); font-weight: 400; margin: 0; line-height: 1.04; letter-spacing: -0.015em; }
h1 { font-size: clamp(54px, 9vw, 148px); font-weight: 300; font-style: italic; }
h2 { font-size: clamp(36px, 5vw, 68px); font-weight: 400; }
h3 { font-size: clamp(24px, 2.6vw, 38px); font-weight: 500; }
h4 { font-size: 22px; font-weight: 500; }

p { margin: 0 0 1.1em; text-wrap: pretty; }
a { color: var(--terracotta); text-decoration: none; border-bottom: 1px solid currentColor; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faded);
  font-weight: 500;
}
.eyebrow .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--terracotta); margin-right: 10px; vertical-align: middle; transform: translateY(-1px); }

.smallcaps {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.mono { font-family: var(--mono); font-size: 0.85em; }

.drop::first-letter {
  font-family: var(--serif-display);
  font-size: 5.2em;
  float: left;
  line-height: 0.82;
  padding: 0.06em 0.08em 0 0;
  font-weight: 400;
  color: var(--terracotta);
  font-style: italic;
}

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3em 0;
}

/* Layout */
.wrap { max-width: 1340px; margin: 0 auto; padding: 0 48px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 32px; }
.wrap-mid { max-width: 1040px; margin: 0 auto; padding: 0 32px; }

@media (max-width: 720px) {
  body { font-size: 17px; }
  .wrap, .wrap-mid, .wrap-narrow { padding: 0 22px; }
}

/* Top nav */
.top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244, 239, 230, 0.82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.top-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-soft);
}
.top-inner nav { display: flex; gap: 28px; }
.top-inner nav a { color: var(--ink-soft); border: 0; cursor: pointer; }
.top-inner nav a:hover { color: var(--terracotta); }
.top-mark { font-family: var(--serif-display); font-style: italic; font-size: 18px; text-transform: none; letter-spacing: -0.01em; color: var(--ink); }
@media (max-width: 760px) { .top-inner nav { display: none; } }

/* Hero */
.hero {
  min-height: 100vh;
  padding: 120px 0 80px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.hero-title {
  padding: 20px 0 40px;
  position: relative;
}
.hero-title h1 {
  font-style: italic;
  font-weight: 300;
}
.hero-title h1 .mk {
  color: var(--terracotta);
  font-style: italic;
}
.hero-title .q {
  position: absolute;
  top: -18px; left: -24px;
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 180px;
  line-height: 1;
  color: var(--rule);
  z-index: -1;
  opacity: 0.5;
}
.hero-meta {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
  font-size: 16px;
  color: var(--ink-soft);
}
.hero-meta h4 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faded); margin-bottom: 10px; font-weight: 500; }

@media (max-width: 780px) {
  .hero-meta { grid-template-columns: 1fr; gap: 24px; }
  .hero-title .q { font-size: 110px; top: -6px; left: -6px; }
}

/* The coin animation canvas */
.coin-stage {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 560px;
  position: relative;
  margin: 40px 0 20px;
  background: transparent;
}
.coin-stage svg { width: 100%; height: 100%; display: block; overflow: visible; }

/* Section containers */
section.bl { padding: 120px 0; position: relative; }
section.bl.alt { background: var(--paper-warm); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
section.bl.dark { background: var(--ink); color: var(--paper); }
section.bl.dark h1, section.bl.dark h2, section.bl.dark h3 { color: var(--paper); }
section.bl.dark .eyebrow { color: rgba(244,239,230,0.5); }

.section-head {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 48px;
  align-items: baseline;
  margin-bottom: 56px;
}
.section-num {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 56px;
  color: var(--terracotta);
  line-height: 1;
}
.section-title h2 { max-width: 900px; }
.section-title .kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-faded); margin-bottom: 14px; }

@media (max-width: 720px) {
  .section-head { grid-template-columns: 1fr; gap: 10px; margin-bottom: 36px; }
  .section-num { font-size: 40px; }
}

/* Two column */
.cols2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}
@media (max-width: 820px) { .cols2 { grid-template-columns: 1fr; gap: 36px; } }

/* Pull quote */
.pullquote {
  font-family: var(--serif-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.14;
  color: var(--ink);
  margin: 60px 0;
  padding-left: 40px;
  border-left: 2px solid var(--terracotta);
  max-width: 900px;
  text-wrap: balance;
}
.pullquote cite {
  display: block;
  margin-top: 20px;
  font-family: var(--mono);
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faded);
}

/* Stat row */
.statgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.statgrid .stat {
  padding: 32px 24px;
  border-right: 1px solid var(--rule);
}
.statgrid .stat:last-child { border-right: 0; }
.stat .n { font-family: var(--serif-display); font-size: clamp(40px, 5vw, 72px); line-height: 1; font-weight: 400; color: var(--ink); display: block; }
.stat .n .unit { font-size: 0.45em; color: var(--ink-faded); font-style: italic; margin-left: 4px; }
.stat .l { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faded); margin-top: 12px; display: block; line-height: 1.45; }
.stat.accent .n { color: var(--terracotta); }
.stat.moss .n { color: var(--moss); }
@media (max-width: 780px) {
  .statgrid { grid-template-columns: 1fr 1fr; }
  .statgrid .stat:nth-child(2) { border-right: 0; }
  .statgrid .stat:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
}

/* Buttons & chips */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  border: 0; cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}
.btn:hover { background: var(--terracotta); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 0;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Tweaks panel */
.tweaks-btn {
  position: fixed; right: 20px; bottom: 20px;
  width: 50px; height: 50px;
  background: var(--ink); color: var(--paper);
  display: none; align-items: center; justify-content: center;
  font-family: var(--serif-display); font-style: italic; font-size: 24px;
  cursor: pointer; z-index: 9998;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.tweaks-btn.visible { display: flex; }
.tweaks-panel {
  position: fixed; right: 20px; bottom: 84px;
  width: 320px;
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 24px;
  z-index: 9999;
  display: none;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.tweaks-panel.open { display: block; }
.tweaks-panel h4 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faded); margin: 0 0 8px; font-weight: 500; }
.tweaks-panel .group { margin-bottom: 18px; }
.tweaks-panel .group:last-child { margin-bottom: 0; }
.tweaks-panel .opts { display: flex; flex-wrap: wrap; gap: 6px; }

/* Footer */
footer.end {
  padding: 80px 0 60px;
  border-top: 1px solid var(--rule);
  background: var(--paper-warm);
}
footer.end .mark {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 48px;
  line-height: 1;
  margin-bottom: 24px;
}
footer.end .cols {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 48px;
  font-size: 14px; color: var(--ink-soft);
}
footer.end h5 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faded); font-weight: 500; margin: 0 0 14px; }
footer.end ul { list-style: none; padding: 0; margin: 0; }
footer.end li { margin-bottom: 6px; }
footer.end a { color: var(--ink-soft); border: 0; }
footer.end a:hover { color: var(--terracotta); }
@media (max-width: 780px) { footer.end .cols { grid-template-columns: 1fr 1fr; gap: 32px; } }

/* utility */
.spacer-s { height: 24px; }
.spacer-m { height: 56px; }
.spacer-l { height: 100px; }

.hidden { display: none !important; }

/* appear-on-scroll */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
