/* ============================================================
   COLIN DREIS — SHARED STYLES
   Design thesis: calm surface, earned depth.
   Palette: dark ground + light ink + one pine accent.
   Type: Playfair Display (voice) / DM Sans (body) / DM Mono (utility)
   ============================================================ */

:root {
  /* Light professional theme (everything below the dark title card).
     "paper" = the ground, "ink" = the marks on it.                     */
  --paper:      #FAF8F3;   /* warm off-white ground    */
  --paper-warm: #FFFFFF;   /* raised card / panel      */
  --ink:        #1b1a17;   /* near-black warm text      */
  --ink-soft:   #55524b;   /* secondary text           */
  --ink-faint:  #918c82;   /* meta / utility text       */
  --pine:       #2f6b47;   /* accent, deepened for light */
  --pine-deep:  #234f37;
  --hairline:   #e5e0d5;   /* soft borders on paper    */
  --glow:       rgba(47, 107, 71, 0.16); /* pine halo  */

  --curtain:    #0b0b0c;   /* dark title-card background */

  --serif: 'Playfair Display', Georgia, serif;
  --sans:  'DM Sans', system-ui, sans-serif;
  --mono:  'DM Mono', monospace;

  --maxw: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; color-scheme: light; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  padding: 0 24px;
}

::selection { background: var(--pine); color: var(--paper); }

/* ---- INTRO / SPLASH (home only) ---------------------- */
/* Full-screen dot-field title card. The name is drawn on a
   <canvas> (see index.html); scroll scatters it away to reveal home. */
.intro {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 -24px;              /* full-bleed dark curtain, edge to edge */
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--curtain);   /* dark curtain; JS lightens it on scroll */
  color: #f2f0ea;
  will-change: background-color;
}
.intro-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  will-change: transform;
}

.intro-canvas {
  display: block;
  width: min(calc(100vw - 48px), 960px);  /* JS overrides with exact px */
  max-width: 100%;
  height: auto;
}

.intro-quote {
  margin-top: 32px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(15px, 2.2vw, 20px);
  color: #EEEDE9;
  opacity: 0.9;
  letter-spacing: 0.2px;
}

.intro-cue {
  margin-top: 40px;
  line-height: 1;
  color: rgba(240, 238, 232, 0.45);
  text-decoration: none;
  transition: color 0.2s;
}
.intro-cue:hover { color: #7fc79a; }
.intro-arrow {
  display: inline-block;
  font-size: 20px;
  line-height: 1;
  animation: bob 1.9s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}

/* ---- NAV (persistent sticky bar) --------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  margin: 0 -24px;             /* break out of the body's 24px padding */
  padding: 0 24px;
  background: rgba(250, 248, 243, 0.82);
  backdrop-filter: saturate(120%) blur(10px);
  -webkit-backdrop-filter: saturate(120%) blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 15px 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.nav .mark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  color: var(--ink);
  text-decoration: none;
}
.nav .links {
  display: flex;
  gap: 20px;
  font-family: var(--mono);
  font-size: 13px;
}
.nav .links a {
  color: var(--ink-soft);
  text-decoration: none;
  text-transform: capitalize;
  transition: color 0.2s;
}
.nav .links a:hover,
.nav .links a[aria-current="page"] { color: var(--pine); }

/* ---- LAYOUT ------------------------------------------ */
.wrap { max-width: var(--maxw); margin: 0 auto; }
.app  { padding: 0 0 56px; }

/* ---- MASTHEAD (persistent name) ---------------------- */
.masthead { padding: 60px 0 22px; }
.masthead .name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(40px, 7vw, 58px);
  line-height: 1.0;
  letter-spacing: -1.2px;
}

/* ---- VIEW (swappable content, crossfades on route) --- */
.view { transition: opacity 0.2s ease, transform 0.2s ease; }
.view.view--leave { opacity: 0; transform: translateY(-8px); }
.view.view--enter { opacity: 0; transform: translateY(8px); }

/* section heads (timeline / projects / travels / notes) */
.section-head { margin-bottom: 40px; }
.page-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 34px;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.page-sub {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Portfolio credibility bar (chips under the page heading) */
.cred-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: -22px 0 40px; }
.cred-item {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.3px;
  color: var(--ink-soft); background: var(--paper-warm);
  border: 1px solid var(--hairline); border-radius: 999px; padding: 6px 14px;
}

/* ---- HOME HERO LINE (under the title card) ----------- */
.hero-line {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(20px, 2.8vw, 28px);
  line-height: 1.3;
  color: var(--ink);
  letter-spacing: -0.2px;
  padding: 2px 0 32px;
}
.hero-line .a { color: var(--pine); }

