/* Anything marked hidden stays hidden, even when a rule above gives it a display value. */
[hidden] { display: none !important; }
/* Painted-timber scoreboard on watercolor paper: cream ground, eucalyptus green,
   stencil headings, chalkboard panels for the key facts. Single light look by design. */
:root {
  --paper: #f6f4ec;
  --timber: #fdfcf7;
  --ink: #23271f;
  --muted: #646a5c;
  --line: #dcdccd;
  --green: #36553a;
  --green-soft: #e3ead9;
  --sage: #8aa17a;
  --board: #2c2f2b;
  --chalk: #f2f0e6;
  --error: #a3402c;
  --stencil: "Stardos Stencil", "Arial Black", Impact, sans-serif;
  --chalkface: "Cabin Sketch", "Comic Sans MS", cursive;
  --body: "Source Sans 3", -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.55 var(--body);
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; display: block; }
a { color: var(--green); }
:focus-visible { outline: 3px solid var(--sage); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
.muted { color: var(--muted); }

/* header */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  padding-top: calc(8px + env(safe-area-inset-top));
  background: rgba(246, 244, 236, .94); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-family: var(--stencil); font-weight: 700; font-size: 1.05rem; letter-spacing: .02em; min-width: 0; }
.brand img { mix-blend-mode: multiply; flex: none; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; padding: 6px 10px; border-radius: 8px; }
.nav a:hover { background: var(--green-soft); }
.nav .nav-rsvp { background: var(--green); color: #fff; }
.nav .nav-rsvp:hover { background: var(--green); }
/* phones: section links move to a bottom tab bar (thumb reach), header keeps the brand only */
.tabbar { display: none; }
@media (max-width: 720px) {
  .nav { display: none; }
  .top { justify-content: center; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: rgba(253, 252, 247, .97); border-top: 1px solid var(--line);
    padding: 4px max(4px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
    box-shadow: 0 -6px 18px -14px rgba(40, 40, 20, .5);
  }
  .tabbar a {
    display: grid; justify-items: center; align-content: center; gap: 2px;
    min-height: 56px; text-decoration: none; color: var(--muted);
    font-size: .72rem; font-weight: 700; border-radius: 10px;
  }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.on { color: var(--green); background: var(--green-soft); }
  .tabbar .tab-rsvp { color: var(--green); }
  body.typing .tabbar { display: none; }
  .foot { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  html { scroll-padding-top: 64px; }
}

main { display: block; }
.section, .hero {
  max-width: 760px; margin: 0 auto;
  padding: 56px max(16px, env(safe-area-inset-right)) 56px max(16px, env(safe-area-inset-left));
}

/* hero */
/* --ph: photo box height. --ih: height the photo is drawn at (it covers the box).
   The card's top lines up with the batter's feet, 65% down the photo. */
.hero { max-width: none; padding: 0 0 40px; text-align: center; --ph: clamp(300px, 52vw, 600px); --ih: max(56.2vw, 300px); }
.hero-photo img { display: block; width: 100%; height: var(--ph); object-fit: cover; object-position: 50% 45%; }
.hero-card {
  position: relative; width: min(760px, calc(100% - 24px)); box-sizing: border-box;
  margin: calc(.2 * var(--ih) - .55 * var(--ph)) auto 0;
  background: var(--paper); border-radius: 10px;
  box-shadow: 0 18px 40px -20px rgba(30, 35, 25, .55), 0 2px 6px rgba(30, 35, 25, .12);
  padding: clamp(22px, 4vw, 36px) clamp(14px, 4vw, 40px) clamp(24px, 4vw, 36px);
  display: grid; justify-items: center; gap: 14px;
}
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .16em; font-weight: 700; font-size: .8rem; color: var(--green); }
h1 { font-family: var(--stencil); font-weight: 700; font-size: clamp(2.3rem, 9vw, 4rem); line-height: 1; letter-spacing: .01em; }
h1 em { font-style: normal; font-weight: 400; color: var(--muted); font-size: .6em; vertical-align: .15em; padding: 0 .1em; }
.lede { max-width: 32em; margin: 6px 0 4px; font-size: 1.08rem; }

/* scoreboard panel: painted timber with chalkboard cells */
.board {
  width: 100%; max-width: 620px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  background: var(--timber); padding: 12px;
  border: 1px solid #d9d6c6; border-radius: 4px;
  box-shadow: 0 1px 0 #e9e6d8, 0 8px 24px -18px rgba(40, 40, 20, .45);
  background-image: repeating-linear-gradient(180deg, transparent 0 46px, rgba(160, 150, 120, .12) 46px 47px);
}
.board-cell { display: grid; gap: 6px; }
.board-label { font-family: var(--stencil); font-weight: 700; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.chalk {
  font-family: var(--chalkface); font-weight: 700; color: var(--chalk);
  background: var(--board); border-radius: 3px; padding: 10px 6px;
  font-size: clamp(1.05rem, 4.4vw, 1.5rem); line-height: 1.1;
  background-image: radial-gradient(ellipse at 30% 40%, rgba(255,255,255,.06), transparent 60%);
}
@media (max-width: 560px) { .board { grid-template-columns: 1fr 1fr; } }
.board.two { grid-template-columns: 1fr 1fr; max-width: 400px; }
@media (max-width: 380px) { .board { gap: 6px; padding: 8px; } .board-label { font-size: .7rem; } }

.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  background: var(--green); color: #fff; font: 700 1.05rem var(--body);
  padding: 14px 28px; border-radius: 8px; min-height: 48px;
}
.btn:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: .6; cursor: progress; }

.photo-band { margin: 0; }
.photo-band img { width: 100%; height: clamp(200px, 38vw, 420px); object-fit: cover; }

/* headings */
.stencil { font-family: var(--stencil); font-weight: 700; font-size: clamp(1.8rem, 6vw, 2.5rem); letter-spacing: .01em; margin-bottom: 16px; }
.stencil.small { font-size: 1.35rem; margin-bottom: 8px; }

/* matches */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--timber); border: 1px solid var(--line); border-radius: 6px; padding: 18px; display: grid; gap: 8px; align-content: start; }
.card h3 { font-size: 1.2rem; }
.card p { margin: 0; }
.time { justify-self: start; font-size: 1.4rem; padding: 4px 14px; }
.bring { margin-top: 26px; }
.ticks { padding: 0; margin: 0 0 8px; list-style: none; display: grid; gap: 6px; }
.ticks li { padding-left: 28px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 4px; top: .45em; width: 12px; height: 7px; border-left: 2.5px solid var(--green); border-bottom: 2.5px solid var(--green); transform: rotate(-45deg); }

