/* ===========================================================
   GGATHER — Community Gaming Club
   Palette: green + amber, warm community bulletin-board motif
   =========================================================== */

:root {
  --bg-light: #f7f3ea;
  --bg-dark: #1e2422;
  --text-on-light: #1e2422;
  --text-on-dark: #f7f3ea;
  --accent-green: #2f9e44;
  --accent-amber: #f08c00;
  --newcomer: #7048e8; /* derived neutral third pin, distinct from the two brand accents */

  --radius: 8px;
  --border: 1.5px solid currentColor;
  --hairline: rgba(30, 36, 34, 0.16);
  --hairline-on-dark: rgba(247, 243, 234, 0.18);

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Public Sans", system-ui, sans-serif;

  --section-y: 96px;
  --wrap: 1200px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-on-light);
  background: var(--bg-light);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.05; margin: 0; }
p { margin: 0 0 1rem; }
a { color: inherit; }

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent-green); color: var(--text-on-dark);
  padding: 10px 16px; border-radius: var(--radius); z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

:focus-visible { outline: 3px solid var(--accent-amber); outline-offset: 3px; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  padding: 13px 24px;
  border-radius: var(--radius);
  border: var(--border);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease), color 0.18s var(--ease);
}
.btn--primary { background: var(--accent-green); color: var(--text-on-dark); border-color: var(--accent-green); }
.btn--ghost { background: transparent; color: currentColor; }
/* motif: a pin "sticks" into the corner on hover */
.btn::after {
  content: "";
  position: absolute; top: 7px; right: 7px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-amber);
  transform: scale(0);
  transition: transform 0.2s var(--ease);
}
.btn--primary::after { background: var(--bg-light); }
.btn:hover::after, .btn:focus-visible::after { transform: scale(1); }
.btn:hover { transform: translateY(-2px); }

/* ---------- Pins (bulletin-board motif) ---------- */
.pin {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(30, 36, 34, 0.25);
  vertical-align: middle;
}
.pin--green { background: var(--accent-green); }
.pin--amber { background: var(--accent-amber); }
.pin--newcomer { background: var(--newcomer); }
/* corner-positioned pins on cards/photos */
.pin--tl, .pin--tr, .pin--br {
  position: absolute; z-index: 3;
  width: 14px; height: 14px;
  border-color: rgba(255, 255, 255, 0.55);
}
.pin--tl { top: 10px; left: 10px; }
.pin--tr { top: 10px; right: 10px; }
.pin--br { bottom: 10px; right: 10px; }

/* ---------- Handwritten scribble underline ---------- */
.scribble-word { position: relative; display: inline-block; }
.scribble {
  position: absolute; left: 0; bottom: -0.28em;
  width: 100%; height: 0.42em;
  color: var(--accent-amber);
  overflow: visible;
}
.scribble path {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.7s var(--ease) 0.3s;
}
.scribble--sm { bottom: -0.15em; height: 0.5em; }
.reveal.is-visible .scribble path,
.is-visible .scribble path { stroke-dashoffset: 0; }

/* ---------- Flow arrows between sections ---------- */
.flow-arrow {
  display: block;
  width: 120px; height: 46px;
  margin: -24px auto 0;
  color: var(--accent-green);
  overflow: visible;
}
.flow-arrow--flip { transform: scaleX(-1); }
.flow-arrow path {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.8s var(--ease);
}
.flow-arrow.is-visible path { stroke-dashoffset: 0; }

/* ---------- Section scaffolding ---------- */
.section { padding-block: var(--section-y); }
.section__head { max-width: 720px; margin-bottom: 40px; }
.kicker {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  color: var(--accent-green);
  margin-bottom: 12px;
}
h1 { font-size: clamp(40px, 6.5vw, 80px); font-weight: 700; }
h2 { font-size: clamp(30px, 4.5vw, 50px); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.3rem; font-weight: 700; }
.section__intro { font-size: 1.08rem; color: rgba(30, 36, 34, 0.82); }

/* ===========================================================
   NAV — nav-split-logo
   =========================================================== */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  width: 100%;
  padding: 18px max(20px, (100vw - var(--wrap)) / 2);
  background: transparent;
  transition: padding 0.25s var(--ease), background-color 0.25s var(--ease), border-color 0.25s var(--ease);
  border-bottom: 1.5px solid transparent;
}
.nav.is-scrolled {
  padding-block: 10px;
  background: rgba(247, 243, 234, 0.92);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--hairline);
}
.nav__brand a { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.nav__emblem { width: 28px; height: 28px; flex: none; display: block; }
.nav__name { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: 0.02em; }
.nav__center { display: flex; gap: 26px; }
.nav__center a {
  position: relative;
  text-decoration: none; font-weight: 500;
  padding: 4px 0;
}
.nav__center a::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 2px; background: var(--accent-amber);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.2s var(--ease);
}
.nav__center a:hover::after, .nav__center a.is-active::after { transform: scaleX(1); }
.nav__cta { padding: 9px 18px; }