/* ---- HOME STORY (museum-style narrative) ------------- */
.story-section {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 40px;
  padding: 44px 0;
  border-top: 1px solid var(--hairline);
}
.story-section:first-child { border-top: none; padding-top: 12px; }
.story-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 6px;
}
.story-body > p {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.62;
  color: var(--ink-soft);
  margin-bottom: 14px;
  max-width: 740px;
}
.story-body > p:last-child { margin-bottom: 0; }
.story-body .a { color: var(--pine); }
.story-body em { font-style: italic; color: var(--ink); }
.story-body > .story-lead {
  font-style: italic;
  color: var(--ink);
  margin-bottom: 18px;
}

/* ---- HOME EDITORIAL MOVES ---------------------------- */
/* By-the-numbers strip (under the masthead) */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  margin: 6px 0 8px;
}
.stat { padding: 22px 22px; border-left: 1px solid var(--hairline); }
.stat:first-child { border-left: none; padding-left: 0; }
.stat-num {
  font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 4vw, 40px);
  line-height: 1; color: var(--ink);
}
.stat-num .a { color: var(--pine); }
.stat-cap {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.4px;
  text-transform: uppercase; color: var(--ink-faint); margin-top: 8px; line-height: 1.4;
}

/* Editorial pull-quote interlude */
.interlude { padding: 40px 0; }
.pullquote {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: clamp(28px, 4.6vw, 50px); line-height: 1.16; letter-spacing: -0.5px;
  color: var(--ink); max-width: 900px; margin: 0;
}
.pullquote .a { color: var(--pine); }
.pullquote-by {
  font-family: var(--mono); font-size: 12px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--ink-faint); margin-top: 20px;
}

/* "Now" as a live status card */
.now-card {
  position: relative;
  background: var(--paper-warm); border: 1px solid var(--hairline);
  border-radius: 16px; padding: 26px 30px; max-width: 620px;
}
.now-dot {
  position: absolute; top: 22px; right: 22px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--pine);
  box-shadow: 0 0 0 0 rgba(47, 107, 71, 0.5); animation: now-pulse 2.4s infinite;
}
@keyframes now-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(47, 107, 71, 0.45); }
  70%  { box-shadow: 0 0 0 10px rgba(47, 107, 71, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 107, 71, 0); }
}
.now-body p {
  font-family: var(--serif); font-size: 18px; line-height: 1.62;
  color: var(--ink-soft); margin-bottom: 12px;
}
.now-body p:last-child { margin-bottom: 0; }
.now-body .a { color: var(--pine); }

@media (max-width: 600px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat { border-left: none; padding: 16px 0; border-top: 1px solid var(--hairline); }
  .stat:first-child, .stat:nth-child(2) { border-top: none; }
  .interlude { padding: 28px 0; }
  .now-card { padding: 22px 20px; }
}
@media (prefers-reduced-motion: reduce) { .now-dot { animation: none; } }

/* section with a photo beside the text (e.g. About) — editorial portrait */
.with-photo { display: flex; gap: 44px; align-items: flex-start; }
.side-photo { margin: 0; flex: 0 0 auto; }
.side-photo img {
  display: block;
  width: 340px;
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 20px 48px rgba(30, 25, 18, 0.16);
}
.photo-caption {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.with-photo-text { flex: 1 1 auto; min-width: 0; }
.with-photo-text p {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.62;
  color: var(--ink-soft);
  margin-bottom: 14px;
  max-width: 620px;
}
.with-photo-text p:last-child { margin-bottom: 0; }
.about-actions { margin-bottom: 22px; }

/* ---- RESUME BUTTON (About top + Contact block) ------- */
/* Outlined pine button — clearly a button, fills in on hover. */
.resume-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--paper-warm);
  color: var(--pine);
  border: 1px solid rgba(47, 107, 71, 0.45);
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  letter-spacing: 0.2px;
  padding: 11px 20px; border-radius: 9px; text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.resume-btn:hover {
  background: var(--pine); color: #fff; border-color: var(--pine);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(47, 107, 71, 0.18);
}
.resume-btn .resume-ico { font-size: 15px; line-height: 1; }

@media (max-width: 600px) {
  .with-photo { flex-direction: column; gap: 20px; }
  .side-photo img { width: min(300px, 74vw); }
  .with-photo-text p { font-size: 17px; }
}

/* contact list */
.contact-list { display: grid; gap: 12px; }
.contact-row { display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; }
.contact-key {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-faint);
  min-width: 110px;
}
.contact-val { font-size: 16px; color: var(--ink-soft); }
.contact-val a {
  color: var(--ink-soft); text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  transition: color 0.2s, border-color 0.2s;
}
.contact-val a:hover { color: var(--pine); border-color: var(--pine); }

