/* ===== NYC Walking Challenge =====
   Plain CSS. No framework, no build step.

   Everything leans on the tokens in :root. Change a colour or a spacing step
   there and it moves consistently across every page. */

/* ------------------------------------------------------------------ tokens */
:root {
  /* Field Guide palette: warm cream paper, dark forest green, rust used
     sparingly so it still reads as an accent rather than a second brand. */
  --paper:      #f4f0e6;
  --surface:    #faf7ef;
  --surface-2:  #e9e2d2;

  --forest:      #193b2b;
  --forest-deep: #11291d;

  --rust:       #da6d3d;
  --rust-soft:  #d36e45;

  --ink:        #24352a;
  --ink-soft:   #455b4b;
  --ink-faint:  #6b786e;

  --line:       #b7c2ae;
  --line-soft:  #cbd2c2;

  --gold:       #d4b980;   /* only on the dark featured card */

  /* Type */
  --font-body:    'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-stamp:   'Oswald', 'DM Sans', sans-serif;

  /* Panel colours the mockup uses directly rather than through a token. */
  --card-planned: #ebe9dd;
  --card-pill:    #d9ddd1;
  --foot-bg:      #e9e4d8;
  --gold-bright:  #f7db9d;

  /* Spacing steps */
  --s-1: .25rem;
  --s-2: .5rem;
  --s-3: .75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;

  --radius:      10px;
  --radius-sm:   6px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(28,40,32,.06);
  --shadow:    0 2px 10px rgba(28,40,32,.08);
  --shadow-lg: 0 10px 30px rgba(28,40,32,.14);

  --gutter:   1.25rem;
  --w-text:   46rem;
  --w-wide:   68rem;
  --header-h: 4rem;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

a { color: var(--forest); }
a:hover, a:focus-visible { color: var(--rust); }

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

/* --------------------------------------------------------------- headings */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;   /* DM Serif Display ships one weight */
  line-height: 1.15;
  color: var(--forest);
  margin: 0;
}

h1 { font-size: clamp(3.3rem, 6.2vw, 6.25rem); line-height: .96; letter-spacing: -.055em; margin-bottom: var(--s-5); }
h2 { font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.375rem); letter-spacing: -.03em; margin-bottom: var(--s-4); }
h3 { font-size: clamp(1.4rem, 1.2rem + .7vw, 1.8125rem); margin-bottom: var(--s-2); }
h4 { font-size: 1.25rem; margin-bottom: var(--s-2); }

p { margin: 0 0 var(--s-4); }
p:last-child { margin-bottom: 0; }

/* =================================================================== header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header-inner {
  /* Full bleed: constrained to the content container the bar floated in the
     middle of a wide screen with dead space before the logo. */
  max-width: none;
  margin: 0;
  padding: 0 clamp(1rem, 2.5vw, 2.5rem);
  min-height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--s-4);
}

.site-title {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -.01em;
  color: var(--forest);
  text-decoration: none;
  white-space: nowrap;
}
.site-title:hover { color: var(--rust); }

.site-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: none;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  justify-self: center;
}

