/* ==========================================================================
   cartergaffney.com — shared styles
   ========================================================================== */

:root {
  --paper: #f6f2ea;
  --paper-2: #ece5d8;
  --card: #fffdf8;
  --ink: #15202d;
  --ink-2: #3a4554;
  --muted: #6a7280;
  --line: #dcd3c3;
  --accent: #c9541f;
  --accent-ink: #ffffff;
  --navy: #0f1c2b;
  --gold: #d9a441;
  --shadow: 0 1px 2px rgba(20, 25, 35, .06), 0 8px 24px rgba(20, 25, 35, .08);
  --radius: 14px;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1200px;
  --header-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10151c;
    --paper-2: #161d26;
    --card: #1a222d;
    --ink: #eee8dc;
    --ink-2: #c9c2b5;
    --muted: #949aa4;
    --line: #2a3441;
    --accent: #e46a33;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #10151c; --paper-2: #161d26; --card: #1a222d; --ink: #eee8dc; --ink-2: #c9c2b5;
  --muted: #949aa4; --line: #2a3441; --accent: #e46a33; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0 0 .4em; letter-spacing: .01em; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow {
  font: 600 13px/1 var(--body); letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 14px;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  font: 600 15px/1 var(--body); text-decoration: none; letter-spacing: .02em;
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand { font: 700 24px/1 var(--display); text-decoration: none; letter-spacing: .04em; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-size: 17px; letter-spacing: 0;
  box-shadow: inset 0 -3px 0 var(--accent);
}
.site-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 8px 14px; border-radius: 999px; text-decoration: none;
  font-weight: 600; font-size: 15px; color: var(--ink-2);
}
.site-nav a:hover { background: var(--paper-2); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.nav-toggle { display: none; background: none; border: 0; color: inherit; padding: 8px; cursor: pointer; }
.nav-toggle svg { width: 26px; height: 26px; }
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: var(--header-h);
    background: var(--paper); border-bottom: 1px solid var(--line);
    display: none; padding: 8px var(--gutter) 16px;
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: 12px 14px; font-size: 17px; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 80px; padding: 32px 0 48px; color: var(--muted); font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.site-footer a { color: var(--ink-2); }

/* ---------- Page intro ---------- */
.page-intro { padding-top: 56px; padding-bottom: 28px; }
.page-intro h1 { font-size: clamp(44px, 7vw, 84px); text-transform: uppercase; }
.page-intro .lede { font-size: clamp(18px, 2vw, 21px); color: var(--ink-2); max-width: 62ch; }

/* ==========================================================================
   Home — hero slider
   ========================================================================== */
.hero { position: relative; background: var(--navy); color: #fff; overflow: hidden; }
.hero-track { display: grid; }
.slide {
  grid-area: 1 / 1; position: relative;
  opacity: 0; visibility: hidden; transition: opacity .8s ease, visibility 0s linear .8s;
  min-height: min(76vh, 660px);
  display: flex; align-items: center;
}
.slide.is-active { opacity: 1; visibility: visible; transition: opacity .8s ease; }
.slide-bg {
  position: absolute; inset: -40px; z-index: 0;
  background: var(--navy) center / cover no-repeat;
  filter: blur(28px) saturate(1.1) brightness(.45);
  transform: scale(1.05);
}
.slide::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(90deg, rgba(10, 18, 28, .85) 0%, rgba(10, 18, 28, .35) 60%, rgba(10, 18, 28, .1) 100%);
}
.slide-inner {
  position: relative; z-index: 1; width: 100%;
  max-width: var(--max); margin: 0 auto; padding: 56px var(--gutter) 88px;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(24px, 5vw, 64px); align-items: center;
}
.slide-copy h2 { font-size: clamp(46px, 7vw, 92px); text-transform: uppercase; margin-bottom: 18px; }
.slide-copy h2 em { font-style: normal; color: var(--gold); }
.slide-copy p { font-size: clamp(17px, 1.7vw, 20px); color: rgba(255, 255, 255, .86); max-width: 52ch; margin-bottom: 26px; }
.slide .eyebrow { color: var(--gold); }
.slide-media { margin: 0; justify-self: center; position: relative; }
.slide-media img {
  max-height: min(58vh, 500px); width: auto; border-radius: 10px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .45), 0 0 0 6px rgba(255, 255, 255, .92);
  transform: rotate(1.5deg);
}
.slide-media figcaption { font-size: 13px; color: rgba(255, 255, 255, .65); margin-top: 16px; text-align: center; }

