/* Layout concept: a national team's club site. Black header with the cedar crest at its
   centre, condensed heavy type set like a scoreboard, ivory on black, Lebanese red for
   emphasis and cedar green for the open section. One committed dark look. */
@font-face {
  font-family: "Archivo"; font-style: normal; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%;
  src: url("/fonts/archivo.woff2") format("woff2-variations"), url("/fonts/archivo.woff2") format("woff2");
}
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("/fonts/plex-mono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("/fonts/plex-mono-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 600; font-display: swap; src: url("/fonts/plex-mono-600.woff2") format("woff2"); }
/* Plex Mono's ½ is cramped; take that one glyph from Archivo. Declared last so it wins. */
@font-face {
  font-family: "IBM Plex Mono"; font-weight: 100 900; font-display: swap; unicode-range: U+00BD;
  src: url("/fonts/archivo.woff2") format("woff2-variations"), url("/fonts/archivo.woff2") format("woff2");
}

:root {
  --black: #080a09;        /* page ground */
  --panel: #101412;        /* tables, cards */
  --raise: #171d1a;        /* heads, hover */
  --line: #232b27;         /* rules */
  --ivory: #f2efe8;        /* text, filled squares */
  --muted: #9aa49f;        /* secondary text */
  --faint: #66716b;        /* ticks, tertiary */
  --red: #e0242f;          /* Lebanese red: emphasis, women's series */
  --cedar: #1fa25a;        /* cedar green: crest, open series */

  --condensed: "Archivo", "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
  --body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 2rem;
  --step-3: clamp(3rem, 9vw, 6rem);
  --step-4: clamp(4rem, 15vw, 11rem);

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--black); color: var(--ivory); font: 400 var(--step-0)/1.55 var(--body); }
a { color: inherit; text-decoration: none; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- header */
.masthead { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: var(--black); border-bottom: 1px solid var(--line); }
.masthead .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; height: 88px; }
.masthead nav { display: flex; gap: clamp(16px, 3vw, 40px); }
.masthead nav.right { justify-content: flex-end; }
.masthead nav a {
  font-family: var(--condensed); font-weight: 700; font-stretch: 85%; font-size: 0.9375rem;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); padding-block: 8px;
  border-bottom: 2px solid transparent; transition: color 150ms ease;
}
.masthead nav a:hover { color: var(--ivory); }
.masthead nav a[aria-current="page"] { color: var(--ivory); border-bottom-color: var(--red); }
.crest { display: grid; justify-items: center; gap: 4px; }
.crest i {
  display: block; width: 50px; height: 50px; background: var(--cedar);
  -webkit-mask: url("/cedar.svg") center / contain no-repeat; mask: url("/cedar.svg") center / contain no-repeat;
}
.crest b { font-family: var(--condensed); font-weight: 800; font-stretch: 75%; font-size: 10px; line-height: 1; letter-spacing: 0.32em; text-transform: uppercase; color: var(--ivory); padding-left: 0.32em; }

/* -------------------------------------------------------------- type */
h1, h2, h3 { margin: 0; text-wrap: balance; }
.kicker {
  display: flex; align-items: center; gap: 12px; margin: 0 0 18px;
  font-family: var(--condensed); font-weight: 700; font-stretch: 85%; font-size: var(--step--1);
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
}
.kicker::before { content: ""; width: 28px; height: 2px; background: var(--red); flex: none; }
.mega {
  font-family: var(--condensed); font-weight: 900; font-stretch: 62%; font-size: var(--step-4);
  line-height: 0.82; letter-spacing: -0.01em; text-transform: uppercase;
}
.mega .outline, .headline .outline { color: transparent; -webkit-text-stroke: 2px var(--ivory); }
.mega .red { color: var(--red); }
.headline {
  font-family: var(--condensed); font-weight: 900; font-stretch: 62%; font-size: var(--step-3);
  line-height: 0.86; text-transform: uppercase;
}
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.section-head h2 { font-family: var(--condensed); font-weight: 800; font-stretch: 70%; font-size: var(--step-2); line-height: 1; text-transform: uppercase; letter-spacing: 0.01em; }
.section-head p { margin: 0; color: var(--muted); font-size: var(--step--1); max-width: 48ch; }
.lede { max-width: 58ch; color: var(--muted); font-size: var(--step-1); line-height: 1.5; margin: 24px 0 0; }

