/* ==========================================================================
   TSS The Summit Society
   Design source: STYLE.md ("Basecamp" neubrutalist frames + pixel warmth)
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --paper: #FFF6E8;
  --panel: #FFFDF6;
  --sky: #A9DCD2;
  --sky-deep: #7CC4B8;
  --peach: #FFD9C7;
  --ink: #1C1B17; /* borders, shadows, text on panels */
  --ink-60: #5C584E;
  --page-ink: #1C1B17; /* text directly on paper/sky/peach bands */
  --panel-ink: #1C1B17; /* text inside panels (always lit windows) */
  --coral: #FF6B4A;
  --coral-deep: #E14E2F;
  --sun: #FFC93C;
  --shadow: #1C1B17;
  --dither: rgba(28, 27, 23, 0.09);
  --ridge-back: #7CC4B8;
  --ridge-front: #4FA394;
  --ghost: rgba(28, 27, 23, 0.38);

  --font-display: "Bricolage Grotesque", sans-serif;
  --font-text: "Space Grotesk", sans-serif;
  --font-pixel: "Silkscreen", monospace;

  --frame-border: 3px solid var(--ink);
  --frame-shadow: 4px 4px 0 var(--shadow);
  --frame-shadow-hover: 6px 6px 0 var(--shadow);
  --frame-radius: 10px;

  --maxw: 1200px;
}

/* Hidden scrollbar (scroll still works wheel, keys, touch) */
html { scrollbar-width: none; -ms-overflow-style: none; }
::-webkit-scrollbar { width: 0; height: 0; display: none; }

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--page-ink);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}
h2 { font-size: clamp(30px, 4.5vw, 42px); }
h3 { font-size: 23px; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 1em; max-width: 66ch; }
strong { font-weight: 600; }

::selection { background: var(--sun); color: var(--ink); }

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: var(--panel);
  padding: 10px 16px;
  font-weight: 600;
  text-decoration: none;
  transition: top 150ms;
}
.skip-link:focus { top: 12px; }

/* ---------- Pixel label ---------- */
.pixel-label {
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 14px;
  color: var(--page-ink);
}

/* Highlight swash marker behind the word, never colored text */
.hl {
  background: linear-gradient(transparent 58%, var(--sun) 58%, var(--sun) 94%, transparent 94%);
  padding: 0 0.06em;
  white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 13px 26px;
  border: var(--frame-border);
  border-radius: 8px;
  box-shadow: var(--frame-shadow);
  cursor: pointer;
  transition: transform 120ms, box-shadow 120ms, background-color 120ms;
  white-space: nowrap;
  min-height: 48px;
}
.btn--primary { background: var(--coral); color: var(--ink); }
.btn--primary:hover { background: var(--coral-deep); transform: translate(-2px, -2px); box-shadow: var(--frame-shadow-hover); }
.btn--ghost { background: var(--panel); color: var(--panel-ink); }
.btn--ghost:hover { transform: translate(-2px, -2px); box-shadow: var(--frame-shadow-hover); }
.btn:active, .btn--pressed { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow); }
.btn--sm { padding: 8px 18px; min-height: 42px; font-size: 13px; }
.btn--full { width: 100%; text-align: center; }

/* ---------- Chips ---------- */
.chip {
  display: inline-block;
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 13px;
  color: var(--panel-ink);
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 5px 14px;
  cursor: default;
}
button.chip { cursor: pointer; transition: background-color 120ms, transform 120ms; }
button.chip:hover { transform: translateY(-1px); }
button.chip[aria-pressed="true"] { background: var(--sun); font-weight: 600; }

/* ---------- Frames ---------- */
.frame {
  background: var(--panel);
  color: var(--panel-ink);
  border: var(--frame-border);
  border-radius: var(--frame-radius);
  box-shadow: var(--frame-shadow);
}