/* "Work" slide uses a stat board instead of a photo (swap in a photo any time) */
.stat-board {
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 28px),
              repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px 28px), #13283f;
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; padding: 26px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 460px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .4);
}
.stat-board div { background: rgba(10, 18, 28, .55); border-radius: 8px; padding: 14px 16px; border-left: 3px solid var(--gold); }
.stat-board b { display: block; font: 700 32px/1 var(--display); color: #fff; margin-bottom: 6px; }
.stat-board span { font-size: 13px; color: rgba(255, 255, 255, .72); line-height: 1.35; display: block; }

.hero-controls {
  position: absolute; z-index: 5; left: 0; right: 0; bottom: 26px;
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 18px;
}
.hero-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.hero-tab {
  background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .8); border: 0; cursor: pointer;
  font: 600 13px/1 var(--body); letter-spacing: .08em; text-transform: uppercase;
  padding: 9px 14px; border-radius: 999px; position: relative; overflow: hidden;
}
.hero-tab[aria-selected="true"] { background: rgba(255, 255, 255, .95); color: var(--navy); }
.hero-tab .bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--accent); }
.hero-tab[aria-selected="true"] .bar { animation: heroBar var(--dur, 7s) linear forwards; }
.hero.paused .hero-tab .bar { animation-play-state: paused; }
@keyframes heroBar { to { width: 100%; } }
.hero-arrows { margin-left: auto; display: flex; gap: 8px; }
.hero-arrows button {
  width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .5);
  background: transparent; color: #fff; cursor: pointer; display: grid; place-items: center;
}
.hero-arrows button:hover { background: rgba(255, 255, 255, .15); }

@media (max-width: 820px) {
  .slide { min-height: 0; align-items: stretch; }
  .slide::after { background: linear-gradient(180deg, rgba(10,18,28,.15) 0%, rgba(10,18,28,.85) 55%); }
  .slide-inner { grid-template-columns: 1fr; padding: 28px var(--gutter) 96px; gap: 22px; }
  .slide-media { order: -1; }
  .slide-media img { max-height: 280px; transform: none; }
  .slide-media figcaption { display: none; }
  .stat-board { padding: 16px; gap: 10px; }
  .stat-board b { font-size: 24px; }
  .hero-arrows { display: none; }
  .hero-controls { bottom: 22px; }
}
@media (max-width: 560px) {
  .stat-board { display: none; }
  .slide-media img { max-height: 220px; }
  .slide-copy h2 { font-size: 42px; margin-bottom: 12px; }
  .slide-copy p { font-size: 16px; margin-bottom: 18px; }
  .hero-tab { padding: 8px 11px; font-size: 11px; }
}

/* ==========================================================================
   Home — intro + list tiles
   ========================================================================== */
.home-intro { padding-top: 72px; padding-bottom: 24px; display: grid; grid-template-columns: 1fr 1.4fr; gap: 40px; align-items: end; }
.home-intro h2 { font-size: clamp(40px, 5vw, 64px); text-transform: uppercase; margin: 0; }
.home-intro p { font-size: 19px; color: var(--ink-2); margin: 0; }
@media (max-width: 820px) { .home-intro { grid-template-columns: 1fr; gap: 16px; padding-top: 48px; } }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 24px 0; }
@media (max-width: 1080px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr; } }

