/* ===========================================================
   GEORGE'S WEBSITE — Garibaldi Grid design system
   Page styles for the main pages. Design tokens, the header/nav and
   the footer live in shell.css, which every page (quiz games included)
   loads first. Organised in the order below:

   1. Fonts & reset
   2. Design tokens (in shell.css)
   3. Base typography
   4. Layout helpers
   5. Header & navigation (in shell.css)
   6. Buttons
   7. Hero (home) + page banners
   8. Cards
   9. Section blocks (stats, quick-fire, gallery, footer)
   10. Footer (in shell.css)
   11. Motion
   12. Accessibility & responsive
   =========================================================== */

/* 1. Fonts & reset --------------------------------------------------
   Fonts are NOT loaded here with @import — that forces the browser to
   download this file, parse it, discover the @import, and only then
   start the font request: one extra network round-trip before a single
   font byte arrives. Each HTML page instead loads the font stylesheet
   with its own <link rel="stylesheet">, right after the <link
   rel="preconnect"> hints, so the connection and the request start
   together as soon as the page is parsed. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body { margin: 0; }
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; color: inherit; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }


/* 3. Base typography -------------------------------------------------- */
body{
  background: var(--ink);
  color: var(--chalk);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; color: var(--chalk); text-wrap: balance; margin: 0 0 var(--s3); }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.05; }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.55rem); line-height: 1.2; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 var(--s4); max-width: 62ch; color: var(--chalk-dim); }
.lede { font-size: 1.1rem; color: var(--chalk); }
.eyebrow{
  font-family: var(--font-display); font-weight: 600; font-size: 0.8rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-text);
  margin: 0 0 var(--s2);
}
code, .mono-num { font-variant-numeric: tabular-nums; font-family: var(--font-display); letter-spacing: 0.02em; }

/* 4. Layout helpers -------------------------------------------------- */
.wrap { max-width: 1080px; margin: 0 auto; padding-inline: var(--s4); }
main { display: block; }
section { padding-block: var(--s7); }
section + section { border-top: 1px solid var(--line); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s5); }
@media (max-width: 800px){
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}


/* 6. Buttons ------------------------------------------------------------ */
.btn{
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.03em; text-transform: uppercase;
  border-radius: var(--r-pill); padding: 14px 28px; border: none; cursor: pointer; min-height: 44px;
  display: inline-flex; align-items: center; gap: 8px; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--chalk); outline-offset: 3px; }
/* Text-on-fill contrast varies by colour, so background + text come from
   the paired --btn-bg/--on-accent tokens (set per page above), never
   --accent + a hardcoded chalk — that combination is what produced an
   unreadable 1.5:1 button on the gold-accented School page. */
.btn-primary{ background: var(--btn-bg); color: var(--on-accent); box-shadow: var(--glow-accent); }
.btn-primary:hover, .btn-primary:focus-visible { filter: brightness(1.08); }
.btn-secondary{ background: transparent; color: var(--accent-text); border: 2px solid var(--accent); padding: 12px 26px; }
.btn-secondary:hover, .btn-secondary:focus-visible { box-shadow: var(--glow-accent); }
.btn-ghost{ background: var(--surface-raised); color: var(--chalk); border: 1px solid var(--line-strong); }
.btn-ghost:hover, .btn-ghost:focus-visible { border-color: var(--gold); color: var(--gold); }
.btn-row { display: flex; gap: var(--s4); flex-wrap: wrap; }

/* 7. Hero (home) + page banners ------------------------------------------ */
.hero{
  background:
    radial-gradient(120% 140% at 15% 0%, rgba(225,16,44,0.16), transparent 55%),
    radial-gradient(100% 120% at 100% 10%, rgba(157,92,255,0.12), transparent 55%),
    var(--surface);
  border-bottom: 1px solid var(--line-strong);
  padding-block: var(--s8) var(--s7);
}
.hero-wordmark{
  font-family: var(--font-display); font-weight: 700; font-size: clamp(2.6rem, 9vw, 5.5rem);
  line-height: 0.95; letter-spacing: -0.01em; color: var(--chalk);
  text-shadow: 0 0 40px rgba(225,16,44,0.45); animation: pulseGlow 3.4s ease-in-out infinite;
}
.hero-wordmark span { color: var(--garibaldi); }
@keyframes pulseGlow{
  0%,100% { text-shadow: 0 0 40px rgba(225,16,44,0.45); }
  50% { text-shadow: 0 0 58px rgba(225,16,44,0.75), 0 0 20px rgba(157,92,255,0.25); }
}
.hero-tag{ color: var(--chalk-dim); font-size: 1.1rem; max-width: 46ch; }

