/* ==========================================================================
   WHSCL — Wisconsin High School Climbing League
   Tokens and base components are unchanged from the approved build.
   New sections are grouped at the bottom under clear headings.
   ========================================================================== */

:root {
  --red: #c9202f;
  --red-dark: #9d1522;
  --ink: #111315;
  --charcoal: #24272a;
  --muted: #666b70;
  --line: #dfe2e5;
  --paper: #ffffff;
  --soft: #f4f5f6;
  --max: 1180px;
  --shadow: 0 14px 34px rgba(17, 19, 21, .08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
/* height:auto stops the width/height HTML attributes stretching an image
   when CSS sets only the width. Without it the footer logo renders 210x420. */
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input, select { font: inherit; }
button, .button { min-height: 44px; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.section--dark :focus-visible, .page-hero :focus-visible, .hero :focus-visible { outline-color: #fff; }
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #fff;
  padding: .75rem 1rem;
  z-index: 1000;
}
.skip-link:focus { left: 1rem; top: 1rem; }
.container { width: min(calc(100% - 2rem), var(--max)); margin-inline: auto; }
.section { padding: clamp(3.5rem, 7vw, 7rem) 0; }
.section--soft { background: var(--soft); }
.section--dark { background: var(--ink); color: #fff; }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .8rem;
  color: var(--red);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 26px; height: 3px; background: currentColor; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: .98; letter-spacing: -.035em; }
h1 { font-size: clamp(3.2rem, 11vw, 8.5rem); font-weight: 950; }
h2 { font-size: clamp(2.2rem, 5vw, 4.4rem); font-weight: 900; }
h3 { font-size: clamp(1.25rem, 2.4vw, 1.8rem); font-weight: 850; }
h4 { margin: 0 0 .35rem; font-size: 1.05rem; font-weight: 850; letter-spacing: -.02em; }
.lead { font-size: clamp(1.05rem, 2vw, 1.35rem); max-width: 62ch; color: var(--muted); }
.section--dark .lead { color: #d4d7da; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(17,19,21,.08);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
}
.nav-wrap {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { width: clamp(160px, 24vw, 240px); height: auto; }
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: .65rem .8rem;
  font-weight: 850;
  cursor: pointer;
}
.site-nav {
  position: absolute;
  inset: 76px 0 auto 0;
  display: none;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 1rem;
}
.site-nav.is-open { display: grid; }
.site-nav a { padding: .8rem .6rem; font-weight: 800; text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--red); }

/* ---------- hero ---------- */
.hero {
  min-height: min(760px, calc(100vh - 76px));
  display: grid;
  align-items: end;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(110deg, rgba(17,19,21,.98) 0 46%, rgba(17,19,21,.88) 70%, rgba(17,19,21,.72)),
    radial-gradient(circle at 80% 24%, rgba(201,32,47,.36), transparent 34%);
  color: #fff;
}
.hero::after {
  content: "";
  position: absolute;
  width: min(48vw, 620px);
  aspect-ratio: 1;
  right: -11vw;
  top: 6%;
  border: clamp(12px, 2vw, 24px) solid rgba(255,255,255,.08);
  transform: rotate(45deg);
}
.hero-inner { position: relative; z-index: 1; padding: clamp(4rem, 9vw, 8rem) 0; }
.hero h1 { margin-bottom: 1.4rem; text-transform: uppercase; }
.hero h1 span { display: block; }
.hero h1 .accent { color: var(--red); }
.hero-copy { max-width: 700px; color: #e5e7e9; font-size: clamp(1.05rem, 2vw, 1.35rem); }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.7rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .78rem 1.05rem;
  border: 2px solid transparent;
  background: var(--red);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--red-dark); }
.button--light { background: #fff; color: var(--ink); }
.button--light:hover { background: #eceff1; }
.button--outline { background: transparent; color: inherit; border-color: currentColor; }
.button--outline:hover { background: rgba(127,127,127,.12); }
.button--small { padding: .5rem .8rem; min-height: 38px; font-size: .88rem; }
.button[aria-disabled="true"], .button:disabled { opacity: .55; cursor: not-allowed; }
.button:disabled:hover { background: var(--red); }

.grid-3 { display: grid; gap: 1rem; }
.grid-2 { display: grid; gap: 1.25rem; }
/* Grid children default to a min-content floor, which lets long words and
   nowrap content push the page wider than the viewport. */
.grid-2 > *, .grid-3 > *, .split > *, .cards > *, .cards--two > *, .footer-grid > *, .stat-grid > *, .deflist > * { min-width: 0; }
.feature { border-top: 5px solid var(--red); padding: 1.35rem 0 0; }
.feature p { color: var(--muted); }
.section--dark .feature p { color: #c9cdd1; }
.split { display: grid; gap: 2rem; align-items: start; }
.callout {
  background: var(--ink);
  color: #fff;
  padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: var(--shadow);
}
.callout p { color: #d4d7da; }
.callout strong { color: #fff; }
.page-hero {
  padding: clamp(4rem, 8vw, 7rem) 0 clamp(3rem, 6vw, 5rem);
  background: var(--ink);
  color: #fff;
}
.page-hero h1 { font-size: clamp(3rem, 8vw, 6.5rem); margin-bottom: 1rem; }
.page-hero .lead { color: #d9dcdf; }
.cards { display: grid; gap: 1rem; }
.cards--two { display: grid; gap: 1rem; }
.card { border: 1px solid var(--line); background: #fff; padding: 1.25rem; }
.card--accent { border-top: 5px solid var(--red); }
.card--flat { border: 0; background: transparent; padding: 0; }
.card h3 { margin-bottom: .5rem; }
.card p:last-child { margin-bottom: 0; }
.card-meta { display: flex; flex-wrap: wrap; gap: .45rem .8rem; color: var(--muted); font-size: .92rem; margin-bottom: .6rem; }
.tag {
  display: inline-flex;
  padding: .25rem .5rem;
  background: #eceeef;
  font-size: .78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.tag--red { background: #f7dfe2; color: #8f1420; }
.tag--ink { background: var(--ink); color: #fff; }
.filter-bar {
  display: grid;
  gap: .8rem;
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: var(--soft);
  border: 1px solid var(--line);
}
.field { display: grid; gap: .35rem; }
.field label { font-size: .8rem; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.field input, .field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #bfc4c8;
  background: #fff;
  padding: .7rem .8rem;
  color: var(--ink);
}
.results-count { color: var(--muted); margin-bottom: 1rem; }
.timeline { display: grid; gap: 0; border-left: 3px solid var(--ink); margin-left: .7rem; }
.timeline-item { position: relative; padding: 0 0 2rem 1.5rem; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -8px;
  top: .15rem;
  width: 13px;
  height: 13px;
  background: var(--red);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--red);
}
.timeline-year { color: var(--red); font-weight: 950; font-size: 1.05rem; }
.timeline-item p { color: var(--muted); margin-bottom: 0; }
.resource-group + .resource-group { margin-top: 2.5rem; }
.resource-list { display: grid; gap: .75rem; }
.resource-row {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  justify-content: space-between;
  border: 1px solid var(--line);
  padding: 1rem;
}
.resource-status { color: var(--muted); font-size: .9rem; }
.status--complete { background: #e0f0e6; color: #1c5b32; }
.status--pending  { background: #fdf0c9; color: #6d5306; }
.status--attention{ background: #f7dfe2; color: #8f1420; }
.status--expiring { background: #ffe6d2; color: #8a4212; }
.status--expired  { background: #f7dfe2; color: #8f1420; }
.status--missing  { background: #e7e9ea; color: #3b3f43; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: .85rem; border-bottom: 1px solid var(--line); }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.site-footer { background: var(--ink); color: #fff; padding: 2.5rem 0; }
.footer-grid { display: grid; gap: 1.5rem; }
.footer-logo { width: 210px; }
.site-footer p { color: #cfd2d5; max-width: 58ch; }
.site-footer a { color: #fff; }
.footer-links { display: grid; gap: .4rem; padding: 0; margin: 0; list-style: none; }
.footer-links li, .footer-links a { overflow-wrap: anywhere; }
.footer-links a { font-weight: 800; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-heading { font-size: .78rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: var(--red); margin-bottom: .7rem; }
.footer-note { border-top: 1px solid rgba(255,255,255,.15); margin-top: 1.75rem; padding-top: 1.25rem; font-size: .88rem; }

/* ==========================================================================
   Added components
   ========================================================================== */

/* --- statistics band (home) --- */
.stat-band { background: var(--ink); color: #fff; border-top: 5px solid var(--red); }
.stat-grid { display: grid; gap: 1.75rem; padding: clamp(2.25rem, 5vw, 3.25rem) 0; }
.stat strong { display: block; font-size: clamp(2.75rem, 7vw, 4rem); font-weight: 950; line-height: .9; letter-spacing: -.04em; }
.stat span { display: block; margin-top: .5rem; font-size: .82rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; color: #a8adb2; }

/* --- generic definition rows (fees, key dates, schedules) --- */
.deflist { display: grid; gap: 0; margin: 0; }
.defrow {
  display: grid;
  gap: .2rem .9rem;
  padding: .95rem 0;
  border-bottom: 1px solid var(--line);
}
.section--dark .defrow { border-bottom-color: rgba(255,255,255,.16); }
.defrow:first-child { border-top: 1px solid var(--line); }
.section--dark .defrow:first-child { border-top-color: rgba(255,255,255,.16); }
.defrow dt { font-weight: 850; }
.defrow dd { margin: 0; color: var(--muted); }
.section--dark .defrow dd { color: #c3c7cb; }
.defrow .defrow-amount { font-weight: 950; color: var(--red); }

/* --- competition cards --- */
.event-card { display: flex; flex-direction: column; gap: .1rem; }
.event-card .event-date { font-size: 1.05rem; font-weight: 950; letter-spacing: -.02em; }
.event-card dl { margin: .85rem 0 1rem; display: grid; gap: .45rem; }
.event-card dl > div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .5rem; font-size: .95rem; }
.event-card dt { font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: .18rem; }
.event-card dd { margin: 0; }
.event-card .event-note { color: var(--muted); font-size: .92rem; }
.event-card .actions { margin-top: auto; padding-top: .4rem; }
.event-card--state { border-top-width: 5px; background: var(--ink); color: #fff; border-color: var(--ink); }
.event-card--state dt, .event-card--state .event-note { color: #b6bbbf; }
.event-card--state .tag { background: rgba(255,255,255,.14); color: #fff; }
.event-card--state .tag--red { background: var(--red); color: #fff; }
.event-card--state .card-meta { color: #b6bbbf; }

/* --- archive rows --- */
.archive-row {
  display: grid;
  gap: .6rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.archive-row:first-child { border-top: 1px solid var(--line); }
.archive-row h3 { font-size: 1.15rem; margin: 0; }
.archive-row .archive-meta { color: var(--muted); font-size: .92rem; }
.archive-row .actions { margin-top: 0; }

/* --- team directory --- */
.team-card { display: flex; flex-direction: column; text-align: left; gap: .55rem; }
.team-card h3 { margin-bottom: 0; }
.team-card dl { margin: 0; display: grid; gap: .4rem; font-size: .95rem; }
.team-card dl > div { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: .5rem; }
.team-card dt { font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: .2rem; }
.team-card dd { margin: 0; }
.team-card .actions { margin-top: auto; padding-top: .5rem; }
.coach-strip { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--soft);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.avatar--lg { width: 64px; height: 64px; }
.avatar--initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 900;
  color: var(--muted);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}

/* --- team detail dialog --- */
dialog.sheet {
  width: min(640px, calc(100% - 2rem));
  max-height: 88vh;
  padding: 0;
  border: 0;
  background: #fff;
  box-shadow: 0 30px 70px rgba(17,19,21,.35);
}
dialog.sheet::backdrop { background: rgba(17,19,21,.66); }
.sheet-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--ink);
  color: #fff;
}
.sheet-head h2 { font-size: clamp(1.6rem, 5vw, 2.2rem); margin: 0; }
.sheet-close {
  border: 2px solid rgba(255,255,255,.5);
  background: transparent;
  color: #fff;
  min-width: 44px;
  padding: .35rem .7rem;
  font-weight: 900;
  cursor: pointer;
}
.sheet-close:hover { background: rgba(255,255,255,.14); }
.sheet-body { padding: 1.25rem; overflow-y: auto; }
.sheet-body h3 { font-size: 1.05rem; margin: 1.5rem 0 .6rem; }
.sheet-body h3:first-child { margin-top: 0; }
.coach-row {
  display: flex;
  gap: .85rem;
  align-items: center;
  padding: .75rem 0;
  border-bottom: 1px solid var(--line);
}
.coach-row:last-child { border-bottom: 0; }
.coach-row .coach-name { font-weight: 850; }
.coach-row .coach-role { font-size: .8rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.coach-row a { font-size: .92rem; word-break: break-word; }

/* --- resource library --- */
.resource-card {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--red);
  padding: 1.1rem;
  background: #fff;
}
.resource-card h3 { font-size: 1.15rem; margin: 0; }
.resource-card p { color: var(--muted); font-size: .95rem; margin: 0; }
.resource-card .resource-meta { font-size: .78rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.resource-card .actions { margin-top: auto; padding-top: .5rem; }

/* --- numbered startup steps (a genuine sequence) --- */
.steps { display: grid; gap: 1rem; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li {
  position: relative;
  padding: 1.1rem 1.1rem 1.1rem 3.75rem;
  border: 1px solid var(--line);
  background: #fff;
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 1.1rem;
  top: 1.05rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  font-weight: 950;
}
.steps p { margin: 0; color: var(--muted); font-size: .95rem; }

/* --- leadership --- */
.person { display: flex; gap: 1rem; align-items: center; }
.person .person-role { font-size: .75rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.person .person-name { font-weight: 900; font-size: 1.1rem; letter-spacing: -.02em; }
.person .person-org { color: var(--muted); font-size: .92rem; }
.person a { font-size: .92rem; word-break: break-word; }

/* ==========================================================================
   Interface components
   ========================================================================== */
.req-list { display: grid; gap: .75rem; }
.progress--light { background: rgba(255,255,255,.22); }
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.chip {
  border: 1px solid #bfc4c8;
  background: #fff;
  padding: .45rem .8rem;
  font-size: .85rem;
  font-weight: 850;
  cursor: pointer;
  min-height: 40px;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (min-width: 560px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .defrow { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; }
  .defrow dd { grid-column: 1 / -1; }
  .archive-row { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (min-width: 720px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
  .resource-row { flex-direction: row; align-items: center; }
  .footer-grid { grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, .8fr)); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 980px) {
  .nav-toggle { display: none; }
  .site-nav {
    position: static;
    display: flex;
    align-items: center;
    gap: .2rem;
    border: 0;
    padding: 0;
  }
  .site-nav a { padding: .65rem .7rem; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-bar { grid-template-columns: 1.8fr 1fr 1fr 1.4fr; }
}
@media (max-width: 640px) {
  h1 { hyphens: none; overflow-wrap: normal; }
  .hero h1 { font-size: clamp(3.25rem, 17vw, 5.3rem); }
  .table-wrap { overflow: visible; }
  table, thead, tbody, th, td, tr { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tr { background: #fff; border: 1px solid var(--line); margin-bottom: .8rem; padding: .7rem; }
  td { border: 0; padding: .3rem 0; display: flex; gap: .6rem; justify-content: space-between; align-items: baseline; }
  td::before {
    content: attr(data-label);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    flex: 0 0 auto;
  }
  td[data-label="Coach"] { display: block; }
  td[data-label="Coach"]::before { display: block; margin-bottom: .1rem; }
  td:last-child { display: block; margin-top: .5rem; }
  td:last-child::before { display: none; }
  td:last-child .button { width: 100%; }
  .event-card dl > div, .team-card dl > div { grid-template-columns: 1fr; gap: .05rem; }
  dialog.sheet { width: 100%; max-width: 100%; max-height: 100dvh; height: 100dvh; margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* --- registration options --- */
.option-group { display: grid; gap: .8rem; margin-top: 1.25rem; }
.option-group .button { width: 100%; text-align: center; }
@media (min-width: 720px) {
  .option-group { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
}
.fee-headline { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: baseline; }
.fee-headline .fee-amount { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 950; color: var(--red); letter-spacing: -.03em; }