/* history */
.history { text-align: center; }
.trophy-plaques { margin: 0 auto 12px; width: min(560px, 100%); mix-blend-mode: multiply; }
.honours { list-style: none; padding: 0; margin: 0 auto 28px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 560px; }
.honours li { background: var(--board); color: var(--chalk); border-radius: 3px; padding: 8px 4px; font-weight: 600; font-size: .92rem; }
.honours .yr { display: block; font-family: var(--chalkface); font-size: 1.25rem; }
@media (max-width: 420px) { .honours { grid-template-columns: repeat(2, 1fr); } }
.scoreboard-art { margin: 0; }
.scoreboard-art img { mix-blend-mode: multiply; width: 100%; }

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; }
@media (max-width: 640px) { .gallery { grid-template-columns: 1fr 1fr; } }

/* rules */
/* The commandments sit on a ruled scorecard: one rule per line, a small chalk number on the left. */
.commandments {
  list-style: none; counter-reset: c; margin: 0 0 28px; padding: 4px 0;
  background: var(--timber); border: 1px solid #d9d6c6; border-radius: 6px;
  box-shadow: 0 8px 24px -20px rgba(40, 40, 20, .45);
}
.commandments li {
  counter-increment: c; position: relative;
  padding: 14px 18px 14px 64px; line-height: 1.5;
  border-bottom: 1px solid #e6e3d4;
}
.commandments li:last-child { border-bottom: 0; }
.commandments li::before {
  content: counter(c); position: absolute; left: 18px; top: 13px;
  width: 30px; height: 28px; display: grid; place-items: center;
  font-family: var(--chalkface); font-weight: 700; font-size: 1rem; line-height: 1;
  color: var(--chalk); background: var(--board); border-radius: 3px;
}
@media (max-width: 480px) {
  .commandments li { padding: 12px 14px 12px 54px; }
  .commandments li::before { left: 12px; top: 11px; }
}
.aside-photo { margin: 0 0 24px; display: grid; grid-template-columns: 140px 1fr; gap: 14px; align-items: center; }
.aside-photo img { border-radius: 6px; aspect-ratio: 3/4; object-fit: cover; }
.aside-photo figcaption { font-family: var(--stencil); font-size: 1.3rem; }
.more { border-top: 1px solid var(--line); padding: 12px 0; }
.more:last-of-type { border-bottom: 1px solid var(--line); }
.more summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; padding: 4px 0; }
.more ol { margin: 10px 0 4px; padding-left: 1.4em; display: grid; gap: 8px; line-height: 1.5; }
.more ol li::marker { font-weight: 700; color: var(--green); }
.outs { margin: 10px 0 0; }
.outs dt { font-weight: 700; margin-top: 10px; }
.outs dd { margin: 2px 0 0; color: var(--muted); line-height: 1.5; }
.fineprint { margin: 16px 0 4px; font-size: .82rem; font-style: italic; color: var(--muted); }

