/* =========================================================================
   BoxOff Game — style.css
   Single stylesheet for the whole static site.
   Plain CSS, no build step. Mobile-first. Light theme, white background.
   ========================================================================= */

/* ---------- 1. Design tokens ------------------------------------------------ */
:root {
  /* Colour */
  --bg:        #ffffff;   /* page background */
  --bg-soft:   #f7f7f5;   /* subtle panel / alt band */
  --ink:       #1b1b1b;   /* primary text */
  --ink-soft:  #565654;   /* secondary text */
  --line:      #e6e6e2;   /* hairline borders */
  --accent:    #0d7d76;   /* links, buttons, active state */
  --accent-ink:#0a5b56;   /* accent hover / pressed */
  --focus:     #1d6fb8;   /* focus ring */

  /* Type */
  --font-sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;

  /* Rhythm */
  --step--1: clamp(0.83rem, 0.79rem + 0.20vw, 0.94rem);
  --step-0:  clamp(1.00rem, 0.94rem + 0.28vw, 1.15rem);
  --step-1:  clamp(1.20rem, 1.08rem + 0.55vw, 1.55rem);
  --step-2:  clamp(1.45rem, 1.22rem + 1.05vw, 2.15rem);
  --step-3:  clamp(1.80rem, 1.35rem + 2.00vw, 3.05rem);

  --container: 1120px;
  --gutter: clamp(1rem, 0.6rem + 2vw, 2rem);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 28px rgba(0,0,0,.06);
}

/* ---------- 2. Reset ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px; /* keep anchor targets clear of the sticky header */
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-ink); }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; text-wrap: balance; }
p { text-wrap: pretty; }

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

/* ---------- 3. Helpers --------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 0; top: 0;
  transform: translateY(-120%);
  background: var(--ink);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 200;
}
.skip-link:focus { transform: translateY(0); color: #fff; }

.prose { max-width: 68ch; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: var(--step-1); margin-top: 1.8em; }
.prose h3 { font-size: var(--step-0); margin-top: 1.6em; }

.section { padding-block: clamp(2.5rem, 1.8rem + 3.5vw, 5rem); }
.section--soft { background: var(--bg-soft); border-block: 1px solid var(--line); }
.section__head { max-width: 60ch; margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.75rem); }
.section__eyebrow {
  font-size: var(--step--1);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-ink);
  font-weight: 600;
}
.section__title { font-size: var(--step-2); margin-top: .35rem; }
.section__intro { margin-top: .75rem; color: var(--ink-soft); }

/* ---------- 4. Buttons ------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: var(--step--1);
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.button--primary { background: var(--accent); color: #fff; }
.button--primary:hover { background: var(--accent-ink); color: #fff; }
.button--ghost { border-color: var(--line); color: var(--ink); background: #fff; }
.button--ghost:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- 5. Site header / navigation ------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}
.site-header__logo { display: inline-flex; flex: none; }
.site-header__logo img { width: clamp(118px, 12vw, 150px); }

.nav-toggle {
  --bar: #1b1b1b;
  display: none;
  position: relative;
  width: 44px; height: 44px;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  position: absolute;
  left: 50%; top: 50%;
  width: 20px; height: 2px;
  background: var(--bar);
  transform: translate(-50%, -50%);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle__bar::before { content: ""; transform: translate(-50%, -8px); }
.nav-toggle__bar::after  { content: ""; transform: translate(-50%,  6px); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translate(-50%, -50%) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after  { transform: translate(-50%, -50%) rotate(-45deg); }

.primary-nav__list {
  list-style: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: clamp(.75rem, .2rem + 1.6vw, 1.75rem);
}
.primary-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: var(--step--1);
  font-weight: 500;
  padding: .4rem 0;
  position: relative;
  white-space: nowrap;
}
.primary-nav a:hover { color: var(--accent-ink); }
.primary-nav a[aria-current="page"] { color: var(--accent-ink); }
.primary-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.primary-nav__cta {
  background: var(--accent);
  color: #fff !important;
  padding: .55rem 1.15rem !important;
  border-radius: 999px;
}
.primary-nav__cta:hover { background: var(--accent-ink); }
.primary-nav__cta[aria-current="page"]::after { display: none; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
  }
  .primary-nav.is-open { display: block; }
  .primary-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .5rem var(--gutter) 1.25rem;
  }
  .primary-nav li { border-top: 1px solid var(--line); }
  .primary-nav li:first-child { border-top: 0; }
  .primary-nav a { display: block; padding: .9rem .25rem; font-size: var(--step-0); }
  .primary-nav a[aria-current="page"]::after { display: none; }
  .primary-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); padding-left: .75rem; }
  .primary-nav__cta {
    display: inline-block;
    margin-top: 1rem;
    text-align: center;
  }
}

/* ---------- 6. Hero (landing) --------------------------------------- */
.hero {
  padding-block: clamp(2.25rem, 1.4rem + 4vw, 4.5rem);
  text-align: center;
}
.hero__media {
  max-width: 860px;
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--bg-soft);
}
.hero__media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.hero__body { max-width: 46ch; margin: clamp(1.5rem, 1rem + 2vw, 2.5rem) auto 0; }
.hero__title { font-size: var(--step-3); }
.hero__tagline { margin-top: .85rem; color: var(--ink-soft); font-size: var(--step-1); }
.hero__text { margin-top: 1rem; color: var(--ink-soft); }
.hero__actions {
  margin-top: 1.75rem;
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- 7. Feature rows (inline images, alternating) ----------- */
.feature-row {
  display: grid;
  gap: clamp(1.5rem, 1rem + 3vw, 3.5rem);
  align-items: center;
}
.feature-row + .feature-row { margin-top: clamp(2.5rem, 1.8rem + 3vw, 4.5rem); }
.feature-row__media {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
}
.feature-row__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.feature-row__title { font-size: var(--step-1); }
.feature-row__text { margin-top: .75rem; color: var(--ink-soft); }
.feature-row__text > * + * { margin-top: .75rem; }

@media (min-width: 780px) {
  .feature-row { grid-template-columns: 1fr 1fr; }
  .feature-row:nth-child(even) .feature-row__media { order: 2; }
}

/* ---------- 8. Card grid (Monthly Challenges archive) ------------- */
.card-grid {
  display: grid;
  gap: clamp(1.25rem, .9rem + 1.5vw, 2rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.challenge-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.challenge-card__media { background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.challenge-card__media img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.challenge-card__body { padding: 1.1rem 1.15rem 1.3rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.challenge-card__date {
  font-size: var(--step--1);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-ink);
  font-weight: 600;
}
.challenge-card__title { font-size: var(--step-1); }
.challenge-card__text { color: var(--ink-soft); font-size: var(--step--1); }
.challenge-card__links {
  margin-top: auto;
  padding-top: .75rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: var(--step--1);
  font-weight: 600;
}

/* Solution disclosure */
.solution {
  margin-top: .6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  font-size: var(--step--1);
}
.solution > summary {
  cursor: pointer;
  padding: .6rem .8rem;
  font-weight: 600;
  color: var(--accent-ink);
  list-style: none;
}
.solution > summary::-webkit-details-marker { display: none; }
.solution > summary::before { content: "► "; font-size: .8em; }
.solution[open] > summary::before { content: "▼ "; }
.solution__inner { padding: 0 .8rem .8rem; color: var(--ink-soft); }

/* ---------- 9. Testimonials -------------------------------------- */
.testimonial-grid {
  display: grid;
  gap: clamp(1.25rem, .9rem + 1.5vw, 2rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.testimonial {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 1.4rem 1.5rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.testimonial__quote { font-size: var(--step-0); }
.testimonial__quote p + p { margin-top: .6rem; }
.testimonial__cite {
  font-style: normal;
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.testimonial__cite strong { color: var(--ink); display: block; font-weight: 600; }
.testimonial--feature {
  grid-column: 1 / -1;
  border-left-width: 4px;
  background: var(--bg-soft);
}
.testimonial--feature .testimonial__quote { font-size: var(--step-1); }

/* ---------- 10. Media / press list ---------------------------- */
.media-list { list-style: none; padding: 0; display: grid; gap: 1rem; }
.media-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  display: grid;
  gap: .3rem;
}
.media-item__meta {
  font-size: var(--step--1);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
}
.media-item__title { font-size: var(--step-0); font-weight: 700; }
.media-item__title a { text-decoration: none; }
.media-item__title a:hover { text-decoration: underline; }
.media-item__note { font-size: var(--step--1); color: var(--ink-soft); }

/* ---------- 11. Page header (interior pages) ----------------- */
.page-header {
  padding-block: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
  border-bottom: 1px solid var(--line);
}
.page-header__eyebrow {
  font-size: var(--step--1);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-ink);
  font-weight: 600;
}
.page-header__title { font-size: var(--step-3); margin-top: .4rem; }
.page-header__lede { margin-top: .9rem; color: var(--ink-soft); max-width: 60ch; font-size: var(--step-1); }

/* ---------- 12. Steps list (How to Play) -------------------- */
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 1.25rem; }
.steps > li {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 1rem;
  align-items: start;
}
.steps > li::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: var(--step--1);
}
.steps h3 { font-size: var(--step-0); }
.steps p { color: var(--ink-soft); margin-top: .25rem; }

/* ---------- 13. Callout ------------------------------------- */
.callout {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  text-align: center;
}
.callout h2 { font-size: var(--step-2); }
.callout p { color: var(--ink-soft); margin-top: .6rem; max-width: 50ch; margin-inline: auto; }
.callout .hero__actions { margin-top: 1.5rem; }

/* ---------- 14. Footer ------------------------------------- */
.site-footer {
  margin-top: auto;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  padding-block: clamp(2rem, 1.5rem + 2vw, 3rem);
  font-size: var(--step--1);
}
.site-footer__inner {
  display: grid;
  gap: 1.25rem;
  justify-items: center;
  text-align: center;
}
.site-footer__logo img { width: 120px; opacity: .9; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; justify-content: center; }
.site-footer__nav a { color: var(--ink-soft); text-decoration: none; }
.site-footer__nav a:hover { color: var(--accent-ink); text-decoration: underline; }
.site-footer__social { list-style: none; padding: 0; display: flex; gap: 1.25rem; }
.site-footer__social a { color: var(--ink-soft); text-decoration: none; }
.site-footer__social a:hover { color: var(--accent-ink); }
.site-footer__legal { color: var(--ink-soft); }

/* ---------- 15. Print (challenge sheets) ------------------ */
@media print {
  .site-header, .site-footer, .hero__actions, .nav-toggle { display: none !important; }
  body { color: #000; }
  a { color: #000; text-decoration: underline; }
  .challenge-card, .testimonial, .media-item { break-inside: avoid; border-color: #999; }
}