.hero-inner{ display: flex; align-items: center; justify-content: space-between; gap: var(--s7); flex-wrap: wrap; }
.hero-copy{ flex: 1 1 380px; }
.hero-photo{ flex: 0 1 260px; max-width: 260px; }
.hero-photo img{
  width: 100%; height: auto; display: block; border-radius: var(--r-lg);
  border: 1px solid var(--line-strong); box-shadow: var(--glow-garibaldi);
}
.hero-photo figcaption{ font-size: 0.8rem; color: var(--chalk-faint); margin-top: var(--s2); text-align: center; }

/* A real photo used as a feature (not squeezed into a small card slot). */
.feature-photo{ max-width: 300px; }
.feature-photo img{
  width: 100%; height: auto; display: block; border-radius: var(--r-lg);
  border: 1px solid var(--line-strong); box-shadow: var(--glow-accent);
}
.feature-photo figcaption{ font-size: 0.85rem; color: var(--chalk-dim); margin-top: var(--s3); }
.feature-row{ display: flex; gap: var(--s6); align-items: center; flex-wrap: wrap; }
.feature-row .feature-text{ flex: 1 1 320px; }

.page-banner{
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
  padding-block: var(--s7) var(--s6);
  position: relative;
  overflow: hidden;
}
.page-banner::before{
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(120% 160% at 10% 0%, var(--accent-ink), transparent 60%);
  opacity: 0.6;
  pointer-events: none;
}
.page-banner .wrap { position: relative; }
.page-banner h1 { font-size: clamp(1.9rem, 5vw, 2.75rem); }

/* 8. Cards ----------------------------------------------------------------
   Deliberately NOT a coloured top-border rail on every card — that reads
   as a template default. At rest, a card is quiet (neutral border, no
   accent). The accent only shows up in the tag chip, and the border
   only picks up the accent colour and glow when a visitor is actually
   interacting with the card (hover / keyboard focus). */
.card{
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover, .card:focus-within { transform: translateY(-4px); }
.card.football:hover, .card.football:focus-within { border-color: var(--garibaldi); box-shadow: var(--glow-garibaldi); }
.card.gaming:hover, .card.gaming:focus-within { border-color: var(--volt); box-shadow: var(--glow-volt); }
.card.school:hover, .card.school:focus-within { border-color: var(--gold); box-shadow: var(--glow-gold); }
.card.quiz:hover, .card.quiz:focus-within { border-color: var(--volt); box-shadow: var(--glow-volt), 0 0 40px rgba(245,185,66,0.18); }

/* A considered empty state, not a wireframe box: soft gradient, a quiet
   icon, small-caps label underneath — reads as "photo coming soon"
   rather than "unfinished placeholder". */
.photo-slot{
  height: 130px; border-radius: var(--r-sm);
  background: radial-gradient(120% 140% at 30% 15%, rgba(241,237,233,0.05), transparent 65%), var(--surface-raised);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--chalk-dim); font-size: 0.72rem; font-family: var(--font-body); letter-spacing: 0.02em;
  border: 1px solid var(--line); text-align: center; padding: var(--s3);
}
.photo-slot svg{ width: 22px; height: 22px; opacity: 0.55; }
.card.football .photo-slot svg{ color: var(--garibaldi); }
.card.gaming .photo-slot svg{ color: var(--volt); }

/* Real logo/cover-art image, same footprint as .photo-slot above so a
   card looks the same whether it has a real image yet or not. contain
   (not cover) so a square logo or a portrait cover never gets cropped. */
