/* Cambridge Students for Life: shared styles for every page. */
/* Layout: one calm column; the heartbeat line from the logo runs across the hero
   and resurfaces as section dividers. Striped circles echo the term cards. */
:root {
  --teal: #19B9C4;        /* logo teal, for fills and lines */
  --teal-ink: #0A6F78;    /* readable teal for text and buttons */
  --gold: #E2B93B;        /* mustard from the term cards */
  --gold-ink: #8A6A0B;    /* readable gold for small text */
  --ink: #12302F;         /* body text, teal-biased near black */
  --muted: #4E6B6B;
  --bg: #FFFFFF;
  --wash: #EAF8F9;        /* pale teal panels and stripes */
  --line: #CDE9EB;
  --on-teal: #FFFFFF;
  --band: #0A6F78;        /* values band */
  --on-band: #FFFFFF;
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --teal: #2CCAD4; --teal-ink: #6FDDE4; --gold: #E8C24E; --gold-ink: #E8C24E;
    --ink: #E3F1F1; --muted: #9DB8B8; --bg: #0C1F21; --wash: #12302F; --line: #1F4547;
    --on-teal: #062022; --band: #0F4C52; --on-band: #E3F1F1; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --teal: #2CCAD4; --teal-ink: #6FDDE4; --gold: #E8C24E; --gold-ink: #E8C24E;
  --ink: #E3F1F1; --muted: #9DB8B8; --bg: #0C1F21; --wash: #12302F; --line: #1F4547;
  --on-teal: #062022; --band: #0F4C52; --on-band: #E3F1F1; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.65 var(--body); }
a { color: var(--teal-ink); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
img, svg { max-width: 100%; }
.wrap { width: 100%; max-width: 70rem; margin-inline: auto; padding-inline: 1.25rem; }
h1, h2, h3 { font-family: var(--display); text-transform: uppercase; letter-spacing: .02em; line-height: 1.02; text-wrap: balance; margin: 0; }
h2 { font-size: clamp(2rem, 4.5vw, 2.75rem); font-weight: 600; color: var(--teal-ink); }
h3 { font-size: 1.5rem; font-weight: 600; }
p { margin: 0; }
.eyebrow { font: 600 .8rem/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: .5rem 1rem; z-index: 10; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; padding-block: .75rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--teal-ink); margin-right: auto; }
.brand svg { width: 44px; height: 44px; flex: none; }
.brand span { font: 600 1.15rem/1 var(--display); text-transform: uppercase; letter-spacing: .04em; }
.brand b { display: block; font-weight: 300; font-size: 1.6rem; letter-spacing: .3em; }
nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0; padding: 0; }
nav a { font: 500 1.05rem/1 var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--ink); text-decoration: none; padding-block: .4rem; border-bottom: 2px solid transparent; }
nav a:hover, nav a[aria-current="page"] { border-color: var(--gold); }
nav a.support-link { color: var(--teal-ink); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: 4rem 3.5rem; }
.stripes { position: absolute; border-radius: 50%; pointer-events: none;
  background: repeating-linear-gradient(135deg, var(--wash) 0 12px, transparent 12px 24px); }
