/* Harvard Fencing Club — crimson, paper, ink. Simple, readable, crimson-forward. */
:root {
  --crimson: #a51c30;
  --crimson-bright: #c41e3a;
  --crimson-deep: #7a1222;
  --crimson-night: #22050c;
  --paper: #f7f4f0;
  --card: #ffffff;
  --ink: #1a1314;
  --muted: #6c5f60;
  --line: rgba(26, 19, 20, 0.12);
  --accent: #a51c30;
  --on-crimson: #fff4ef;
  --on-crimson-muted: rgba(255, 240, 235, 0.72);
  /* Fonts: change these (and the Google Fonts link in _layouts/default.html). */
  --title: "Graduate", Georgia, serif;
  --display: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --display-stretch: 100%;
  --display-case: none;
  --display-track: -0.01em;
  --body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, Consolas, monospace;
  --label: "Barlow Semi Condensed", "Helvetica Neue", Arial, sans-serif;
  --label-weight: 700;
  --label-size: 16px;
  --header: 72px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --radius: 4px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* Dark mode: same crimson identity on a warm near-black. Light is the default; the logo switches. */
:root[data-theme="dark"] {
  --paper: #141011;
  --card: #1d1617;
  --ink: #f2e9e6;
  --muted: #ab9b9c;
  --line: rgba(255, 236, 230, 0.13);
  --accent: #ef6b7d;
  --home-bg: linear-gradient(160deg, #6a1122 0%, #4a0c18 42%, #22050c 100%);
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
}
body {
  transition:
    background-color 0.25s,
    color 0.25s;
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
p,
figure {
  margin: 0;
}
body > main {
  flex: 1 0 auto;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  display: block;
  max-width: 100%;
}
button {
  font: inherit;
  cursor: pointer;
  color: inherit;
}
a,
button,
summary {
  -webkit-tap-highlight-color: transparent;
}
::selection {
  background: var(--crimson);
  color: #fff;
}
:focus-visible {
  outline: 3px solid #f2b13d;
  outline-offset: 3px;
  border-radius: 4px;
}
[hidden] {
  display: none !important;
}
.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;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius);
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
}
.wrap {
  width: min(var(--max), 100% - 2 * var(--gutter));
  margin-inline: auto;
}
.label {
  font-family: var(--label);
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  letter-spacing: 0;
  line-height: 1.2;
}

/* ---------- Page transitions: a short cross-fade between pages (Chrome, Edge, Safari). ---------- */
@view-transition {
  navigation: auto;
}
.site-header {
  view-transition-name: site-header;
}
/* Fade out to the page background, then fade the next page in (not a cross-fade). */
::view-transition {
  background: var(--paper);
}
:root[data-theme="dark"]::view-transition {
  background: #141011;
}
::view-transition-old(root) {
  animation: page-out 0.16s ease-in forwards;
}
::view-transition-new(root) {
  animation: page-in 0.2s ease-out 0.16s both;
}
@keyframes page-out {
  to {
    opacity: 0;
  }
}
@keyframes page-in {
  from {
    opacity: 0;
  }
}
/* The header swaps instantly (no fade) so it never flickers between pages. */
::view-transition-group(site-header) {
  animation: none;
}
::view-transition-old(site-header) {
  display: none;
}
::view-transition-new(site-header) {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--crimson);
  color: var(--on-crimson);
}
.page-home .site-header {
  position: relative;
  background: transparent;
}
.header-inner {
  height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--title);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(17px, 2.3vw, 32px);
  letter-spacing: 0.01em;
}
.brand-name {
  display: block;
}
.brand-name > span {
  display: block;
  line-height: 1;
}
.theme-toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(36px, 3.6vw, 48px);
  height: clamp(36px, 3.6vw, 48px);
  margin: -4px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.2s;
}
/* Hover glow follows the shield's own outline instead of a box. */
.theme-toggle:hover {
  background: transparent;
}
.theme-toggle img {
  transition: filter 0.2s;
}
.theme-toggle:hover img,
.theme-toggle:focus-visible img {
  filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 6px rgba(255, 255, 255, 0.55));
}
.theme-toggle:focus-visible {
  outline: none;
}
.theme-toggle img {
  width: auto;
  height: clamp(34px, 3.4vw, 44px);
}
.brand span {
  line-height: 1;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
}
.main-nav a {
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: background 0.2s;
}
.main-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}
.main-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.16);
}
.menu-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
  position: relative;
}
.menu-toggle span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition:
    transform 0.25s var(--ease),
    top 0.25s var(--ease);
}
.menu-toggle span:first-child {
  top: 18px;
}
.menu-toggle span:last-child {
  top: 26px;
}
.menu-toggle[aria-expanded="true"] span:first-child {
  top: 22px;
  transform: rotate(45deg);
}
.menu-toggle[aria-expanded="true"] span:last-child {
  top: 22px;
  transform: rotate(-45deg);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 18px;
  border-radius: var(--radius);
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  border: 1.5px solid transparent;
  transition:
    transform 0.2s var(--ease),
    background 0.2s,
    color 0.2s;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.btn-light {
  background: var(--on-crimson);
  color: var(--accent);
}
.btn-ghost {
  border-color: rgba(255, 240, 235, 0.5);
  color: var(--on-crimson);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}
.btn-crimson {
  background: var(--crimson);
  color: #fff;
}
.btn-crimson:hover {
  background: var(--crimson-deep);
}
.btn-outline {
  border-color: var(--line);
  color: var(--ink);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Home ---------- */
.page-home {
  background: var(
    --home-bg,
    linear-gradient(160deg, var(--crimson-bright) 0%, var(--crimson) 40%, var(--crimson-deep) 100%)
  );
  color: var(--on-crimson);
}
.home {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(340px, 1fr) 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: stretch;
  padding-block: clamp(8px, 2vh, 24px) clamp(24px, 4vh, 44px);
}
.home-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.home-join {
  font-family: var(--display);
  font-size: clamp(22px, 2.2vw, 30px); /* same size as the weekday names */
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: clamp(24px, 4.5vh, 44px);
}
.home-join:has(+ .home-note) {
  margin-bottom: 10px;
}
.home-note {
  max-width: 560px;
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.45;
  color: var(--on-crimson-muted);
  margin-bottom: clamp(20px, 3.6vh, 36px);
}
.home-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  margin-right: -16px;
}
.home-kicker {
  color: var(--on-crimson);
}
.next-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
  font-size: 13px;
  font-weight: 500;
}
.next-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7dffa6;
  box-shadow: 0 0 0 0 rgba(125, 255, 166, 0.7);
  animation: pulse 2s infinite;
}
.next-badge.is-later .dot {
  background: var(--on-crimson);
  animation: none;
}
@keyframes pulse {
  70% {
    box-shadow: 0 0 0 8px rgba(125, 255, 166, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(125, 255, 166, 0);
  }
}
.practice-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}
.practice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(14px, 2.2vh, 20px) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}
.practice-item.is-next {
  background: var(--on-crimson);
  color: var(--crimson-deep);
  padding-inline: 16px;
  margin-inline: -16px;
  border-radius: var(--radius);
  border-bottom-color: transparent;
  margin-top: -1px;
}
.practice-day {
  font-family: var(--display);
  font-stretch: var(--display-stretch);
  text-transform: var(--display-case);
  letter-spacing: var(--display-track);
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 700;
  line-height: 1.1;
}
.practice-day small {
  display: block;
  font-family: var(--body);
  font-stretch: 100%;
  text-transform: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  opacity: 0.75;
  margin-top: 4px;
}
.practice-time {
  font-size: clamp(16px, 1.5vw, 20px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}
.practice-where {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: clamp(20px, 3.5vh, 32px);
  color: var(--on-crimson);
  font-family: var(--display);
  font-size: clamp(21px, 2.1vw, 28px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.practice-where:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
.practice-where svg {
  width: clamp(24px, 2.2vw, 30px);
  height: clamp(24px, 2.2vw, 30px);
  flex: none;
}
.home-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: clamp(20px, 3.5vh, 32px);
}
.home-actions .btn {
  padding: 0 8px;
  font-size: clamp(13px, 1.05vw, 14px);
  gap: 7px;
  white-space: nowrap;
}
.btn-whatsapp {
  background: #25d366;
  color: #073b1e;
}
.btn-whatsapp:hover {
  background: #3ae07a;
}
.btn-email {
  background: #fff;
  color: var(--crimson);
}
.btn-instagram {
  border: 0;
  background: linear-gradient(45deg, #f58529 0%, #dd2a7b 40%, #8134af 75%, #515bd4 100%);
  color: #fff;
}
.btn-instagram:hover {
  filter: brightness(1.08);
}
.btn-short {
  display: none;
}

/* Slideshow */
.home-media {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  margin-block: clamp(0px, 1.2vh, 12px);
}
.home-media .gallery {
  flex: 1;
}
.slide-dots {
  display: none;
}
.home-photo-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 13px;
  color: var(--on-crimson-muted);
}
.home-photo-meta a {
  color: var(--on-crimson);
  font-weight: 600;
}
.home-photo-meta a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.gallery {
  position: relative;
  min-height: 340px;
  margin-block: 0;
  overflow: hidden;
  border-radius: 6px;
  background: var(--crimson-night);
  outline-offset: 4px;
}
.gallery-stage,
.gallery-slide {
  position: absolute;
  inset: 0;
}
.gallery-slide {
  opacity: 0;
  transition: opacity 1.1s ease;
}
.gallery-slide.is-active {
  opacity: 1;
}
.gallery-slide img {
  filter: contrast(1.07) saturate(1.12) brightness(1.03);
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Scrubber slider along the bottom of the photo. */
.gallery-scrub {
  position: absolute;
  z-index: 2;
  left: 20px;
  right: 20px;
  bottom: 10px;
  width: calc(100% - 40px);
  height: 18px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  --pct: 0%;
}
.gallery-scrub::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, #fff var(--pct), rgba(255, 255, 255, 0.35) var(--pct));
}
.gallery-scrub::-moz-range-track {
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, #fff var(--pct), rgba(255, 255, 255, 0.35) var(--pct));
}
.gallery-scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s;
}
.gallery-scrub::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.gallery-scrub:hover::-webkit-slider-thumb,
.gallery-scrub:active::-webkit-slider-thumb {
  transform: scale(1.25);
}
.gallery-scrub:focus-visible {
  outline: none;
}
.gallery-scrub:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px #f2b13d;
}
.gallery::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 58%, rgba(30, 4, 10, 0.38) 100%);
}
.gallery::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  background: linear-gradient(transparent, rgba(20, 3, 8, 0.6));
  pointer-events: none;
}
.gallery-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 800;
  color: var(--on-crimson);
}
.gallery-controls {
  position: absolute;
  z-index: 2;
  left: 20px;
  right: 20px;
  bottom: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.gallery-count {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.gallery-buttons {
  display: flex;
  gap: 6px;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius);
  background: rgba(20, 3, 8, 0.45);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  display: grid;
  place-items: center;
  transition: background 0.2s;
}
.icon-btn:hover {
  background: rgba(20, 3, 8, 0.7);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* ---------- Inner pages ---------- */
.page-body {
  flex: 1;
  padding-block: clamp(18px, 3.5vh, 34px) clamp(6px, 1.5vh, 14px);
}
.site-footer {
  padding: 6px 0 10px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  opacity: 0.75;
}
.site-footer a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.page-home .site-footer {
  color: var(--on-crimson-muted);
  padding-top: 0;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent);
  margin-bottom: 16px;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.section-title + .grid,
.section-title + .faq-list {
  border-top: 0;
}
.grid {
  display: grid;
  border-top: 1px solid var(--line);
}
.card {
  position: relative;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  transition: color 0.2s;
}
a.card:hover {
  color: var(--accent);
}

/* Events */
.events-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(24px, 4vw, 48px);
  align-items: stretch;
}
.events-layout:has(.photo-stack[hidden]) {
  grid-template-columns: 1fr;
}
/* The photo column matches the height of the event list beside it. */
.photo-stack {
  display: grid;
  gap: 12px;
  grid-auto-rows: 1fr;
}
.photo-stack .photo-frame {
  position: relative;
  aspect-ratio: auto;
  min-height: 150px;
}
.photo-stack .photo-frame img {
  position: absolute;
  inset: 0;
}
.photo-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: clamp(10px, calc(3.5vh - 10px), 24px);
}
.photo-row .photo-frame {
  aspect-ratio: 16/10.6;
}
.photo-frame {
  margin: 0;
  aspect-ratio: 4/3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--line);
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-frame.is-empty {
  display: grid;
  place-items: center;
  background: transparent;
  border: 1.5px dashed rgba(165, 28, 48, 0.35);
  color: var(--muted);
  font-size: 14px;
}
.event-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 28px;
  align-items: start;
  padding-block: 26px;
}
.event-date {
  color: var(--accent);
  display: grid;
  line-height: 1;
}
.event-date .m {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.event-date .d {
  font-family: var(--display);
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 6px;
}
.event-date.is-open .d {
  font-size: 30px;
}
.event-date.is-past {
  color: #b9aeac;
}
.events-past-title {
  margin-top: clamp(28px, 5vh, 44px);
}
.events-past .event-card {
  opacity: 0.6;
}
.event-tag {
  color: var(--accent);
}
.event-card h2 {
  font-family: var(--display);
  font-stretch: var(--display-stretch);
  text-transform: var(--display-case);
  letter-spacing: var(--display-track);
  font-size: clamp(21px, 2.2vw, 26px);
  font-weight: 700;
  line-height: 1.15;
  margin-top: 6px;
}
.event-sub {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}
.event-desc {
  margin-top: 10px;
  max-width: 640px;
}
.event-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-weight: 600;
  color: var(--accent);
}
.event-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Team */
.team-layout {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}
.leaders-grid {
  grid-template-columns: repeat(2, 1fr);
  column-gap: 32px;
}
.leader-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 0;
}
.leader-portrait {
  position: relative;
  width: 68px;
  height: 68px;
  flex: none;
  border-radius: 50%;
  background: var(--crimson);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  overflow: hidden;
}
.leader-portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.leader-portrait.has-photo {
  background: none;
}
.leader-portrait.has-photo span {
  display: none;
}
.leader-card h3 {
  font-family: var(--display);
  font-stretch: var(--display-stretch);
  text-transform: var(--display-case);
  letter-spacing: var(--display-track);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}