/* ---- MIND (mental health page) prose ----------------- */
.prose { max-width: 740px; margin-bottom: 34px; }
.prose p {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.62;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.prose p:last-child { margin-bottom: 0; }
.prose .a { color: var(--pine); }
.prose em { font-style: italic; color: var(--ink); }

.note-hint {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-faint);
}

/* ---- HIGHLIGHTS -------------------------------------- */
.highlight-list { list-style: none; }
.highlight-list li {
  position: relative;
  padding: 7px 0 7px 22px;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.4;
  color: var(--ink);
}
.highlight-list li::before {
  content: "";
  position: absolute; left: 0; top: 15px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--pine);
}
.highlight-list em { font-style: italic; }

/* sub-grouped categories (Achievements, Building, Focus) */
.hl-group + .hl-group { margin-top: 22px; }
.hl-sub {
  font-family: var(--mono); font-size: 11px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--pine); margin-bottom: 4px;
}
.hl-group .highlight-list li { font-size: 17px; }
.hl-group .prose { margin-top: 8px; }
.hl-soon { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); padding: 4px 0; }
/* compact interest chips (Hobbies) */
.hl-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.hl-tag {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.3px;
  color: var(--ink-soft); background: var(--paper-warm);
  border: 1px solid var(--hairline); border-radius: 999px; padding: 6px 14px;
}

/* ---- CHESS (live from chess.com) --------------------- */
.chess-loading, .chess-msg {
  font-family: var(--mono); font-size: 12px; color: var(--ink-faint); margin-bottom: 16px;
}
.chess-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.chess-stat {
  border: 1px solid var(--hairline); border-radius: 12px;
  background: var(--paper-warm); padding: 16px 18px;
}
.chess-stat-fmt {
  font-family: var(--mono); font-size: 11px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--ink-faint);
}
.chess-stat-rating {
  font-family: var(--serif); font-weight: 500; font-size: 34px; line-height: 1.1;
  color: var(--ink); margin: 4px 0 6px;
}
.chess-stat-rec { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }
.chess-stat-rec b { color: var(--ink); font-weight: 500; }

.chess-games { margin-top: 22px; }
.chess-games-lead {
  font-family: var(--mono); font-size: 11px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px;
}
.chess-game {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 11px 0; border-bottom: 1px solid var(--hairline);
  text-decoration: none; color: inherit;
}
.chess-game:hover .chess-opp { color: var(--pine); }
.chess-res {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.5px; text-transform: uppercase;
  padding: 2px 8px; border-radius: 5px; flex: none; min-width: 46px; text-align: center;
}
.chess-win  { background: rgba(47, 107, 71, 0.14); color: var(--pine-deep); }
.chess-loss { background: rgba(150, 60, 45, 0.12); color: #8a3a2a; }
.chess-draw { background: rgba(30, 25, 18, 0.08); color: var(--ink-soft); }
.chess-opp { font-family: var(--serif); font-size: 17px; color: var(--ink); transition: color 0.2s; }
.chess-gmeta { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); margin-left: auto; white-space: nowrap; }

.chess-profile {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 22px;
  background: var(--pine); color: #fff;
  font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0.2px;
  padding: 11px 20px; border-radius: 9px; text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}
.chess-profile:hover { background: var(--pine-deep); transform: translateY(-1px); }
@media (max-width: 600px) {
  .chess-gmeta { margin-left: 0; width: 100%; }
}

/* ---- HOME SPINE (numbered sections) ------------------ */
.spine { border-top: 1px solid var(--hairline); }
.section {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 20px;
  padding: 30px 0;
  border-bottom: 1px solid var(--hairline);
}
.section .num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--pine);
  padding-top: 7px;
}
.section h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 24px;
  margin-bottom: 10px;
}
.section p { color: var(--ink-soft); margin-bottom: 10px; }
.section p:last-child { margin-bottom: 0; }

/* ---- TIMELINE ---------------------------------------- */
.tl { border-left: 1px solid var(--hairline); margin-left: 8px; }
.tl-item { position: relative; padding: 0 0 26px 30px; }
.tl-item::before {
  content: ""; position: absolute; left: -5px; top: 6px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--paper); border: 1.5px solid var(--ink-faint);
}
.tl-item.big::before { border-color: var(--pine); background: var(--pine); width: 11px; height: 11px; left: -6px; }
.tl-item .yr {
  font-family: var(--mono); font-size: 12px; color: var(--ink-faint);
  letter-spacing: 1px;
}
.tl-item .ti {
  font-family: var(--serif); font-weight: 500;
  margin: 2px 0 4px;
}
.tl-item.small .ti { font-size: 18px; color: var(--ink-soft); }
.tl-item.normal .ti { font-size: 22px; }
.tl-item.big .ti { font-size: 26px; }
.tl-item .note { color: var(--ink-soft); font-size: 16px; }

