/* ============================================================
   tomtiffanyisacoward.com — styles
   Palette: cream paper, ink navy, coward-coward red, mustard.
   ============================================================ */

:root {
  --paper: #faf6ee;
  --paper-2: #f1ead9;
  --ink: #14213d;
  --ink-soft: #3a4a6b;
  --red: #c8102e;
  --red-dark: #9c0c23;
  --gold: #f2b705;
  --teal: #1d7a74;
  --line: #d8cfba;
  --card: #fffdf8;
  --shadow: 0 2px 6px rgba(20, 33, 61, 0.08), 0 12px 32px rgba(20, 33, 61, 0.10);
  --font-display: "Archivo Black", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --font-type: "Special Elite", "Courier New", monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: clip; /* stamp/rotate must not widen the document (breaks sticky on mobile) */
}

/* Keep anchored sections from sliding under the sticky header.
   Measured header height: desktop ≈78px, mobile (wrapped nav row) ≈115px. */
section[id] { scroll-margin-top: 94px; }
@media (max-width: 640px) { section[id] { scroll-margin-top: 128px; } }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 8px 16px; z-index: 100;
}
.skip-link:focus { left: 8px; }

a { color: var(--red-dark); }

/* ---------------- header ---------------- */

.site-header {
  position: sticky;
  top: 0;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: var(--paper);
  border-bottom: 3px double var(--line);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap;
  min-height: 52px; /* brand row height — stable across font swaps */
}

.brand {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink);
}

.brand-flag { font-size: 34px; line-height: 1; }

.brand-text {
  font-family: var(--font-display);
  font-size: 15px; line-height: 1.05; letter-spacing: 0.02em;
  min-height: 31px; /* two lines at 15px * 1.05 — stable across font swaps */
}
.brand-text em { color: var(--red); font-style: normal; }

.nav-wrap { position: relative; }

.site-nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }

/* "more items to the right" indicator — mobile only */
.nav-more {
  display: none;
  position: absolute; top: 0; right: 0; bottom: 0;
  align-items: center; justify-content: center;
  width: 24px; padding: 0; margin: 0;
  border: 0; background: transparent; color: var(--red-dark);
  cursor: pointer; z-index: 2;
}

.site-nav a {
  text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: 14.5px;
  padding: 8px 12px; border-radius: 8px; transition: background 0.15s, color 0.15s;
}
.site-nav a:hover { background: var(--paper-2); color: var(--ink); }

.site-nav a.active {
  color: var(--red-dark); background: var(--paper-2);
  box-shadow: inset 0 -3px 0 var(--red);
}

.nav-cta {
  background: var(--red) !important; color: #fff !important;
}
.nav-cta:hover { background: var(--red-dark) !important; }
.nav-cta.active {
  background: var(--red-dark) !important;
  box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.85);
}

/* ---------------- hero ---------------- */

.hero {
  padding: 56px 0 40px;
  background:
    radial-gradient(ellipse at 85% -10%, rgba(200, 16, 46, 0.07), transparent 55%),
    repeating-linear-gradient(-45deg, transparent 0 34px, rgba(20, 33, 61, 0.022) 34px 36px);
}

.hero-grid {
  display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 48px; align-items: center;
}

.kicker {
  font-family: var(--font-type);
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--red-dark); font-size: 13.5px; margin: 0 0 12px;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 68px);
  line-height: 0.98; margin: 0 0 20px; letter-spacing: -0.01em;
}

.highlight {
  color: var(--red);
  background: linear-gradient(transparent 62%, rgba(242, 183, 5, 0.55) 62%);
}

.lede { font-size: 19px; color: var(--ink-soft); max-width: 56ch; margin: 0 0 24px; }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }

.btn {
  display: inline-block; text-decoration: none; font-weight: 700; font-size: 15.5px;
  padding: 12px 22px; border-radius: 10px; transition: transform 0.12s, box-shadow 0.12s, background 0.15s;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--red); color: #fff; box-shadow: 0 3px 0 var(--red-dark); }
.btn-primary:hover { background: var(--red-dark); }

.btn-ghost { border: 2px solid var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }

.hero-facts {
  list-style: none; margin: 0; padding: 18px 0 0;
  border-top: 3px double var(--line);
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; font-size: 14.5px; color: var(--ink-soft);
}
.hero-facts strong { color: var(--ink); }