.card-photo{
  height: 130px; border-radius: var(--r-sm); overflow: hidden;
  background: var(--surface-raised); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.card-photo img{ max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.card.school .photo-slot svg{ color: var(--gold); }

.card h3 { font-size: 1.1rem; margin-bottom: 0; }
.card p { margin: 0; color: var(--chalk-dim); font-size: 0.92rem; }
.tag{
  align-self: flex-start; font-family: var(--font-display); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.02em; padding: 4px 10px; border-radius: var(--r-pill);
}
.card.football .tag { background: var(--garibaldi-ink); color: var(--garibaldi-text); }
.card.gaming .tag { background: var(--volt-ink); color: var(--volt-text); }
.card.school .tag { background: var(--gold-ink); color: var(--gold); }

/* Card CTA affordance: an arrow that nudges right on hover. Used on the
   three Home tiles so they read as "go here", not just decorative panels. */
.card-arrow{
  margin-top: auto; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.9rem;
}
.card-arrow svg{ width: 16px; height: 16px; transition: transform 0.2s ease; }
.card:hover .card-arrow svg, .card:focus-within .card-arrow svg{ transform: translateX(4px); }
.card.football .card-arrow{ color: var(--garibaldi-text); }
.card.gaming .card-arrow{ color: var(--volt-text); }
.card.school .card-arrow{ color: var(--gold); }
.card.quiz .card-arrow{ color: var(--volt-text); }

/* 9. Section blocks: stats, live badge, quick-fire, gallery -------------- */
.section-head { margin-bottom: var(--s5); }
.section-head p { margin-top: var(--s2); }

.stat-strip { display: flex; gap: var(--s6); flex-wrap: wrap; }
.stat .num { font-family: var(--font-display); font-weight: 700; font-size: 2.4rem; }
.stat.red .num { color: var(--garibaldi-text); }
.stat.violet .num { color: var(--volt-text); }
.stat.gold .num { color: var(--gold); }
.stat .cap { color: var(--chalk-dim); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; }

.live-badge{
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700;
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--volt-text);
  background: var(--volt-ink); border-radius: var(--r-pill); padding: 8px 16px;
}
.live-dot{ width: 8px; height: 8px; border-radius: 50%; background: var(--volt); animation: livePulse 1.8s ease-in-out infinite; }
@keyframes livePulse{ 0%,100% { box-shadow: 0 0 0 0 rgba(157,92,255,0.6); } 50% { box-shadow: 0 0 0 8px rgba(157,92,255,0); } }

.fact-list{ display: flex; flex-direction: column; gap: var(--s3); }
.fact-list li{
  position: relative; padding-left: var(--s5); color: var(--chalk);
}
.fact-list li::before{
  content: ''; position: absolute; left: 0; top: 0.55em; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent);
}