/* getting there */
.routes { margin: 16px 0 20px; }
.routes .from { color: var(--green); font-weight: 700; font-size: .95rem; }
/* Both route cards share one shape: title, towns, directions text, then the button pinned to the bottom. */
.routes .card { grid-template-rows: auto auto 1fr auto; gap: 10px; }
.routes .from { margin: 0; }
.btn-quiet { justify-self: stretch; text-align: center; margin-top: 6px; font-size: .98rem; padding: 12px 18px; min-height: 48px; }

.draft-note { border: 1px dashed var(--sage); color: var(--muted); padding: 12px 14px; border-radius: 6px; font-size: .95rem; }

/* rsvp */
.rsvp form { display: grid; gap: 16px; margin-top: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .row2 { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field label, .field legend { font-weight: 700; padding: 0; }
.field legend { margin-bottom: 6px; }
input, textarea {
  font: inherit; color: var(--ink); width: 100%; min-width: 0;
  background: var(--timber); border: 1px solid #c9c8b6; border-radius: 6px; padding: 12px;
}
input:focus, textarea:focus { outline: 3px solid var(--sage); outline-offset: 0; border-color: var(--green); }
.choices { display: grid; gap: 8px; }
.choice { display: flex; align-items: center; gap: 10px; background: var(--timber); border: 1px solid #c9c8b6; border-radius: 8px; padding: 12px 14px; cursor: pointer; font-weight: 600; }
.choice input { width: 20px; height: 20px; accent-color: var(--green); flex: none; margin: 0; }
.choice:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.form-error { color: var(--error); font-weight: 600; margin: 0; }
.people { display: grid; gap: 10px; }
.person { background: var(--timber); border: 1px solid #c9c8b6; border-radius: 8px; padding: 10px; display: grid; gap: 8px; }
.person-top { display: flex; gap: 8px; align-items: center; }
.person-top input { flex: 1; }
.remove { flex: none; width: 44px; height: 44px; border: 0; background: none; color: var(--muted); font-size: 1.4rem; border-radius: 8px; cursor: pointer; }
.remove:hover { background: #efeee4; }
.plays { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.plays label { position: relative; }
.plays input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.plays span { display: grid; place-items: center; text-align: center; min-height: 48px; padding: 6px 4px; border: 1px solid #c9c8b6; border-radius: 8px; font-weight: 700; font-size: .92rem; line-height: 1.15; background: var(--paper); }
.plays span small { display: block; font-weight: 600; color: var(--muted); font-size: .76rem; }
.plays input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.plays input:checked + span small { color: #e3ead9; }
.plays input:focus-visible + span { outline: 3px solid var(--sage); outline-offset: 2px; }
.person-extra { display: grid; gap: 6px; padding-top: 4px; border-top: 1px dashed #d9d6c6; }
.mini-label { font-size: .85rem; font-weight: 700; color: var(--muted); }
.plays.sides span { min-height: 44px; font-size: .9rem; }
.p-level { width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid #c9c8b6; border-radius: 8px; background: var(--paper); font: 600 .95rem var(--body); color: var(--ink); }
.add-person { justify-self: start; border: 1px dashed var(--green); background: none; color: var(--green); font: 700 1rem var(--body); border-radius: 8px; padding: 10px 16px; min-height: 44px; cursor: pointer; margin-top: 4px; }
.thanks { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 24px 0; }
.thanks img { mix-blend-mode: multiply; }
.thanks h3 { font-family: var(--stencil); font-size: 1.8rem; }
.thanks p { margin: 0; max-width: 30em; }
/* add to calendar: an outline button that opens two choices */
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: flex-start; }
.cal { position: relative; }
.cal summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; min-height: 48px; padding: 12px 22px; border: 1.5px solid var(--green); border-radius: 8px; color: var(--green); font: 700 1.05rem var(--body); background: var(--paper); }
.cal summary::-webkit-details-marker { display: none; }
.cal[open] summary { background: var(--green-soft); }
.cal-menu { position: absolute; z-index: 5; left: 50%; transform: translateX(-50%); top: calc(100% + 6px); min-width: 210px; display: grid; background: var(--timber); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 30px -16px rgba(30, 35, 25, .5); overflow: hidden; }
.cal-menu a { display: block; padding: 13px 16px; color: var(--ink); text-decoration: none; font-weight: 600; text-align: left; }
.cal-menu a + a { border-top: 1px solid var(--line); }
.cal-menu a:hover { background: var(--green-soft); color: var(--green); }

.link-btn { background: none; border: 0; color: var(--green); font: 600 1rem var(--body); text-decoration: underline; cursor: pointer; padding: 6px; }
.contacts { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 18px; color: var(--muted); }
.contacts p { margin: 0 0 4px; }
.contacts strong { color: var(--ink); }

.foot { text-align: center; padding: 32px 16px calc(40px + env(safe-area-inset-bottom)); color: var(--muted); font-size: .92rem; display: grid; justify-items: center; gap: 6px; border-top: 1px solid var(--line); }
.foot img { mix-blend-mode: multiply; }
.foot p { margin: 0; }