/* ---- SEASON BY SEASON (football article) ------------- */
.seasons-lead {
  margin: 48px 0 2px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.seasons-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}
.season-head {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
  color: var(--ink);
  margin-bottom: 10px;
}
.season-sources {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-faint);
}
.season-sources a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  transition: color 0.2s, border-color 0.2s;
}
.season-sources a:hover { color: var(--pine); border-color: var(--pine); }

/* ---- PROJECTS (the centerpiece) ---------------------- */
/* Full-width "What I'm Building" block on the home page. */
.build-section { padding: 48px 0; border-top: 1px solid var(--hairline); }
.build-head { margin-bottom: 30px; }
.build-head .story-label { padding-top: 0; margin-bottom: 8px; }
.build-lead {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(21px, 2.6vw, 28px);
  line-height: 1.3; color: var(--ink);
}

/* card grid (also used on the projects page + mind page) */
.pcards, .cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.pcard, .card {
  display: flex; flex-direction: column;
  background: var(--paper-warm);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none; color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
a.pcard:hover {
  border-color: rgba(47, 107, 71, 0.45);
  box-shadow: 0 10px 30px rgba(30, 25, 18, 0.07);
  transform: translateY(-2px);
}
.pcard-media { aspect-ratio: 16 / 10; background: #ece7db; overflow: hidden; }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1 1 auto; }
.pcard-name {
  font-family: var(--serif); font-weight: 500; font-size: 23px;
  color: var(--ink); line-height: 1.2;
}
.pcard-arrow { color: var(--pine); }
.pcard-role {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.3px;
  color: var(--pine); margin: 8px 0 10px;
}
.pcard-blurb { color: var(--ink-soft); font-size: 15.5px; line-height: 1.55; flex: 1 1 auto; }
.pcard-cta {
  margin-top: 18px; align-self: flex-start;
  font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--pine);
}
a.pcard:hover .pcard-cta { text-decoration: underline; }
/* "Read the analysis" button sits at the bottom of an analysis card */
.analysis-btn { margin-top: 18px; align-self: flex-start; }

/* ---- THE ANALYSIS DESK: inline page-flip viewer ------ */
.analysis-list { display: grid; gap: 24px; }
.analysis-item {
  background: var(--paper-warm);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 26px 28px 24px;
}
.analysis-text { max-width: 760px; }
.analysis-text .pcard-blurb { margin-top: 10px; }

.flip { max-width: 820px; margin: 24px auto 0; }
.flip-stage {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 16px; cursor: pointer;
  background: #f1ece1;
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.flip-stage:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }
.flip-img {
  display: block;
  max-width: 100%; max-height: 72vh; width: auto; height: auto;
  object-fit: contain;
  background: #fff; border-radius: 2px;
  box-shadow: 0 6px 22px rgba(30, 25, 18, 0.16);
}
.flip-nav {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--hairline); background: var(--paper-warm);
  color: var(--ink-soft); font-size: 20px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; z-index: 2;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.flip-nav:hover:not(:disabled) { background: var(--pine); color: #fff; border-color: var(--pine); }
.flip-nav:disabled { opacity: 0.35; cursor: default; }
.flip-foot { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.flip-count { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); white-space: nowrap; }
.flip-hint { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.flip-dl { font-family: var(--mono); font-size: 12px; color: var(--pine); text-decoration: none; white-space: nowrap; margin-left: auto; }
.flip-dl:hover { text-decoration: underline; }
.flip-expand {
  margin-left: auto;
  font-family: var(--mono); font-size: 12px; color: var(--pine);
  background: none; border: none; padding: 0; cursor: pointer; white-space: nowrap;
}
.flip-expand:hover { text-decoration: underline; }

/* Expand: full-screen overlay to read the pages larger (no download) */
.flip.is-expanded {
  position: fixed; inset: 0; z-index: 200; margin: 0; max-width: none;
  background: var(--paper);
  padding: 3vh 3vw; box-sizing: border-box;
  display: flex; flex-direction: column;
}
.flip.is-expanded .flip-stage {
  flex: 1 1 auto; min-height: 0;
  background: transparent; border: none; padding: 0;
}
.flip.is-expanded .flip-img { max-height: 100%; max-width: 100%; }
.flip.is-expanded .flip-foot { flex: none; justify-content: center; margin-top: 16px; }

@media (max-width: 600px) {
  .analysis-item { padding: 20px 16px 18px; }
  .flip-stage { gap: 6px; padding: 10px; }
  .flip-nav { width: 32px; height: 32px; font-size: 18px; }
  .flip-img { max-height: 62vh; }
  .flip-hint { display: none; }
  .flip.is-expanded .flip-img { max-height: 100%; }
}

/* ---- THE FLOOR (embedded live exhibit) --------------- */
.floor {
  margin-top: 34px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--paper-warm);
  padding: 26px 28px 28px;
}
.floor-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--pine); margin-bottom: 10px;
}
.floor-title {
  font-family: var(--serif); font-weight: 500; font-size: 26px;
  color: var(--ink); line-height: 1.15; margin-bottom: 10px;
}
.floor-desc {
  color: var(--ink-soft); font-size: 15.5px; line-height: 1.6;
  max-width: 680px; margin-bottom: 18px;
}
.floor-open {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--pine); color: #fff;
  font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0.2px;
  padding: 11px 20px; border-radius: 9px; text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}