/* ---------- Dither strip ---------- */
.dither {
  height: 14px;
  background-image: conic-gradient(var(--dither) 0 25%, transparent 0 50%, var(--dither) 0 75%, transparent 0);
  background-size: 16px 16px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
  padding: 0 clamp(16px, 3vw, 32px);
  background: var(--panel);
  border-bottom: 3px solid var(--ink);
}
.nav__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav__wordmark {
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.06em;
  color: var(--panel-ink);
  margin: 0;
}
.nav__links { display: flex; gap: 4px; margin-left: auto; }
.nav__links a {
  color: var(--panel-ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 6px;
}
.nav__links a:hover { box-shadow: inset 0 -3px 0 var(--coral); }
.nav__actions { display: flex; align-items: center; gap: 10px; }
.nav__burger { display: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--panel);
  color: var(--panel-ink);
  border: 2px solid var(--ink);
  border-radius: 8px;
  cursor: pointer;
  transition: transform 120ms, box-shadow 120ms;
  box-shadow: 2px 2px 0 var(--shadow);
}
.icon-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--shadow); }
.icon-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--shadow); }

/* ---------- Hero ---------- */
.hero {
  background: var(--sky);
  border-bottom: 3px solid var(--ink);
  overflow: hidden;
}
.hero__copy {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(48px, 7vw, 88px) clamp(20px, 4vw, 40px) clamp(24px, 3vw, 36px);
  text-align: center;
}
.hero__title {
  font-size: clamp(44px, 6.2vw, 80px);
  letter-spacing: -0.03em;
  line-height: 0.98;
  margin: 0 0 18px;
}
.hero__title > span { display: block; }
.hero__sub {
  font-size: clamp(16px, 1.6vw, 19px);
  max-width: 46ch;
  margin: 0 auto 26px;
}
.hero__ctas { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

.cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  margin-left: 4px;
  background: var(--page-ink);
  vertical-align: -2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Scene full-width pixel landscape anchoring the hero band */
.hero__scene { position: relative; height: clamp(240px, 34vw, 430px); }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; }

.scene .sun-core, .story-scene .sun-core { fill: var(--sun); }
.scene .sun-ray, .story-scene .sun-ray { fill: var(--sun); }
.scene .clouds rect, .story-scene .clouds rect { fill: #FFFDF6; }
.ridge-back { fill: var(--ridge-back); }
.ridge-front { fill: var(--ridge-front); }
.flag-pole { fill: var(--ink); }
.flag-cloth { fill: var(--sun); }
.snow { fill: #FFFDF6; }
.pine-f { fill: #3D8570; }
.pine-t { fill: var(--ink); }
.birds rect { fill: var(--ink); }

.cloud--1 { animation: drift-1 30s steps(48) infinite alternate; }
.cloud--2 { animation: drift-2 38s steps(56) infinite alternate-reverse; }
.cloud--3 { animation: drift-3 34s steps(52) infinite alternate; }
.cloud--4 { animation: drift-4 26s steps(40) infinite alternate-reverse; }
.cloud--5 { animation: drift-5 44s steps(60) infinite alternate; }
@keyframes drift-1 { from { transform: translate(180px, 80px); } to { transform: translate(250px, 80px); } }
@keyframes drift-2 { from { transform: translate(620px, 60px); } to { transform: translate(560px, 60px); } }
@keyframes drift-3 { from { transform: translate(1050px, 150px); } to { transform: translate(1120px, 150px); } }
@keyframes drift-4 { from { transform: translate(880px, 150px); } to { transform: translate(830px, 150px); } }
@keyframes drift-5 { from { transform: translate(360px, 205px); } to { transform: translate(420px, 205px); } }

.bird--1 { transform: translate(520px, 150px); }
.bird--2 { transform: translate(585px, 115px); }
.bird--3 { transform: translate(905px, 105px); }

.flag-wave-b { animation: flagwave 0.9s steps(1) infinite; }
@keyframes flagwave { 0%, 50% { opacity: 0; } 50.01%, 100% { opacity: 1; } }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 96px) clamp(20px, 4vw, 40px); }
.section > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section--sky { background: var(--sky); border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); }
.section--peach { background: var(--peach); }
.section--join { background: var(--paper); }
.section__head { margin-bottom: clamp(28px, 4vw, 44px); }
.section__sub { color: var(--ink-60); font-size: 18px; margin: 0; }
.section--sky .section__sub, .section--peach .section__sub { color: var(--page-ink); opacity: 0.75; }