/* ===========================================================
   HERO — hero-quote-framed + Scoreboard Flip Tick bg
   =========================================================== */
.hero {
  position: relative;
  padding-top: 20px;
  padding-bottom: clamp(44px, 6vw, 68px);
  overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero__glow {
  position: absolute; top: 12%; left: 8%;
  width: 60%; height: 60%;
  background: radial-gradient(closest-side, rgba(47, 158, 68, 0.16), transparent);
  filter: blur(10px);
}
.hero__inner { position: relative; z-index: 1; padding-top: 12px; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; letter-spacing: 0.02em;
  color: rgba(30, 36, 34, 0.75);
}
.hero__quote {
  margin: 10px 0 0;
  max-width: 14ch;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(38px, 6.4vw, 76px); line-height: 1.02;
  letter-spacing: -0.02em;
}
.hero__slogan {
  font-family: var(--font-display); font-weight: 600;
  color: var(--accent-amber); font-size: 1.3rem;
  margin: 12px 0 0;
}
.hero__lead { max-width: 52ch; margin-top: 12px; font-size: 1.08rem; color: rgba(30, 36, 34, 0.82); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; }
.hero__corner {
  position: relative;
  margin: 30px 0 0;
  max-width: 560px;
  border: var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.hero__corner img {
  width: 100%; height: auto;
  filter: saturate(1.03) contrast(1.02);
}
/* film grain overlay 3% */
.hero__corner::after, .season__photo::after, .join__photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  opacity: 0.04; z-index: 2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Scoreboard Flip Tick — muted split-flap board behind hero text */
.flapboard {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  grid-auto-rows: 46px;
  gap: 8px; padding: 24px;
  opacity: 0.10;
}
.flapboard span {
  position: relative;
  background: linear-gradient(180deg, #2b332f 0 50%, #232a27 50% 100%);
  border-radius: 4px;
}
.flapboard span::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; background: rgba(0, 0, 0, 0.4);
}
.flapboard span.is-flipping { animation: flapTick 0.4s var(--ease); }
@keyframes flapTick {
  0% { transform: perspective(200px) rotateX(0deg); }
  50% { transform: perspective(200px) rotateX(-90deg); }
  100% { transform: perspective(200px) rotateX(0deg); }
}

/* ===========================================================
   WEEKLY NIGHTS
   =========================================================== */
.legend {
  list-style: none; margin: 22px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  font-size: 0.95rem; font-weight: 500;
}
.legend li { display: flex; align-items: center; gap: 8px; }

.nights__grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(3, 1fr);
}
.night-card {
  position: relative;
  padding: 26px 24px 24px 30px;
  background: #fffdf7;
  border: var(--border); border-radius: var(--radius);
  border-left-width: 4px;
}
.night-card:nth-child(2) { transform: rotate(0.5deg); }
.night-card:nth-child(1) { transform: rotate(-0.4deg); }
.night-card--casual { border-left-color: var(--accent-green); }
.night-card--league { border-left-color: var(--accent-amber); }
.night-card--newcomer { border-left-color: var(--newcomer); }
.night-card__day { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; margin: 4px 0 0; }
.night-card__time { font-weight: 600; color: rgba(30, 36, 34, 0.6); margin: 0 0 12px; letter-spacing: 0.02em; }
.night-card__title { margin-bottom: 4px; }
.night-card__type {
  display: inline-block; margin: 0 0 12px;
  font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(30, 36, 34, 0.55);
}
.night-card p:last-child { margin-bottom: 0; }

/* ===========================================================
   SEASON BOARD — dark
   =========================================================== */
.season {
  background: var(--bg-dark);
  color: var(--text-on-dark);
}
.season .kicker { color: var(--accent-amber); }
.season .section__intro { color: rgba(247, 243, 234, 0.78); }
.season__grid {
  display: grid; gap: 48px;
  grid-template-columns: 1.3fr 0.9fr; align-items: center;
}
.board { list-style: none; margin: 0; padding: 0; }
.board__row {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline-on-dark);
}
.board__rank {
  font-family: var(--font-display); font-weight: 700; font-size: 1.6rem;
  color: var(--accent-amber);
  width: 1.6ch; text-align: center;
}
.board__name { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; }
.board__meta { font-size: 0.82rem; color: rgba(247, 243, 234, 0.6); text-align: right; white-space: nowrap; }