.site-nav a {
  display: block;
  padding: var(--s-2) 0;
  font-size: .92rem;
  font-weight: 600;
  color: var(--forest);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.site-nav a:hover { color: var(--rust); }

/* The current section is marked with a rust rule, not a filled pill - it
   reads as a tab rather than a button. */
.site-nav a[aria-current="page"] {
  color: var(--forest);
  border-bottom-color: var(--rust);
}

/* ------------------------------------------------------------- hamburger */
.nav-toggle {
  justify-self: end;
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem; height: 2.5rem;
  padding: 0;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle:hover { background: var(--surface-2); }

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--forest);
  border-radius: 2px;
  transition: transform .2s ease, background .2s ease;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after { content: ''; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after  { top:  6px; }

.nav-toggle.is-open .nav-toggle-bars { background: transparent; }
.nav-toggle.is-open .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open .nav-toggle-bars::after  { transform: translateY(-6px) rotate(-45deg); }

/* =================================================================== layout */
main {
  max-width: var(--w-text);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
main.wide { max-width: var(--w-wide); }

/* The Field Guide homepage runs wider, on a percentage gutter like the mockup,
   so the hero and cards get the room the design assumes. */
main.field { max-width: 88rem; padding-inline: clamp(1.25rem, 5vw, 3.5rem); }

section { padding: var(--s-6) 0; border-bottom: 1px solid var(--line-soft); }
section:last-of-type { border-bottom: 0; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-soft);
  margin: 0 0 var(--s-2);
}

.lede {
  font-size: 17px;
  line-height: 1.58;
  color: var(--ink-soft);
  max-width: 515px;
  margin: 0;
}

.note { color: var(--ink-faint); font-size: .9rem; }

/* ==================================================================== hero */
/* Two columns on desktop; on a phone the artwork stacks ABOVE the words. */
.hero--field {
  display: grid;
  grid-template-columns: 1.06fr .94fr;
  gap: clamp(2rem, 4vw, 3.4rem);
  align-items: center;
  min-height: 515px;
  padding: 58px 0 54px;
  border-bottom: 1px solid var(--line);
}

.hero-copy h1 { margin-bottom: var(--s-5); }

/* The rust italic in the headline. */
.hero-copy h1 em {
  font-style: italic;
  color: var(--rust);
  font-weight: 700;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 29px;
}

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  padding: 16px 23px;
  border-radius: 3px;
  border: 2px solid var(--forest);
  background: var(--forest);
  color: var(--surface);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--forest-deep); border-color: var(--forest-deep); color: var(--surface); }

.btn-quiet {
  font-size: 13px;
  font-weight: 800;
  padding: 13px 0;
  color: var(--forest);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.btn-quiet:hover { color: var(--rust); border-bottom-color: var(--rust); }

/* ------------------------------------------------------------- hero art */
/* A map-ish plate: ruled grid, a dashed route, the patch sitting on top. */
.hero-art {
  position: relative;
  height: 400px;
  background: var(--surface-2);
  border: 1px solid #1a4a342b;
  overflow: hidden;
}

/* The ruled grid is two repeating gradients turned off-axis, so it reads as a
   surveyor's sheet rather than graph paper. */
.hero-art::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    repeating-linear-gradient(0deg,  transparent 0 54px, #26473125 55px 57px, transparent 58px 104px),
    repeating-linear-gradient(90deg, transparent 0 64px, #26473125 65px 67px, transparent 68px 110px);
  transform: rotate(-11deg);
}

/* A dashed border on a rounded box, tilted - cheaper and crisper than an SVG,
   and it inherits the same off-axis feel as the grid behind it. */
.hero-route {
  position: absolute;
  left: 4%;
  top: 17%;
  width: 360px;
  height: 230px;
  border: 8px dashed var(--rust-soft);
  border-radius: 50%;
  transform: rotate(-12deg);
  opacity: .75;
  pointer-events: none;
}

.hero-patch {
  position: absolute;
  width: 242px;
  height: 242px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  /* The artwork files are square with white corners. The patch is round, so
     clipping it keeps those corners off the map grid and the green card. */
  border-radius: 50%;
  box-shadow: 0 12px 35px #173a3040;
}

.hero-stamp {
  position: absolute;
  top: 22px;
  right: 24px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid var(--forest);
  background: #f4f0e6dd;
  color: var(--forest);
  display: grid;
  place-items: center;
  text-align: center;
  font: 700 11px/1.15 var(--font-stamp);
  text-transform: uppercase;
  transform: rotate(13deg);
  margin: 0;
}

.hero-art-label {
  position: absolute;
  right: 19px;
  bottom: 16px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--forest);
  margin: 0;
}

/* ============================================================== challenges */
.section-head { margin-bottom: 25px; }
.section-head h2 { margin-bottom: 0; }

.challenge-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
  align-items: stretch;
}

/* ---- featured: the one you can actually walk today ---- */
.challenge-card {
  background: var(--forest);
  color: #fff;
  min-height: 290px;
  padding: 30px;
  display: flex;
  align-items: center;
  gap: 23px;
  text-decoration: none;
  transition: background .15s ease;
}
.challenge-card:hover { background: var(--forest-deep); color: var(--surface); }

