/* Match Rugby — static site. No JS, no trackers. */
:root {
  --ink: #16211a;
  --paper: #ffffff;
  --card: #f2f7f3;
  --accent: #00643F; /* matchRugbyGreen — design_tokens.fixture.json brand */
  --accent-ink: #ffffff;
  --muted: #55615a;
  --rule: #e2e9e4;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8efe9;
    --paper: #0f1511;
    --card: #18221b;
    --accent: #199E77; /* darkSurfaceGreen — brand dark-surface accent */
    --accent-ink: #0c2415;
    --muted: #9cb0a2;
    --rule: #25332a;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
header, main, footer { max-width: 56rem; margin: 0 auto; padding: 0 1.5rem; }

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}
.brand img { width: 38px; height: 38px; border-radius: 9px; display: block; }
.brand { margin-right: auto; }
nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; font-weight: 500; }
nav a:hover, nav a[aria-current="page"] { color: var(--accent); }
/* The other languages of the current page, each named in its own language. */
nav.languages { gap: 0.4rem 0.9rem; padding-left: 0.9rem; border-left: 1px solid var(--rule); }
/* Phones: languages sit beside the brand, the page links take the row below. */
@media (max-width: 40rem) {
  nav.site { order: 2; flex-basis: 100%; gap: 0.4rem 0.6rem; justify-content: space-between; }
  nav.site a { font-size: 0.9rem; }
  nav.languages { padding-left: 0; border-left: 0; }
}

/* Main */
main { padding: 2.5rem 1.5rem 4rem; }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 1rem; }
h2 { font-size: 1.25rem; letter-spacing: -0.01em; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1rem; margin: 1.5rem 0 0.25rem; }
p, li { color: var(--ink); }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 40rem; }
ul { padding-left: 1.25rem; }
a { color: var(--accent); }
.updated { font-size: 0.85rem; color: var(--muted); }

/* Hero (home page) */
.hero { text-align: center; padding: 2.5rem 0 1.5rem; }
.hero img.watch-shot {
  width: min(260px, 70vw);
  height: auto;
  background: #000;
  padding: 14px;
  border: 1px solid #2c2c2e;
  border-radius: 56px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  margin-bottom: 1.75rem;
}
.hero .lede { margin-left: auto; margin-right: auto; }
.pill {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}
.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  margin-top: 0.5rem;
}
.button:hover { filter: brightness(1.1); }

/* Feature cards — intentional 2×2, single column on phones */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 0;
  margin: 1.25rem 0 0;
  list-style: none;
}
@media (max-width: 40rem) {
  .cards { grid-template-columns: 1fr; }
}
.cards li {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 1.25rem 1.4rem;
}
.cards h3 { margin: 0 0 0.4rem; font-size: 1.05rem; color: var(--accent); }
.cards p { margin: 0; font-size: 0.95rem; color: var(--muted); }
.cards p strong { color: var(--ink); }
.cards li.wide { grid-column: 1 / -1; }

/* Support page: linked answers clear the sticky header; watch screenshot */
h2[id], h3[id] { scroll-margin-top: 7.5rem; }
.help-shot { margin: 1.75rem 0 0; text-align: center; }
.help-shot img {
  width: min(211px, 60vw);
  height: auto;
  background: #000;
  padding: 11px;
  border: 1px solid #2c2c2e;
  border-radius: 46px;
}
.help-shot figcaption { margin-top: 0.6rem; font-size: 0.85rem; color: var(--muted); }

/* Notice panel */
.notice {
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin: 2rem 0;
}
.notice p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Screenshot gallery — one equal-height row, justified by aspect ratio:
   widths ∝ aspect so all three shots align top and bottom, no scrolling. */
.shots {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-top: 1.5rem;
}
.shots figure { margin: 0; min-width: 0; flex: 0.4595 1 0; } /* 386/840 portrait */
.shots figure:nth-child(2) { flex: 1.3333 1 0; } /* 1376/1032 iPad landscape */
.shots img {
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.shots figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}
/* Phone: App Store-style scroll-snap strip — equal-height slides (the iPad
   pans wide), next card's peek is the affordance; no JS, no auto-advance. */
@media (max-width: 40rem) {
  .shots {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0.75rem;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding: 0 1.5rem 0.5rem;
    scroll-padding: 0 1.5rem;
  }
  .shots figure,
  .shots figure:nth-child(2) {
    flex: 0 0 auto;
    width: min-content; /* caption wraps to the image's width, not its own */
    scroll-snap-align: center;
  }
  .shots img { width: auto; height: min(55vh, 440px); }
}

/* Footer */
footer {
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
  padding-bottom: 3rem;
  font-size: 0.85rem;
  color: var(--muted);
}
footer p { margin: 0.3rem 0; }
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }
