/* #WakyHagrah · Waky Expose Full
   Un seul thème (sombre), une échelle d'espacement, une échelle de rayons. */

:root {
  --bg: #0a0a0a;
  --surface: #121212;
  --line: #222221;
  --line-2: #2f2f2d;
  --fg: #f3f2ee;
  --muted: #8f8e89;
  --dim: #5c5b57;
  --accent: #c8441a;
  --accent-ink: #ffffff;

  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 40px;
  --s5: 64px;
  --gutter: clamp(16px, 4vw, 40px);

  --r-ctl: 999px;
  --r-card: 12px;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --fast: 160ms;

  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

[hidden] { display: none !important; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Fond : champ de points ---------- */

#field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Bandeau ---------- */

.ticker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 7px var(--gutter);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  white-space: nowrap;
}

.ticker strong { font-weight: 800; letter-spacing: -.01em; text-transform: uppercase; }
.ticker .muted { color: var(--muted); }

.pill-accent {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 12px;
}

/* ---------- Navigation ---------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -.03em;
  text-decoration: none;
}

.nav-right { display: flex; align-items: center; gap: var(--s1); }

.btn.btn-small { min-height: 32px; padding: 0 12px; font-size: 13px; text-decoration: none; }

.clock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-ctl);
  font-size: 13px;
  color: var(--muted);
}

.clock b {
  color: var(--fg);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- Hero ---------- */

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s5);
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--s5) var(--gutter) var(--s4);
}

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  gap: var(--s4);
  align-items: end;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 var(--s3);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.live {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.live::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: live 2.4s var(--ease) infinite;
}

@keyframes live {
  0% { transform: scale(.4); opacity: 1; }
  70%, 100% { transform: scale(1.5); opacity: 0; }
}

h1 {
  margin: 0;
  font-size: clamp(52px, 8.6vw, 136px);
  font-weight: 800;
  line-height: .9;
  letter-spacing: -.058em;
}

.line {
  display: block;
  overflow: hidden;
  /* marge pour les jambages (p, y) sous le masque */
  padding-bottom: .08em;
  margin-bottom: -.08em;
}

.line > span { display: inline-block; }

.g { color: var(--dim); }

.sub {
  max-width: 34ch;
  margin: var(--s3) 0 0;
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.4;
  color: #c9c8c3;
}

/* ---------- Colonne date ---------- */

.when { display: flex; flex-direction: column; align-items: flex-start; }

.chip {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-ctl);
  font-size: 12px;
  color: #cfcec9;
}

.when-date {
  margin: var(--s2) 0 0;
  font-size: clamp(44px, 4.6vw, 68px);
  font-weight: 800;
  letter-spacing: -.05em;
  line-height: .95;
}

.when-sub { margin: 10px 0 0; font-size: 15px; color: #cfcec9; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s2); }
.chips .chip { color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s3); }

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-ctl);
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--fast) ease, border-color var(--fast) ease, color var(--fast) ease;
}

.btn:hover { border-color: #4a4a47; background: #161615; }

.btn-primary { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.btn-primary:hover { background: #ffffff; border-color: #ffffff; }

/* ---------- Menu de partage ---------- */

.share { position: relative; }

.share-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-card);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .55);
}

.share-menu:not([hidden]) { animation: pop 180ms var(--ease); }

@keyframes pop {
  from { opacity: 0; transform: translateY(-6px); }
}

.share-preview {
  grid-column: 1 / -1;
  margin: 4px 10px 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.share-warn {
  grid-column: 1 / -1;
  margin: 2px 2px 6px;
  padding: 10px 12px;
  border: 1px solid #4a2a1e;
  border-radius: 8px;
  background: #1c1310;
  font-size: 13px;
  line-height: 1.4;
  color: #e9c3b4;
}

.share-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--fast) ease;
}