.stripes.a { width: 34rem; height: 34rem; left: -12rem; top: -10rem; }
.stripes.b { width: 22rem; height: 22rem; right: -6rem; bottom: -9rem; }
.hero .wrap { position: relative; display: grid; gap: 1.5rem; }
.hero h1 { font-size: clamp(3rem, 9vw, 6.25rem); font-weight: 600; color: var(--teal-ink); max-width: 12ch; }
.hero h1 .life { display: block; font-weight: 300; letter-spacing: .32em; color: var(--ink); }
.heartbeat { display: flex; align-items: center; width: 100%; height: 70px; margin-block: -.5rem .25rem; }
.heartbeat .line { flex: 1; height: 70px; min-width: 0; overflow: visible; }
.heartbeat .bubble-mark { flex: none; width: 60px; height: 55px; margin-left: 2px; overflow: visible; }
.heartbeat path { fill: none; stroke: var(--teal); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.heartbeat .bubble { stroke-width: 2.5; }
.heartbeat .heart { fill: var(--teal); stroke: none; }
@media (prefers-reduced-motion: no-preference) {
  .heartbeat .trace { stroke-dasharray: 1400; stroke-dashoffset: 0; animation: trace 1.6s ease-out both; }
  @keyframes trace { from { stroke-dashoffset: 1400; } }
  .heartbeat .bubble-mark { animation: pop .5s 1.3s ease-out both; }
  @keyframes pop { from { opacity: 0; transform: scale(.6); } }
}
.hero-help { font-size: .98rem; color: var(--muted); }
.lede { font-size: clamp(1.15rem, 2.2vw, 1.35rem); max-width: 38rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn { display: inline-flex; align-items: center; gap: .5rem; font: 600 1.15rem/1 var(--display); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; padding: .85rem 1.4rem; border-radius: 999px; border: 2px solid var(--teal-ink); }
.btn.primary { background: var(--teal-ink); color: var(--on-teal); }
.btn.ghost { color: var(--teal-ink); background: var(--bg); }
.btn:hover { filter: brightness(1.08); }

/* ---------- Section rhythm ---------- */
section.band { padding-block: 4rem; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .75rem 2rem; margin-bottom: 2rem; }
.section-head .eyebrow { display: block; margin-bottom: .6rem; }
.more { font: 600 1.05rem/1 var(--display); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Events ---------- */
.events { background: var(--wash); }
.event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.event { background: var(--bg); border-radius: 14px; padding: 1.25rem 1.4rem; display: grid; grid-template-columns: auto 1fr; gap: .25rem 1.1rem; align-items: start; }
.event .date { grid-row: span 3; text-align: center; color: var(--gold); font-family: var(--display); line-height: .9; min-width: 3.5rem; }
.event .date small { display: block; font: 500 .85rem/1.4 var(--body); color: var(--teal-ink); letter-spacing: .04em; }
.event .date strong { font-size: 3.4rem; font-weight: 700; font-style: italic; }
.event .kind { font: 600 1.25rem/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; color: var(--teal-ink); }
.event .meta { font-size: .95rem; color: var(--muted); }
.calendar-frame { display: block; width: 100%; height: 30rem; border: 0; border-radius: 14px; background: var(--bg); }
.note { margin-top: 1rem; font-size: .9rem; color: var(--muted); }

/* ---------- What we do ---------- */
.offer { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.offer article { display: grid; gap: .6rem; align-content: start; border-top: 3px solid var(--gold); padding-top: 1.1rem; }
.offer h3 { color: var(--teal-ink); }
.offer p { color: var(--muted); }

/* ---------- Values ---------- */
.values { background: var(--band); color: var(--on-band); }
.values .wrap { display: grid; gap: 1.5rem; max-width: 56rem; }
.values .eyebrow { color: var(--gold); }
.values blockquote { margin: 0; font: 500 clamp(1.8rem, 4.2vw, 2.8rem)/1.12 var(--display); text-transform: uppercase; letter-spacing: .01em; text-wrap: balance; }
.values blockquote mark { background: none; color: var(--gold); }
.values p { max-width: 42rem; opacity: .92; }
.values a { color: var(--on-band); font-weight: 600; }

/* ---------- Support ---------- */
.support-box { display: grid; gap: 1.5rem 3rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); align-items: center; border: 2px solid var(--teal); border-radius: 20px; padding: clamp(1.5rem, 4vw, 2.75rem); }
.support-box h2 { margin-bottom: .75rem; }
.support-box ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .6rem; }
.support-box li { display: flex; gap: .7rem; align-items: baseline; }
.support-box li::before { content: ""; flex: none; width: .55rem; height: .55rem; border-radius: 50%; background: var(--gold); transform: translateY(-.1rem); }

/* ---------- Get involved ---------- */
.involve { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.involve > div { background: var(--wash); border-radius: 14px; padding: 1.4rem; display: grid; gap: .6rem; align-content: start; }
.involve h3 { color: var(--teal-ink); font-size: 1.35rem; }
.involve .addr { font-weight: 600; overflow-wrap: anywhere; }
.placeholder { display: inline-block; font: 600 .75rem/1.3 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--gold-ink); border: 1px dashed var(--gold); border-radius: 6px; padding: .2rem .45rem; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding-block: 2.5rem; font-size: .95rem; color: var(--muted); }
footer .wrap { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
footer .wrap > div { display: grid; gap: .4rem; align-content: start; }
footer strong { font: 600 1.1rem/1.2 var(--display); text-transform: uppercase; letter-spacing: .05em; color: var(--ink); display: block; margin-bottom: .4rem; }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.footer-support { background: var(--wash); border-radius: 12px; padding: 1rem 1.2rem; }

@media (max-width: 640px) {
  .site-header { position: static; }
  nav ul { gap: .25rem 1rem; }
  .hero { padding-block: 2.5rem; }
  section.band { padding-block: 3rem; }
}

/* ---------- Inner pages ---------- */
.page-hero { position: relative; overflow: hidden; padding-block: 3rem 2.5rem; border-bottom: 1px solid var(--line); }
.page-hero .wrap { position: relative; display: grid; gap: 1rem; }
.page-hero h1 { font-size: clamp(2.6rem, 7vw, 4.5rem); font-weight: 600; color: var(--teal-ink); }
.page-hero .stripes.a { width: 24rem; height: 24rem; left: auto; right: -8rem; top: -10rem; }
.prose { display: grid; gap: 1rem; max-width: 42rem; }
.prose h2 { margin-top: 1rem; }
.prose strong { color: var(--teal-ink); }
.two-col { display: grid; gap: 2rem 4rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); align-items: start; }

/* Committee */
.committee { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.committee li { background: var(--wash); border-radius: 14px; padding: 1.25rem; display: grid; gap: .35rem; align-content: start; }
.committee .role { font: 600 .8rem/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); }
.committee .name { font: 600 1.5rem/1.1 var(--display); text-transform: uppercase; color: var(--teal-ink); }
.committee .detail { font-size: .95rem; color: var(--muted); }

/* Events archive */
.archive { display: grid; gap: 2.5rem; }
.year { display: grid; gap: .75rem; grid-template-columns: 9rem 1fr; }
.year h3 { color: var(--gold-ink); font-size: 1.6rem; font-weight: 600; }
.year ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; min-width: 0; }
.year li { display: grid; grid-template-columns: 7.5rem 1fr; gap: .25rem 1rem; padding-block: .9rem; border-top: 1px solid var(--line); }
.year li:first-child { border-top: 0; padding-top: .2rem; }
.year .when { font: 500 .9rem/1.5 var(--body); color: var(--muted); font-variant-numeric: tabular-nums; }
.year .talk { font: 600 1.25rem/1.15 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.year .who { color: var(--muted); }
.year li > div { display: grid; gap: .2rem; min-width: 0; }
@media (max-width: 640px) {
  .year, .year li { grid-template-columns: 1fr; }
}

/* Support */
.help-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.help { border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem 1.4rem; display: grid; gap: .5rem; align-content: start; }
.help h3 { font-size: 1.35rem; color: var(--teal-ink); }
.help .phone { font: 600 1.6rem/1 var(--display); letter-spacing: .04em; color: var(--ink); font-variant-numeric: tabular-nums; }
.help p { color: var(--muted); }
.help.urgent { border: 2px solid var(--teal); }
.calm { background: var(--wash); border-radius: 14px; padding: 1.25rem 1.4rem; max-width: 42rem; }
.group { display: grid; gap: 1.25rem; }
.group + .group { margin-top: 3rem; }

/* Talk write-ups */
.page-hero h1.talk-title { font-size: clamp(2.2rem, 5.5vw, 3.6rem); max-width: 22ch; }
.article p, .article li { font-size: 1.08rem; }
.article ul, .article ol { margin: 0; padding-left: 1.3rem; display: grid; gap: .4rem; }
.article h3 { color: var(--gold-ink); }
.article .aside { background: var(--wash); border-radius: 12px; padding: 1rem 1.2rem; font-size: .98rem; color: var(--muted); }
.article .back { margin-top: 1.5rem; }
.year .talk a { color: inherit; text-decoration-color: var(--gold); text-decoration-thickness: 2px; }
.year .talk a:hover { color: var(--teal-ink); }

/* Event cards filled from the calendar (events.js) */
.event .title { font-weight: 500; }
.event .meta + .meta { margin-top: .15rem; }
.empty { background: var(--bg); border-radius: 14px; padding: 1.25rem 1.4rem; color: var(--muted); max-width: 42rem; }
.event .body { display: grid; gap: .25rem; align-content: start; min-width: 0; }