.leader-role {
  color: var(--accent);
  margin-top: 4px;
}
.outreach-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 4px;
}
.outreach-card h2 {
  font-family: var(--display);
  font-stretch: var(--display-stretch);
  text-transform: var(--display-case);
  letter-spacing: var(--display-track);
  font-size: clamp(24px, 2.8vw, 34px);
  font-weight: 800;
  line-height: 1.1;
}
.outreach-card p {
  color: var(--muted);
}
.outreach-items {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.outreach-items a,
.outreach-items li > span {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.outreach-items strong {
  display: block;
}
.outreach-items small {
  color: var(--muted);
  font-size: 14px;
}
.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Resources */
.resources-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}
.resource-groups {
  display: grid;
  gap: 28px;
}
.resource-grid {
  grid-template-columns: repeat(2, 1fr);
  column-gap: 32px;
}
.resource-group summary {
  list-style: none;
  cursor: default;
}
.resource-group summary::-webkit-details-marker {
  display: none;
}
.resource-group summary i {
  display: none;
  order: 3;
  font-family: var(--body);
  font-style: normal;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  transition: transform 0.25s var(--ease);
}
.resource-group summary::after {
  order: 2;
}
.resource-group[open] summary i {
  transform: rotate(45deg);
}
.resource-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
}
.resource-card strong {
  display: block;
  font-family: var(--display);
  font-stretch: var(--display-stretch);
  text-transform: var(--display-case);
  letter-spacing: var(--display-track);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}
