:root {
  --pad: clamp(16px, 2.6vw, 40px);
  --gap: calc(var(--pad) + 8px);
  --sans: "Archivo", "Arial Narrow", Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "DM Mono", Consolas, monospace;
  --stretch: 112%;
}

@media (max-aspect-ratio: 4/5) {
  :root { --stretch: 62%; }
}

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

html {
  background: #000;
  scrollbar-width: none;
  overscroll-behavior: none;
}

/* Au doigt, c'est le JS qui declenche les transitions */
html:not(.calm) { touch-action: none; }

html::-webkit-scrollbar { display: none; }

body {
  margin: 0;
  background: #000;
  color: #fff;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
}

a, img { -webkit-user-drag: none; }

h1, h2, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

#track { height: calc(var(--steps, 0) * 120lvh + 100lvh); }

#stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: radial-gradient(circle at 62% 38%, #8a8a8a, #1c1c1c 45%, #000 75%);
}

/* Le liquide : un seul fond, sous tous les ecrans */
#fluid {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  animation: fade 1.8s .15s both;
}

@keyframes fade { from { opacity: 0; } }

/* Tous les ecrans partagent la meme composition que l'accueil.
   Le texte s'inverse tout seul quand le liquide passe en negatif. */

.scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  color: #fff;
  mix-blend-mode: difference;
}

#crosses {
  position: fixed;
  inset: -200px 0;
  background: #fff;
  opacity: .22;
  mix-blend-mode: difference;
  pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cpath d='M90 83v14M83 90h14' stroke='%23000'/%3E%3C/svg%3E") 0 0 / 180px 180px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cpath d='M90 83v14M83 90h14' stroke='%23000'/%3E%3C/svg%3E") 0 0 / 180px 180px;
}

.brk {
  position: fixed;
  inset: var(--pad);
  mix-blend-mode: difference;
  pointer-events: none;
}

.brk i {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 0 solid #fff;
}

.brk i:nth-child(1) { top: 0; left: 0; border-width: 1px 0 0 1px; }
.brk i:nth-child(2) { top: 0; right: 0; border-width: 1px 1px 0 0; }
.brk i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 1px 1px; }
.brk i:nth-child(4) { bottom: 0; right: 0; border-width: 0 1px 1px 0; }

.top {
  position: absolute;
  top: var(--gap);
  left: var(--gap);
  width: min(24rem, 76%);
  padding: 8px 0 0 8px;
  font-weight: 500;
  font-size: clamp(1.05rem, 1.7vw, 1.4rem);
  line-height: 1.32;
}

.foot {
  position: absolute;
  right: var(--pad);
  bottom: var(--pad);
  left: var(--pad);
}

.line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0 1.2em;
  margin-bottom: .1em;
  padding: 0 .35em 0 .08em;
  font: italic 400 clamp(1.9rem, 5vw, 4.4rem)/1 var(--serif);
}

.sub {
  margin-left: .4em;
  font-size: .52em;
  opacity: .72;
}

/* Le lien reste dans la voix serif de l'accueil */
.go {
  display: inline-flex;
  align-items: baseline;
  gap: .3em;
  padding: .1em 0;
  font-style: italic;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size .35s cubic-bezier(.2, .8, .2, 1);
}

.go span { transition: transform .35s cubic-bezier(.2, .8, .2, 1); }

@media (hover: hover) {
  .go:hover { background-size: 0 1px; background-position: 100% 100%; }
  .go:hover span { transform: translateX(.2em); }
  .go[data-top]:hover span { transform: translateY(-.15em); }
}

/* Le grand mot : sa taille est calculee en JS pour remplir la largeur */

.giant {
  position: relative;
  margin: 0 0 -.14em;
  padding-right: .07em;
  overflow: hidden;
  font: 900 100px/1.04 var(--sans);
  font-stretch: var(--stretch);
  letter-spacing: -.045em;
  white-space: nowrap;
}

.word { display: inline-block; }

.l {
  display: inline-block;
  will-change: transform;
}

.hint {
  position: absolute;
  top: var(--gap);
  right: calc(var(--pad) + 64px);
  padding-top: 8px;
  font: 400 .78rem/1.4 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.hint::after {
  content: "";
  display: block;
  width: 1px;
  height: 44px;
  margin: 10px 0 0 auto;
  background: #fff;
  transform-origin: top;
  animation: pull 2s cubic-bezier(.7, 0, .3, 1) infinite;
}

@keyframes pull {
  0% { transform: scaleY(0); }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* Fin */

.rows { width: min(26rem, 100%); }

.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  min-height: 40px;
  padding: .3rem 0;
  transition: padding .25s;
}

.row em {
  font: italic 400 1.3em/1 var(--serif);
}

@media (hover: hover) {
  .row:hover { padding-left: .6rem; }
}

/* Elements fixes */

#brand, #rail {
  position: fixed;
  z-index: 10;
  color: #fff;
  mix-blend-mode: difference;
}

#brand {
  top: var(--gap);
  right: calc(var(--pad) + 16px);
  padding: 16px 44px 16px 0;
  font-weight: 800;
  line-height: 18px;
  letter-spacing: -.01em;
  opacity: 0;
}

/* Le logo reste hors du mode inverse : renard blanc sur disque noir partout */
#mark {
  position: fixed;
  z-index: 11;
  top: calc(var(--gap) + 8px);
  right: calc(var(--pad) + 16px);
  width: 34px;
  height: 34px;
  opacity: 0;
  pointer-events: none;
}

#rail {
  top: 50%;
  right: calc(var(--pad) - 8px);
  display: grid;
  transform: translateY(-50%);
}

#rail a {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 8px;
  font: 400 .72rem/1 var(--mono);
}

#rail a span {
  opacity: 0;
  transform: translateX(6px);
  transition: opacity .2s, transform .2s;
}

#rail a::after {
  content: "";
  width: 14px;
  height: 1px;
  background: currentColor;
  opacity: .5;
  transition: width .35s cubic-bezier(.2, .8, .2, 1), opacity .35s;
}

#rail a.on::after { width: 34px; opacity: 1; }

@media (hover: hover) {
  #rail a:hover span { opacity: 1; transform: none; }
}

#rail a:focus-visible span { opacity: 1; transform: none; }

.nojs { padding: 2rem; }

/* Telephone */

@media (max-width: 640px) {
  .hint { display: none; }
  .top { width: 74%; font-size: 1rem; }
  .line { padding-right: 0; }
  .go { min-height: 44px; align-items: center; }
  #brand { padding-right: 34px; color: transparent; font-size: 0; }
  #rail a { height: 34px; }
  #rail a::after { width: 10px; }
  #rail a.on::after { width: 22px; }
}

/* Mouvement reduit : les ecrans s'affichent simplement les uns sous les autres */

.calm #track { display: none; }
.calm #stage { position: static; overflow: visible; background: none; }
.calm .scene { position: relative; inset: auto; min-height: 100svh; opacity: 1; }
.calm #brand, .calm #mark { display: none; }
.calm .hint::after, .calm #fluid { animation: none; }
.calm .hint::after { transform: none; }