.floor-open:hover { background: var(--pine-deep); transform: translateY(-1px); }
.floor-frame {
  position: relative;
  margin-top: 22px;
  height: 540px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  overflow: hidden;
  background: #f1ece1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.floor-iframe { width: 100%; height: 100%; border: 0; display: block; }
.floor-fallback {
  position: absolute; inset: 0; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; padding: 24px;
  font-family: var(--mono); font-size: 13px; color: var(--ink-faint);
}
.floor-fallback a { color: var(--pine); text-decoration: none; }
.floor-frame.floor-failed .floor-iframe { display: none; }
.floor-frame.floor-failed .floor-fallback { display: flex; }
@media (max-width: 700px) {
  .floor { padding: 22px 18px 24px; }
  .floor-title { font-size: 22px; }
}

/* ---- CONTACT CTA ------------------------------------- */
.cta {
  background: var(--paper-warm);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 32px 34px;
  margin-bottom: 24px;
}
.cta-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(24px, 3.4vw, 32px); color: var(--ink);
  margin-bottom: 10px; letter-spacing: -0.4px;
}
.cta-line { color: var(--ink-soft); font-size: 16px; line-height: 1.55; margin-bottom: 22px; max-width: 500px; }
.cta-btn {
  display: inline-block;
  background: var(--pine); color: #fff;
  font-family: var(--mono); font-size: 14px; font-weight: 500;
  padding: 13px 24px; border-radius: 9px; text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}
.cta-btn:hover { background: var(--pine-deep); transform: translateY(-1px); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---- TRAVELS MAPS ------------------------------------ */
.mapblock { margin-bottom: 44px; }
.map-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 14px;
}
.map-wrap {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  overflow: hidden;                 /* clip the zoom to the map frame */
  background:
    radial-gradient(ellipse 80% 70% at 50% 34%, #ffffff 0%, #f1ece1 74%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.map-loading {
  font-family: var(--mono); font-size: 12px; color: var(--ink-faint);
  padding: 40px 0; text-align: center;
}
.map-svg {
  width: 100%; height: auto; display: block; overflow: visible;
  transform-origin: 0 0;
  transition: transform 0.7s cubic-bezier(0.33, 0, 0.15, 1);   /* theatrical zoom */
}
/* during a zoom, focus the clicked region and fade the rest */
.map-svg.is-zoomed .region.on:not(.zoom-target) { opacity: 0.55; }
.region.zoom-target { filter: drop-shadow(0 0 7px rgba(47, 107, 71, 0.7)); }
.region {
  fill: url(#mapLand);
  stroke: #faf8f3;
  stroke-width: 0.5;
  transition: filter 0.25s ease, opacity 0.4s ease;
}
.region.on {
  fill: url(#mapVisited);
  stroke: rgba(255, 255, 255, 0.65);
  stroke-width: 0.7;
  cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(35, 79, 55, 0.25));
}
.region.on:hover,
.region.on:focus {
  filter: drop-shadow(0 0 6px rgba(47, 107, 71, 0.6));
  outline: none;
}

/* ---- REGION / COUNTRY MODAL -------------------------- */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(26, 22, 16, 0.5);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.modal-panel {
  position: relative;
  width: 100%; max-width: 620px; max-height: 86vh; overflow-y: auto;
  background: var(--paper-warm);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 30px;
}
.modal-close {
  position: absolute; top: 10px; right: 14px;
  background: none; border: none; color: var(--ink-faint);
  font-size: 26px; line-height: 1; cursor: pointer; padding: 4px;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--ink); }
.modal-title {
  font-family: var(--serif); font-weight: 500; font-size: 28px;
  margin-bottom: 12px; padding-right: 24px;
}
.modal-story { color: var(--ink-soft); font-size: 16px; line-height: 1.6; }
.modal-empty { color: var(--ink-faint); font-style: italic; }
.modal-photos {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px; margin-top: 18px;
}
.modal-photos img { width: 100%; border-radius: 5px; display: block; }
.modal-videos { margin-top: 18px; display: grid; gap: 14px; }
.video-embed { position: relative; padding-bottom: 56.25%; height: 0; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 5px; }
.video-file { width: 100%; border-radius: 5px; display: block; }
.video-link { color: var(--pine); text-decoration: none; font-family: var(--mono); font-size: 14px; }

/* ---- NOTES ------------------------------------------- */
.note-cta {
  border: 1px solid var(--hairline); border-radius: 4px;
  padding: 22px; margin-bottom: 30px; background: var(--paper-warm);
}
.note-cta a { color: var(--pine); font-weight: 500; text-decoration: none; }
.note-item {
  padding: 18px 0; border-bottom: 1px solid var(--hairline);
  display: flex; justify-content: space-between; gap: 16px; align-items: baseline;
  text-decoration: none; color: inherit;
}
.note-item h3 { font-family: var(--serif); font-weight: 500; font-size: 20px; }
.note-item .date { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); white-space: nowrap; }
.note-item:hover h3 { color: var(--pine); }
.note-item:first-child { border-top: 1px solid var(--hairline); }
.notes-loading { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); padding: 8px 0; }
.notes-loading a { color: var(--pine); text-decoration: none; }
.book-note { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); margin-top: 12px; }
.notes-more {
  font-family: var(--mono); font-size: 12px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--ink-faint);
  margin: 44px 0 18px; padding-top: 34px; border-top: 1px solid var(--hairline);
}