/* ---------- Arenas ---------- */
.arenas { padding-top: clamp(40px, 6vw, 64px); padding-bottom: clamp(40px, 6vw, 64px); text-align: center; }
.arenas .pixel-label { font-size: 18px; margin-bottom: 20px; }
.arenas__list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}
.arena {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  color: var(--panel-ink);
  border: var(--frame-border);
  border-radius: var(--frame-radius);
  box-shadow: var(--frame-shadow);
  padding: 14px 26px;
  font-weight: 600;
  font-size: 17px;
}
.arena svg { width: 28px; height: 28px; fill: var(--panel-ink); flex: none; }

/* ---------- Cards ---------- */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.card { padding: 26px 24px 28px; position: relative; }
.card__num { display: block; margin-bottom: 10px; }
.card p { margin: 0; }

/* ---------- Roster ---------- */
.roster__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.member { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.member__head { display: flex; align-items: center; gap: 16px; }
.member__avatar {
  flex: none;
  background: var(--panel);
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--shadow);
}
svg.member__avatar { width: 80px; height: 80px; image-rendering: pixelated; }
img.member__avatar { display: block; width: 80px; height: auto; }
.member__name { margin: 0; font-size: 22px; }
.member__field { margin: 3px 0 0; font-size: 15px; color: var(--ink-60); font-weight: 500; }
.member__quote { font-size: 15px; color: var(--ink-60); margin: 0; }
.member__meters { display: flex; flex-direction: column; gap: 10px; }
.meter { display: grid; grid-template-columns: 100px 1fr; align-items: center; gap: 12px; }
.meter__label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.meter__track { height: 16px; border: 2px solid var(--ink); border-radius: 4px; background: var(--panel); overflow: hidden; }
.meter__fill { display: block; height: 100%; background: var(--sun); border-right: 2px solid var(--ink); width: 0; transition: width 700ms steps(12); }
.reveal.in .meter__fill { width: var(--w); }
.member__chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 4px; }
.member__chips .chip { font-size: 14px; padding: 6px 16px; }

.member--empty {
  border-style: dashed;
  box-shadow: none;
  background: transparent;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 240px;
  gap: 10px;
}
.member--empty p { margin: 0; font-weight: 600; }
.member--empty .pixel-label { margin: 0; }
.member--empty a { color: var(--panel-ink); text-decoration-color: var(--coral); text-decoration-thickness: 3px; }

/* ---------- Trophy ---------- */
.trophy { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(24px, 5vw, 56px); align-items: center; }
.trophy__stage { width: 100%; max-width: 260px; aspect-ratio: 1 / 1; margin: 0 auto; }
.trophy__stage canvas { width: 100% !important; height: 100% !important; display: block; }
.trophy__copy p { max-width: 52ch; }
.trophy__copy .btn { margin-top: 8px; }