.challenge-card .card-index {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
}
.challenge-card h3 { color: #fff; margin: 12px 0; }
.challenge-card p {
  color: rgba(255,255,255,.88);
  font-size: 13px;
  line-height: 1.6;
  max-width: 365px;
  margin: 0;
}

.card-cta {
  display: inline-block;
  margin: 12px 0 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--gold-bright);
}
.challenge-card:hover .card-cta { color: #fff; }

.card-patch { width: 180px; height: 180px; flex: none; display: block; border-radius: 50%; }

/* ---- planned: must not look clickable ---- */
.challenge-card--planned {
  background: var(--card-planned);
  color: var(--ink);
  border: 1px solid #b5c3b2;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.challenge-card--planned .eyebrow { color: var(--ink-faint); margin-bottom: 0; }
.challenge-card--planned h3 { color: var(--forest); margin: 12px 0; }
.challenge-card--planned p { color: var(--ink-soft); font-size: 13px; line-height: 1.6; max-width: 365px; margin: 0; }

.pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: var(--card-pill);
  color: var(--ink-soft);
  width: max-content;
  padding: 8px 10px;
  margin: 13px 0 0;
}

/* Legacy card style, still used on /challenges/. */
.walk {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--forest);
  border-radius: var(--radius);
  padding: var(--s-5);
  margin: 0 0 var(--s-4);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s ease;
}
.walk:hover { box-shadow: var(--shadow); }
.walk h3 { margin-bottom: var(--s-2); }
.walk h3 a { color: var(--forest); text-decoration: none; }
.walk h3 a:hover { color: var(--rust); }
.walk p { color: var(--ink-soft); margin-bottom: var(--s-3); }

.walk-status {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: var(--s-1) var(--s-3);
  background: var(--forest);
  color: var(--surface);
  margin: 0;
}
.walk.is-planned { border-left-color: var(--line); background: var(--surface-2); box-shadow: none; }
.walk.is-planned .walk-status { background: var(--line); color: var(--ink-soft); }

/* =============================================================== cemeteries */
.cemetery-block { padding: var(--s-6) 0; border-bottom: 1px solid var(--line-soft); }

.cem-borough {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .7rem;
  font-weight: 700;
  color: var(--ink-faint);
  margin: 0 0 var(--s-1);
}
.cem-name    { margin: 0 0 var(--s-1); }
.cem-address { margin: 0 0 var(--s-5); }

.map-split {
  display: grid;
  grid-template-columns: 1fr 22rem;
  gap: var(--s-4);
  align-items: start;
}

/* --------------------------------------------------------------- map pane */
.map {
  height: 30rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}

.map-note { font-size: .82rem; color: var(--ink-faint); margin: var(--s-2) 0 0; }
.map-fail { padding: var(--s-6); color: var(--ink-faint); text-align: center; }

.pin { display: flex; align-items: center; gap: var(--s-1); cursor: pointer; }

.pin-dot {
  flex: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}

.pin-label {
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: rgba(255,255,255,.93);
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(28,40,32,.07);
}

.pin--grave .pin-dot    { background: var(--forest); }
.pin--cemetery          { cursor: default; }
.pin--cemetery .pin-dot { background: var(--rust); width: 20px; height: 20px; }

.pin.is-done .pin-dot   { background: var(--ink-faint); }
.pin.is-done .pin-label { color: var(--ink-faint); text-decoration: line-through; }

.pin.is-selected .pin-dot {
  box-shadow: 0 0 0 5px rgba(200,96,58,.35), 0 1px 4px rgba(0,0,0,.35);
}
.pin.is-selected .pin-label { background: var(--forest); color: #fff; }

/* -------------------------------------------------------------- list pane */
.list-pane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  max-height: 30rem;
  overflow: hidden;
}

.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.list-head h3 {
  font-family: var(--font-body);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .02em;
  margin: 0;
}

.progress { font-size: .78rem; font-weight: 700; color: var(--rust); margin: 0; }

.grave-panel { overflow-y: auto; flex: 1 1 auto; }

.glist { list-style: none; margin: 0; padding: 0; }

.glist-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line-soft);
  transition: background .12s ease;
}
.glist-row:last-child { border-bottom: 0; }
.glist-row:hover { background: var(--surface-2); }

.glist-num {
  flex: none;
  width: 1.5rem; height: 1.5rem;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-faint);
  font-size: .72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: center;
}
.glist-row:hover .glist-num { background: var(--line-soft); }

