/* ============================================================
   Lagrange
   Un batiment, deux heures. La bascule change le lieu,
   pas seulement la palette.
   ============================================================ */

:root {
  --display: 'Archivo', system-ui, sans-serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;

  --oak: #8A6A45;          /* la seule constante : le bois */
  --pad: clamp(1.25rem, 5vw, 5.5rem);
  --barh: 3.5rem;
}

/* --- NUIT : le rig dans les fermes, 450 nm dans le brouillard --- */
html[data-hour="night"] {
  --ink:  #07070C;
  --haze: #101019;
  --rule: #24242F;
  --beam: #5B49F5;
  --text: #E6E4F2;
  --dim:  #8A88A0;
  --glow: 0 0 60px rgba(91,73,245,.30);
}

/* --- JOUR : chaux de Flandre, lumiere du nord --- */
html[data-hour="day"] {
  --ink:  #E4E8DD;
  --haze: #D3D9C9;
  --rule: #B9C0AE;
  --beam: #3A2BD4;
  --text: #15171B;
  --dim:  #5D6360;
  --glow: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: clamp(1rem, .55vw + .9rem, 1.1rem);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background .7s ease, color .7s ease;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--beam); color: #fff; padding: .6rem 1rem; z-index: 99;
}
.skip:focus { left: 1rem; top: 1rem; }

:focus-visible { outline: 2px solid var(--beam); outline-offset: 3px; }

/* hide the hour that is not current */
html[data-hour="night"] [data-day],
html[data-hour="day"]   [data-night] { display: none; }

/* ============================ bar ============================ */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  height: var(--barh);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 var(--pad);
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.bar__mark {
  font-family: var(--display);
  font-variation-settings: 'wdth' 118, 'wght' 700;
  font-size: .95rem; letter-spacing: .14em; text-transform: uppercase;
}
.bar__clock {
  font-family: var(--mono); font-size: .8rem; color: var(--dim);
  margin-left: auto; font-variant-numeric: tabular-nums;
}

.toggle {
  position: relative; display: flex; align-items: center;
  border: 1px solid var(--rule); border-radius: 999px;
  background: transparent; padding: 3px; cursor: pointer;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--dim);
}
.toggle__opt { position: relative; z-index: 2; padding: .34rem .7rem; transition: color .3s; }
html[data-hour="day"]   .toggle__opt[data-for="day"],
html[data-hour="night"] .toggle__opt[data-for="night"] { color: var(--ink); }
.toggle__knob {
  position: absolute; top: 3px; bottom: 3px; width: calc(50% - 3px);
  border-radius: 999px; background: var(--beam);
  transition: transform .42s cubic-bezier(.65,0,.35,1);
}
html[data-hour="night"] .toggle__knob { transform: translateX(100%); }
html[data-hour="day"]   .toggle__knob { transform: translateX(0); }

/* ============================ hero ============================ */
.hero {
  min-height: 100svh; padding: calc(var(--barh) + 12vh) var(--pad) 4rem;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.hero::after {   /* le balayage : un seul geste au chargement */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 42%, color-mix(in srgb, var(--beam) 22%, transparent) 50%, transparent 58%);
  transform: translateX(-120%);
  animation: sweep 2.6s cubic-bezier(.4,0,.2,1) .25s both;
}
@keyframes sweep { to { transform: translateX(120%); } }

.hero__inner { max-width: 54rem; }

.eyebrow {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--dim); margin: 0 0 1.4rem;
}

.hero__title {
  font-family: var(--display);
  font-variation-settings: 'wdth' 124, 'wght' 800;
  font-size: min(11rem, calc((100vw - 2 * var(--pad)) / 7.3));
  line-height: .86; letter-spacing: -.035em;
  margin: 0 0 1.6rem; text-transform: uppercase;
  text-shadow: var(--glow);
}

.hero__lede { margin: 0 0 2.4rem; }
.hero__lede p { font-size: clamp(1.05rem, 1.4vw + .7rem, 1.6rem); max-width: 34ch; margin: 0; color: var(--text); }

.hero__acts { display: flex; flex-wrap: wrap; gap: .7rem; }

