/* ==========================================================================
   Premier Referee Association — one stylesheet for the whole site.
   Mobile-first: base styles are for phones; @media (min-width) adds desktop.
   To restyle the site, change the tokens in :root first.
   ========================================================================== */

/* Fonts are self-hosted (app/static/fonts) — no Google/CDN dependency. */
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlow-condensed-semibold.woff") format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlow-condensed-bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-variable.woff") format("woff"); font-weight: 100 900; font-display: swap; }

:root {
  /* Brand */
  --navy: #0e1a33;
  --navy-2: #16264a;
  --blue: #3f61aa;        /* crest blue */
  --blue-dark: #2f4c8c;
  --blue-light: #8fb0f2;  /* accent on dark backgrounds */

  /* Neutrals */
  --ink: #121826;
  --muted: #5b6475;
  --line: #e3e7ef;
  --surface: #f4f6fa;
  --white: #fff;

  /* Type */
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Layout */
  --wrap: 1160px;
  --gutter: 20px;
  --radius: 14px;
  --header-h: 64px;
  --section-y: 64px;
}

@media (min-width: 900px) {
  :root { --gutter: 32px; --section-y: 96px; --header-h: 72px; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: .01em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 8vw, 4.5rem); text-transform: uppercase; }
h2 { font-size: clamp(1.9rem, 5vw, 2.75rem); }
h3 { font-size: 1.35rem; font-weight: 600; letter-spacing: .02em; }
p { margin: 0 0 1em; }
.icon { flex: none; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--white); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--blue-light); outline-offset: 2px; }

.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: .6em;
}
.accent { color: var(--blue-light); }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 0 24px;
  font-family: var(--font-display); font-weight: 600; font-size: 1.1rem;
  letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  color: var(--white); background: var(--blue);
  border: 2px solid var(--blue); border-radius: 999px;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn--ghost { background: transparent; color: var(--blue); }
.btn--ghost:hover { background: var(--blue); color: var(--white); }
.btn--small { min-height: 40px; padding: 0 18px; font-size: 1rem; }

.link-arrow, .link-back {
  display: inline-flex; align-items: center; gap: .4em;
  font-weight: 600; text-decoration: none;
}
.link-arrow:hover .icon { transform: translateX(3px); }
.link-arrow .icon { transition: transform .15s; }
.link-back { color: var(--muted); margin-bottom: 24px; }
.link-back:hover { color: var(--blue); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em;
  color: var(--navy); text-decoration: none;
}
.brand img { width: 36px; height: auto; }
.brand { font-size: 1.1rem; }
@media (min-width: 420px) { .brand { font-size: 1.3rem; } }

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a:not(.btn) {
  color: var(--ink); text-decoration: none; font-weight: 500;
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.site-nav a:not(.btn):hover, .site-nav a[aria-current="page"]:not(.btn) { border-color: var(--blue); color: var(--blue); }

.nav-toggle {
  display: none; width: 44px; height: 44px; margin-right: -10px;
  align-items: center; justify-content: center;
  background: none; border: 0; color: var(--navy); cursor: pointer;
}
.nav-toggle__close { display: none; }

@media (max-width: 759px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 20px;
    background: var(--white); border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 30px rgba(14, 26, 51, .12);
    display: none;
  }
  .site-nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.1rem; }
  .site-nav a:not(.btn)[aria-current="page"] { border-color: var(--line); }
  .site-nav .btn { margin-top: 16px; min-height: 48px; }
  [data-nav].is-open .site-nav { display: flex; }
  [data-nav].is-open .nav-toggle__open { display: none; }
  [data-nav].is-open .nav-toggle__close { display: inline; }
}