.share-item:hover,
.share-item:focus-visible { background: #1d1d1c; }
.share-item:focus-visible { outline-offset: -2px; }

.share-item span { font-size: 12px; font-weight: 400; color: var(--muted); }
.share-item.wide { grid-column: 1 / -1; }

.share-sep { grid-column: 1 / -1; height: 1px; margin: 4px 0; background: var(--line); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  margin: 0;
  padding: 10px 18px;
  border-radius: var(--r-ctl);
  background: var(--fg);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms var(--ease);
}

.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .share { position: static; }
  .share-menu {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
  }
  .share-menu:not([hidden]) { animation: sheet 220ms var(--ease); }
  .share-item { padding: 14px 12px; }
}

@keyframes sheet {
  from { transform: translateY(100%); }
}

@media (prefers-reduced-motion: reduce) {
  .share-menu:not([hidden]) { animation: none; }
  .toast { transition: none; }
}

/* ---------- Compte à rebours ---------- */

.count {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding-top: var(--s3);
}

.count::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line-2);
  transform-origin: left;
}

.unit {
  padding: 0 var(--s3);
  border-left: 1px solid var(--line);
}

.unit:first-of-type { padding-left: 0; border-left: 0; }

.digits {
  display: flex;
  font-size: clamp(60px, 10.5vw, 172px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
}

.cell {
  display: grid;
  overflow: hidden;
  /* évite que le masque coupe le haut des chiffres */
  padding: .04em 0;
}

.cell > .d { grid-area: 1 / 1; text-align: center; }

.unit-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s1);
  margin-top: var(--s1);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.unit-label small {
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

/* État terminé */
.is-done .live { background: var(--fg); }
.is-done .live::after { display: none; }
.is-done .digits { color: var(--dim); }

/* ---------- Pied de page ---------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s1) var(--s3);
  padding: var(--s2) var(--gutter);
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}


/* ---------- Curseur ---------- */

.ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 1px solid rgba(243, 242, 238, .55);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease, width 200ms var(--ease), height 200ms var(--ease), margin 200ms var(--ease), border-color 200ms ease;
}

.ring.on { opacity: 1; }
.ring.hot { width: 44px; height: 44px; margin: -22px 0 0 -22px; border-color: var(--fg); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Reveals (uniquement si JS actif) ---------- */

.js .reveal-down { transform: translateY(-100%); }
.js .line > span { transform: translateY(105%); }
.js .fade { opacity: 0; transform: translateY(10px); }
.js .count::before { transform: scaleX(0); }
.js .unit-label { opacity: 0; }

.js.in .reveal-down { transform: none; transition: transform 600ms var(--ease); }
.js.in .line > span { transform: none; transition: transform 680ms var(--ease); }
.js.in .line:nth-child(2) > span { transition-delay: 110ms; }
.js.in .fade { opacity: 1; transform: none; transition: opacity 500ms ease, transform 600ms var(--ease); transition-delay: var(--d, 0ms); }
.js.in .count::before { transform: none; transition: transform 680ms var(--ease) 350ms; }
.js.in .unit-label { opacity: 1; transition: opacity 500ms ease; transition-delay: var(--d, 0ms); }

@media (prefers-reduced-motion: reduce) {
  .js .reveal-down,
  .js .line > span,
  .js .fade,
  .js .count::before,
  .js .unit-label { transform: none; opacity: 1; transition: none; }
  .live::after { animation: none; }
  .ring { display: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero-top { grid-template-columns: 1fr; gap: var(--s4); }
  .hero { justify-content: flex-start; gap: var(--s4); padding-top: var(--s4); }
}

@media (max-width: 640px) {
  .ticker .muted { display: none; }
  .clock span { display: none; }
  .count { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s3); }
  .unit:nth-of-type(3) { padding-left: 0; border-left: 0; }
  .digits { font-size: clamp(64px, 24vw, 120px); }
  .unit-label small { display: none; }
}

@media (hover: none), (pointer: coarse) {
  .ring { display: none; }
}