main { padding-block: 0 96px; display: flex; flex-direction: column; gap: 88px; }
section { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* -------------------------------------------------------------- hero */
.hero { position: relative; padding-top: 72px; }
.hero .watermark {
  position: absolute; right: 0; top: 32px; width: min(48vw, 560px); aspect-ratio: 1; max-width: 100%;
  background: var(--cedar); opacity: 0.1; pointer-events: none;
  -webkit-mask: url("/cedar.svg") center / contain no-repeat; mask: url("/cedar.svg") center / contain no-repeat;
}
.hero > * { position: relative; }
.tally { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 48px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tally div { padding: 22px 0 18px 24px; display: flex; flex-direction: column; gap: 6px; border-left: 1px solid var(--line); }
.tally div:first-child { border-left: 0; padding-left: 0; }
.tally b { font-family: var(--condensed); font-weight: 900; font-stretch: 62%; font-size: clamp(2.75rem, 6vw, 4.5rem); line-height: 0.85; font-variant-numeric: tabular-nums; }
.tally span { font-family: var(--condensed); font-weight: 700; font-stretch: 85%; font-size: var(--step--1); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }

/* -------------------------------------------------------------- chart */
.chart { margin: 0; display: flex; flex-direction: column; gap: 16px; }
.legend { display: flex; gap: 20px; font-size: var(--step--1); color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.chart-scroll { overflow-x: auto; border-bottom: 1px solid var(--line); }
.chart svg.plot { display: block; width: 100%; min-width: 680px; height: auto; }
.plot .grid { stroke: var(--line); stroke-width: 1; }
.plot .tick { fill: var(--faint); font: 500 11px var(--mono); }
.plot .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.plot .open { stroke: var(--cedar); }
.plot .women { stroke: var(--red); stroke-dasharray: 6 4; }
.plot .mark { stroke: var(--black); stroke-width: 1.5; }
.plot .mark.open { fill: var(--cedar); }
.plot .mark.women { fill: var(--red); }
.plot a:hover .mark, .plot a:focus .mark { stroke: var(--ivory); }
.plot .end { fill: var(--ivory); font: 700 12px var(--body); letter-spacing: 0.04em; text-transform: uppercase; }
.plot .note { fill: var(--muted); font: 500 11px var(--mono); }

/* -------------------------------------------------------------- ledger (home) */
.ledger { display: flex; flex-direction: column; border-top: 2px solid var(--ivory); }
.ledger-row { display: grid; grid-template-columns: 140px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); }
.ledger-head { padding: 12px 0; font-family: var(--condensed); font-weight: 700; font-stretch: 85%; font-size: var(--step--1); letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.ledger .year { font-family: var(--condensed); font-weight: 900; font-stretch: 62%; font-size: 3.25rem; line-height: 0.85; font-variant-numeric: tabular-nums; }
.ledger .where b { display: block; font-family: var(--condensed); font-weight: 800; font-stretch: 75%; font-size: 1.375rem; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.1; }
.ledger .where span { color: var(--muted); font-size: var(--step--1); }
.finish { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; padding: 8px 10px; margin: -8px -10px; transition: background 150ms ease; }
a.finish:hover { background: var(--panel); }
.finish .place { font-family: var(--condensed); font-weight: 800; font-stretch: 75%; font-size: 1.5rem; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.finish .place small { font-size: 0.9375rem; color: var(--muted); font-weight: 600; }
.finish .meta { grid-column: 1 / -1; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.finish.none { color: var(--faint); font-family: var(--condensed); font-weight: 700; font-stretch: 85%; font-size: var(--step--1); letter-spacing: 0.12em; text-transform: uppercase; }
.finish .label { display: none; }
.position { position: relative; height: 4px; background: var(--raise); min-width: 56px; }
.position i { position: absolute; top: -4px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; border: 2px solid var(--black); }
.position.open i { background: var(--cedar); }
.position.women i { background: var(--red); border-radius: 1px; }

/* -------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; background: var(--panel); border-top: 2px solid var(--ivory); }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
thead th { background: var(--panel); font-family: var(--condensed); font-weight: 700; font-stretch: 85%; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; }
tbody tr { transition: background 120ms ease; }
tbody tr:hover td { background: var(--raise); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.person { font-weight: 600; }
.person:hover { color: var(--red); }
.ttl { display: inline-block; min-width: 2.4em; margin-right: 6px; font: 600 11px var(--mono); color: var(--red); }
.sec { font-family: var(--condensed); font-weight: 700; font-stretch: 85%; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; padding: 2px 7px; border: 1px solid currentColor; }
.sec.open { color: var(--cedar); }
.sec.women { color: var(--red); }
.code { font: 500 12px var(--mono); color: var(--muted); margin-left: 6px; }

/* -------------------------------------------------------------- page headers */
.crumbs { font-size: var(--step--1); color: var(--muted); margin: 0 0 28px; letter-spacing: 0.04em; }
.crumbs a { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line); }
.crumbs a:hover { color: var(--ivory); }
.page-head { padding-top: 56px; }
.scoreboard { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 40px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.scoreboard > div { padding: 22px 24px 20px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.scoreboard > div:first-child { border-left: 0; padding-left: 0; }
.scoreboard dt { font-family: var(--condensed); font-weight: 700; font-stretch: 85%; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.16em; }
.scoreboard dd { margin: 0; font-family: var(--condensed); font-weight: 900; font-stretch: 62%; font-size: clamp(2.75rem, 5vw, 4rem); line-height: 0.85; font-variant-numeric: tabular-nums; }
.scoreboard dd small { font-size: 1.25rem; color: var(--muted); font-weight: 700; font-stretch: 85%; }
.scoreboard .sub { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* -------------------------------------------------------------- crosstable */
.key { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: var(--step--1); color: var(--muted); }
.key span { display: inline-flex; align-items: center; gap: 8px; }
.key .sq { width: 18px; height: 18px; font-size: 10px; }
.crosstable th, .crosstable td { padding: 9px 10px; }
.crosstable .rd { text-align: center; padding-inline: 4px; }
.crosstable thead .rd a { display: block; font: 600 11px var(--mono); color: var(--ivory); letter-spacing: 0; }
.crosstable thead .rd a:hover { color: var(--red); }
.crosstable thead .rd span { display: block; font: 500 10px var(--mono); color: var(--faint); }
.crosstable .sticky { position: sticky; left: 0; background: var(--panel); z-index: 1; }
.crosstable .board { display: inline-block; width: 6.5ch; white-space: nowrap; font: 500 12px var(--mono); color: var(--faint); }
.crosstable tfoot td { background: var(--raise); font-weight: 700; border-bottom: 0; }
.crosstable tfoot .sticky { background: var(--raise); font-family: var(--condensed); font-stretch: 85%; letter-spacing: 0.12em; text-transform: uppercase; font-size: 12px; }
.sq {
  display: inline-grid; place-items: center; width: 26px; height: 26px;
  font: 600 12px var(--mono); border: 1.5px solid var(--ivory); color: var(--ivory); background: transparent;
}
.sq.w { background: var(--ivory); color: var(--black); }
.sq.d { background: linear-gradient(135deg, var(--ivory) 0 50%, transparent 50% 100%); }
.sq.l { color: var(--faint); border-color: var(--faint); }
.sq.ff { border-style: dashed; }
.sq.none { border-color: transparent; color: var(--faint); }
.mscore { font: 600 12px var(--mono); }
.squares { display: inline-flex; gap: 3px; }
.squares .sq { width: 20px; height: 20px; font-size: 10px; }

/* -------------------------------------------------------------- rounds */
.rounds { display: flex; flex-direction: column; border-top: 2px solid var(--ivory); }
.rounds details { border-bottom: 1px solid var(--line); }
.rounds summary { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto 80px; gap: 20px; align-items: center; padding: 16px 4px; cursor: pointer; list-style: none; transition: background 120ms ease; }
.rounds summary::-webkit-details-marker { display: none; }
.rounds summary:hover, .rounds details[open] summary { background: var(--panel); }
.rounds .rnum { font: 600 12px var(--mono); color: var(--faint); padding-left: 8px; }
.rounds .opp b { font-family: var(--condensed); font-weight: 800; font-stretch: 75%; font-size: 1.25rem; text-transform: uppercase; letter-spacing: 0.02em; }
.rounds .opp span { color: var(--muted); font-size: var(--step--1); margin-left: 10px; }
.rounds .boards { display: flex; gap: 3px; }
.rounds .boards .sq { width: 14px; height: 14px; font-size: 0; }
.rounds .score { font-family: var(--condensed); font-weight: 900; font-stretch: 62%; font-size: 1.75rem; line-height: 1; text-align: right; padding-right: 8px; font-variant-numeric: tabular-nums; }
.rounds .score.loss { color: var(--faint); }
.games { overflow-x: auto; background: var(--panel); }
.games td { padding: 10px 16px; font-size: 0.875rem; }
.piece { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ivory); margin-right: 10px; vertical-align: -1px; }
.piece.w { background: var(--ivory); }

/* -------------------------------------------------------------- players */
.career { display: block; position: relative; height: 14px; width: 100%; min-width: 200px; }
.career::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: var(--raise); }
.career i { position: absolute; top: 2px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--cedar); border: 2px solid var(--panel); }
.career i.women { background: var(--red); border-radius: 1px; }
.bar { display: flex; height: 6px; min-width: 140px; gap: 2px; }
.bar i { display: block; height: 100%; }
.bar .w { background: var(--ivory); }
.bar .d { background: var(--muted); }
.bar .l { background: var(--raise); }

/* -------------------------------------------------------------- records */
.records { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 1px; background: var(--line); border-top: 2px solid var(--ivory); border-bottom: 1px solid var(--line); }
.record { background: var(--black); padding: 26px 24px 22px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.record h3 { font-family: var(--condensed); font-weight: 700; font-stretch: 85%; font-size: var(--step--1); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.record .lead { display: flex; align-items: flex-end; gap: 16px; }
.record .lead b { font-family: var(--condensed); font-weight: 900; font-stretch: 62%; font-size: 4.5rem; line-height: 0.8; font-variant-numeric: tabular-nums; flex: none; }
.record .lead span { display: flex; flex-direction: column; min-width: 0; }
.record .lead strong { font-family: var(--condensed); font-weight: 800; font-stretch: 75%; font-size: 1.375rem; text-transform: uppercase; line-height: 1.05; }
.record .lead small { color: var(--muted); font-size: var(--step--1); }
.record ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.record li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--line); font-size: 0.9375rem; }
.record li .rank { font: 500 12px var(--mono); color: var(--faint); }
.record li .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record li .who small { color: var(--muted); margin-left: 6px; }
.record li .val { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- misc */
.empty { padding: 56px 20px; text-align: center; border: 1px dashed var(--line); color: var(--muted); }
.source { font-size: var(--step--1); color: var(--muted); }
.source a { text-decoration: underline; text-underline-offset: 4px; }
footer.site { border-top: 1px solid var(--line); }
footer.site .wrap { padding-block: 40px 56px; display: grid; grid-template-columns: auto 1fr auto; gap: 16px 32px; align-items: center; font-size: var(--step--1); color: var(--muted); }
footer.site .crest i { width: 34px; height: 34px; }
footer.site a { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 820px) {
  .masthead .wrap { grid-template-columns: 1fr 1fr; height: auto; padding-block: 12px 4px; gap: 4px 22px; }
  .masthead .crest { grid-column: 1 / -1; grid-row: 1; }
  .masthead nav.left { justify-content: flex-end; }
  .masthead nav.right { justify-content: flex-start; }
  .masthead nav { gap: 22px; }
  .masthead nav a { font-size: 0.8125rem; letter-spacing: 0.1em; }
  .hero { padding-top: 48px; }
  .tally { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tally div:nth-child(3) { border-left: 0; padding-left: 0; }
  .tally div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .ledger-head { display: none; }
  .ledger-row { grid-template-columns: 84px minmax(0, 1fr); gap: 12px 16px; }
  .ledger .year { grid-row: span 3; align-self: start; font-size: 2.5rem; }
  .finish .label { display: inline-block; width: 5.5em; font: 700 11px var(--body); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
  .finish .meta { padding-left: calc(5.5em * 11 / 16); }
  .scoreboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scoreboard > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .scoreboard > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .rounds summary { grid-template-columns: 40px minmax(0, 1fr) 64px; gap: 12px; }
  .rounds .boards { display: none; }
  .rounds .opp span { display: block; margin: 0; }
  footer.site .wrap { grid-template-columns: 1fr; justify-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