/* split-flap score plate: mono digits, horizontal fold line + fold gradient */
.flap {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 6px 10px;
  background: linear-gradient(180deg, #2b332f 0 50%, #202724 50% 100%);
  border: 1px solid rgba(247, 243, 234, 0.14);
  border-radius: 4px;
  position: relative;
  transform-origin: center;
}
.flap::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; background: rgba(0, 0, 0, 0.45);
}
.flap__digits {
  font-family: ui-monospace, "Public Sans", monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 600; font-size: 1.25rem; letter-spacing: 0.06em;
  color: var(--text-on-dark);
}
.flap__unit { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-amber); }
.flap.is-flip { animation: flapReveal 0.5s var(--ease) both; }
@keyframes flapReveal {
  0% { transform: perspective(240px) rotateX(-88deg); opacity: 0; }
  100% { transform: perspective(240px) rotateX(0deg); opacity: 1; }
}
.board__note { margin-top: 20px; font-size: 0.9rem; color: rgba(247, 243, 234, 0.6); }

.season__photo { position: relative; margin: 0; border: 1.5px solid var(--hairline-on-dark); border-radius: var(--radius); overflow: hidden; }
.season__photo img { width: 100%; height: auto; }
.season__photo figcaption {
  padding: 10px 14px; font-size: 0.82rem;
  color: rgba(247, 243, 234, 0.7);
  border-top: 1px solid var(--hairline-on-dark);
}

/* ===========================================================
   THE CREW
   =========================================================== */
.crew__grid { display: grid; gap: 22px; grid-template-columns: repeat(3, 1fr); }
.crew-card {
  position: relative;
  padding: 30px 26px 26px;
  background: #fffdf7;
  border: var(--border); border-radius: var(--radius);
}
.crew-card:nth-child(2) { transform: rotate(0.5deg); }
.crew-card__name {
  position: relative; display: inline-block;
  font-size: 1.7rem; margin-bottom: 6px; padding-bottom: 6px;
}
.crew-card__role {
  font-weight: 600; color: var(--accent-green);
  margin: 0 0 12px;
}
.crew-card p:last-child { margin-bottom: 0; }

/* ===========================================================
   HOW TO JOIN
   =========================================================== */
.join__grid {
  display: grid; gap: 48px;
  grid-template-columns: 0.9fr 1.1fr; align-items: center;
}
.join__photo { position: relative; margin: 0; border: var(--border); border-radius: var(--radius); overflow: hidden; }
.join__photo img { width: 100%; height: auto; }
.timeline--horizontal { display: grid; gap: 22px; }
.timeline__step {
  position: relative;
  padding-left: 66px;
}
.timeline__num {
  position: absolute; left: 0; top: 0;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem;
  background: var(--accent-green); color: var(--bg-light);
}
.timeline__step:nth-child(2) .timeline__num { background: var(--accent-amber); }
.timeline__step:nth-child(3) .timeline__num { background: var(--newcomer); }
.timeline__step h3 { margin-bottom: 4px; }
.timeline__step p { margin-bottom: 0; }

/* ===========================================================
   RSVP FORM — dark, centered minimal
   =========================================================== */