/* ---------- Events ---------- */
.events__upcoming { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-bottom: 32px; }
.event { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.event__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.event__date { text-align: center; line-height: 1; }
.event__date-day { display: block; font-family: var(--font-display); font-weight: 800; font-size: 30px; letter-spacing: -0.02em; }
.event h3 { margin: 0; font-size: 20px; }
.event p { margin: 0; font-size: 15px; }
.event__loc { font-size: 13px; font-weight: 600; color: var(--ink-60); text-transform: uppercase; letter-spacing: 0.04em; }

.events__past { padding: 0; }
.events__past summary {
  cursor: pointer;
  font-weight: 600;
  padding: 16px 22px;
  list-style: none;
}
.events__past summary::before { content: "+"; font-family: var(--font-pixel); margin-right: 10px; }
.events__past[open] summary::before { content: "–"; }
.events__past summary::-webkit-details-marker { display: none; }
.events__past-hint { font-weight: 400; color: var(--ink-60); font-size: 14px; }
.events__past ul { list-style: none; margin: 0; padding: 4px 22px 18px; }
.events__past li { padding: 8px 0 8px 18px; border-left: 3px solid var(--sun); margin: 6px 0; font-size: 15px; }
.events__past li span { font-weight: 600; margin-right: 8px; }

/* ---------- Story ---------- */
.story { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(24px, 5vw, 64px); align-items: center; justify-items: center; }
.story__copy { justify-self: start; }
.story__flag { width: 100%; max-width: 420px; margin: 0 auto; }
.story-scene { display: block; width: 100%; background: var(--panel); border: var(--frame-border); border-radius: var(--frame-radius); box-shadow: var(--frame-shadow); }
.story__stats { list-style: none; display: flex; gap: 28px; padding: 0; margin: 26px 0 0; flex-wrap: wrap; }
.story__stats li { display: flex; flex-direction: column; gap: 4px; }
.story__stats .pixel-label { margin: 0; }
.story__stat { font-family: var(--font-display); font-weight: 800; font-size: 40px; letter-spacing: -0.02em; line-height: 1; }

/* ---------- Join ---------- */
.join { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.join__expect { padding-left: 22px; margin: 0 0 18px; }
.join__expect li { margin-bottom: 10px; }
.join__note { font-weight: 600; }

.join__form { padding: clamp(20px, 3vw, 32px); }
.field { margin-bottom: 20px; border: none; padding: 0; }
.field label, .field legend {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  padding: 0;
}
.field__hint { font-weight: 400; color: var(--ink-60); }
.field input, .field textarea {
  width: 100%;
  font-family: var(--font-text);
  font-size: 16px;
  color: var(--panel-ink);
  background: var(--paper);
  border: var(--frame-border);
  border-radius: 8px;
  padding: 12px 14px;
}
.field input:focus, .field textarea:focus { outline: none; box-shadow: 4px 4px 0 var(--coral); }
.field textarea { resize: vertical; }
.field--invalid input, .field--invalid textarea { border-color: var(--coral-deep); }
.field__error { color: var(--coral-deep); font-size: 14px; font-weight: 500; margin: 8px 0 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }

.join__success { padding: clamp(28px, 4vw, 40px); text-align: center; }
.join__success h3 { margin: 14px 0 8px; }
.join__success p { margin: 0 auto; max-width: 40ch; }

/* ---------- Footer ---------- */
.footer { background: var(--paper); }
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px clamp(20px, 4vw, 40px) 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}
.footer__brand { display: flex; align-items: center; gap: 12px; }
.footer__brand .nav__wordmark { color: var(--page-ink); }
.footer__tag { margin: 0; font-size: 13px; color: var(--ink-60); }
.footer__links { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.footer__links a { color: var(--page-ink); font-weight: 600; font-size: 14px; text-decoration: none; }
.footer__links a:hover { box-shadow: inset 0 -3px 0 var(--coral); }
.footer__fine { width: 100%; margin: 8px 0 0; font-size: 13px; color: var(--ink-60); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 450ms, transform 450ms; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .cards-3, .roster__grid, .events__upcoming { grid-template-columns: repeat(2, 1fr); }
  .join, .trophy, .story { grid-template-columns: 1fr; }
  .story__flag { max-width: 280px; }
  .trophy__stage { max-width: 210px; }
}

@media (max-width: 768px) {
  .hero__scene { height: clamp(190px, 56vw, 300px); }

  .nav__links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--panel);
    border-bottom: 3px solid var(--ink);
    padding: 12px 16px 16px;
    gap: 2px;
  }
  .nav__links.open { display: flex; }
  .nav__links a { padding: 12px; font-size: 16px; }
  .nav__burger { display: inline-flex; }
  .nav { gap: 12px; }
  .nav__actions { margin-left: auto; }
}

@media (max-width: 560px) {
  .cards-3, .roster__grid, .events__upcoming { grid-template-columns: 1fr; }
  .meter { grid-template-columns: 90px 1fr; }
  .btn { padding: 13px 20px; }
  .hero__title { font-size: clamp(30px, 8.6vw, 44px); }
  .hero__ctas { flex-direction: column; }
  .hero__ctas .btn { text-align: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .cursor { display: none; }
  .meter__fill { transition: none; }
}
