/* Barlow is self-hosted so the site makes no requests to other servers. */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap;
  src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap;
  src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap;
  src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }

:root {
  --brand: #16243d; --brand-strong: #0f1a2e; --pitch: #1a2b48; --pitch-light: #213656;
  --accent: #f2b134; --ground: #eef1f5; --surface: #fbfcfd; --ink: #111a2b;
  --muted: #55607a; --rule: #cdd4df; --line: #eef1f5;
  --on-brand: #ffffff; --bib-b: #ffffff; --alert: #a32a17;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.5 "Barlow", system-ui, sans-serif;
}

main { max-width: 34rem; margin: 0 auto; padding: 1rem 1rem 3rem; }

h1, h2, h3 { font-family: "Barlow Condensed", "Barlow", sans-serif; font-weight: 600; line-height: 1.05; }
h1 { font-size: clamp(2.5rem, 12vw, 3.5rem); margin: 0.5rem 0; }
h2 { font-size: 1.625rem; margin: 2rem 0 0.5rem; }

a { color: var(--brand); font-weight: 600; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.muted { color: var(--muted); }

.nav {
  display: flex; flex-wrap: wrap; gap: 0.125rem; align-items: center;
  padding: 0.5rem; background: var(--brand);
}
.nav-link {
  padding: 0.25rem 0.25rem; border-radius: 4px; color: var(--on-brand); white-space: nowrap;
  font-size: clamp(0.8125rem, 3.9vw, 1.0625rem); font-weight: 600; text-decoration: none; transition: background-color 0.2s ease, color 0.2s ease;
}
.nav-link:hover { background: color-mix(in srgb, var(--on-brand) 16%, transparent); }
.nav-link.is-active { background: var(--accent); color: var(--brand-strong); }

/* Between pages, the old highlight fades out and the new one fades in.
   Only the menu links animate. Browsers without this feature just switch. */
@view-transition { navigation: auto; }
.nav-groups { view-transition-name: nav-groups; }
.nav-week { view-transition-name: nav-week; }
.nav-ratings { view-transition-name: nav-ratings; }
.nav-account { view-transition-name: nav-account; }
.nav-brand { view-transition-name: nav-brand; }
.nav-login { view-transition-name: nav-login; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(*) { animation-duration: 0.3s; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .nav-link { transition: none; }
}
.nav-end { margin-left: auto; }

.notice { padding: 0.625rem 0.875rem; background: var(--surface); border-left: 4px solid var(--brand); margin: 0.75rem 0; }
.notice-error { border-left-color: var(--alert); color: var(--alert); }

.match { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.headcount { margin: 0 0 0.5rem; white-space: nowrap; font-family: "Barlow Condensed", sans-serif; font-size: 1.375rem; }
.headcount strong { font-size: 2.5rem; font-weight: 600; }

label { display: block; font-weight: 600; }
input, select {
  width: 100%; min-height: 3rem; padding: 0.5rem 0.75rem;
  border: 2px solid var(--ink); border-radius: 4px; background: var(--surface);
  color: var(--ink); font: inherit;
}

.stack > * + * { margin-top: 0.5rem; }
.stack label:not(:first-child) { margin-top: 1rem; }
.stack .button { margin-top: 1.25rem; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0.5rem 1.25rem; border: 2px solid var(--ink); border-radius: 4px;
  background: var(--surface); color: var(--ink); font: 600 1.0625rem "Barlow", sans-serif;
  text-decoration: none; cursor: pointer;
}
.button-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.button-wide { width: 100%; }
.link-button { padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.nav .link-button { text-decoration: none; }
.danger-zone { margin-top: 2rem; }
.danger-zone .link-button { color: var(--alert); }


#teams { margin-top: 2rem; }
#teams h2 { margin-top: 0; }
#teams .pitch { margin-top: 0.75rem; }

/* The pitch: Team A attacks down from the top, Team B up from the bottom. */
.pitch {
  position: relative;
  padding: 0.75rem;
  border-radius: 4px;
  color: var(--line);
  background: repeating-linear-gradient(var(--pitch) 0 3.5rem, var(--pitch-light) 3.5rem 7rem);
}
.half { position: relative; display: flex; flex-direction: column; gap: 1rem; padding: 0.75rem 0.5rem 1.5rem; border: 2px solid var(--line); }
.half-a { border-bottom-width: 1px; }
.half-b { flex-direction: column-reverse; padding: 1.5rem 0.5rem 0.75rem; border-top-width: 1px; }
.half h3 { margin: 0; font-size: 1.375rem; text-align: center; }
.half h3 span { display: block; font: 400 0.875rem "Barlow", sans-serif; }

/* Center circle, sitting on the halfway line. */
.pitch::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 3.5rem; height: 3.5rem;
  border: 2px solid var(--line); border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none;
}

.line { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.375rem; margin: 0; padding: 0; list-style: none; position: relative; z-index: 1; }
.bib { padding: 0.25rem 0.625rem; border-radius: 3px; color: var(--ink); font-weight: 600; font-size: 1rem; overflow-wrap: anywhere; }
.half-a .bib { background: var(--accent); }
.half-b .bib { background: var(--bib-b); }
.bib-moved { outline: 2px dashed var(--ink); outline-offset: -4px; padding: 0.25rem 0.75rem; }

.team-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

.roster { margin: 0.5rem 0 0; padding: 0; list-style: none; }
.roster li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
.roster .muted { text-align: right; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.lead { font-size: 1.25rem; margin: 0 0 1.25rem; }
.inline-field { display: flex; gap: 0.5rem; }
.inline-field input { flex: 1; min-width: 0; }

.group-name { margin: 0.5rem 0 0; font-weight: 600; color: var(--muted); overflow-wrap: anywhere; }
.match h1 { margin-top: 0; }

.code-inline { letter-spacing: 0.04em; white-space: nowrap; }
.invite-label { margin: 1rem 0 0.25rem; }
.button-danger { background: var(--surface); border-color: var(--alert); color: var(--alert); }

.attendance h2 { margin: 1.25rem 0 0.5rem; }
.attendance-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.attendance-buttons [aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 2px; }

.requests { margin-top: 1rem; padding: 0.75rem 1rem 1rem; background: var(--accent); border-radius: 4px; }
.requests h2 { margin: 0; }
.requests .muted { color: var(--ink); }
.roster li form { margin: 0; }
.roster .row-actions { display: flex; flex-shrink: 0; gap: 0.75rem; align-items: center; }
.roster li.request, .roster li.member { align-items: center; }
.button-small { min-height: 2.75rem; padding: 0.25rem 0.75rem; font-size: 1rem; }
.member-detail { display: block; font-size: 0.9375rem; }
.roster .member-detail { text-align: left; }
.link-danger { color: var(--alert); }

/* Ratings: five large tap targets, one row per player. */
.rating { margin: 1rem 0 0; padding: 0; border: 0; }
.rating legend { padding: 0; font-weight: 600; overflow-wrap: anywhere; }
.rating-scores { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.25rem; margin-top: 0.25rem; }
.rating-scores label { position: relative; display: block; font-weight: 600; }
.rating-scores input { position: absolute; inset: 0; width: 100%; min-height: 0; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.rating-scores span {
  display: flex; align-items: center; justify-content: center; height: 3rem;
  border: 2px solid var(--ink); border-radius: 4px; background: var(--surface);
}
.rating-scores input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.rating-scores input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.rating-save { margin-top: 1.5rem; }

/* Who's coming, grouped by answer. */
.answer-group { margin-top: 1.5rem; }
.answer-group h3 { display: flex; justify-content: space-between; margin: 0; padding-bottom: 0.375rem; border-bottom: 3px solid var(--rule); font-size: 1.5rem; }
.answer-attending h3 { border-bottom-color: var(--brand); }
.answer-declined h3 { border-bottom-color: var(--alert); }
.answer-group .roster { margin-top: 0; }
.answer-group > .muted { margin: 0.5rem 0 0; }

/* Your groups */
.group-cards, .demo-users { margin: 1rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
.group-card form, .demo-users form { margin: 0; }
.group-open, .group-waiting {
  position: relative; display: block; width: 100%; padding: 0.75rem 1rem; text-align: left;
  border: 2px solid var(--rule); border-radius: 4px; background: var(--surface); color: var(--ink); font: inherit;
}
.group-open { border-color: var(--ink); cursor: pointer; }
.group-open:hover { background: var(--ground); }
.group-card-name { display: block; font: 600 1.5rem/1.2 "Barlow Condensed", sans-serif; padding-right: 3.5rem; overflow-wrap: anywhere; }
.group-card-detail { display: block; color: var(--muted); font-size: 0.9375rem; }
.group-card-role { position: absolute; top: 0.875rem; right: 1rem; font-size: 0.875rem; font-weight: 600; color: var(--muted); }

.demo-bar { margin: 0; padding: 0.375rem 1rem; background: var(--accent); color: var(--brand-strong); font-size: 0.9375rem; }
.demo-bar a { color: inherit; }
code { font-size: 0.95em; }

/* Home page */
.page-landing main { max-width: 68rem; padding-top: 0; }
.page-landing .nav { background: var(--brand-strong); }
.hero { position: relative; overflow: hidden; background: var(--brand-strong); color: var(--on-brand); }
.hero-lines { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--on-brand); opacity: 0.07; }
.hero-inner {
  position: relative; display: grid; gap: 2rem; align-items: center;
  max-width: 68rem; margin: 0 auto; padding: 2.5rem 1rem 3rem;
}
.hero h1 { margin: 0; font-size: clamp(3rem, 12vw, 5rem); line-height: 0.98; }
.hero .lead { margin: 1rem 0 0; max-width: 34rem; font-size: 1.25rem; line-height: 1.45; }
.hero-free { margin: 1rem 0 0; color: var(--accent); font: 600 1.625rem "Barlow Condensed", sans-serif; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }
.button-accent { background: var(--accent); border-color: var(--accent); color: var(--brand-strong); }
.button-on-dark { background: transparent; border-color: var(--on-brand); color: var(--on-brand); }
.hero :focus-visible, .nav :focus-visible { outline-color: var(--on-brand); }
.hero-pitch .pitch { box-shadow: 0 0 0 1px color-mix(in srgb, var(--on-brand) 18%, transparent); }

/* The one moment of motion: players settle into their positions when the page opens. */
@media (prefers-reduced-motion: no-preference) {
  .hero-pitch .bib { animation: settle 0.5s ease-out both; }
  .hero-pitch .half-a .bib { --from: -0.75rem; animation-delay: 0.15s; }
  .hero-pitch .half-b .bib { --from: 0.75rem; animation-delay: 0.3s; }
}
@keyframes settle { from { opacity: 0; transform: translateY(var(--from)); } }

.how h2, .why h2 { font-size: clamp(2rem, 7vw, 2.75rem); margin-top: 2.5rem; }
.steps { display: grid; gap: 1.25rem; margin: 1rem 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; padding-left: 3rem; position: relative; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -0.125rem;
  color: var(--brand); font: 600 2.75rem/1 "Barlow Condensed", sans-serif;
}
.steps h3 { margin: 0; font-size: 1.5rem; }
.steps p { margin: 0.25rem 0 0; }
.reasons { display: grid; gap: 1rem; margin: 1rem 0 0; }
.reasons dt { font: 600 1.375rem "Barlow Condensed", sans-serif; }
.reasons dd { margin: 0.125rem 0 0; }
.join-band { margin-top: 2.5rem; padding: 1.25rem; background: var(--surface); border-left: 4px solid var(--accent); }
.join-band h2 { margin: 0 0 0.75rem; }
.join-band .inline-field { max-width: 26rem; }
.join-band p { margin: 0.75rem 0 0; }

@media (min-width: 52rem) {
  .hero-inner { grid-template-columns: 1.2fr 1fr; padding: 4rem 1rem; gap: 3rem; }
  .steps { grid-template-columns: repeat(4, 1fr); gap: 2rem; }
  .steps li { padding-left: 0; padding-top: 3rem; }
  .reasons { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
}

.group-card-actions { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; padding: 0.5rem 1rem 0; }
.group-card-actions form { margin: 0; }
.group-card-actions .link-button { min-height: 2.75rem; }
.page-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }

@media (min-width: 30rem) { .nav-link { padding: 0.25rem 0.5rem; } }

/* Why these teams */
.why-teams { margin-top: 1.5rem; }
.why-reasons { margin: 0.5rem 0 0; padding-left: 1.25rem; }
.why-reasons li + li { margin-top: 0.25rem; }
.compare, .factors { width: 100%; margin-top: 1rem; border-collapse: collapse; }
.compare th, .compare td, .factors th, .factors td { padding: 0.375rem 0.25rem; border-bottom: 1px solid var(--rule); text-align: left; font-weight: 400; }
.compare thead th { font-weight: 600; border-bottom: 2px solid var(--ink); }
.compare tbody th { color: var(--muted); }
.compare td { width: 34%; font-weight: 600; }
.compare td .muted { display: block; font-size: 0.875rem; font-weight: 400; }
.factors td { text-align: right; font-variant-numeric: tabular-nums; }
.factors tfoot th, .factors tfoot td { font-weight: 600; border-bottom: 0; }
.why-teams > .muted { margin: 0.5rem 0 0; font-size: 0.9375rem; }
.why-teams h3 { margin: 1.5rem 0 0; font-size: 1.375rem; }
.why-teams h3 + .muted { margin: 0.125rem 0 0; }
.rating-columns { display: grid; gap: 1rem; margin-top: 0.5rem; }
.rating-columns h4 { margin: 0; font: 600 1.125rem "Barlow Condensed", sans-serif; }
.why-details { margin-top: 1.25rem; }
.why-details summary { min-height: 2.75rem; font-weight: 600; cursor: pointer; }
@media (min-width: 30rem) { .rating-columns { grid-template-columns: 1fr 1fr; } }
