/* Louise Cup landing — palette and type from the mockup's 視覺風格 / 字體風格 panel:
   navy · cobalt · sky · lemon · lime · cream; Fraunces (soft) / Noto Serif TC for
   headings, Inter / Noto Sans TC for text, Caveat for the handwritten notes. */
:root {
  --navy: #0e2a54;
  --cobalt: #2f6fb8;
  --cobalt-deep: #1f5aa0;
  --sky: #cfe3f6;
  --sky-soft: #e6f0fa;
  --lemon: #f4e45a;
  --lime: #a8cc52;
  --cream: #f8f3e8;
  --paper: #fffdf8;
  --ink: #0e2a54;
  --muted: #5b6b84;
  --line: rgb(14 42 84 / 0.1);
  --live: #e5483b;

  /* Latin headings: Fraunces at its softest (rounded terminals, no hairline
     edges) instead of the mockup's Playfair; CJK falls through to Noto Serif TC. */
  --font-serif: 'Fraunces', 'Noto Serif TC', serif;
  --font-sans: 'Inter', 'Noto Sans TC', system-ui, -apple-system, sans-serif;
  --font-script: 'Caveat', 'Noto Sans TC', cursive;

  --radius: 18px;
  --shadow: 0 1px 2px rgb(14 42 84 / 0.06), 0 8px 24px rgb(14 42 84 / 0.07);
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 48px);
  --head-h: 92px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--cream);
  color: var(--ink);
  font: 400 16px/1.6 var(--font-sans);
  font-variation-settings: 'SOFT' 100, 'WONK' 0; /* Fraunces only; other fonts ignore it */
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
/* Build-generated <picture> wrappers (build/images.mjs) must not affect layout. */
picture { display: contents; }
/* …and its <source> tags must not become flex/grid items (each would take a gap). */
picture > source { display: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
:focus-visible { outline: 3px solid var(--lemon); outline-offset: 3px; border-radius: 6px; }

.script { font-family: var(--font-script); font-weight: 700; }
.serif { font-family: var(--font-serif); font-weight: 900; letter-spacing: 0.02em; }
/* English runs entirely in Fraunces — lighter weights read softer than CJK's 900. */
html[lang="en"] .serif, html[lang="en"] .event-body h3 { font-weight: 700; letter-spacing: 0; }
html[lang="en"] .hero-lead { font-weight: 500; letter-spacing: 0; }

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 26px; border-radius: 999px;
  font-weight: 700; font-size: 15px; letter-spacing: 0.04em; white-space: nowrap;
  border: 1.5px solid transparent;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { min-height: 40px; padding: 0 20px; font-size: 14px; }
.btn-primary { background: var(--cobalt); color: #fff; box-shadow: 0 6px 16px rgb(47 111 184 / 0.28); }
.btn-primary:hover { background: var(--cobalt-deep); }
.btn-ghost { border-color: var(--cobalt); color: var(--cobalt); background: rgb(255 255 255 / 0.6); }
.btn-ghost:hover { background: #fff; }
.btn-lemon { background: var(--lemon); color: var(--navy); }
.btn-ghost-light { border-color: rgb(255 255 255 / 0.55); color: #fff; }
.btn-ghost-light:hover { background: rgb(255 255 255 / 0.1); }

/* ─── Header ──────────────────────────────────────────────────────────── */
.site-head {
  position: relative; z-index: 20;
  max-width: var(--wrap); margin: 0 auto; height: var(--head-h);
  padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 24px;
}
.brand { display: block; flex: none; }
/* The logo artwork (content/images.json `louise-cup-logo`) — square, so size by height. */
.brand-logo { width: auto; height: 86px; filter: drop-shadow(0 2px 6px rgb(14 42 84 / .12)); }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 34px; font-weight: 500; font-size: 15px; }
.site-nav a:not(.btn) { position: relative; padding: 6px 0; color: var(--navy); opacity: .82; }
.site-nav a:not(.btn):hover, .site-nav a.is-active { opacity: 1; }
.site-nav a.is-active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--cobalt);
}
.nav-join { margin-left: 12px; }
.lang-toggle {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 40px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid rgb(14 42 84 / .18); background: rgb(255 255 255 / .6); color: var(--navy);
  font: 600 13.5px/1 var(--font-sans); letter-spacing: .04em;
  transition: background-color .15s ease, border-color .15s ease;
}
.lang-toggle:hover { background: #fff; border-color: rgb(14 42 84 / .35); }
.lang-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.menu-toggle {
  display: none; margin-left: auto; width: 44px; height: 44px; border: 0; border-radius: 12px;
  background: transparent; color: var(--navy); cursor: pointer;
}
.menu-toggle svg { width: 26px; height: 26px; margin: auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ─── Hero ────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  max-width: var(--wrap); margin: 0 auto;
  min-height: clamp(520px, 50vw, 640px);
  padding: 40px var(--gutter) 64px;
  display: flex; align-items: center;
}
.hero-copy { position: relative; z-index: 2; width: min(560px, 47%); }
.hero-title {
  font-size: clamp(52px, 5.9vw, 84px); line-height: .95; color: var(--navy); white-space: nowrap;
  transform: rotate(-4deg); transform-origin: left bottom; margin-bottom: 28px;
}
.hero-lead { max-width: 25em; font: 700 clamp(17px, 1.7vw, 21px)/1.5 var(--font-serif); letter-spacing: .04em; margin-bottom: 14px; }
.hero-intro { color: var(--muted); font-size: 15px; margin-bottom: 30px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-photo {
  position: absolute; z-index: 1; top: 0; right: 0; bottom: 24px;
  width: 60%;
  /* Organic left + bottom edge, stretched to the box. */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M15 0H100V93C92 99 80 97 68 98C52 99 40 100 30 97C17 93 22 80 16 68C8 52 1 38 7 20C10 9 11 2 15 0Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M15 0H100V93C92 99 80 97 68 98C52 99 40 100 30 97C17 93 22 80 16 68C8 52 1 38 7 20C10 9 11 2 15 0Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  border-top-right-radius: 28px;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%; }
.hero-note {
  position: absolute; top: 9%; right: 5%; color: #fff; font-size: clamp(22px, 2.2vw, 30px); line-height: 1;
  transform: rotate(-8deg); text-align: left; text-shadow: 0 2px 10px rgb(14 42 84 / .35);
}

.deco { position: absolute; pointer-events: none; }
.sparkle { fill: var(--lemon); }
.sparkle.s1 { width: 30px; top: -18px; left: 52%; }
.sparkle.s2 { width: 22px; fill: var(--navy); top: 44%; right: -4%; }
.swoosh-top { width: 92px; top: -52px; left: -46px; fill: none; stroke: var(--lemon); stroke-width: 5; stroke-linecap: round; }
.swoosh-bottom {
  z-index: 3; width: 300px; bottom: 6px; left: 47%;
  fill: none; stroke: var(--lemon); stroke-width: 6; stroke-linecap: round;
}

/* ─── Sections ────────────────────────────────────────────────────────── */
.section { max-width: var(--wrap); margin: 0 auto; padding: 48px var(--gutter); }
.section-head, .gallery-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head h2 { display: flex; align-items: center; gap: 14px; white-space: nowrap; font-size: clamp(24px, 2.6vw, 32px); }
.title-star { width: 28px; fill: none; stroke: #e9c94a; stroke-width: 1.8; stroke-linejoin: round; transform: rotate(-12deg); }
.more { font-size: 14px; font-weight: 600; color: var(--navy); opacity: .8; white-space: nowrap; }
.more:hover { opacity: 1; }

/* Event cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.event { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.event:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgb(14 42 84 / .06), 0 16px 32px rgb(14 42 84 / .1); }
.event-link { display: block; height: 100%; }
.event-media { position: relative; aspect-ratio: 16 / 8; overflow: hidden; }
.event-media img { width: 100%; height: 100%; object-fit: cover; }
.event.is-past .event-media img { filter: saturate(.75); }
.date {
  position: absolute; top: 0; left: 0; min-width: 74px; padding: 10px 14px 12px;
  background: var(--paper); border-bottom-right-radius: 16px; text-align: center; line-height: 1;
}
.date span { display: block; font: 700 11px/1 var(--font-sans); letter-spacing: .12em; color: var(--navy); margin-bottom: 6px; }
.date b { font: 700 28px/1 var(--font-serif); color: var(--navy); }
.badge {
  position: absolute; top: 14px; right: 14px; padding: 6px 14px; border-radius: 999px;
  background: var(--lemon); color: var(--navy); font-size: 13px; font-weight: 700; letter-spacing: .06em;
}
.badge-soft { background: rgb(255 255 255 / .92); }
.badge-live { background: var(--live); color: #fff; }
.badge-live::before { content: '●'; margin-right: 6px; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.event-body { position: relative; padding: 18px 20px 20px; }
.event-body h3 { font: 900 18px/1.4 var(--font-serif); padding-right: 44px; margin-bottom: 6px; }
.event-body .sep { color: var(--cobalt); margin: 0 4px; font-weight: 400; }
.where { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.where svg { width: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: 4px 12px; border-radius: 999px; background: #eef2f7; font-size: 12.5px; color: #3c4d68; }
.go {
  position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; border: 1.5px solid #b7c6da; color: var(--navy); font-size: 15px;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.event:hover .go { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }

/* ─── Event detail panel ─────────────────────────────────────────────────
   Desktop: expands below the cards (grid-rows 0fr → 1fr), notch under the
   open card. ≤ 860px: the same element becomes a sheet from the right. */
.event.is-selected { box-shadow: 0 0 0 2px var(--cobalt), var(--shadow); }
.event.is-selected .go { background: var(--cobalt); border-color: var(--cobalt); color: #fff; transform: rotate(90deg); }
.go { transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .25s ease; }

.event-panel {
  --notch-x: 50%;
  position: relative; display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .38s cubic-bezier(.2, .8, .2, 1), margin-top .38s ease;
}
.event-panel.is-open { grid-template-rows: 1fr; margin-top: 22px; }
.panel-clip { overflow: hidden; min-height: 0; }
.event-panel.is-open::before {
  content: ''; position: absolute; top: -9px; left: calc(var(--notch-x) - 10px); width: 20px; height: 20px;
  background: var(--paper); transform: rotate(45deg); border-radius: 4px 0 0 0;
  box-shadow: -2px -2px 4px rgb(14 42 84 / .05); z-index: 1;
  transition: left .3s ease;
}
.panel-inner {
  position: relative; background: var(--paper); border-radius: 24px; box-shadow: var(--shadow);
  padding: 28px 32px 32px; outline: none;
}
.panel-bar { position: absolute; top: 18px; right: 18px; z-index: 2; display: flex; }
.panel-close, .panel-back {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; min-width: 40px; justify-content: center;
  border: 0; border-radius: 999px; background: #eef2f7; color: var(--navy); cursor: pointer; font: 600 14px var(--font-sans);
}
.panel-close:hover, .panel-back:hover { background: #e2e8f1; }
.panel-back { display: none; } /* phone/tablet sheet only */
.panel-bar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 40px; }
.detail[hidden] { display: none; }
.detail-head { display: contents; }
.detail-banner { position: relative; grid-column: 1; grid-row: 1 / span 2; border-radius: 18px; overflow: hidden; aspect-ratio: 16 / 9; align-self: start; }
.detail-banner img { width: 100%; height: 100%; object-fit: cover; }
.detail-intro { grid-column: 2; grid-row: 1; padding-right: 48px; }
.detail-kicker { font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--cobalt); margin-bottom: 6px; }
.detail-intro h3 { font-size: clamp(22px, 2.2vw, 28px); line-height: 1.3; margin-bottom: 14px; }
.detail-intro h3 .sep { color: var(--cobalt); margin: 0 6px; font-weight: 400; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.facts li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--sky-soft); font-size: 13.5px; font-weight: 500; }
.facts svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--cobalt); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.detail-desc { color: var(--muted); font-size: 15px; margin-bottom: 18px; }
.detail-ctas { display: flex; flex-wrap: wrap; gap: 10px; }
.detail-ctas .btn { min-height: 44px; padding: 0 20px; font-size: 14px; }

.detail-block { grid-column: 1 / -1; }
.detail-block.rules { grid-column: 1 / -1; grid-row: auto; }
.block-title { display: flex; align-items: center; gap: 8px; font: 700 18px/1.3 var(--font-serif); margin-bottom: 6px; }
.block-title .spark { color: #e9c94a; font-size: 18px; }
.block-lead { color: var(--muted); font-size: 14.5px; margin-bottom: 16px; }

/* Relay track */
.relay { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; counter-reset: leg; margin-bottom: 8px; }
.relay li {
  position: relative; display: grid; gap: 2px; padding: 14px 16px 16px; border-radius: 14px;
  background: linear-gradient(135deg, var(--cobalt), var(--cobalt-deep)); color: #fff;
}
.relay li:nth-child(2) { background: linear-gradient(135deg, #2a64a8, #18498a); }
.relay li:nth-child(3) { background: linear-gradient(135deg, var(--navy), #08203f); }
.relay li:not(:last-child)::after {
  content: ''; position: absolute; z-index: 1; right: -15px; top: 50%; width: 20px; height: 20px; margin-top: -10px;
  border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f6f48a, #d1d334 70%); box-shadow: 0 2px 6px rgb(0 0 0 / .25);
}
.leg-name { font: 700 18px/1.2 var(--font-serif); }
.leg-games { font-size: 12.5px; opacity: .8; }
.leg-score { font: 700 22px/1.2 var(--font-sans); color: var(--lemon); letter-spacing: .02em; margin-top: 4px; }
.relay-note { font-size: 13.5px; color: var(--muted); margin-bottom: 18px; }

/* Two-phase flow (Cup 2) */
.phases { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 10px; margin-bottom: 18px; }
.phase { display: grid; gap: 4px; align-content: start; padding: 14px 16px; border-radius: 14px; background: var(--sky-soft); }
.phase-tag { justify-self: start; padding: 2px 10px; border-radius: 999px; background: var(--cobalt); color: #fff; font-size: 12px; font-weight: 700; }
.phase b { font: 700 17px/1.3 var(--font-serif); }
.phase span:last-child { font-size: 13.5px; color: var(--muted); }
.phase-arrow { align-self: center; font-size: 22px; color: var(--cobalt); }

/* Numbered rule cards */
.rule-cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.rule-cards li { display: flex; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.rule-n {
  flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
  background: var(--lemon); color: var(--navy); font: 700 14px/1 var(--font-sans);
}
.rule-cards h5 { font-size: 14.5px; line-height: 1.35; margin-bottom: 4px; }
.rule-cards p { font-size: 13px; line-height: 1.5; color: var(--muted); }

/* Ranking chain */
.ranking { padding-top: 4px; }
.chain { list-style: none; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 10px; }
.chain { gap: 8px 26px; }
.chain li { position: relative; padding: 7px 14px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 13.5px; font-weight: 600; }
.chain li:first-child { background: var(--cobalt); }
.chain li:not(:last-child)::after { content: '→'; position: absolute; right: -19px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 400; }
.mvp { font-size: 14px; color: var(--muted); }
.mvp b { color: var(--navy); margin-right: 6px; }

/* Planned-event template */
.past-formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.past-formats a, .tba-slot { display: grid; gap: 4px; padding: 16px; border-radius: 14px; }
.past-formats a { background: var(--sky-soft); transition: background-color .15s ease; }
.past-formats a:hover { background: var(--sky); }
.past-formats b { font: 700 15.5px/1.3 var(--font-serif); }
.past-formats span { font-size: 13px; color: var(--muted); }
.tba-slot { border: 2px dashed rgb(14 42 84 / .2); place-items: center; text-align: center; color: var(--muted); }
.tba-slot b { font: 700 28px/1 var(--font-serif); color: var(--cobalt); }
.panel-scrim { display: none; }

@media (max-width: 1080px) and (min-width: 861px) {
  .rule-cards { grid-template-columns: 1fr 1fr; }
}

/* Docked inside a cards grid (desktop): span the row; the negative margin
   cancels the grid gap while closed so collapsing doesn't leave a hole. */
.cards > .event-panel { grid-column: 1 / -1; margin-top: -24px; }
.cards > .event-panel.is-open { margin-top: -4px; }

/* ─── /events/ page ───────────────────────────────────────────────────── */
.page-hero { max-width: var(--wrap); margin: 0 auto; padding: 24px var(--gutter) 8px; }
.crumbs { display: flex; gap: 8px; font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--cobalt); font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }
.page-hero h1 { display: flex; align-items: center; gap: 14px; font-size: clamp(32px, 4vw, 48px); line-height: 1.15; margin-bottom: 10px; }
.page-hero .title-star { width: 34px; }
.page-lead { color: var(--muted); font-size: 16px; max-width: 36em; }
.events-page { padding-top: 24px; }
.event-group + .event-group { margin-top: 44px; }
.event-group[hidden] { display: none; }
.group-title { display: flex; align-items: baseline; gap: 10px; font-size: clamp(20px, 2vw, 24px); margin-bottom: 18px; }
.group-count {
  display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px;
  background: var(--sky-soft); color: var(--cobalt); font: 700 13px/1 var(--font-sans); transform: translateY(-3px);
}

.legal-hero { max-width: 820px; }
.legal-updated { font-size: 13px; color: var(--muted); margin: -2px 0 14px; }
/* ─── /terms/, /privacy/ ──────────────────────────────────────────────── */
.legal { max-width: 820px; padding-top: 8px; padding-bottom: 72px; display: grid; gap: 14px; }
.legal-section { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 26px; }
.legal-section h2 { font-size: 19px; margin-bottom: 8px; }
.legal-section p { color: #34465f; font-size: 15px; line-height: 1.75; }
.legal-section p + p { margin-top: 8px; }

/* ─── Community ───────────────────────────────────────────────────────── */
.community {
  max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 24px auto 0;
  background: var(--sky-soft); border-radius: 40px 40px 0 0;
}
.community-inner { max-width: var(--wrap); margin: 0 auto; padding: 48px var(--gutter) 56px; }
.community-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 28px; }
.community-head h2 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.45; }
.motto { position: relative; display: flex; align-items: flex-start; gap: 6px; margin-right: 2%; }
.motto-ball { width: 84px; margin-top: 4px; }
.motto p { font-size: 26px; line-height: .98; color: var(--navy); transform: rotate(-10deg); }
.motto-tick { position: absolute; width: 36px; right: 8px; bottom: -22px; fill: none; stroke: var(--navy); stroke-width: 2.5; stroke-linecap: round; }

.features { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 40px; }
.features li { display: flex; align-items: center; gap: 14px; padding: 6px 20px; border-left: 1px solid rgb(14 42 84 / .14); }
.features li:first-child { border-left: 0; padding-left: 0; }
.features svg { width: 38px; flex: none; fill: none; stroke: var(--navy); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.features b { display: block; font-size: 15.5px; margin-bottom: 2px; }
.features span { font-size: 13px; color: var(--muted); }

.gallery-head h3 { font-size: 22px; }
.gallery { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1.25fr; grid-auto-rows: clamp(150px, 16vw, 210px); gap: 14px; }
.gallery figure { position: relative; border-radius: 14px; overflow: hidden; background: var(--sky); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.gallery figure:hover img { transform: scale(1.04); }
.sticker {
  position: absolute; left: 8px; top: 10px; padding: 8px 14px 10px; border-radius: 40% 55% 45% 50%;
  background: #fff; color: var(--navy); font-size: 17px; line-height: .95; transform: rotate(-10deg);
  box-shadow: 0 3px 10px rgb(14 42 84 / .15);
}

/* ─── Join ────────────────────────────────────────────────────────────── */
.join { padding-top: 56px; padding-bottom: 64px; }
.join-card {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.4fr 1fr; align-items: center; gap: 32px;
  padding: clamp(28px, 4vw, 52px); border-radius: 28px;
  background: radial-gradient(120% 140% at 100% 0%, #1d4f8f 0%, var(--navy) 60%);
  color: #fff; scroll-margin-top: 24px;
}
.join-card::after {
  /* A tennis ball (felt shading, two seams, sheen) peeking in from the corner. */
  content: ''; position: absolute; width: 230px; height: 230px; right: -64px; bottom: -84px; border-radius: 50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3CradialGradient id='f' cx='.36' cy='.3' r='.78'%3E%3Cstop offset='0' stop-color='%23f6f78c'/%3E%3Cstop offset='.55' stop-color='%23dfe443'/%3E%3Cstop offset='1' stop-color='%23aab626'/%3E%3C/radialGradient%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.6' numOctaves='2' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 .8 0 0 0 .18 0'/%3E%3CfeComposite in2='SourceGraphic' operator='in'/%3E%3C/filter%3E%3CclipPath id='c'%3E%3Ccircle cx='50' cy='50' r='48'/%3E%3C/clipPath%3E%3C/defs%3E%3Ccircle cx='50' cy='50' r='48' fill='url(%23f)'/%3E%3Ccircle cx='50' cy='50' r='48' fill='%23fff' filter='url(%23n)'/%3E%3Cg clip-path='url(%23c)' fill='none' stroke-linecap='round'%3E%3Cpath d='M14 4C40 26 40 74 14 96' stroke='%23000' stroke-opacity='.12' stroke-width='9'/%3E%3Cpath d='M86 4C60 26 60 74 86 96' stroke='%23000' stroke-opacity='.12' stroke-width='9'/%3E%3Cpath d='M12 4C38 26 38 74 12 96' stroke='%23fbfbef' stroke-width='5.5'/%3E%3Cpath d='M88 4C62 26 62 74 88 96' stroke='%23fbfbef' stroke-width='5.5'/%3E%3C/g%3E%3Cellipse cx='36' cy='28' rx='14' ry='8' fill='%23fff' opacity='.22' transform='rotate(-28 36 28)'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: rotate(-24deg);
  filter: drop-shadow(-10px -6px 22px rgb(0 0 0 / .28));
}
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--lemon); margin-bottom: 10px; }
.join-copy h2 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 14px; }
.join-copy p { color: rgb(255 255 255 / .82); font-size: 15px; max-width: 34em; }
.join-soon { margin-top: 12px; font-size: 14px !important; color: var(--lemon) !important; }
.ig-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; }
.ig-dot { fill: currentColor; stroke: none; }
.join-ctas { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.join-note { position: absolute; z-index: 1; right: 190px; bottom: 22px; font-size: 26px; color: var(--lemon); transform: rotate(-6deg); }

/* ─── Footer ──────────────────────────────────────────────────────────── */
.site-foot { border-top: 1px solid var(--line); }
.foot-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 28px var(--gutter) 36px;
  display: flex; align-items: center; gap: 32px; flex-wrap: wrap; font-size: 13px; color: var(--muted);
}
.foot-logo { width: auto; height: 64px; }
.foot-inner nav { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.foot-inner nav a:hover { color: var(--navy); }
.foot-social { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-weight: 600; color: var(--navy); }
.foot-social .ig-icon { width: 34px; height: 34px; padding: 7px; border-radius: 50%; background: var(--navy); stroke: #fff; transition: background-color .15s ease; }
.foot-social .ig-dot { fill: #fff; stroke: none; }
.foot-social:hover .ig-icon { background: var(--cobalt); }
.foot-inner p { flex-basis: 100%; margin-left: 0; }


/* ─── Tablet & phone (≤ 860px): photo-led hero, menu toggle ──────────── */
@media (max-width: 860px) {
  :root { --head-h: 76px; }
  .brand-logo { height: 66px; }

  .menu-toggle { display: grid; margin-left: 0; }
  .site-head { gap: 10px; }
  .lang-toggle { margin-left: auto; height: 38px; padding: 0 12px; }
  .site-nav {
    position: absolute; top: calc(var(--head-h) - 4px); right: var(--gutter); left: var(--gutter);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 10px; border-radius: 18px; background: var(--paper); box-shadow: 0 16px 40px rgb(14 42 84 / .18);
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .18s ease, transform .18s ease, visibility .18s;
  }
  .site-nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .site-nav a:not(.btn) { padding: 12px 14px; border-radius: 10px; }
  .site-nav a.is-active::after { display: none; }
  .site-nav a.is-active { background: var(--sky-soft); }
  .nav-join { margin: 8px 0 0; }

  /* The photo fills the hero; copy sits on its lower half. */
  .hero { display: grid; min-height: 0; padding: 0 var(--gutter); }
  .hero-photo, .hero-copy { grid-area: 1 / 1; }
  .hero-photo {
    position: relative; inset: auto; width: auto; margin: 0 calc(-1 * var(--gutter));
    aspect-ratio: 5 / 4; border-radius: 0;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 6C18 0 34 4 52 3C70 2 86 0 100 3V90C84 99 66 93 48 96C30 99 14 100 0 96Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 6C18 0 34 4 52 3C70 2 86 0 100 3V90C84 99 66 93 48 96C30 99 14 100 0 96Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  }
  .hero-photo::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgb(14 42 84 / .25) 52%, rgb(14 42 84 / .72) 100%);
  }
  .hero-photo img { object-position: 50% 30%; }
  .hero-note { top: 7%; font-size: 22px; }
  .hero-copy { align-self: end; width: auto; padding: 0 4px 13%; color: #fff; }
  .hero-title { color: #fff; font-size: clamp(50px, 12vw, 84px); margin-bottom: 16px; text-shadow: 0 3px 16px rgb(14 42 84 / .35); }
  .hero-lead { font-size: clamp(16px, 4.2vw, 20px); text-shadow: 0 2px 10px rgb(14 42 84 / .4); max-width: 22em; }
  .hero-intro, .hero .btn-ghost, .swoosh-top, .sparkle.s1 { display: none; }
  .hero-ctas { margin-top: 18px; }
  .btn-primary { box-shadow: 0 8px 20px rgb(14 42 84 / .3); }
  .sparkle.s2 { top: auto; bottom: 2%; right: 2%; width: 30px; fill: var(--lemon); z-index: 3; }
  .swoosh-bottom { width: 180px; left: -40px; bottom: 0; }

  .section { padding-top: 36px; padding-bottom: 36px; }

  /* Cards become a swipeable row. */
  .cards {
    display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 20px; scroll-padding: 0 var(--gutter);
    scrollbar-width: none;
  }
  .cards::-webkit-scrollbar { display: none; }
  .event { flex: 0 0 min(86%, 380px); scroll-snap-align: start; }
  .event:hover { transform: none; }

  .community { border-radius: 32px 32px 0 0; }
  .community-inner { padding-top: 36px; }
  .features { grid-template-columns: 1fr 1fr; gap: 18px 0; }
  .features li:nth-child(odd) { border-left: 0; padding-left: 0; }

  .gallery {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); scroll-padding: 0 var(--gutter);
  }
  .gallery::-webkit-scrollbar { display: none; }
  .gallery { grid-auto-rows: auto; }
  .gallery figure { flex: 0 0 min(46%, 300px); aspect-ratio: 4 / 3; scroll-snap-align: start; }

  /* Event panel → sheet from the right */
  .event-panel, .event-panel.is-open {
    position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; margin: 0;
    width: min(100%, 560px); display: block;
    transform: translateX(100%); visibility: hidden;
    transition: transform .34s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .34s;
  }
  .event-panel.is-open { transform: none; visibility: visible; transition: transform .34s cubic-bezier(.2, .8, .2, 1); }
  .event-panel.is-open::before { display: none; }
  .panel-clip { height: 100%; }
  .panel-inner {
    height: 100%; overflow-y: auto; overscroll-behavior: contain; border-radius: 0;
    padding: 0 var(--gutter) calc(32px + env(safe-area-inset-bottom));
    box-shadow: -12px 0 40px rgb(14 42 84 / .2);
  }
  .panel-bar {
    position: sticky; top: 0; right: auto; justify-content: space-between;
    margin: 0 calc(-1 * var(--gutter)) 12px; padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px;
    background: rgb(255 253 248 / .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .panel-back { display: inline-flex; padding: 0 14px 0 8px; background: transparent; }
  .panel-scrim {
    display: block; position: fixed; inset: 0; z-index: 45; background: rgb(14 42 84 / .38);
    animation: fade .25s ease;
  }
  .panel-scrim[hidden] { display: none; }
  @keyframes fade { from { opacity: 0; } }
  html.sheet-open, html.sheet-open body { overflow: hidden; }

  .detail { grid-template-columns: 1fr; gap: 22px; }
  .detail-banner, .detail-intro { grid-column: 1; grid-row: auto; }
  .detail-intro { padding-right: 0; }
  .relay { gap: 8px; }
  .relay li { padding: 12px 10px 14px; }
  .relay li:not(:last-child)::after { right: -13px; width: 18px; height: 18px; margin-top: -9px; }
  .leg-name { font-size: 16px; }
  .leg-score { font-size: 18px; }
  .rule-cards { grid-template-columns: 1fr; }
  .phases { grid-template-columns: 1fr; }
  .phase-arrow { justify-self: center; transform: rotate(90deg); }
  .past-formats { grid-template-columns: 1fr; }

  /* /events/ lists stay a grid (2 up on tablet, 1 up on phone), not a swipe row */
  .cards.cards-list { display: grid; grid-template-columns: repeat(2, 1fr); overflow: visible; margin: 0; padding: 0; gap: 16px; }
  .cards.cards-list .event { flex: none; }
  .page-hero { padding-top: 8px; }
  .legal-section { padding: 18px 18px; }
  .foot-inner p { margin-left: 0; flex-basis: 100%; }
  .join-card { grid-template-columns: 1fr; }
  .join-ctas { flex-direction: row; flex-wrap: wrap; }
}

/* ─── Phone (≤ 640px) ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-head { padding-top: env(safe-area-inset-top); }
  .hero-photo { aspect-ratio: 3 / 4; }
  .community-head { flex-direction: column; gap: 0; }
  .community-head h2 { font-size: 23px; }
  .section-head h2 { font-size: 22px; gap: 10px; }
  .title-star { width: 22px; }
  .motto { position: absolute; right: var(--gutter); margin: 0; transform: scale(.72); transform-origin: top right; }
  .community { position: relative; }
  .features { margin-bottom: 32px; }
  .features li { flex-direction: column; align-items: flex-start; gap: 8px; padding: 0 0 0 16px; }
  .features svg { width: 30px; }
  .features b { font-size: 15px; }
  .features span { font-size: 12.5px; }
  .cards.cards-list { grid-template-columns: 1fr; }
  .join-note { display: none; }
  .join-card::after { width: 150px; height: 150px; right: -48px; top: -58px; bottom: auto; transform: rotate(18deg); }
  .join-ctas .btn { width: 100%; }
  /* Phone footer: logo and Instagram share the first row, links + © below. */
  .foot-inner { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 16px 14px; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
  .foot-inner nav, .foot-inner p { grid-column: 1 / -1; margin-left: 0; }
  .foot-social { grid-column: 2; grid-row: 1; margin-left: 0; justify-self: start; }

}