.resource-card small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  margin-top: 2px;
}
.resource-card .arrow {
  flex: none;
  color: var(--accent);
  display: grid;
  place-items: center;
  transition: transform 0.2s var(--ease);
}
.resource-card:hover .arrow {
  transform: translate(2px, -2px);
}
.resource-card .arrow svg {
  width: 15px;
  height: 15px;
}
.faq-list {
  display: grid;
  border-top: 1px solid var(--line);
}
.faq-item {
  border-bottom: 1px solid var(--line);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 0;
  font-weight: 600;
  line-height: 1.3;
}
.faq-item summary:hover {
  color: var(--accent);
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary i {
  flex: none;
  color: var(--accent);
  font-style: normal;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  transition: transform 0.25s var(--ease);
}
.faq-item[open] summary i {
  transform: rotate(45deg);
}
.faq-link {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}
.faq-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.faq-item p {
  padding: 0 0 16px;
  color: var(--muted);
  font-size: 15px;
}

/* Donate */
.donate-hero {
  text-align: center;
  padding: 0 0 clamp(22px, 4vh, 36px);
  border-bottom: 1px solid var(--line);
}
.donate-hero .donate-intro {
  margin: 0 auto;
  max-width: 1120px;
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.5;
  color: var(--ink);
}
.btn-donate {
  margin-top: clamp(18px, 3.4vh, 28px);
  height: 64px;
  padding: 0 40px;
  font-size: 20px;
  font-weight: 700;
  background: #1f6feb;
  color: #fff;
  border-radius: 8px;
}
.btn-donate:hover {
  background: #1858c4;
}
.donate-hero .donate-match {
  margin-top: 14px;
  font-size: 16px;
  color: var(--ink);
}
.donate-match strong {
  color: #1f6feb;
}
:root[data-theme="dark"] .donate-match strong {
  color: #6aa6ff;
}
.donate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  padding-top: clamp(6px, 1.4vh, 12px);
}
.donate-steps,
.donate-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.donate-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  line-height: 1.4;
}
.donate-steps span {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--crimson);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}
.donate-list li {
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted);
}
.donate-list strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
}
.donate-list a {
  color: var(--accent);
  font-weight: 600;
}
.donate-check {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted);
}
.donate-check strong {
  color: var(--ink);
}
.donate-check a {
  color: var(--accent);
  font-weight: 600;
}