.btn {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .85rem 1.5rem; border: 1px solid var(--rule); border-radius: 999px;
  color: var(--text); text-decoration: none; transition: border-color .25s, color .25s, background .25s;
}
.btn:hover { border-color: var(--beam); color: var(--beam); }
.btn--solid { background: var(--beam); border-color: var(--beam); color: #fff; }
.btn--solid:hover { background: transparent; color: var(--beam); }

.hero__hint {
  font-family: var(--mono); font-size: .74rem; color: var(--dim);
  margin: 4rem 0 0; max-width: 40ch; line-height: 1.7;
  border-left: 1px solid var(--rule); padding-left: 1rem;
}

/* ============================ la traversee ============================ */
.walk { position: relative; }

.walk__stage {
  position: sticky; top: var(--barh); z-index: 10;
  padding: 1.5rem var(--pad) .75rem;
  background: var(--ink);
}
.walk__stage::after {
  content: ''; position: absolute; left: 0; right: 0; top: 100%;
  height: 3rem; pointer-events: none;
  background: linear-gradient(to bottom, var(--ink), transparent);
}

.plan { margin: 0; }
.plan svg { width: 100%; height: auto; max-height: 46vh; display: block; overflow: visible; }

/* --- structure du batiment --- */
.frame path { fill: none; stroke-linecap: square; }
.beam-heavy { stroke: var(--oak); stroke-width: 5; }
.beam-thin  { stroke: var(--oak); stroke-width: 3; opacity: .85; }
.beam-hair  { stroke: var(--oak); stroke-width: 1.5; opacity: .5; }
.ground     { stroke: color-mix(in srgb, var(--oak) 60%, transparent); stroke-width: 2.5; }

/* --- la lumiere --- */
.shafts--day, .shafts--night { transition: opacity .6s ease; }
html[data-hour="night"] .shafts--day   { opacity: 0; }
html[data-hour="day"]   .shafts--night { opacity: 0; }

.shaft {
  opacity: .06;
  transition: opacity .55s ease;
}
html[data-hour="night"] .shaft { fill: var(--beam); }
html[data-hour="day"]   .shaft { fill: #D8C079; }

.pool { opacity: 0; transition: opacity .55s ease; }
html[data-hour="night"] .pool { fill: var(--beam); }
html[data-hour="day"]   .pool { fill: #C2A659; }

.tag {
  font-family: var(--mono); font-size: 15px; fill: var(--dim);
  text-anchor: middle; opacity: .35; transition: opacity .4s, fill .4s;
}

/* --- la travee active --- */
.plan[data-room="1"] .shaft[data-bay="1"], .plan[data-room="2"] .shaft[data-bay="2"],
.plan[data-room="3"] .shaft[data-bay="3"], .plan[data-room="4"] .shaft[data-bay="4"],
.plan[data-room="5"] .shaft[data-bay="5"], .plan[data-room="6"] .shaft[data-bay="6"] { opacity: .5; }

.plan[data-room="1"] .pool[data-bay="1"], .plan[data-room="2"] .pool[data-bay="2"],
.plan[data-room="3"] .pool[data-bay="3"], .plan[data-room="4"] .pool[data-bay="4"],
.plan[data-room="5"] .pool[data-bay="5"], .plan[data-room="6"] .pool[data-bay="6"] { opacity: .55; }

.plan[data-room="1"] .tag[data-bay="1"], .plan[data-room="2"] .tag[data-bay="2"],
.plan[data-room="3"] .tag[data-bay="3"], .plan[data-room="4"] .tag[data-bay="4"],
.plan[data-room="5"] .tag[data-bay="5"], .plan[data-room="6"] .tag[data-bay="6"] { opacity: 1; fill: var(--beam); }


/* --- ce qu'il y a dans chaque travee --- */
html[data-hour="night"] .props--day   { display: none; }
html[data-hour="day"]   .props--night { display: none; }

.thing {
  fill: none; stroke: var(--oak); stroke-width: 1.6;
  stroke-linejoin: round; stroke-linecap: round;
  opacity: .26; transition: opacity .55s ease;
}
.thing .steam { opacity: .55; stroke-width: 1.2; }
.thing .drape { opacity: .5; stroke-width: 1.2; }

.plan[data-room="1"] .thing[data-bay="1"], .plan[data-room="2"] .thing[data-bay="2"],
.plan[data-room="3"] .thing[data-bay="3"], .plan[data-room="4"] .thing[data-bay="4"],
.plan[data-room="5"] .thing[data-bay="5"], .plan[data-room="6"] .thing[data-bay="6"] { opacity: .95; }

/* --- le cristal et sa diffraction, sur le dancefloor --- */
.prism { opacity: .3; transition: opacity .55s ease; }
.plan[data-room="2"] .prism { opacity: 1; }

.ray { fill: none; stroke-width: 1.3; stroke-linecap: round; }
.ray--feed { stroke: var(--beam); stroke-width: 2.2; }
.crystal { fill: color-mix(in srgb, var(--beam) 45%, #FFFFFF); stroke: none; }
.r1 { stroke: #8B5BFF; }
.r2 { stroke: #5B7BFF; }
.r3 { stroke: #49C4F5; }
.r4 { stroke: #46E8C8; }
.r5 { stroke: #B94AF0; }

.plan__cap {
  display: flex; justify-content: space-between; gap: 1rem;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--dim);
  border-top: 1px solid var(--rule); padding-top: .6rem; margin-top: .4rem;
}
.plan__now { color: var(--beam); }

/* --- les pieces --- */
.walk__scroll { padding: 0 var(--pad) 8vh; }

.room {
  min-height: 62vh; max-width: 40rem;
  display: flex; flex-direction: column; justify-content: center;
  padding: 4vh 0; border-top: 1px solid var(--rule);
}
.room:first-child { border-top: none; }

.room__num {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .2em;
  color: var(--dim); margin: 0 0 .5rem;
}
.room__name {
  font-family: var(--display);
  font-variation-settings: 'wdth' 112, 'wght' 700;
  font-size: clamp(2rem, 5.5vw, 3.6rem); line-height: .95;
  letter-spacing: -.02em; text-transform: uppercase; margin: 0 0 1.2rem;
}
.room__body { margin: 0 0 1.6rem; max-width: 42ch; }

.room__data {
  list-style: none; display: flex; flex-wrap: wrap; gap: .45rem;
  margin: 0 0 1.4rem; padding: 0;
}
.room__data li {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--dim);
  border: 1px solid var(--rule); border-radius: 999px; padding: .3rem .75rem;
}
.room__data .is-soon { border-color: var(--beam); color: var(--beam); }

.room__flip {
  font-family: var(--mono); font-size: .74rem; color: var(--dim);
  margin: 0; padding-left: 1rem; border-left: 1px solid var(--beam);
  max-width: 36ch; line-height: 1.7;
}

/* ============================ le mur de noms ============================ */
.roster {
  padding: 13vh var(--pad); border-top: 1px solid var(--rule);
}
.roster__list {
  list-style: none; margin: 2.2rem 0 2rem; padding: 0;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .85rem;
}
.roster__list li {
  font-family: var(--display);
  font-variation-settings: 'wdth' 106, 'wght' 640;
  font-size: clamp(1.35rem, 3.2vw, 2.6rem);
  line-height: 1.22; letter-spacing: -.015em; text-transform: uppercase;
  transition: color .2s ease;
}
.roster__list li:hover { color: var(--beam); }
.roster__list li + li::before {
  content: '·'; color: var(--beam); margin-right: .85rem;
  font-family: var(--body); font-weight: 400;
}
.roster__k2 { margin: 3.2rem 0 1rem; }
.roster__col {
  list-style: none; padding: 0; margin: 0 0 2rem;
  display: flex; flex-wrap: wrap; gap: .1rem .7rem;
}
.roster__col li {
  font-family: var(--display);
  font-variation-settings: 'wdth' 104, 'wght' 560;
  font-size: clamp(.95rem, 1.9vw, 1.5rem);
  text-transform: uppercase; letter-spacing: -.01em; color: var(--dim);
  transition: color .2s ease;
}
.roster__col li:hover { color: var(--beam); }
.roster__col li + li::before {
  content: '·'; color: var(--beam); margin-right: .7rem;
  font-family: var(--body); font-weight: 400;
}

.roster__fine {
  font-family: var(--mono); font-size: .74rem; color: var(--dim); margin: 0;
  border-left: 1px solid var(--rule); padding-left: 1rem;
}

/* ============================ telegram ============================ */
.join {
  padding: 14vh var(--pad); border-top: 1px solid var(--rule);
  background: var(--haze); transition: background .7s ease;
}
.join__title {
  font-family: var(--display);
  font-variation-settings: 'wdth' 116, 'wght' 750;
  font-size: clamp(1.9rem, 5vw, 3.4rem); line-height: 1;
  letter-spacing: -.02em; margin: 0 0 1.2rem; max-width: 26ch;
}
.join__body { max-width: 44ch; margin: 0 0 2rem; }
.join__acts { display: flex; flex-wrap: wrap; gap: .7rem; margin-bottom: 1.4rem; }
.join__fine { font-family: var(--mono); font-size: .72rem; color: var(--dim); margin: 0; }

/* ============================ pied ============================ */
.foot {
  padding: 8vh var(--pad); border-top: 1px solid var(--rule);
  display: grid; gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  font-size: .9rem;
}
.foot p { margin: 0 0 .3rem; color: var(--dim); }
.foot__k {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text) !important; margin-bottom: .8rem !important;
}
.foot a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: .2em; }
.foot a:hover { color: var(--beam); text-decoration-color: var(--beam); }

/* ============================ etroit ============================ */
@media (max-width: 720px) {
  .plan svg { max-height: 30vh; }
  .walk__stage { padding-top: 1rem; }
  .room { min-height: 56vh; }
  .hero { padding-top: calc(var(--barh) + 8vh); }
  .plan__cap { font-size: .64rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero::after { animation: none; opacity: 0; }
  * { transition-duration: .01ms !important; }
}