.glist-name {
  flex: 1 1 auto;
  min-width: 0;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 600;
  font-size: .93rem;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}
.glist-name:hover { color: var(--rust); }

.glist-flag {
  display: block;
  font-weight: 500;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-faint);
}

.tick {
  flex: none;
  width: 1.85rem; height: 1.85rem;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--line);
  font-size: .8rem;
  cursor: pointer;
  line-height: 1;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.tick:hover { border-color: var(--forest); color: var(--forest); }
.tick.is-on { background: var(--forest); border-color: var(--forest); color: #fff; }

.glist-row.is-done { background: var(--surface-2); }
.glist-row.is-done .glist-name { color: var(--ink-faint); text-decoration: line-through; }

/* ----------------------------------------------------------------- detail */
.gdetail { padding: var(--s-4); }
.gdetail h4 { margin: var(--s-3) 0 var(--s-1); }
.gdetail-cem {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-faint);
  margin: 0 0 var(--s-4);
}

.grave-facts {
  margin: 0 0 var(--s-4);
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: .9rem;
}
.grave-facts li { margin: var(--s-2) 0; }

.tickbtn {
  font: inherit;
  font-size: .88rem;
  font-weight: 700;
  padding: var(--s-2) var(--s-4);
  border-radius: 2px;
  border: 1.5px solid var(--forest);
  background: var(--surface);
  color: var(--forest);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.tickbtn:hover { background: var(--surface-2); }
.tickbtn.is-on { background: var(--forest); color: #fff; }

.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: .88rem;
  color: var(--ink-faint);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.linkish:hover { color: var(--rust); }

.reset-section { padding: var(--s-5) 0 0; border-bottom: 0; }

/* =================================================================== footer */
.site-footer {
  margin-top: var(--s-8);
  background: var(--foot-bg);
  border-top: 1px solid #c6c9bc;
}

.site-footer-inner {
  max-width: none;
  margin: 0;
  padding: var(--s-5) clamp(1rem, 2.5vw, 2.5rem);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  align-items: baseline;
  justify-content: space-between;
}

.site-footer-name { font-weight: 700; margin: 0; font-size: .92rem; }
.site-footer-name a { color: var(--forest); text-decoration: none; }
.site-footer-name a:hover { color: var(--rust); }

.site-footer-meta { font-size: .78rem; color: var(--ink-faint); margin: 0; }
.site-footer-meta a { color: var(--ink-faint); }

/* =========================================================== narrow screens */
@media (max-width: 900px) {
  .challenge-grid { grid-template-columns: 1fr; }
  .challenge-card { flex-direction: column; align-items: flex-start; gap: 18px; min-height: 0; }
  .card-patch { width: 130px; height: 130px; }
}

@media (max-width: 820px) {
  .site-header-inner {
    grid-template-columns: 1fr auto;
    padding-top: var(--s-2);
    padding-bottom: var(--s-2);
  }

  /* Placed explicitly: left to auto-placement the toggle lands on a third
     row below the open menu, because it follows the nav in the DOM. */
  .site-title { grid-row: 1; grid-column: 1; }

  .nav-toggle { display: flex; grid-row: 1; grid-column: 2; }

  .site-nav {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: stretch;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--s-2) 0 var(--s-3);
    border-top: 1px solid var(--line-soft);
    margin-top: var(--s-2);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a {
    padding: var(--s-3) 0;
    font-size: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--line-soft);
  }
  .site-nav a:last-child { border-bottom: 0; }
  .site-nav a[aria-current="page"] { color: var(--rust); border-bottom-color: var(--line-soft); }

  /* Artwork first, words underneath. */
  .hero--field {
    display: flex;
    flex-direction: column-reverse;
    gap: 20px;
    padding: 35px 0 41px;
    min-height: 0;
  }
  .hero-art   { width: 100%; height: 260px; }
  .hero-patch { width: 155px; height: 155px; }
  .hero-route { width: 230px; height: 150px; border-width: 6px; }
  .hero-stamp { width: 50px; height: 50px; font-size: 8px; top: 14px; right: 14px; }
  .hero-art-label { font-size: 9px; }
  h1 { font-size: 53px; }

  .map-split { grid-template-columns: 1fr; }
  .map { height: 20rem; }
  .list-pane { max-height: 26rem; }
}

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