/* Astral Ridge E-Sport : styles communs à toutes les pages */

/* ── Polices hébergées sur le site (aucun appel à Google) ── */
@font-face {
  font-family: 'Archivo';
  src: url('../polices/archivo-variable-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('../polices/plex-mono-400-latin.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('../polices/plex-mono-500-latin.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

/* Couleurs de l'agent mis en avant : déclarées pour pouvoir s'animer */
@property --c1 { syntax: '<color>'; inherits: true; initial-value: #355285; }
@property --c2 { syntax: '<color>'; inherits: true; initial-value: #101c47; }

:root {
  --night: #05060D;
  --night-2: #0A0D1E;
  --night-3: #10152E;
  --ink: #EEF0F7;
  --ink-soft: #C3C8DD;
  --muted: #8D95B5;
  --line: rgba(238, 240, 247, 0.10);
  --line-strong: rgba(238, 240, 247, 0.22);
  --blue: #3454E0;
  --blue-soft: #8FA4FF;
  --pink: #E56ED4;
  --win: #9FB4FF;
  --loss: #F08A95;

  --sans: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --gutter: clamp(16px, 5vw, 72px);

  /* Mis à jour par le script au défilement */
  --sy: 0;
  --dawn: 0;
}
:root:not([data-theme="light"]) { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--night);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-stretch: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
::selection { background: rgba(229, 110, 212, .35); color: #fff; }
:focus-visible { outline: 2px solid var(--blue-soft); outline-offset: 4px; border-radius: 2px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--night); padding: 10px 16px; font-weight: 600;
}
.skip:focus { top: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); }

/* ── Ciel fixe : nuit → aube en approchant du sommet ── */
.sky, .sky-dawn, .stars, .grain { position: fixed; inset: 0; pointer-events: none; }
.sky {
  z-index: -4;
  background:
    radial-gradient(110% 70% at 50% -10%, #111842 0%, transparent 60%),
    radial-gradient(60% 50% at 85% 20%, rgba(52, 84, 224, .10), transparent 70%),
    linear-gradient(180deg, #080B1C 0%, var(--night) 70%);
}
.sky-dawn {
  z-index: -3;
  opacity: var(--dawn);
  background:
    radial-gradient(90% 55% at 50% 115%, rgba(229, 110, 212, .30), transparent 70%),
    radial-gradient(60% 45% at 15% 105%, rgba(52, 84, 224, .28), transparent 70%),
    linear-gradient(180deg, transparent 25%, rgba(58, 30, 92, .38) 100%);
}
.stars { z-index: -2; opacity: calc(1 - var(--dawn) * .65); }
.star { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; opacity: .5; }
.star.tw { animation: twinkle 5s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: .12; } 50% { opacity: .85; } }
.grain {
  z-index: 90;
  opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Navigation ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background .5s ease, border-color .5s ease, backdrop-filter .5s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(5, 6, 13, .72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; height: 76px; }
.brand { grid-column: 1; justify-self: start; display: flex; align-items: center; }
.brand svg { height: 32px; width: auto; }
.nav-links { grid-column: 2; display: flex; gap: 44px; justify-self: center; }
.nav-links a {
  position: relative; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft);
  font-stretch: 112%; transition: color .3s ease;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-right { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 20px; }
.nav-alt { display: none; font-family: var(--mono); font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.nav-alt b { font-weight: 500; color: var(--ink); }
.nav-cta {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-stretch: 115%; font-weight: 700;
  padding: 13px 22px; color: var(--night); background: var(--ink);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25), 0 10px 34px rgba(229, 110, 212, .28), 0 0 22px rgba(143, 164, 255, .25);
  transition: background .4s ease, box-shadow .4s ease, transform .4s var(--ease);
}
.nav-cta::after {
  content: ''; position: absolute; inset: -1px; z-index: -1; opacity: 0;
  background: linear-gradient(90deg, var(--blue-soft), var(--pink)); filter: blur(14px); transition: opacity .4s ease;
}
.nav-cta .arrow { transition: transform .4s var(--ease); }
.nav-cta:hover { background: linear-gradient(90deg, #DCE3FF, #FBD3F4); transform: translateY(-1px); }
.nav-cta:hover::after { opacity: .7; }
.nav-cta:hover .arrow { transform: translateX(4px); }
.nav-toggle {
  display: none; width: 44px; height: 44px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink);
  position: relative; z-index: 61;
}
.nav-toggle span { position: absolute; left: 11px; right: 11px; height: 1.5px; background: currentColor; transition: transform .4s var(--ease), opacity .3s; }
.nav-toggle span:nth-child(1) { top: 17px; }
.nav-toggle span:nth-child(2) { top: 26px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-4.5px) rotate(-45deg); }


/* ── Boutons ── */
.btn {
  display: inline-flex; align-items: center; gap: 14px; padding: 17px 28px;
  font-family: var(--sans); font-stretch: 115%; font-weight: 600; font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase;
  transition: background .35s ease, color .35s ease, border-color .35s ease, box-shadow .35s ease;
  border: 1px solid transparent; cursor: pointer;
}
.btn .arrow { transition: transform .4s var(--ease); }
.btn:hover .arrow { transform: translateX(5px); }
.btn-primary { background: var(--ink); color: var(--night); }
.btn-primary:hover { background: #fff; box-shadow: 0 0 40px rgba(143, 164, 255, .35); }
.btn-line { border-color: var(--line-strong); color: var(--ink); }
.btn-line:hover { border-color: var(--ink); }

/* ── Apparitions au défilement (activées seulement avec JS) ── */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0s); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ── En-têtes de section ── */
section { position: relative; }
.sec { padding: clamp(72px, 11vh, 120px) 0; }
.sec-meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 18px;
}
.sec-meta .num { color: var(--ink); }
.sec-meta .rule { width: 48px; height: 1px; background: var(--line-strong); }
.sec-meta .alt { color: var(--pink); }
.title-xl {
  font-stretch: 125%; font-weight: 800; text-transform: uppercase; letter-spacing: -.01em;
  font-size: clamp(34px, 5.2vw, 82px); line-height: .92;
}


/* ── Pied de page ── */
footer { border-top: 1px solid var(--line); padding: 22px 0; background: rgba(5, 6, 13, .6); }
.foot {
  display: flex; justify-content: space-between; align-items: center; gap: 14px 24px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.foot-brand { display: flex; align-items: center; gap: 12px; margin: 0; white-space: nowrap; }
.foot-brand svg { height: 18px; width: auto; color: var(--ink-soft); }
.foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot a { transition: color .3s; }
.foot a:hover { color: var(--ink); }
.foot-legal { gap: 16px !important; }
.foot-portal { color: var(--ink-soft); }


/* ── Résultats : tableau, bilan, anti-spoil (accueil et page Résultats) ── */
.results-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.record { font-family: var(--mono); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); display: flex; gap: 18px; }
.record b { font-weight: 500; color: var(--ink); font-size: 15px; }
.record-note { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tag { padding: 4px 10px; border: 1px solid currentColor; }
.tag.win { color: var(--win); }
.tag.loss { color: var(--loss); }

.matches { width: 100%; margin-top: 18px; border-collapse: collapse; }
.matches th {
  text-align: left; font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  padding: 12px 12px; border-bottom: 1px solid var(--line);
}
.matches td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.matches tr { transition: background .3s ease; }
.matches tbody tr:hover { background: rgba(238, 240, 247, .03); }
.matches .date { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.matches .opp { font-stretch: 112%; font-weight: 600; }
.opp-badge {
  display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 12px; vertical-align: middle;
  font-family: var(--mono); font-weight: 400; font-size: 10.5px; color: var(--ink-soft); border: 1px solid var(--line-strong);
}
.matches .sc { font-family: var(--mono); font-size: 16px; white-space: nowrap; text-align: right; }
.matches .res { text-align: right; width: 1%; white-space: nowrap; }
.matches th.r { text-align: right; }
.results-foot { margin-top: 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.results-side { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.latest {
  display: inline-block; margin-left: 12px; padding: 2px 8px; vertical-align: 2px;
  font-family: var(--mono); font-weight: 400; font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--pink); border: 1px solid rgba(229, 110, 212, .45);
}
/* Anti-spoil : scores et bilan floutés tant qu'on ne demande pas à les voir */
.spoil-toggle {
  display: none; align-items: center; gap: 10px; padding: 10px 16px; cursor: pointer;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink); background: rgba(238, 240, 247, .04); border: 1px solid var(--line-strong);
  transition: border-color .3s ease, background .3s ease;
}
.js .spoil-toggle { display: inline-flex; }
.spoil-toggle { position: relative; }
.spoil-toggle .comet { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); overflow: visible; pointer-events: none; transition: opacity .4s ease; }
.comet rect { x: .5px; y: .5px; width: calc(100% - 1px); height: calc(100% - 1px); fill: none; stroke: var(--pink); stroke-linecap: round; animation: comet1 3.4s linear infinite; }
.comet .t1 { animation-name: comet1; stroke-width: 1; stroke-opacity: .2; stroke-dasharray: 26 74; }
.comet .t2 { animation-name: comet2; stroke-width: 1.5; stroke-opacity: .5; stroke-dasharray: 11 89; }
.comet .hd { animation-name: comet3; stroke-width: 2.5; stroke: #FBD6F5; stroke-dasharray: 2.5 97.5; filter: drop-shadow(0 0 3px var(--pink)) drop-shadow(0 0 8px rgba(229, 110, 212, .9)); }
@keyframes comet1 { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -100; } }
@keyframes comet2 { from { stroke-dashoffset: -15; } to { stroke-dashoffset: -115; } }
@keyframes comet3 { from { stroke-dashoffset: -23.5; } to { stroke-dashoffset: -123.5; } }
.spoil-toggle[aria-pressed="true"] .comet { opacity: 0; }
.spoil-toggle:hover { border-color: var(--ink); background: rgba(238, 240, 247, .08); }
.spoil-toggle svg:not(.comet) { width: 16px; height: 16px; }
.spoil-toggle .off { display: none; }
.spoil-toggle[aria-pressed="true"] .on { display: none; }
.spoil-toggle[aria-pressed="true"] .off { display: inline; }
.spoil { transition: filter .5s ease, opacity .5s ease; }
.is-hidden .spoil { filter: blur(7px); opacity: .75; user-select: none; }
.is-hidden .matches tbody { cursor: pointer; }


@media (max-width: 640px) {
  .matches th:first-child, .matches td.date { display: none; }
  .matches td, .matches th { padding-left: 6px; padding-right: 6px; }
}
.tag .t-court { display: none; }
@media (max-width: 360px) {
  .matches .opp { font-size: 12.5px !important; letter-spacing: -.01em; }
  .matches th { letter-spacing: .06em; }
}
@media (max-width: 420px) {
  .matches .opp-badge { display: none; }
  .matches .opp { font-size: 14px; overflow-wrap: anywhere; }
  .matches td, .matches th { padding-left: 4px; padding-right: 4px; }
  /* Résultat abrégé (V / D) : le mot complet reste lu par les lecteurs d'écran */
  .tag .t-court { display: inline; }
  .tag .t-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .matches .latest { display: block; width: max-content; margin: 4px 0 0; }
  .matches .sc { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .comet { display: none; }
}

/* ── Navigation tablette et mobile ── */
@media (max-width: 960px) {
  .nav-links {
    position: fixed; inset: 0; z-index: 60; flex-direction: column; justify-content: center; align-items: center; gap: 30px;
    background: rgba(5, 6, 13, .97); opacity: 0; visibility: hidden; transition: opacity .4s ease, visibility .4s;
  }
  .nav-links a { font-size: 22px; }
  .nav-links.open { opacity: 1; visibility: visible; }
  .nav-toggle { display: block; }
  .nav-right { gap: 12px; }
  .nav-cta { padding: 10px 14px; font-size: 11px; letter-spacing: .12em; }
  .nav-cta .arrow { display: none; }
}
@media (max-width: 960px) and (pointer: coarse), (max-width: 640px) {
  /* Liens du pied de page : cibles tactiles plus confortables */
  .foot nav { gap: 4px 20px; }
  .foot nav a { display: inline-block; padding: 8px 2px; }
  .brand { padding: 6px 4px; margin: -6px -4px; }
}
@media (max-width: 560px) {
  /* Grands titres : moins étirés pour tenir sur les petits écrans */
  .title-xl { font-stretch: 100%; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav-inner { height: 64px; }
  .btn { padding: 16px 22px; }
}
@media (max-width: 420px) {
  .foot-brand { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