/* Gallery */
.gallery-total {
  color: var(--muted);
  font-weight: 600;
}
.tile-count {
  position: absolute;
  z-index: 1;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(20, 3, 8, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}
.tile-count svg {
  width: 13px;
  height: 13px;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(110px, 15vw, 190px), 1fr));
  grid-auto-rows: clamp(110px, 15vw, 190px);
  grid-auto-flow: dense;
  gap: 8px;
}
.photo-tile {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: var(--line);
  cursor: zoom-in;
}
.photo-tile.big {
  grid-column: span 2;
  grid-row: span 2;
}
.photo-tile.wide {
  grid-column: span 2;
}
.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition:
    opacity 0.45s ease,
    transform 0.5s var(--ease);
}
.photo-tile.is-loaded img {
  opacity: 1;
  transform: none;
}
.photo-tile.is-loaded:hover img {
  transform: scale(1.06);
}
.photo-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 60%, rgba(20, 3, 8, 0.35));
  opacity: 0;
  transition: opacity 0.25s;
}
.photo-tile:hover::after {
  opacity: 1;
}
.photo-tile.is-error {
  display: none;
}
.grid-sentinel {
  height: 1px;
}
.viewer-open,
.viewer-open body {
  overflow: hidden;
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(14, 4, 7, 0.94);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.lightbox.is-open {
  opacity: 1;
}
.lb-stage {
  margin: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 56px clamp(12px, 7vw, 96px);
}
.lb-stage img {
  max-width: 100%;
  max-height: calc(100vh - 112px);
  max-height: calc(100dvh - 112px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  opacity: 0;
  transform: scale(0.985);
  transition:
    opacity 0.3s ease,
    transform 0.3s var(--ease);
}
.lightbox.is-ready .lb-stage img {
  opacity: 1;
  transform: none;
}
.lb-count {
  position: absolute;
  left: 50%;
  top: 22px;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 13px;
  opacity: 0.75;
}
.lb-btn {
  position: absolute;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: grid;
  place-items: center;
  transition: background 0.2s;
}
.lb-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}
.lb-btn svg {
  width: 22px;
  height: 22px;
}
.lb-close {
  top: 14px;
  right: 14px;
}
.lb-prev {
  left: clamp(8px, 2vw, 24px);
  top: 50%;
  transform: translateY(-50%);
}
.lb-next {
  right: clamp(8px, 2vw, 24px);
  top: 50%;
  transform: translateY(-50%);
}

.lightbox.has-strip .lb-stage {
  padding-bottom: 104px;
}
.lightbox.has-strip .lb-stage img {
  max-height: calc(100vh - 160px);
  max-height: calc(100dvh - 160px);
}
.lb-strip {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  display: flex;
  gap: 6px;
  padding: 6px;
  overflow-x: auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}
.lb-thumb {
  flex: none;
  width: 74px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0.55;
  transition:
    opacity 0.2s,
    border-color 0.2s;
}
.lb-thumb:hover {
  opacity: 0.9;
}
.lb-thumb[aria-current="true"] {
  opacity: 1;
  border-color: #fff;
}
.lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Play */
.game-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0 40px;
  align-items: start;
}
.game-title {
  grid-column: 1/-1;
}
.game-stage {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: var(--crimson-night);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.game-stage canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16/8;
}
.game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  text-align: center;
  padding: 20px;
  background: rgba(34, 5, 12, 0.75);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: var(--on-crimson);
}
.game-overlay h2 {
  font-family: var(--display);
  font-stretch: var(--display-stretch);
  text-transform: var(--display-case);
  letter-spacing: var(--display-track);
  font-size: clamp(30px, 5vw, 56px);
  font-weight: 800;
  line-height: 1;
}
.game-overlay p {
  color: var(--on-crimson-muted);
  max-width: 420px;
}
.difficulty {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
}
.difficulty button {
  border: 0;
  border-radius: 2px;
  background: none;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 14px;
}
.difficulty button[aria-pressed="true"] {
  background: var(--on-crimson);
  color: var(--accent);
}
.game-side {
  display: grid;
  gap: 28px;
}
.keys {
  display: grid;
  gap: 8px;
  font-size: 14px;
}
.keys div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
kbd {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 3px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
}
.record {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
}
.game-rules {
  margin-block: 12px 16px;
  font-size: 14px;
}
.game-rules a {
  color: var(--accent);
  font-weight: 600;
}
.game-rules a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.touch-pad {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.touch-pad button {
  height: 60px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  font-weight: 700;
  font-size: 14px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.touch-pad button.is-strong {
  background: var(--crimson);
  border-color: var(--accent);
  color: #fff;
}
.touch-pad button.is-down {
  transform: scale(0.96);
}

.noscript-note {
  padding: 12px var(--gutter);
  background: #fff3cd;
  color: #000;
}

/* ---------- Responsive ---------- */
@media (min-width: 961px) {
  .page-home {
    height: 100vh;
    height: 100svh;
  }
  .page-home .gallery {
    min-height: 0;
  }
  /* The photo frame keeps a photo's shape (10:7, between 3:2 and 4:3) on every screen,
     as big as fits the column (leaving room for the line under it), centred with
     crimson space around it, so wide photos are never trimmed at the sides. */
  .page-home .home-media {
    min-height: 0;
    justify-content: center;
    align-items: center;
    container-type: size;
  }
  .page-home .home-media .gallery,
  .page-home .home-media .home-photo-meta {
    flex: 0 0 auto;
    width: 100%;
    width: min(100%, calc((100cqh - 44px) * 10 / 7));
  }
  .page-home .home-media .gallery {
    aspect-ratio: 10 / 7;
  }
  .page-home .home {
    min-height: 0;
    transform: translateY(-15px);
  }
}
@media (min-width: 961px) and (max-width: 1200px) {
  .home-actions .btn svg {
    display: none;
  }
}
@media (max-width: 960px) {
  .menu-toggle {
    display: block;
  }
  /* Mobile menu: a full-width crimson dropdown that unrolls from the header. */
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 2px var(--gutter) 10px;
    background: var(--crimson);
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 18px 30px -18px rgba(20, 3, 8, 0.55);
    font-size: 18px;
    clip-path: inset(0 0 100% 0);
    visibility: hidden;
    transition:
      clip-path 0.28s var(--ease),
      visibility 0.28s;
  }
  .main-nav.is-open {
    clip-path: inset(0 0 -40px 0);
    visibility: visible;
  }
  .main-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 2px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }
  .main-nav a:last-child {
    border-bottom: 0;
  }
  .main-nav a::before {
    content: "";
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0;
  }
  .main-nav a:hover,
  .main-nav a[aria-current="page"] {
    background: transparent;
  }
  .main-nav a[aria-current="page"] {
    font-weight: 700;
  }
  .main-nav a[aria-current="page"]::before {
    opacity: 1;
  }
  .home {
    grid-template-columns: 1fr;
    padding-top: 4px;
    gap: 28px;
  }
  .practice-item.is-next {
    padding-inline: 12px;
    margin-inline: -12px;
  }
  .home-head {
    margin-right: -12px;
  }
  .practice-where {
    font-size: clamp(16px, 4.4vw, 19px);
    gap: 8px;
  }
  .home-media {
    order: -1;
    margin-block: 0;
  }
  .gallery {
    min-height: 0;
    aspect-ratio: 4/3;
    flex: none;
  }
  .team-layout,
  .resources-layout,
  .game-shell,
  .events-layout,
  .donate-grid {
    grid-template-columns: 1fr;
  }
  .photo-stack {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
  }
  .photo-stack .photo-frame {
    aspect-ratio: 4/3;
    min-height: 0;
  }
  .game-side {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}
@media (max-width: 640px) {
  .game-overlay {
    gap: 5px;
    padding: 8px;
  }
  .game-overlay h2 {
    font-size: 22px;
  }
  .game-overlay p {
    font-size: 12px;
    line-height: 1.25;
  }
  .difficulty {
    flex-wrap: nowrap;
    padding: 2px;
    gap: 2px;
  }
  .difficulty button {
    padding: 4px 8px;
    font-size: 12px;
  }
  .game-overlay .btn {
    height: 32px;
    padding: 0 18px;
  }
  .leaders-grid,
  .resource-grid {
    grid-template-columns: 1fr;
  }
  /* Resources: link groups fold up like the FAQ. */
  .resource-groups {
    gap: 0;
    margin-bottom: 28px;
  }
  .resource-group summary {
    cursor: pointer;
    margin-bottom: 0;
    padding-block: 14px;
  }
  .resource-group[open] summary {
    margin-bottom: 2px;
  }
  .resource-group summary i {
    display: block;
  }
  /* Smallest phones: keep the wordmark on one line. */
  .header-inner {
    gap: 12px;
  }
  .brand {
    gap: 10px;
    font-size: min(17px, 4.4vw);
    white-space: nowrap;
  }
  .event-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .event-date {
    display: flex;
    align-items: baseline;
    gap: 8px;
  }
  .event-date .d {
    font-size: 26px;
    margin: 0;
  }
  .event-date.is-open .d {
    font-size: 22px;
  }
  /* One main WhatsApp button, with email and Instagram as two smaller buttons below. */
  .home-actions {
    grid-template-columns: 1fr 1fr;
  }
  .home-actions .btn-whatsapp {
    grid-column: 1 / -1;
  }
  .home-actions .btn-email,
  .home-actions .btn-instagram {
    height: 42px;
  }
  .btn-long {
    display: none;
  }
  .btn-short {
    display: inline;
  }
  /* Slideshow: swipe, with dots below and only a small pause button on the photo. */
  .gallery::after,
  .gallery-count,
  .gallery-scrub,
  #slide-prev,
  #slide-next {
    display: none;
  }
  .gallery-controls {
    left: auto;
    right: 10px;
    bottom: 10px;
  }
  .gallery-controls .icon-btn {
    width: 32px;
    height: 32px;
  }
  .gallery-controls .icon-btn svg {
    width: 14px;
    height: 14px;
  }
  .slide-dots {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
  }
  .slide-dot {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: var(--on-crimson);
    opacity: 0.35;
    transition:
      width 0.3s var(--ease),
      opacity 0.3s;
  }
  .slide-dot.is-active {
    width: 16px;
    opacity: 1;
  }
  .home-photo-meta {
    margin-top: 10px;
  }
  .site-footer {
    font-size: 10.5px;
    line-height: 1.3;
  }
}
@media (max-width: 340px) {
  /* Smallest phones: keep the whole start/end menu inside the game canvas. */
  .game-overlay {
    gap: 3px;
  }
  .game-overlay h2 {
    font-size: 18px;
  }
  .game-overlay p {
    font-size: 11px;
  }
  .game-overlay .btn {
    height: 28px;
  }
}
@media (hover: none), (max-width: 960px) {
  .touch-pad {
    display: grid;
  }
}
/* Touchscreens use the on-screen buttons, so the keyboard controls list is hidden. */
@media (hover: none), (max-width: 640px) {
  .game-keys {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
  .gallery-slide img {
    transform: none !important;
  }
}