.hero-figure { margin: 0; position: relative; }

.hero-figure img {
  width: 100%; display: block; border-radius: 14px;
  border: 6px solid #fff; box-shadow: var(--shadow);
  transform: rotate(1.2deg); transition: transform 0.3s;
  /* muted, faded, slightly overexposed — the portrait is a little less appealing */
  filter: saturate(0.5) sepia(0.28) contrast(0.92) brightness(1.07);
}

.hero-figure .fig-label {
  position: absolute; top: 14px; left: 14px;
  font-family: var(--font-type); text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 11px; color: #fff; background: rgba(20, 33, 61, 0.78);
  padding: 4px 9px; border-radius: 6px;
}
.hero-figure:hover img { transform: rotate(0deg) scale(1.01); }

.hero-figure figcaption {
  font-size: 12.5px; color: var(--ink-soft); margin-top: 10px; text-align: center;
  font-family: var(--font-type);
}

/* countdown */
.countdown {
  margin-top: 22px; padding: 16px 18px 14px;
  background: var(--card); border: 2px solid var(--ink);
  border-radius: 12px; box-shadow: 4px 4px 0 rgba(20, 33, 61, 0.12);
}
.countdown-label {
  font-family: var(--font-type); text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 12px; color: var(--red-dark); margin: 0 0 12px;
}
.countdown-timer {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.countdown-cell { text-align: center; }
.countdown-value {
  display: block; font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 44px); line-height: 1;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.countdown-unit {
  display: block; margin-top: 6px;
  font-family: var(--font-type); text-transform: uppercase;
  letter-spacing: 0.12em; font-size: 10.5px; color: var(--ink-soft);
}
.countdown-done {
  font-family: var(--font-display); font-size: clamp(20px, 3.4vw, 30px);
  color: var(--red); margin: 0;
}

/* stamp */
.stamp {
  position: absolute; top: 8px; right: 8px;
  width: 118px; height: 118px; border-radius: 50%;
  border: 3px dashed var(--red); color: var(--red);
  display: grid; place-items: center; text-align: center;
  font-family: var(--font-display); font-size: 12.5px; line-height: 1.15;
  transform: rotate(-14deg);
  background: rgba(250, 246, 238, 0.75);
  animation: stampWiggle 5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes stampWiggle {
  0%, 100% { transform: rotate(-14deg) scale(1); }
  50% { transform: rotate(-9deg) scale(1.04); }
}

/* ---------------- stat band ---------------- */

.stat-band {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 52px;
}

.stat-card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 20px 18px 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden;
}
.stat-card::before {
  content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 5px;
  background: var(--red);
}

.stat-value {
  font-family: var(--font-display); font-size: 46px; line-height: 1; color: var(--ink);
}

.stat-label { font-size: 14px; color: var(--ink-soft); flex: 1; }

.stat-src, .money-card a.stat-src {
  font-size: 12.5px; text-decoration: none; color: var(--teal); font-weight: 600;
}
.stat-src:hover, .money-card a.stat-src:hover { text-decoration: underline; }

/* ---------------- sections ---------------- */

.section { padding: 72px 0; }
.section-alt { background: var(--paper-2); border-top: 3px double var(--line); border-bottom: 3px double var(--line); }
.section-dark { background: var(--ink); color: #f4efe3; }
.section-dark .kicker { color: var(--gold); }
.section-dark .section-sub { color: #c9d2e6; }

.section-head { max-width: 720px; margin-bottom: 44px; }

h2 {
  font-family: var(--font-display); font-size: clamp(30px, 4vw, 44px);
  line-height: 1.05; margin: 0 0 14px; letter-spacing: -0.01em;
}

.section-sub { color: var(--ink-soft); font-size: 17px; margin: 0; }

/* ---------------- record grid ---------------- */

.record-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}

.record-card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
  transition: transform 0.18s, box-shadow 0.18s;
}
.record-card:hover { transform: translateY(-3px); }

.card-tag {
  align-self: flex-start; font-family: var(--font-type); font-size: 12px; letter-spacing: 0.08em;
  padding: 3px 4px 0px; border-radius: 999px; color: #fff; text-transform: uppercase;
}
.tag-red { background: var(--red); }
.tag-green { background: var(--teal); }
.tag-purple { background: #7b3fa0; }
.tag-orange { background: #d97706; }
.tag-blue { background: #2563eb; }

.record-card h3 { font-family: var(--font-display); font-size: 19.5px; margin: 0; line-height: 1.2; }
.record-card p { margin: 0; color: var(--ink-soft); font-size: 15px; flex: 1; }

.card-links { display: flex; flex-wrap: wrap; gap: 6px 16px; border-top: 1px dashed var(--line); padding-top: 12px; }
.card-links a { font-size: 13px; font-weight: 600; text-decoration: none; color: var(--teal); }
.card-links a:hover { text-decoration: underline; }

/* ---------------- timeline ---------------- */

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }

.timeline::before {
  content: ""; position: absolute; left: 135px; top: 8px; bottom: 8px; width: 3px;
  background: repeating-linear-gradient(var(--line) 0 8px, transparent 8px 16px);
}

.timeline li {
  display: grid; grid-template-columns: 110px 52px 1fr; align-items: start; gap: 0;
  padding: 14px 0; position: relative;
}

.tl-date {
  font-family: var(--font-type); font-weight: 700; color: var(--red-dark);
  text-align: right; font-size: 15px; padding-top: 2px;
}

.tl-dot {
  width: 17px; height: 17px; border-radius: 50%; background: var(--paper-2);
  border: 4px solid var(--red); justify-self: center; margin-top: 6px; z-index: 1;
}

.tl-body { background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); }
.tl-body h3 { margin: 0 0 6px; font-size: 17px; font-family: var(--font-display); line-height: 1.25; }
.tl-body p { margin: 0; color: var(--ink-soft); font-size: 14.5px; }

.tl-tag {
  display: inline-block; font-family: var(--font-type); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; background: var(--paper-2); border: 1px solid var(--line);
  color: var(--ink-soft); border-radius: 999px; padding: 3px 4px 0px; margin-bottom: 8px;
}

/* ---------------- quotes ---------------- */

.quote-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.quote-card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 22px; box-shadow: var(--shadow); position: relative;
  display: flex; flex-direction: column; gap: 10px;
}

.quote-card::before {
  content: "“"; position: absolute; top: -4px; left: 14px;
  font-family: var(--font-display); font-size: 58px; color: var(--gold); line-height: 1;
}

.quote-text { font-size: 15.5px; line-height: 1.5; margin: 10px 0 0; }

.quote-who { font-family: var(--font-type); font-size: 12.5px; color: var(--red-dark); font-weight: 700; }

.quote-context {
  font-size: 13px; color: var(--ink-soft); background: var(--paper-2);
  border-left: 3px solid var(--gold); padding: 10px 12px; border-radius: 0 8px 8px 0;
}

.quote-src { font-size: 12.5px; color: var(--teal); font-weight: 600; margin-top: auto; }
.quote-src a { text-decoration: none; }
.quote-src a:hover { text-decoration: underline; }

/* ---------------- money ---------------- */

.money-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 40px; }