/* ---- LINKS ROW --------------------------------------- */
.linkrow { display: flex; flex-wrap: wrap; gap: 20px; }
.linkrow a {
  font-family: var(--mono); font-size: 14px; color: var(--ink-soft);
  text-decoration: none; transition: color 0.2s;
}
.linkrow a:hover { color: var(--pine); }
.linkrow a::after { content: " ↗"; color: var(--pine); }

/* ---- FOOTER ------------------------------------------ */
.foot {
  max-width: var(--maxw); margin: 0 auto;
  padding: 28px 0; border-top: 1px solid var(--hairline);
  font-family: var(--mono); font-size: 12px; color: var(--ink-faint);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

/* ---- SECTION LEAD (italic intro under a section head) - */
.section-lead {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.42;
  color: var(--ink);
  max-width: 760px;
  margin: -12px 0 32px;
}

/* ---- RESUME BLOCKS (Education + Work Experience) ------ */
.resume-list { display: grid; gap: 26px; }
.resume-item + .resume-item {
  border-top: 1px solid var(--hairline);
  padding-top: 26px;
}
.resume-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 16px; flex-wrap: wrap;
}
.resume-title {
  font-family: var(--serif); font-weight: 500; font-size: 22px;
  color: var(--ink); line-height: 1.2;
}
.resume-dates {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.5px;
  color: var(--ink-faint); white-space: nowrap;
}
.resume-dates--tbd { color: var(--pine); opacity: 0.85; }
.resume-role {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.3px;
  color: var(--pine); margin: 7px 0 9px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.resume-now {
  font-family: var(--mono); font-size: 10px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--pine);
  border: 1px solid rgba(47, 107, 71, 0.4); border-radius: 20px;
  padding: 2px 9px;
}
.resume-detail {
  font-family: var(--serif); font-size: 17px; line-height: 1.55;
  color: var(--ink-soft); max-width: 640px;
}

/* ---- SOCIAL LINKS (Contact section pill row) --------- */
.social-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.social-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  color: var(--ink); text-decoration: none;
  background: var(--paper-warm);
  border: 1px solid var(--hairline); border-radius: 999px;
  padding: 9px 18px;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.social-link:hover {
  border-color: rgba(47, 107, 71, 0.5); color: var(--pine);
  transform: translateY(-1px);
}
.social-arrow { color: var(--pine); font-size: 12px; }

/* ---- PROJECT CARD CTA (destination host) ------------- */
.pcard-cta-arrow { margin-left: 5px; color: var(--pine); }