.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  text-align: left; padding: 0; cursor: pointer; color: inherit; font: inherit;
  transition: transform .2s ease, box-shadow .2s ease;
}
.tile:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 18px 40px rgba(0,0,0,.14); }
.tile-art { height: 190px; position: relative; overflow: hidden; }
.tile-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.tile-body h3 { font-size: 30px; text-transform: uppercase; margin: 0 0 2px; }
.tile-body .sub { color: var(--muted); font-size: 15px; margin: 0 0 12px; }
.tile-body ol { margin: 0 0 16px; padding-left: 22px; font-size: 15px; color: var(--ink-2); }
.tile-body ol li { margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-more { margin-top: auto; font-weight: 600; font-size: 15px; color: var(--accent); }

/* Bookshelf art */
.art-books { background: linear-gradient(#6b4a2e, #5a3d25); display: flex; align-items: flex-end; gap: 4px; padding: 0 18px; }
.art-books::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background: #3d2815; box-shadow: 0 -2px 0 #7a5535; }
.spine {
  width: 34px; margin-bottom: 14px; border-radius: 3px 3px 0 0;
  writing-mode: vertical-rl; transform: rotate(180deg);
  font: 600 12px/1 var(--display); letter-spacing: .06em; text-transform: uppercase;
  color: rgba(255,255,255,.92); padding: 10px 0; display: flex; align-items: center; justify-content: flex-start;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  box-shadow: inset -4px 0 0 rgba(0,0,0,.18), inset 3px 0 0 rgba(255,255,255,.12);
}
.spine.lean { transform: rotate(180deg) translateX(-6px) rotate(-6deg); }

/* YouTube art */
.art-yt { background: #181818; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 18px; align-content: center; }
.yt-chip { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: #ddd; text-align: center; line-height: 1.2; }
.yt-chip i { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 700 18px/1 var(--display); font-style: normal; color: #fff; box-shadow: 0 0 0 2px #181818, 0 0 0 4px #ff0033; }
.yt-chip span { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yt-play { position: absolute; right: 12px; top: 12px; width: 38px; height: 27px; background: #ff0033; border-radius: 8px; display: grid; place-items: center; }
.yt-play::after { content: ""; border-left: 11px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent; margin-left: 3px; }

/* Marquee art */
.art-marquee { background: radial-gradient(ellipse at 50% 120%, #4a1010, #1a0606 70%); display: grid; place-items: center; padding: 16px; }
.marquee-board {
  position: relative; background: #fbf3dc; color: #1b1b1b; padding: 18px 16px 14px; width: 100%; text-align: center;
  border-radius: 6px; box-shadow: 0 0 0 8px #8c1b1b, 0 0 30px rgba(255, 200, 80, .35);
}
.marquee-board::before, .marquee-board::after {
  content: ""; position: absolute; left: -6px; right: -6px; height: 6px;
  background: radial-gradient(circle, #ffe9a0 0 2.2px, transparent 2.6px) 0 0 / 14px 6px repeat-x;
  animation: bulbs 1.2s steps(2) infinite;
}
.marquee-board::before { top: -7px; } .marquee-board::after { bottom: -7px; }
@keyframes bulbs { 50% { background-position: 7px 0; } }
.marquee-board small { display: block; font: 700 11px/1 var(--body); letter-spacing: .3em; color: #8c1b1b; margin-bottom: 8px; }
.marquee-board strong { display: block; font: 700 24px/1.05 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.marquee-board em { display: block; font-style: normal; font-size: 12px; color: #555; margin-top: 6px; }

/* Pantry art */
.art-pantry { background: linear-gradient(#e9dcc2, #dccaa7); display: flex; flex-direction: column; justify-content: space-evenly; padding: 8px 14px; }
.shelf { display: flex; align-items: flex-end; justify-content: space-around; gap: 8px; border-bottom: 7px solid #9b7446; padding: 0 4px; height: 76px; }
.jar {
  border-radius: 8px 8px 6px 6px; position: relative; display: grid; place-items: center;
  background: rgba(255,255,255,.35); border: 2px solid rgba(80,60,30,.25);
}
.jar::before { content: ""; position: absolute; top: -9px; left: 12%; right: 12%; height: 9px; border-radius: 3px 3px 0 0; background: var(--lid, #b9472b); }
.jar span { background: #fffaf0; font: 600 10px/1.15 var(--body); padding: 4px 5px; border-radius: 2px; text-align: center; max-width: 90%; color: #4a3820; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

/* ---------- List dialog ---------- */
dialog.list-dialog, dialog.lightbox { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(8, 12, 18, .72); backdrop-filter: blur(3px); }
.list-panel {
  background: var(--card); width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  overflow: auto; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.4);
}
.list-head { position: sticky; top: 0; z-index: 1; padding: 22px 24px 16px; background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 16px; }
.list-head h2 { font-size: 38px; text-transform: uppercase; margin: 0; }
.list-head p { margin: 2px 0 0; color: var(--muted); }
.close-btn { margin-left: auto; flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; font-size: 22px; line-height: 1; }
.list-items { list-style: none; margin: 0; padding: 8px 24px 24px; counter-reset: rank; }
.list-items li { counter-increment: rank; display: grid; grid-template-columns: 48px 1fr; gap: 4px 12px; padding: 18px 0; border-bottom: 1px dashed var(--line); }
.list-items li:last-child { border-bottom: 0; }
.list-items li::before { content: counter(rank, decimal-leading-zero); font: 700 30px/1 var(--display); color: var(--accent); grid-row: span 3; }
.list-items h3 { font-size: 24px; margin: 0; }
.list-items h3 a { text-decoration: none; }
.list-items h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.list-items h3 a::after { content: " ↗"; font-size: .7em; color: var(--muted); }
.list-items .by { color: var(--muted); font-size: 14px; }
.list-items .why { margin: 4px 0 0; color: var(--ink-2); }

/* ==========================================================================
   Resume
   ========================================================================== */
.resume-top { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
.resume-top .contact { color: var(--muted); font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chips li { background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 14px; font-weight: 500; }
@media (max-width: 820px) { .resume-top { grid-template-columns: 1fr; gap: 20px; } }

.resume-section { padding-top: 48px; }
.resume-section > h2 { font-size: 15px; font-family: var(--body); font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 8px; }

.role { display: grid; grid-template-columns: 1.35fr 1fr; gap: 32px; padding: 32px 0; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 16px); }
.role:last-child { border-bottom: 0; }
.role-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.role h3 { font-size: 34px; margin: 0; }
.role .where { color: var(--muted); font-size: 15px; }
.role .title { font-weight: 600; margin: 4px 0 2px; }
.role .dates { font: 600 14px/1.4 var(--body); color: var(--accent); letter-spacing: .04em; }
.role .note { color: var(--muted); font-style: italic; font-size: 15px; margin: 6px 0 0; }
.role ul { padding-left: 20px; margin: 14px 0 0; color: var(--ink-2); }
.role ul li { margin: 6px 0; }
.role-video { position: sticky; top: calc(var(--header-h) + 20px); align-self: start; }
@media (max-width: 900px) { .role { grid-template-columns: 1fr; gap: 18px; } .role-video { position: static; } }

.video-slot { border-radius: 12px; overflow: hidden; background: var(--navy); aspect-ratio: 16 / 9; position: relative; }
.video-slot iframe, .video-slot video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 16px;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0 12px, transparent 12px 24px), linear-gradient(135deg, #142a42, #0d1a29);
  color: rgba(255,255,255,.75); font-size: 14px;
}
.video-empty .play { width: 54px; height: 54px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); display: grid; place-items: center; }
.video-empty .play::after { content: ""; border-left: 15px solid rgba(255,255,255,.7); border-top: 9px solid transparent; border-bottom: 9px solid transparent; margin-left: 4px; }
.video-empty strong { font: 700 20px/1 var(--display); text-transform: uppercase; letter-spacing: .05em; color: #fff; }
.video-caption { font-size: 14px; color: var(--muted); margin-top: 10px; }
.video-caption b { color: var(--ink); }

.edu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; padding-top: 20px; }
.edu > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.edu h3 { font-size: 28px; margin: 0; }
@media (max-width: 720px) { .edu { grid-template-columns: 1fr; } }
.earlier { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.earlier li { padding-left: 16px; border-left: 3px solid var(--line); color: var(--ink-2); }
.earlier b { color: var(--ink); }

/* ==========================================================================
   Timeline (Amazon-Photos-style scrubber)
   ========================================================================== */
.tl-layout { position: relative; padding-right: 140px; }
@media (max-width: 720px) { .tl-layout { padding-right: 64px; } }

.tl-year { padding-top: 12px; }
.tl-year > h2 {
  font-size: clamp(64px, 10vw, 120px); color: transparent; -webkit-text-stroke: 1.5px var(--line);
  margin: 24px 0 -10px; line-height: .9; letter-spacing: 0;
}
.tl-month { scroll-margin-top: calc(var(--header-h) + 12px); padding: 18px 0 8px; }
.tl-month-head {
  position: sticky; top: var(--header-h); z-index: 5; padding: 10px 0;
  background: var(--paper); display: flex; align-items: baseline; gap: 10px;
  border-bottom: 1px solid var(--line); margin-bottom: 16px;
}
.tl-month-head h3 { font-size: 24px; margin: 0; text-transform: uppercase; }
.tl-month-head span { color: var(--muted); font-size: 14px; }
.tl-grid { columns: 280px; column-gap: 18px; }
.tl-card {
  break-inside: avoid; margin: 0 0 18px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); display: block;
}
.tl-card button.img { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; width: 100%; }
.tl-card img { width: 100%; height: auto; }
.tl-card .body { padding: 14px 16px 16px; }
.tl-card h4 { font-size: 22px; margin: 6px 0 4px; }
.tl-card p { font-size: 15px; color: var(--ink-2); margin: 0; }
.tl-tag { display: inline-block; font: 600 11px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; padding: 5px 8px; border-radius: 4px; background: var(--paper-2); color: var(--ink-2); }
.tl-tag.approx { background: transparent; color: var(--muted); padding-left: 2px; letter-spacing: .04em; text-transform: none; font-weight: 500; font-size: 12px; }

/* Text-only milestones look like stamped paper */
.tl-card.milestone { background: var(--paper-2); border-style: dashed; box-shadow: none; position: relative; }
.tl-card.milestone .body { padding: 22px 20px 20px; }
.tl-card.milestone h4 { font-size: 26px; }
.tl-card.milestone::after {
  content: attr(data-stamp); position: absolute; top: 14px; right: 14px; transform: rotate(8deg);
  font: 700 12px/1 var(--display); letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); border: 2px solid var(--accent); border-radius: 4px; padding: 4px 6px; opacity: .8;
}

/* Right-hand rail */
.tl-rail {
  position: fixed; right: max(12px, calc((100vw - var(--max)) / 2 + 12px)); top: calc(var(--header-h) + 24px); bottom: 24px;
  width: 124px; padding-right: 12px; z-index: 20; overflow-y: auto; scrollbar-width: none;
}
.tl-rail::-webkit-scrollbar { display: none; }
.tl-rail ol { list-style: none; margin: 0; padding: 0; }
.tl-rail > ol { border-right: 2px solid var(--line); padding: 4px 0; }
.tl-rail li.yr { text-align: right; }
.tl-rail .yr-btn {
  background: none; border: 0; cursor: pointer; color: var(--muted);
  font: 600 14px/1 var(--body); padding: 7px 12px 7px 0; position: relative; width: 100%; text-align: right;
}
.tl-rail .yr-btn::after { content: ""; position: absolute; right: -6px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--paper); border: 2px solid var(--line); }
.tl-rail .yr-btn:hover { color: var(--ink); }
.tl-rail li.yr.open > .yr-btn { color: var(--ink); font: 700 22px/1 var(--display); }
.tl-rail li.yr.open > .yr-btn::after { background: var(--accent); border-color: var(--accent); width: 14px; height: 14px; margin-top: -7px; right: -8px; }
.tl-months {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  max-height: 0; overflow: hidden; padding-right: 14px;
  transition: max-height .45s ease, padding .3s ease;
}
li.yr.open .tl-months { max-height: 520px; padding-top: 6px; padding-bottom: 12px; }
.mb {
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink-2); cursor: pointer;
  border-radius: 999px; font: 600 12px/1 var(--body); padding: 6px 10px; display: inline-flex; align-items: center; gap: 6px;
  transform: scale(.85); opacity: 0; transition: transform .3s ease, opacity .3s ease, background .2s, color .2s;
}
.mb i { font-style: normal; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--paper-2); display: grid; place-items: center; color: var(--muted); }
li.yr.open .mb { transform: scale(1); opacity: 1; }
.mb.active { background: var(--accent); border-color: var(--accent); color: #fff; transform: scale(1.08); }
.mb.active i { background: rgba(255,255,255,.25); color: #fff; }
@media (max-width: 720px) {
  .tl-rail { width: 62px; right: 4px; padding-right: 10px; }
  .tl-rail .yr-btn { font-size: 11px; padding-right: 10px; }
  .tl-rail li.yr.open > .yr-btn { font-size: 16px; }
  .mb { padding: 5px 7px; font-size: 10px; }
  .mb i { display: none; }
  .tl-months { padding-right: 10px; }
  .tl-grid { columns: 1; }
}

/* Lightbox */
.lightbox figure { margin: 0; max-width: calc(100vw - 32px); }
.lightbox img { max-width: calc(100vw - 32px); max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); border-radius: 10px; margin: 0 auto; }
.lightbox figcaption { color: #fff; text-align: center; padding: 12px; font-size: 15px; }
.lightbox .close-btn { position: fixed; top: 16px; right: 16px; background: rgba(255,255,255,.9); }

/* ==========================================================================
   Passions
   ========================================================================== */
.subnav { position: sticky; top: var(--header-h); z-index: 30; background: var(--paper); border-bottom: 1px solid var(--line); }
.subnav ul { list-style: none; display: flex; gap: 6px; margin: 0; padding: 10px 0; overflow-x: auto; }
.subnav a { display: block; padding: 8px 14px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 15px; white-space: nowrap; border: 1px solid var(--line); }
.subnav a:hover, .subnav a.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.passion { scroll-margin-top: calc(var(--header-h) + 60px); padding-top: 56px; padding-bottom: 24px; }
.passion-band {
  border-radius: 20px; overflow: hidden; position: relative; color: #fff; min-height: 300px;
  display: flex; align-items: flex-end; padding: clamp(24px, 4vw, 44px);
}
.passion-band h2 { font-size: clamp(54px, 9vw, 110px); text-transform: uppercase; margin: 0; position: relative; z-index: 1; }
.passion-band .eyebrow { color: var(--gold); position: relative; z-index: 1; }
.passion-band > div { position: relative; z-index: 1; }
.band-ultra { background: #2b3a2a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='300' viewBox='0 0 400 300'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.13' stroke-width='1.5'%3E%3Cpath d='M-20 220 C60 160 120 250 200 190 S330 120 420 170'/%3E%3Cpath d='M-20 190 C60 130 120 220 200 160 S330 90 420 140'/%3E%3Cpath d='M-20 160 C60 100 120 190 200 130 S330 60 420 110'/%3E%3Cpath d='M-20 130 C60 70 120 160 200 100 S330 30 420 80'/%3E%3Cpath d='M-20 100 C60 40 120 130 200 70 S330 0 420 50'/%3E%3Cpath d='M-20 250 C60 190 120 280 200 220 S330 150 420 200'/%3E%3Cpath d='M-20 280 C60 220 120 310 200 250 S330 180 420 230'/%3E%3C/g%3E%3C/svg%3E") center / 520px; }
.band-ultra::before { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(20,30,20,.8), transparent 70%); }
.band-ski { background: linear-gradient(160deg, #cfe3f2 0%, #8db4d4 45%, #2c5277 100%); }
.band-ski::before { content: ""; position: absolute; inset: 0; background:
  linear-gradient(155deg, transparent 55%, rgba(255,255,255,.9) 55.2%, #fff 100%),
  linear-gradient(200deg, transparent 62%, rgba(240,246,252,.95) 62.2%);
}
.band-ski::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(20,40,64,.75), transparent 60%); }
.band-wood { background: #3a2412 center 35% / cover no-repeat; }
.band-wood::before { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(30,18,8,.85), rgba(30,18,8,.15) 70%); }

.passion-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; padding-top: 32px; }
.passion-grid .lede { font-size: 20px; color: var(--ink-2); }
@media (max-width: 900px) { .passion-grid { grid-template-columns: 1fr; gap: 24px; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel h3 { font-size: 24px; text-transform: uppercase; margin-bottom: 12px; }
.panel ul { margin: 0; padding-left: 20px; color: var(--ink-2); }
.panel ul li { margin: 6px 0; }
.panel + .panel { margin-top: 18px; }

.race-log { width: 100%; border-collapse: collapse; font-size: 15px; }
.race-log th { text-align: left; font: 600 12px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 8px 6px; border-bottom: 2px solid var(--ink); }
.race-log td { padding: 10px 6px; border-bottom: 1px solid var(--line); }
.race-log td.tbd { color: var(--muted); font-style: italic; }
.table-scroll { overflow-x: auto; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 24px; }
.gallery figure { margin: 0; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; position: relative; background: var(--paper-2); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 12px 10px; font-size: 13px; color: #fff; background: linear-gradient(0deg, rgba(0,0,0,.7), transparent); }
.gallery .slot { border: 2px dashed var(--line); display: grid; place-items: center; color: var(--muted); font-size: 14px; text-align: center; padding: 12px; background: transparent; }