.money-card {
  background: rgba(255, 253, 248, 0.06); border: 1.5px solid rgba(244, 239, 227, 0.25);
  border-radius: 14px; padding: 24px 20px; display: flex; flex-direction: column; gap: 10px;
}

.money-value { font-family: var(--font-display); font-size: 44px; color: var(--gold); line-height: 1; }
.money-label { font-size: 14.5px; color: #d9e0ef; flex: 1; }

.pipeline {
  background: rgba(255, 253, 248, 0.06); border: 1.5px solid rgba(244, 239, 227, 0.25);
  border-radius: 14px; padding: 28px;
}

.pipeline h3 { font-family: var(--font-display); font-size: 21px; margin: 0 0 16px; color: #fff; }
.pipeline ol { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 10px; color: #d9e0ef; font-size: 15.5px; }
.pipeline ol strong { color: #fff; }

.pipeline-note { color: #b9c4da; font-size: 14.5px; margin: 0 0 16px; }

.section-dark .card-links { border-top-color: rgba(244, 239, 227, 0.25); }
.section-dark .card-links a { color: var(--gold); }

/* ---------------- race ---------------- */

.race-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }

.poll-card, .race-facts {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 26px; box-shadow: var(--shadow);
}

.poll-card h3, .race-facts h3 { font-family: var(--font-display); font-size: 19px; margin: 0 0 4px; }
.poll-sub { font-family: var(--font-type); font-size: 12.5px; color: var(--ink-soft); margin: 0 0 20px; }

.poll-bar-row { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; margin-bottom: 14px; }
.poll-name { font-weight: 700; font-size: 14.5px; text-align: right; color: var(--ink-soft); }

.poll-track { position: relative; height: 34px; background: var(--paper-2); border-radius: 8px; overflow: hidden; }
.poll-fill { height: 100%; width: 0; border-radius: 8px 0 0 8px; transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1); }
.poll-crowley { background: var(--teal); }
.poll-tiffany { background: var(--red); }

.poll-num {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-display); font-size: 14px; color: var(--ink);
}

.poll-note { font-size: 13.5px; color: var(--ink-soft); margin: 16px 0 0; }

.race-facts ul { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 10px; color: var(--ink-soft); font-size: 15px; }
.race-facts li strong { color: var(--ink); }

/* ---------------- sources ---------------- */

.source-list {
  list-style: none; counter-reset: src; margin: 0; padding: 0;
  columns: 2; column-gap: 40px;
}

.source-list li {
  counter-increment: src; break-inside: avoid;
  font-size: 14.5px; padding: 8px 0; border-bottom: 1px dashed var(--line);
}

.source-list li::before {
  content: counter(src, decimal-leading-zero) " ";
  font-family: var(--font-type); color: var(--red-dark); font-weight: 700; margin-right: 6px;
}

.source-list a { text-decoration: none; color: var(--ink-soft); }
.source-list a:hover { color: var(--red-dark); text-decoration: underline; }

/* ---------------- disclaimer ---------------- */

.disclaimer {
  background: var(--paper-2); border-top: 3px double var(--line); padding: 60px 0;
}

.disclaimer h2 { font-size: clamp(24px, 3vw, 32px); }

.disclaimer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 20px; }
.disclaimer p { font-size: 14.5px; color: var(--ink-soft); margin: 0 0 14px; }
.disclaimer strong { color: var(--ink); }

/* ---------------- footer ---------------- */

.site-footer { background: var(--ink); color: #c9d2e6; padding: 32px 0; font-size: 14px; }
.footer-inner p { margin: 4px 0; }
.footer-inner a { color: var(--gold); text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }
.footer-small { opacity: 0.75; font-size: 12.5px; margin-top: 12px !important; }

/* ---------------- reveal animations ---------------- */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .stamp { animation: none; }
  .poll-fill { transition: none; }
}

/* ---------------- responsive ---------------- */

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-figure { max-width: 420px; }
  .stat-band { grid-template-columns: repeat(2, 1fr); }
  .record-grid { grid-template-columns: 1fr; }
  .quote-grid { grid-template-columns: repeat(2, 1fr); }
  .money-grid { grid-template-columns: 1fr; }
  .race-grid { grid-template-columns: 1fr; }
  .source-list { columns: 1; }
  .disclaimer-grid { grid-template-columns: 1fr; gap: 8px; }

  .timeline::before { left: 9px; }
  .timeline li { grid-template-columns: 24px 1fr; }
  .tl-date { grid-column: 2; text-align: left; padding-top: 0; margin-bottom: 6px; }
  .tl-dot { grid-row: 1 / span 2; margin-top: 8px; }
  .tl-body { grid-column: 2; }
}

@media (max-width: 640px) {
  .stat-band { grid-template-columns: 1fr; }
  .quote-grid { grid-template-columns: 1fr; }
  .hero-facts { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; gap: 6px; padding-top: 8px; padding-bottom: 8px; }
  /* single swipeable row keeps the sticky header short */
  .nav-wrap { width: 100%; }
  .site-nav {
    justify-content: flex-start;
    flex-wrap: nowrap; width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    min-height: 38px; /* one row at 13.5px font + 7px padding top/bottom — stable across font swaps */
    /* room for the chevron indicator to float over the last item */
    padding-right: 26px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent);
            mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent);
  }
  .site-nav::-webkit-scrollbar { display: none; }
  /* chevron fades in only when there is actually content off-screen to the right */
  .nav-more {
    display: flex;
    background: linear-gradient(to right, rgba(250, 246, 238, 0), var(--paper) 38%);
    transition: opacity 0.18s ease;
    opacity: 0; pointer-events: none;
  }
  .nav-wrap.nav-overflowing .nav-more { opacity: 1; }
  .site-nav a { white-space: nowrap; font-size: 13.5px; padding: 7px 10px; }
  .section { padding: 52px 0; }
}