/* ---- FOOTER (identity + persistent social) ----------- */
.foot-left { display: flex; flex-direction: column; gap: 3px; }
.foot-social { display: flex; flex-wrap: wrap; gap: 18px; }
.foot-social a {
  color: var(--ink-soft); text-decoration: none;
  transition: color 0.2s;
}
.foot-social a:hover { color: var(--pine); }
body.route-football .foot-social a { color: rgba(233, 228, 218, 0.7); }
body.route-football .foot-social a:hover { color: #86c9a1; }

/* ---- FOOTBALL VIDEO BACKGROUND ----------------------- */
/* A fixed cinematic layer sits behind the football route only; the
   chrome + content are lifted above it and re-tinted light so text
   stays legible over the footage. Professional routes are untouched. */
#fb-bg { display: none; }
body.route-football #fb-bg {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;                 /* clicks pass through to content */
  background: linear-gradient(165deg, #0e1c13 0%, #0b0d0e 55%, #05080a 100%);
  opacity: 0;
  transition: opacity 0.9s ease;
}
body.route-football #fb-bg.is-in { opacity: 1; }

.fb-poster,
.fb-iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
}
.fb-poster { width: 100%; height: 100%; object-fit: cover; }
/* Cover the viewport at 16:9 and then some, cropping overflow (no
   letterboxing). The ~1.3x over-scale pushes the player's edge chrome
   (the YouTube watermark, any controls) off-screen. */
.fb-iframe {
  width: 130vw;
  height: 73.125vw;           /* 16:9 from width  */
  min-width: 231.12vh;        /* 16:9 from height */
  min-height: 130vh;
}
#fb-bg.fb-failed .fb-iframe { opacity: 0; }   /* blocked embed -> gradient/poster shows */

.fb-scrim {
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 10, var(--fb-overlay, 0.6));
}

/* Lift chrome + content above the fixed video (nav keeps its own sticky z). */
body.route-football .masthead,
body.route-football main.app,
body.route-football #foot-slot { position: relative; z-index: 1; }

/* Dark-glass nav while the route is cinematic. */
body.route-football .navbar {
  background: rgba(10, 12, 11, 0.55);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}
