/* =============================================================================
   SOCCEROOS 2006–2026 - DESIGN SYSTEM
   Editorial "analytics dossier". Dark-default, theme-aware. Validated palette.
   ========================================================================== */

:root {
  /* SOCCEROOS BRAND - DARK (default): warm charcoal surfaces, green & gold chrome */
  --page:        #0b0d0a;
  --surface-1:   #12140f;
  --surface-2:   #1a1d16;
  --surface-3:   #232720;
  --ink:         #f5f3e8;
  --ink-2:       #bebcaa;
  --muted:       #8a8b78;
  --grid:        #262a20;
  --axis:        #38402f;
  --border:      rgba(255,255,255,0.09);
  --border-str:  rgba(255,255,255,0.16);

  /* brand chrome - bright Socceroos green & gold (UI accents) */
  --gold:        #ebc14d;   /* Socceroos gold - hero/accent */
  --gold-deep:   #c98500;
  --green:       #2ac07e;   /* Socceroos green */
  --green-br:    #37d68e;
  --blue:        #3987e5;   /* field / opponent (data) */
  --violet:      #9085e9;
  --red:         #e66767;

  --good:        #2fd07f;
  --warn:        #f5b93b;
  --bad:         #e5605f;

  /* data series - validated for the dark surface (decoupled from bright chrome) */
  --s-aus:       #c98500;   /* Australia = rich gold */
  --s-field:     #3987e5;   /* field / opponent = blue */
  --s-women:     #199e70;   /* AFC / Matildas = green */

  --radius:      14px;
  --radius-sm:   9px;
  --shadow:      0 1px 2px rgba(0,0,0,.4), 0 8px 30px rgba(0,0,0,.30);
  --maxw:        1180px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

:root[data-theme="light"] {
  /* SOCCEROOS BRAND - LIGHT: warm cream surfaces, deep green & gold */
  --page:        #f5f2e6;
  --surface-1:   #fffef8;
  --surface-2:   #efeadb;
  --surface-3:   #e6e0ce;
  --ink:         #16150e;
  --ink-2:       #4c4a3b;
  --muted:       #827c68;
  --grid:        #e7e1cf;
  --axis:        #cdc7b2;
  --border:      rgba(20,18,10,0.10);
  --border-str:  rgba(20,18,10,0.18);
  --gold:        #9a7412;
  --gold-deep:   #c98500;
  --green:       #0c8a45;
  --green-br:    #0f9a4f;
  --blue:        #2a6fce;
  --violet:      #5646c0;
  --red:         #cf4544;
  --good:        #0c8a3a;
  --warn:        #b8850c;
  --bad:         #cf3b3a;
  --s-aus:       #a97e12;
  --s-field:     #2a6fce;
  --s-women:     #0f8a4f;
  --shadow:      0 1px 2px rgba(40,34,10,.06), 0 10px 34px rgba(40,34,10,.09);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --page:#f5f2e6; --surface-1:#fffef8; --surface-2:#efeadb; --surface-3:#e6e0ce;
    --ink:#16150e; --ink-2:#4c4a3b; --muted:#827c68; --grid:#e7e1cf; --axis:#cdc7b2;
    --border:rgba(20,18,10,0.10); --border-str:rgba(20,18,10,0.18);
    --gold:#9a7412; --gold-deep:#c98500; --green:#0c8a45; --green-br:#0f9a4f;
    --blue:#2a6fce; --violet:#5646c0; --red:#cf4544;
    --good:#0c8a3a; --warn:#b8850c; --bad:#cf3b3a;
    --s-aus:#a97e12; --s-field:#2a6fce; --s-women:#0f8a4f;
    --shadow:0 1px 2px rgba(40,34,10,.06), 0 10px 34px rgba(40,34,10,.09);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--page); }
body {
  margin: 0; background: transparent; color: var(--ink);
  position: relative; z-index: 0;
  font-family: var(--font); line-height: 1.6;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
#bg-fx { transition: opacity .6s; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.section { padding: clamp(38px, 6vw, 74px) 0; }
.section-tight { padding: clamp(24px,4vw,44px) 0; }
h1,h2,h3,h4 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
p { margin: 0 0 1rem; color: var(--ink-2); }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
.lede { font-size: clamp(1.05rem, 1.8vw, 1.28rem); color: var(--ink); max-width: 62ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; font-weight: 700; color: var(--gold); margin-bottom: .8rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

/* ---------- top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--page) 86%, transparent);
  backdrop-filter: saturate(140%) blur(12px); border-bottom: 1px solid var(--border);
}
.nav-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; display: flex; align-items: center; gap: 10px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; }
.brand .dot { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, var(--gold), var(--green)); display: inline-block; flex: none; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; flex: none; display: block; }
.brand small { display:block; font-weight:500; font-size:.62rem; letter-spacing:.14em; text-transform:uppercase; color:var(--muted); }
.nav-links { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.nav-links a {
  color: var(--ink-2); font-size: .86rem; font-weight: 600; padding: 7px 11px; border-radius: 8px; white-space: nowrap;
}
.nav-links a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-links a.active { color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); }
.nav-links a { padding: 7px 9px; }
.theme-btn { background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2); width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 15px; display:grid; place-items:center; flex:none; }
.theme-btn:hover { color: var(--ink); border-color: var(--border-str); }
.menu-btn { display:none; background:var(--surface-2); border:1px solid var(--border); color:var(--ink); width:34px;height:34px;border-radius:8px;cursor:pointer;font-size:16px; flex:none; }
@media (max-width: 1040px) {
  .nav-links { position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; background: var(--surface-1); border-bottom: 1px solid var(--border); padding: 8px; display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px; }
  .menu-btn { display: grid; }
}

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero::before {
  content:""; position:absolute; inset:0;
  background: radial-gradient(1100px 500px at 78% -8%, color-mix(in srgb, var(--gold) 20%, transparent), transparent 60%),
              radial-gradient(900px 500px at 6% 108%, color-mix(in srgb, var(--green) 16%, transparent), transparent 62%);
  pointer-events:none;
}
.hero .wrap { position: relative; padding-top: clamp(46px,7vw,90px); padding-bottom: clamp(40px,6vw,72px); }

/* ---------- cards & grids ---------- */
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card.pad-lg { padding: clamp(20px, 3vw, 34px); }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px){ .g3,.g4 { grid-template-columns: repeat(2,1fr);} }
@media (max-width: 560px){ .g2,.g3,.g4 { grid-template-columns: 1fr;} }

/* ---------- stat tiles ---------- */
.stat { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; position:relative; }
.stat .k { font-size: clamp(1.9rem, 4vw, 2.7rem); font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--ink); }
.stat .k.gold { color: var(--gold); }
.stat .k.green { color: var(--green-br); }
.stat .k.red { color: var(--bad); }
.stat .l { font-size: .82rem; color: var(--muted); margin-top: 9px; font-weight:600; }
.stat .sub { font-size: .78rem; color: var(--ink-2); margin-top: 4px; }

