:root {
  --bg: #f5f2e9;
  --surface: #fffdf7;
  --ink: #14251b;
  --muted: #5b6a60;
  --line: #e2ddcd;
  --ball: #d4ef3f;
  --hero-bg: #14251b;
  --hero-ink: #f5f2e9;

  --slam: #1f5c3a;
  --atp: #1d4f91;
  --wta: #7a2e6e;

  --clay: #c0582f;
  --grass: #3f8a3c;
  --hard: #2f6fb0;
  --prov: #9a7a14;

  --radius: 16px;
  --shadow: 0 1px 2px rgb(20 37 27 / 6%), 0 8px 24px rgb(20 37 27 / 6%);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1a13;
    --surface: #16241b;
    --ink: #eef0e6;
    --muted: #9fae9f;
    --line: #26372b;
    --hero-bg: #0b140e;
    --slam: #5fc58a;
    --atp: #77a8ef;
    --wta: #e28ad2;
    --clay: #e88a63;
    --grass: #7fca6c;
    --hard: #79b0ea;
    --prov: #e0c25a;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
  }
}
:root[data-theme="dark"] {
  --bg: #0f1a13; --surface: #16241b; --ink: #eef0e6; --muted: #9fae9f; --line: #26372b;
  --hero-bg: #0b140e; --slam: #5fc58a; --atp: #77a8ef; --wta: #e28ad2;
  --clay: #e88a63; --grass: #7fca6c; --hard: #79b0ea; --prov: #e0c25a;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
code { font-size: 0.9em; background: var(--line); padding: 0.1em 0.35em; border-radius: 4px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ball); color: #14251b; padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

.eyebrow { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* Top bar */
.topbar { background: var(--hero-bg); color: var(--hero-ink); }
.topbar__inner { display: flex; align-items: center; gap: 12px; height: 60px; }
.topbar .bmc { margin-left: auto; }
.topnav { display: none; gap: 22px; margin-left: 36px; font-size: 0.9rem; }
.topnav a { text-decoration: none; opacity: 0.75; }
.topnav a:hover { opacity: 1; }
@media (min-width: 720px) { .topnav { display: flex; } }
.brand { display: inline-flex; align-items: center; font-weight: 600; text-decoration: none; letter-spacing: -0.01em; }
.brand__tld { color: var(--ball); }
.brand__ball { margin-right: 10px; width: 18px; height: 18px; border-radius: 50%; background: var(--ball); box-shadow: inset -3px -2px 0 rgb(0 0 0 / 12%); }

/* Buy me a coffee */
.bmc {
  display: inline-flex; align-items: center; gap: 6px;
  background: #ffdd00; color: #1a1a1a; font-weight: 600; text-decoration: none;
  padding: 12px 20px; border-radius: 999px; white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.bmc:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgb(255 221 0 / 35%); }
.bmc--small { padding: 7px 14px; font-size: 0.88rem; }

/* Hero */
.hero { background: var(--hero-bg); color: var(--hero-ink); padding: 56px 0 88px; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; right: -120px; bottom: -160px; width: 420px; height: 420px; border-radius: 50%;
  background: var(--ball); opacity: 0.12;
}
.hero .eyebrow { color: var(--ball); }
.hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); max-width: 16ch; margin-top: 12px; }
.hero h1 em { font-style: italic; color: var(--ball); font-weight: 500; }
.lede { max-width: 56ch; margin-top: 20px; font-size: 1.1rem; color: rgb(245 242 233 / 78%); }

/* Sections */
.section-title { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-top: 72px; }
.section-sub { color: var(--muted); margin-top: 8px; max-width: 64ch; }

/* Calendar cards */
.cards { display: grid; gap: 16px; margin-top: 28px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(3, 1fr); } }

.cal-card {
  --accent: var(--slam);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; display: flex; flex-direction: column; gap: 20px; border-top: 5px solid var(--accent);
}
.cal-card h3 { font-size: 1.6rem; margin-top: 6px; color: var(--accent); }
.cal-card__meta { font-weight: 600; margin-top: 6px; font-size: 0.92rem; }
.cal-card__desc { color: var(--muted); margin-top: 8px; font-size: 0.95rem; }
.cal-card__actions { display: grid; gap: 8px; margin-top: auto; }