.qf-list { display: flex; flex-direction: column; gap: var(--s3); }
.qf-item { display: flex; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.qf-item dt { font-family: var(--font-display); font-weight: 600; color: var(--chalk); min-width: 220px; }
.qf-item dd { margin: 0; color: var(--chalk-dim); }

.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
@media (max-width: 700px){ .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
.gallery-item { aspect-ratio: 4/3; border-radius: var(--r-md); overflow: hidden; }
.gallery-item .photo-slot { height: 100%; border-radius: var(--r-md); }
.gallery-item figcaption{ font-size: 0.8rem; color: var(--chalk-faint); margin-top: var(--s2); text-align: center; }

.faq-list { display: flex; flex-direction: column; gap: var(--s3); }
.faq-item { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.faq-item summary{
  cursor: pointer; padding: var(--s4); font-family: var(--font-display); font-weight: 600;
  list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 44px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--accent-text); font-size: 1.4rem; }
.faq-item[open] summary::after { content: '\2212'; }
.faq-item p { padding: 0 var(--s4) var(--s4); margin: 0; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
th { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.02em; font-size: 0.85rem; color: var(--chalk-dim); }
td { color: var(--chalk-dim); }
td.mono-num { color: var(--chalk); }

.contact-card{
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: var(--s5);
}

/* A personal aside (a fact, a prediction, a goal) is not the same thing
   as an info panel (club stats, an email link) — giving it its own
   quieter, left-accented treatment instead of the same bordered box
   stops every block on the page from reading as one repeated component. */
.note-block{
  position: relative; padding: var(--s4) var(--s5); padding-left: calc(var(--s5) + var(--s2));
  border-left: 3px solid var(--accent);
}
.note-block p{ margin: 0; color: var(--chalk); font-size: 1.05rem; }
.note-block .note-label{
  display: block; font-family: var(--font-display); font-weight: 600; font-size: 0.78rem;
  letter-spacing: 0.04em; color: var(--accent-text); margin-bottom: 6px;
}


/* 11. Motion --------------------------------------------------------------
   Content is visible by default — the fade-in is a bonus for viewers who
   have JS and no reduced-motion preference, never a requirement for
   seeing the page. If JS fails to load, is blocked, or hasn't run yet,
   .reveal elements are just... visible. The <html class="js"> hook is
   set by a one-line inline script in each page's <head>. */
.reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference){
  html.js .reveal{ opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
  html.js .reveal.is-visible{ opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce){
  .hero-wordmark, .live-dot { animation: none; }
  .card { transition: none; }
}

/* 12. Accessibility & responsive helpers ----------------------------------- */

@media (max-width: 700px){
  section { padding-block: var(--s6); }
  .stat-strip { gap: var(--s5); }
}


/* 13. Additions: rotating facts, next match, prediction tracker,
   progress bar ------------------------------------------------------------ */

/* Home: a small text button under the rotating "Did you know?" fact. */
.link-btn{
  background: none; border: none; padding: 0; margin-top: var(--s3); cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; letter-spacing: 0.03em;
  color: var(--accent-text); min-height: 44px; display: inline-flex; align-items: center; gap: 6px;
}
.link-btn:hover { color: var(--chalk); }

/* Football: next match */
.match-card{
  display: grid; grid-template-columns: 1fr auto; gap: var(--s5); align-items: center;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: var(--s5);
}
@media (max-width: 640px){ .match-card { grid-template-columns: 1fr; } }
.match-teams{ font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 4vw, 1.9rem); line-height: 1.15; margin: 0; color: var(--chalk); }
.match-meta{ margin: var(--s2) 0 0; color: var(--chalk-dim); font-size: 0.95rem; }
.countdown{
  font-family: var(--font-display); font-weight: 700; text-align: center; line-height: 1;
  background: var(--garibaldi-ink); color: var(--garibaldi-text); border-radius: var(--r-md); padding: var(--s4) var(--s5);
}
.countdown .big{ display: block; font-size: 2.4rem; color: var(--chalk); }
.countdown .small{ font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.prediction-line{ grid-column: 1 / -1; max-width: none; border-top: 1px solid var(--line); padding-top: var(--s4); margin: 0; color: var(--chalk); }
.prediction-line strong{ font-family: var(--font-display); font-size: 1.2rem; color: var(--garibaldi-text); }

.predict-form{ grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; }
.predict-form label{ display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--chalk-dim); font-family: var(--font-display); font-weight: 600; letter-spacing: 0.03em; }
.predict-form input, .predict-form select{
  background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  color: var(--chalk); padding: 10px 12px; min-height: 44px; font-size: 1rem;
}
.predict-form input[type=number]{ width: 5.5rem; }
.predict-form input[type=password]{ width: 9rem; }
.predict-form .remember{ flex-direction: row; align-items: center; gap: 8px; min-height: 44px; }
.predict-form .remember input{ min-height: auto; width: 20px; height: 20px; }
.form-status{ grid-column: 1 / -1; max-width: none; margin: 0; font-size: 0.9rem; min-height: 1.4em; }
.form-status.ok{ color: #6ee7a8; }
.form-status.err{ color: var(--garibaldi-text); }
details.predict-toggle{ grid-column: 1 / -1; }
details.predict-toggle summary{
  cursor: pointer; font-family: var(--font-display); font-weight: 600; color: var(--garibaldi-text);
  min-height: 44px; display: inline-flex; align-items: center; list-style: none;
}
details.predict-toggle summary::-webkit-details-marker{ display: none; }
details.predict-toggle[open] summary{ margin-bottom: var(--s3); }

.tracker-summary{ margin-bottom: var(--s5); }
.pts-3{ color: #6ee7a8; font-weight: 700; }
.pts-1{ color: var(--gold); font-weight: 700; }
.pts-0{ color: var(--chalk-dim); }

/* School: bronze / silver / gold progress */
.medal-track{ display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin-top: var(--s4); max-width: 520px; }
.medal-step{
  border-radius: var(--r-md); padding: var(--s3); text-align: center; border: 1px solid var(--line);
  background: var(--surface); color: var(--chalk-dim); font-family: var(--font-display); font-weight: 600;
}
.medal-step .medal{ font-size: 1.6rem; display: block; line-height: 1.2; filter: grayscale(1) opacity(0.45); }
.medal-step.done{ border-color: rgba(245,185,66,0.5); color: var(--chalk); background: var(--gold-ink); }
.medal-step.done .medal{ filter: none; }
.medal-step.next{ border-style: dashed; border-color: var(--gold); color: var(--gold); }
.medal-bar{ height: 8px; border-radius: var(--r-pill); background: var(--surface-raised); margin-top: var(--s3); max-width: 520px; overflow: hidden; }
.medal-bar span{ display: block; height: 100%; background: linear-gradient(90deg, #cd7f32, #c0c0c0, var(--gold)); border-radius: inherit; }