/* ---------- pills / tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.pill { font-size: .74rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--border); }
.pill.gold { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); border-color: color-mix(in srgb, var(--gold) 30%, transparent); }
.pill.green { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green-br); border-color: color-mix(in srgb, var(--green) 34%, transparent); }
.pill.red { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--bad); border-color: color-mix(in srgb, var(--red) 30%, transparent); }

/* result chips */
.rc { display:inline-grid; place-items:center; min-width: 22px; height:22px; padding:0 6px; border-radius:6px; font-size:.72rem; font-weight:800; color:#0c0d0e; }
.rc.W { background: var(--good); } .rc.D { background: var(--warn); } .rc.L { background: var(--bad); }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 560px; }
table.data th, table.data td { padding: 10px 13px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data th { color: var(--muted); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; position: sticky; top: 0; background: var(--surface-2); }
table.data td:first-child, table.data th:first-child { text-align: left; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tr.hi td { background: color-mix(in srgb, var(--gold) 10%, transparent); }
table.data td.pos { color: var(--good); font-weight:700; } table.data td.neg { color: var(--bad); font-weight:700; }

/* ---------- chart chrome ---------- */
.chart-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 20px 16px; box-shadow: var(--shadow); }
.chart-head { display:flex; justify-content: space-between; align-items:flex-start; gap:12px; margin-bottom: 6px; flex-wrap:wrap; }
.chart-title { font-weight: 700; font-size: 1.02rem; color: var(--ink); }
.chart-sub { font-size: .82rem; color: var(--muted); margin-top:2px; max-width: 62ch; }
.legend { display:flex; flex-wrap:wrap; gap: 14px; font-size: .8rem; color: var(--ink-2); margin-top: 4px; }
.legend .li { display:inline-flex; align-items:center; gap:6px; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; display:inline-block; }
svg.chart { width: 100%; height: auto; display:block; overflow: visible; }
svg text { font-family: var(--font); }
.axis-label { fill: var(--muted); font-size: 11px; }
.grid-line { stroke: var(--grid); stroke-width: 1; }
.axis-line { stroke: var(--axis); stroke-width: 1; }

/* tooltip */
.tt { position: fixed; z-index: 90; pointer-events: none; background: var(--surface-3); color: var(--ink); border: 1px solid var(--border-str); border-radius: 8px; padding: 8px 11px; font-size: .8rem; box-shadow: var(--shadow); opacity: 0; transform: translateY(-4px); transition: opacity .1s; max-width: 260px; }
.tt.show { opacity: 1; }
.tt b { color: var(--ink); } .tt .row { display:flex; justify-content:space-between; gap:14px; }

/* ---------- misc ---------- */
.divider { height:1px; background: var(--border); margin: 8px 0; border:0; }
.kicker-num { font-size: clamp(3rem,10vw,6rem); font-weight: 800; letter-spacing: -.04em; line-height:.9; }
.rating-badge { display:inline-flex; align-items:baseline; gap:5px; font-weight:800; }
.rating-badge .n { font-size: 1.6rem; } .rating-badge .d { color: var(--muted); font-weight:600; font-size:.9rem; }
ul.clean { list-style: none; padding: 0; margin: 0; }
ul.clean li { padding: 9px 0; border-bottom: 1px solid var(--border); display:flex; gap:10px; }
ul.clean li:last-child { border-bottom: 0; }
.tick { color: var(--good); font-weight: 800; } .cross { color: var(--bad); font-weight: 800; } .flat { color: var(--warn); font-weight:800; }
.note-box { border-left: 3px solid var(--gold); background: var(--surface-2); padding: 14px 18px; border-radius: 0 8px 8px 0; font-size:.9rem; }

/* footer */
.footer { border-top: 1px solid var(--border); padding: 30px 0 46px; color: var(--muted); font-size: .82rem; }
.footer a { color: var(--ink-2); }

/* page hero band per-page */
.page-head { border-bottom:1px solid var(--border); background:
  radial-gradient(800px 300px at 88% -40%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 60%); }
.page-head .wrap { padding: clamp(30px,5vw,54px) 22px clamp(22px,3vw,34px); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){ .reveal{opacity:1;transform:none;transition:none;} html{scroll-behavior:auto;} }