/* ---------- Hero (home) ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  color: var(--white);
  background: radial-gradient(1200px 600px at 85% 0%, var(--navy-2), var(--navy));
  padding: 56px 0 32px;
}
/* Faint centre circle + halfway line — a nod to the pitch */
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
.hero::before {
  width: 360px; height: 360px; right: -120px; top: 40px;
  border: 2px solid rgba(255,255,255,.06); border-radius: 50%;
}
.hero::after { width: 2px; top: 0; bottom: 0; right: 59px; background: rgba(255,255,255,.06); }
@media (min-width: 900px) {
  .hero::before { width: 560px; height: 560px; right: 20px; top: 50%; transform: translateY(-50%); }
  .hero::after { right: 299px; }
}
.hero__inner { display: grid; gap: 32px; align-items: center; }
.hero .eyebrow { color: var(--blue-light); }
.hero h1 { margin-bottom: .35em; }
.hero__lead { font-size: 1.1rem; color: rgba(255,255,255,.82); max-width: 34em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero .btn--ghost { color: var(--white); border-color: rgba(255,255,255,.5); }
.hero .btn--ghost:hover { background: var(--white); color: var(--navy); border-color: var(--white); }
.hero__crest { width: 140px; order: -1; filter: drop-shadow(0 16px 40px rgba(0,0,0,.35)); }

.levels {
  display: flex; flex-wrap: wrap; gap: 8px 10px;
  list-style: none; margin: 40px 0 0; padding: 24px 0 0;
  border-top: 1px solid rgba(255,255,255,.12);
}
.levels li {
  font-family: var(--font-display); font-weight: 600; letter-spacing: .08em;
  font-size: .95rem; color: rgba(255,255,255,.75);
  padding: 4px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px;
}

@media (min-width: 900px) {
  .hero { padding: 96px 0 48px; }
  .hero__inner { grid-template-columns: 1fr auto; gap: 64px; }
  .hero__crest { order: 0; width: 300px; }
  .hero__lead { font-size: 1.2rem; }
}

/* ---------- Sections ---------- */
.section { padding: var(--section-y) 0; }
.section--alt { background: var(--surface); }
.section--tight { padding-top: 32px; }
.section--flush { padding-bottom: 0; }
.section__head { max-width: 720px; margin-bottom: 40px; }
.section__head--row { max-width: none; display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section__head--row h2 { margin-bottom: 0; }
.section__lead { color: var(--muted); font-size: 1.08rem; }

/* Numbered pillars */
.pillars { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: pillar; }
.pillars li {
  counter-increment: pillar;
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
}
.pillars li::before {
  content: counter(pillar, decimal-leading-zero);
  display: block; margin-bottom: 12px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; color: var(--blue);
}
.pillars p { color: var(--muted); margin: 0; }
@media (max-width: 639px) {
  .pillars li { display: grid; grid-template-columns: 40px 1fr; padding: 20px; column-gap: 8px; }
  .pillars li::before { grid-row: span 2; margin: 0; line-height: 1.05; }
  .pillars h3 { margin-bottom: .25em; }
}
@media (min-width: 640px) { .pillars { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .pillars { grid-template-columns: repeat(4, 1fr); } }

/* Two columns: selection + development */
.split { display: grid; gap: 56px; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 72px; } }

.steps { display: grid; gap: 24px; margin-top: 8px; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 16px; }
.step__num {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem;
  color: var(--white); background: var(--blue);
}
.step h3 { margin-bottom: .3em; }
.step p { color: var(--muted); margin: 0; }

.checklist { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 20px; }
.checklist li { display: grid; grid-template-columns: 24px 1fr; gap: 14px; color: var(--muted); }
.checklist .icon { color: var(--blue); margin-top: 3px; }
.checklist strong { display: block; color: var(--ink); font-weight: 600; }

/* ---------- People ---------- */
.person-card { display: block; text-decoration: none; color: inherit; }
.person-card__photo {
  display: block; overflow: hidden; border-radius: var(--radius);
  aspect-ratio: 4 / 5; background: var(--surface);
}
.person-card__photo img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 20%;
  transition: transform .35s ease;
}
.person-card:hover .person-card__photo img { transform: scale(1.04); }
.person-card__name {
  display: block; margin-top: 12px;
  font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; line-height: 1.15;
  color: var(--ink);
}
.person-card:hover .person-card__name { color: var(--blue); }
.person-card__role { display: block; font-size: .9rem; color: var(--muted); margin-top: 2px; }
.person-card__role.is-lead { color: var(--blue); font-weight: 600; }

.person-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 16px; }
@media (min-width: 640px) { .person-grid { grid-template-columns: repeat(3, 1fr); gap: 36px 24px; } }
@media (min-width: 1000px) { .person-grid { grid-template-columns: repeat(4, 1fr); } }

/* Home: swipeable row on phones, grid on desktop */
.person-rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 62%;
  gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin-inline: calc(var(--gutter) * -1); padding: 0 var(--gutter) 8px;
  scrollbar-width: none;
}
.person-rail::-webkit-scrollbar { display: none; }
.person-rail > * { scroll-snap-align: start; }
@media (min-width: 640px) { .person-rail { grid-auto-columns: 30%; } }
@media (min-width: 1000px) {
  .person-rail { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); overflow: visible; margin: 0; padding: 0; gap: 36px 24px; }
}

.founders { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; max-width: 640px; }
@media (min-width: 640px) { .founders { gap: 32px; } }