.rsvp { background: var(--bg-dark); color: var(--text-on-dark); }
.rsvp .kicker { color: var(--accent-amber); }
.rsvp .section__intro { color: rgba(247, 243, 234, 0.78); }
.rsvp__inner { max-width: 560px; margin-inline: auto; text-align: center; }
.rsvp__inner .section__head { margin-inline: auto; }
.rsvp__form { text-align: left; margin-top: 8px; }
.field { margin-bottom: 18px; }
.field label {
  display: block; margin-bottom: 6px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
}
.field input, .field select {
  width: 100%;
  font-family: var(--font-body); font-size: 1rem;
  padding: 12px 14px;
  color: var(--text-on-dark);
  background: rgba(247, 243, 234, 0.06);
  border: 1.5px solid rgba(247, 243, 234, 0.35);
  border-radius: var(--radius);
  transition: border-color 0.18s var(--ease);
}
.field input::placeholder { color: rgba(247, 243, 234, 0.45); }
.field select { appearance: none; cursor: pointer; }
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--accent-green);
}
/* JS sets a data attribute for the picked night colour */
.rsvp__form[data-night="League Fri"] #night:focus,
.rsvp__form[data-night="League Fri"] #night { border-color: var(--accent-amber); }
.rsvp__form[data-night="Newcomers Sun"] #night:focus,
.rsvp__form[data-night="Newcomers Sun"] #night { border-color: var(--newcomer); }
.rsvp__form[data-night="Casual Wed"] #night:focus,
.rsvp__form[data-night="Casual Wed"] #night { border-color: var(--accent-green); }
.rsvp__submit { width: 100%; margin-top: 6px; }
.form-status { margin: 14px 0 0; font-weight: 600; min-height: 1.2em; }
.form-status.success { color: #8ce99a; }
.form-status.error { color: #ffa8a8; }

/* honeypot */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ===========================================================
   FOOTER — footer-cta-repeat
   =========================================================== */
.footer { background: var(--bg-light); color: var(--text-on-light); }
.footer__cta-band {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 56px 0;
  border-top: 1.5px solid var(--hairline);
}
.footer__cta-title { font-size: clamp(28px, 4vw, 44px); }
.footer__cta-sub { margin: 8px 0 0; color: rgba(30, 36, 34, 0.7); }
.footer__bottom {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px 28px;
  padding: 28px 0 44px;
  border-top: 1px solid var(--hairline);
}
.footer__logo { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; text-decoration: none; }
.footer__emblem { width: 26px; height: 26px; flex: none; display: block; }
.footer__links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer__links a { text-decoration: none; font-weight: 500; }
.footer__links a:hover { color: var(--accent-green); }
.footer__legal { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer__legal a { text-decoration: none; font-weight: 500; font-size: 0.9rem; color: rgba(30, 36, 34, 0.7); }
.footer__legal a:hover { color: var(--accent-green); }
.footer__disclaimer {
  width: 100%; margin: 8px 0 0;
  font-weight: 700; color: var(--accent-green);
  font-size: 0.98rem;
}
.footer__copy { width: 100%; margin: 0; font-size: 0.85rem; color: rgba(30, 36, 34, 0.6); }

/* ===========================================================
   RATES
   =========================================================== */
.rates__grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(3, 1fr);
}
.rate-card {
  position: relative;
  padding: 28px 26px 26px;
  background: #fffdf7;
  border: var(--border); border-radius: var(--radius);
}
.rate-card:nth-child(1) { transform: rotate(-0.4deg); }
.rate-card--main {
  background: #fff;
  border-width: 2px;
  box-shadow: 6px 8px 0 rgba(240, 140, 0, 0.14);
}
.rate-card__type {
  margin: 0 0 6px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
}
.rate-card__price {
  margin: 0 0 12px;
  font-family: var(--font-display); font-weight: 700;
  font-size: 2.4rem; line-height: 1; color: var(--accent-green);
}
.rate-card--main .rate-card__price { color: var(--accent-amber); }
.rate-card__price span {
  font-size: 0.95rem; font-weight: 600;
  color: rgba(30, 36, 34, 0.55);
}
.rate-card p:last-child { margin-bottom: 0; }
.rates__note { margin: 22px 0 0; font-size: 0.9rem; color: rgba(30, 36, 34, 0.6); }

/* ===========================================================
   LEGAL PAGES
   =========================================================== */
.legal { padding-block: var(--section-y); }
.legal__inner { max-width: 760px; }
.legal__updated { margin: 6px 0 0; font-size: 0.9rem; color: rgba(30, 36, 34, 0.6); }
.legal h2 { font-size: clamp(22px, 3vw, 30px); margin: 40px 0 12px; }
.legal h3 { margin: 24px 0 6px; }
.legal p, .legal li { color: rgba(30, 36, 34, 0.85); }
.legal ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.legal li { margin-bottom: 6px; }
.legal__back {
  display: inline-block; margin-top: 36px;
  font-family: var(--font-display); font-weight: 700;
  text-decoration: none; color: var(--accent-green);
}
.legal__back:hover { text-decoration: underline; }

/* ===========================================================
   Reveal animation
   =========================================================== */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.55s var(--ease), transform 0.55s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 1024px) {
  .season__grid, .join__grid { grid-template-columns: 1fr; gap: 36px; }
  .join__photo { order: 2; }
}
@media (max-width: 768px) {
  :root { --section-y: 72px; }
  .nav__center { display: none; }
  .nights__grid, .crew__grid, .rates__grid { grid-template-columns: 1fr; }
  .night-card:nth-child(1), .night-card:nth-child(2), .crew-card:nth-child(2), .rate-card:nth-child(1) { transform: none; }
  .board__meta { font-size: 0.8rem; }
}
@media (max-width: 480px) {
  .btn { width: 100%; }
  .hero__actions .btn { width: auto; flex: 1 1 auto; }
  .board__row { grid-template-columns: auto 1fr auto; gap: 8px 12px; }
  .board__meta { grid-column: 1 / -1; text-align: left; padding-left: calc(1.6ch + 18px); }
}

/* ===========================================================
   Reduced motion — kill everything
   =========================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
  .scribble path, .flow-arrow path { stroke-dashoffset: 0 !important; }
  .flapboard span.is-flipping { animation: none !important; }
}