.btn {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px;
  border-radius: 10px; border: 1px solid var(--line); background: transparent; text-decoration: none;
  font-weight: 600; font-size: 0.95rem; transition: border-color 0.15s ease, background 0.15s ease;
}
.btn:hover { border-color: var(--accent); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { filter: brightness(1.08); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn--primary { color: #0f1a13; } }
:root[data-theme="dark"] .btn--primary { color: #0f1a13; }

.copy-row { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.copy-row__input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--muted); font: 0.8rem/1 ui-monospace, Menlo, monospace; padding: 0 10px; }
.copy-row__btn { border: 0; border-left: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 600 0.82rem var(--sans); padding: 10px 14px; cursor: pointer; }
.copy-row__btn.is-done { color: var(--accent); }

/* Schedules */
.schedules { display: grid; gap: 16px; margin-top: 28px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .schedules { grid-template-columns: repeat(3, 1fr); align-items: start; } }
.schedule { --accent: var(--slam); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 8px; }
.schedule h3 { font-size: 1.25rem; color: var(--accent); padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.event-list { list-style: none; padding: 0; margin: 0; }
.event { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.event:last-child { border-bottom: 0; }
.event__badge {
  width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent);
  font-weight: 700; font-size: 0.72rem; letter-spacing: 0.02em;
}
.event__body { display: flex; flex-direction: column; min-width: 0; }
.event__name { font-weight: 600; font-size: 0.93rem; line-height: 1.3; }
.event__where { color: var(--muted); font-size: 0.83rem; }
.event__right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.event__date { font-weight: 600; font-size: 0.88rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tags { display: flex; gap: 4px; }
.tag { font-size: 0.68rem; font-weight: 600; padding: 2px 7px; border-radius: 999px; border: 1px solid currentColor; line-height: 1.4; white-space: nowrap; }
.tag--clay { color: var(--clay); }
.tag--grass { color: var(--grass); }
.tag--hard { color: var(--hard); }
.tag--prov { color: var(--prov); }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; max-width: 760px; }
.faq details:first-of-type { margin-top: 20px; border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.2rem; line-height: 1; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin-top: 10px; }

/* Coffee */
.coffee { margin-top: 72px; }
.coffee__card {
  background: var(--hero-bg); color: var(--hero-ink); border-radius: var(--radius); padding: 32px 24px;
  display: flex; flex-direction: column; gap: 20px; align-items: flex-start;
}
@media (min-width: 720px) { .coffee__card { flex-direction: row; align-items: center; justify-content: space-between; padding: 40px; } }
.coffee__card h2 { font-size: 1.7rem; }
.coffee__card p { color: rgb(245 242 233 / 75%); margin-top: 8px; max-width: 52ch; }

/* Footer */
.footer { margin-top: 72px; border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 0.88rem; }
.footer__inner { display: flex; flex-direction: column; gap: 12px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer__links a { text-underline-offset: 3px; }

/* Hero layout + next-up card */
.hero__grid { display: grid; gap: 40px; align-items: center; position: relative; z-index: 1; }
@media (min-width: 900px) { .hero__grid { grid-template-columns: 1.5fr 1fr; } }
.hero__cta { display: inline-block; margin-top: 28px; color: var(--ball); font-weight: 600; text-decoration: none; border-bottom: 2px solid currentColor; padding-bottom: 2px; }
.nextup {
  --accent: var(--ball);
  background: rgb(245 242 233 / 6%); border: 1px solid rgb(245 242 233 / 14%); border-left: 4px solid var(--ball);
  border-radius: var(--radius); padding: 24px; backdrop-filter: blur(4px);
}
.nextup__label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ball); }
.nextup__name { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; margin-top: 8px; line-height: 1.15; }
.nextup__when { color: rgb(245 242 233 / 70%); margin-top: 4px; font-size: 0.95rem; }
.nextup__count { display: flex; align-items: baseline; gap: 10px; margin-top: 18px; }
.nextup__count span { font-family: var(--serif); font-size: 3.4rem; font-weight: 700; line-height: 1; color: var(--ball); font-variant-numeric: tabular-nums; }
.nextup__count small { font-size: 0.95rem; color: rgb(245 242 233 / 75%); }

/* Season timeline */
.tl { margin-top: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; overflow-x: auto; }
.tl__inner { min-width: 900px; }
.tl__months { position: relative; height: 22px; margin-left: 150px; border-bottom: 1px solid var(--line); }
.tl__month { position: absolute; top: 0; font-size: 0.72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding-left: 4px; border-left: 1px solid var(--line); height: 100%; }
.tl__row { --accent: var(--slam); display: flex; align-items: center; height: 72px; border-bottom: 1px dashed var(--line); }
.tl__row:last-child { border-bottom: 0; }
.tl__label { width: 150px; flex: none; font-weight: 600; font-size: 0.85rem; color: var(--accent); }
.tl__track { position: relative; flex: 1; height: 10px; }
.tl__bar {
  position: absolute; top: 0; height: 100%; border-radius: 999px; background: var(--accent);
  box-shadow: 0 0 0 2px var(--surface); cursor: default;
}
.tl__code {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.03em; white-space: nowrap; color: var(--accent);
  transition: color 0.12s ease;
}
.tl__bar--up .tl__code { bottom: calc(100% + 5px); }
.tl__bar--down .tl__code { top: calc(100% + 5px); }
.tl__bar:hover { filter: brightness(1.15); }
.tl__bar:hover .tl__code { color: var(--ink); }
.note { margin-top: 16px; color: var(--muted); font-size: 0.88rem; }

/* Manual setup */
.apps { display: grid; gap: 16px; margin-top: 28px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .apps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .apps { grid-template-columns: repeat(4, 1fr); } }
.app { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.app h3 { font-size: 1.15rem; }
.app ol { margin: 12px 0 0; padding-left: 20px; color: var(--muted); font-size: 0.92rem; }
.app li + li { margin-top: 6px; }
.app b { color: var(--ink); font-weight: 600; }

/* Season switcher */
.season-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.season-tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.season-tab { border: 0; background: transparent; color: var(--muted); font: 600 0.92rem var(--sans); padding: 8px 18px; border-radius: 999px; cursor: pointer; font-variant-numeric: tabular-nums; }
.season-tab[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.season[hidden] { display: none; }

/* Per-tour accent: last in the file so it wins over component defaults */
[data-accent="slam"] { --accent: var(--slam); }
[data-accent="atp"] { --accent: var(--atp); }
[data-accent="wta"] { --accent: var(--wta); }