/* Profile page */
.profile__grid { display: grid; gap: 32px; }
.profile__photo img { width: 100%; max-height: 80vh; border-radius: var(--radius); object-fit: cover; object-position: center 20%; }
.profile__body h1 { font-size: clamp(2.4rem, 7vw, 3.75rem); margin-bottom: .15em; }
.profile__role { color: var(--blue); font-weight: 600; font-size: 1.05rem; }
.profile__bio { font-size: 1.08rem; color: #2a3243; max-width: 38em; margin: 20px 0 32px; }
@media (min-width: 800px) {
  .profile__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: start; }
  .profile__photo { position: sticky; top: calc(var(--header-h) + 24px); }
}

/* ---------- Inner page header ---------- */
.page-head { background: var(--navy); color: var(--white); padding: 56px 0 48px; }
.page-head .eyebrow { color: var(--blue-light); }
.page-head h1 { font-size: clamp(2.4rem, 7vw, 4rem); max-width: 16em; }
.page-head__lead { color: rgba(255,255,255,.8); font-size: 1.1rem; max-width: 36em; margin: 0; }
.page-head--center { text-align: center; padding: 96px 0; }
.page-head--center h1, .page-head--center .page-head__lead { margin-inline: auto; }
.page-head--center .hero__actions { justify-content: center; }
.page-head .btn--ghost { color: var(--white); border-color: rgba(255,255,255,.5); }
@media (min-width: 900px) { .page-head { padding: 88px 0 72px; } }

/* ---------- About prose ---------- */
.prose { max-width: 720px; }
.prose h2 { margin-top: 1.4em; }
.prose h2:first-child { margin-top: 0; }
.prose p { font-size: 1.08rem; color: #2a3243; }
.prose blockquote {
  margin: 40px 0; padding: 4px 0 4px 24px; border-left: 4px solid var(--blue);
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 4.5vw, 2.2rem);
  line-height: 1.15; color: var(--navy);
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 20px; }
@media (min-width: 800px) { .contact-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
.contact-card {
  display: flex; flex-direction: column;
  padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
}
.contact-card h2 { font-size: clamp(1.7rem, 4vw, 2.2rem); }
.contact-card p { color: var(--muted); }
.contact-card .btn { margin-top: auto; align-self: flex-start; }
.ticks { list-style: none; padding: 0; margin: 4px 0 28px; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 10px; align-items: center; }
.ticks .icon { color: var(--blue); }

.contact-direct { margin-top: 56px; display: flex; flex-direction: column; gap: 12px; }
.contact-direct h2 { font-size: 1.6rem; margin-bottom: 4px; }
.contact-direct a { display: inline-flex; align-items: center; gap: 12px; font-size: 1.1rem; text-decoration: none; color: var(--ink); width: fit-content; }
.contact-direct a:hover { color: var(--blue); }
.contact-direct .icon { color: var(--blue); }

/* ---------- CTA band ---------- */
.cta { background: var(--surface); padding: var(--section-y) 0; }
.cta__grid { display: grid; gap: 20px; }
@media (min-width: 800px) { .cta__grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
.cta__card { padding: 32px 28px; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); }
.cta__card:first-child { background: var(--navy); border-color: var(--navy); color: var(--white); }

.cta__card:first-child p { color: rgba(255,255,255,.8); }
.cta__card h2 { font-size: clamp(1.7rem, 4vw, 2.2rem); }
.cta__card p { color: var(--muted); }
.cta__card .btn { margin-top: 8px; }
.cta__card:first-child .eyebrow { color: var(--blue-light); }
.contact-card .eyebrow, .cta__card .eyebrow { color: var(--blue); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: rgba(255,255,255,.75); padding: 56px 0 24px; }
.site-footer__inner { display: grid; gap: 32px; }
.site-footer__brand { display: flex; align-items: center; gap: 16px; }
.site-footer__brand p {
  margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.3rem;
  text-transform: uppercase; letter-spacing: .04em; line-height: 1.15; color: var(--white);
}
.site-footer a { color: rgba(255,255,255,.8); text-decoration: none; }
.site-footer a:hover { color: var(--white); }
.site-footer__nav, .site-footer__contact { display: flex; flex-direction: column; gap: 10px; }
.site-footer__contact a { display: inline-flex; align-items: center; gap: 10px; }
.site-footer__legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); font-size: .9rem; }
@media (min-width: 800px) {
  .site-footer__inner { grid-template-columns: 1.4fr 1fr 1.4fr; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