body.route-football .nav .mark { color: #f4f1ea; }
body.route-football .nav .links a { color: rgba(233, 228, 218, 0.82); }
body.route-football .nav .links a:hover,
body.route-football .nav .links a[aria-current="page"] { color: #86c9a1; }

/* Light type for legibility over the dark footage. */
body.route-football .masthead .name,
body.route-football .page-title,
body.route-football .season-head,
body.route-football .seasons-title { color: #f5f2ec; }
body.route-football .page-sub,
body.route-football .story-label,
body.route-football .seasons-lead { color: rgba(233, 228, 218, 0.74); }
body.route-football .story-body > p { color: #ebe6dc; }
body.route-football .story-body .a { color: #86c9a1; }
body.route-football .story-body em { color: #ffffff; }
body.route-football .story-section { border-top-color: rgba(255, 255, 255, 0.15); }
body.route-football .season-sources { color: rgba(233, 228, 218, 0.62); }
body.route-football .season-sources a {
  color: rgba(233, 228, 218, 0.88);
  border-bottom-color: rgba(255, 255, 255, 0.28);
}
body.route-football .season-sources a:hover { color: #86c9a1; border-bottom-color: #86c9a1; }
body.route-football .foot {
  color: rgba(233, 228, 218, 0.6);
  border-top-color: rgba(255, 255, 255, 0.12);
}

/* ---- HOME NAVY MASTHEAD ------------------------------ */
/* Full-bleed textured navy header band that opens the home page,
   carrying the portrait + About copy. Home only; on home the plain
   persistent name is hidden because the band carries the name.
   Texture is layered and tuned entirely from the vars in .masthead-band. */

body.route-home .masthead { display: none; }   /* band carries the name */
/* Full-bleed (100vw) children must never create a horizontal scrollbar.
   `clip` (not `hidden`) avoids turning body into a scroll container,
   so the sticky nav keeps working. */
body { overflow-x: clip; }

.masthead-band {
  /* ---- tune the whole navy treatment from here ---- */
  --navy:         #122032;   /* base navy                       */
  --mh-pine:      #7FB894;   /* lightened pine for the navy field */
  --mh-weave:     0.05;      /* 45deg diagonal weave strength   */
  --mh-noise:     0.06;      /* grain strength                  */
  --mh-glow:      0.20;      /* corner pine glow strength       */
  --mh-vignette:  0.55;      /* inset edge darkening strength   */

  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);   /* break out of the centered wrap */
  overflow: hidden;
  margin-bottom: 4px;
  color: #e9eef4;
  background-color: var(--navy);
  background-image:
    radial-gradient(120% 95% at 90% 6%, rgba(127, 184, 148, var(--mh-glow)) 0%, rgba(127, 184, 148, 0) 48%),
    repeating-linear-gradient(45deg,
      rgba(255, 255, 255, var(--mh-weave)) 0, rgba(255, 255, 255, var(--mh-weave)) 1px,
      rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0) 7px);
}
/* grain + vignette as pseudo layers so their opacity is independently tunable */
.masthead-band::before {
  content: "";
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='150' height='150' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 150px 150px;
  opacity: var(--mh-noise);
  mix-blend-mode: overlay;
}
.masthead-band::after {
  content: "";
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(125% 105% at 50% 42%, rgba(3, 7, 14, 0) 55%, rgba(3, 7, 14, var(--mh-vignette)) 100%);
}

.masthead-inner {
  position: relative;
  z-index: 2;
  max-width: calc(var(--maxw) + 48px);
  margin: 0 auto;
  padding: 58px 24px 62px;
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 50px;
  align-items: start;
}

/* Editorial vertical portrait with a thin offset pine rule behind it. */
.mh-portrait { position: relative; width: 330px; height: 420px; margin: 0; flex: none; }
.mh-portrait::before {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  transform: translate(16px, 16px);
  border: 1px solid var(--mh-pine);
  border-radius: 4px;
}
.mh-portrait picture { position: relative; z-index: 1; display: block; height: 100%; }
.mh-portrait img {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  border-radius: 4px;
  box-shadow: 0 18px 40px rgba(5, 10, 20, 0.4);
}

.mh-content { min-width: 0; }
.mh-eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--mh-pine); margin-bottom: 16px;
}
.mh-name {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(40px, 6vw, 62px); line-height: 1.0;
  letter-spacing: -1.2px; color: #f5f8fb;
}
.mh-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(20px, 2.6vw, 27px); color: #d6dee7; margin-top: 8px;
}
.mh-title .a { color: var(--mh-pine); }
.mh-divider { width: 54px; height: 2px; background: var(--mh-pine); border-radius: 2px; margin: 22px 0 24px; }
.mh-about p {
  font-family: var(--serif); font-size: 17px; line-height: 1.66;
  color: #c9d2dc; margin-bottom: 13px; max-width: 62ch;
}
.mh-about p:last-child { margin-bottom: 0; }
.mh-about .a { color: var(--mh-pine); }
.mh-about em { font-style: italic; color: #eef2f6; }

.mh-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.mh-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0.2px;
  padding: 11px 18px; border-radius: 9px; text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}
.mh-btn--solid { background: var(--mh-pine); color: #0e1a12; border: 1px solid var(--mh-pine); }
.mh-btn--solid:hover { background: #93c7a7; border-color: #93c7a7; transform: translateY(-1px); }
.mh-btn--ghost { background: rgba(255, 255, 255, 0.03); color: #dfe6ee; border: 1px solid rgba(255, 255, 255, 0.22); }
.mh-btn--ghost:hover { background: rgba(127, 184, 148, 0.16); border-color: var(--mh-pine); color: #ffffff; transform: translateY(-1px); }

/* Watermark CD monogram, bottom-right, D set down-and-right of the C. */
.mh-monogram {
  position: absolute; z-index: 1; pointer-events: none;
  right: clamp(10px, 4vw, 56px);
  bottom: clamp(4px, 2vw, 18px);
  width: clamp(120px, 17vw, 210px); height: auto;
}
.mh-monogram .mh-mono {
  font-family: var(--serif); font-weight: 600; font-size: 150px;
  fill: var(--mh-pine); fill-opacity: 0.12;
}

/* Empty state for a projects group with no items yet. */
.pcards-empty {
  border: 1px dashed var(--hairline);
  border-radius: 14px;
  padding: 30px 26px;
  background: var(--paper-warm);
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 13px;
}
.build-head--sub { margin-top: 30px; }

/* Masthead stacks to a single column on narrow screens. */
@media (max-width: 760px) {
  .masthead-inner { grid-template-columns: 1fr; gap: 26px; padding: 40px 20px 46px; }
  .mh-portrait { width: 100%; height: auto; aspect-ratio: 330 / 420; max-width: 340px; }
  .mh-portrait::before { transform: translate(12px, 12px); }
  .mh-monogram { width: clamp(94px, 26vw, 150px); }
  .mh-about p { font-size: 16.5px; }
}

/* ---- MOBILE ------------------------------------------ */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .masthead { padding: 40px 0 18px; }
  .section { grid-template-columns: 1fr; gap: 6px; }
  .section .num { padding-top: 0; }
  .story-section { grid-template-columns: 1fr; gap: 10px; padding: 30px 0; }
  .story-label { padding-top: 0; }
  .story-body > p { font-size: 17px; }
  .page-title { font-size: 27px; }
  .nav { gap: 8px; align-items: center; }
  .nav .links { gap: 11px; font-size: 11px; flex-wrap: wrap; justify-content: flex-end; }
  .travel-item { grid-template-columns: 1fr; }
  .pcards, .cards { grid-template-columns: 1fr; gap: 16px; }
  .build-section { padding: 34px 0; }
  .cta { padding: 24px 22px; }
}

/* ---- REDUCED MOTION ---------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .intro-arrow { animation: none; }
  .view { transition: none !important; }
}
