/* Until Solution — reprend la ligne et les gestes du site actuel :
   logo plein écran qui s'écrit et regarde, bouton + qui fait monter le texte.
   Style actif : <html data-style="original|acide|terminal|editorial|rouge">.
   Le logo ne change jamais de forme : seule sa couleur suit le style. */

/* Police du site actuel : déposer SuisseIntl-Light.ttf dans /fonts. Sinon : Geist Light. */
@font-face {
  font-family: "SuisseIntl Light";
  src: local("Suisse Int'l Light"), local("SuisseIntl-Light"), url("../fonts/SuisseIntl-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* ---------- Original : le site actuel ---------- */
:root {
  --bg: #f0f0f0;
  --fg: #1a1a1a;
  --soft: rgba(26, 26, 26, 0.64);
  --faint: rgba(26, 26, 26, 0.2);
  --accent: var(--fg);
  --font: "SuisseIntl Light", "Geist", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --size: clamp(18px, 1.45vw, 20px);
  --leading: 1.625;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --top: calc(16px + env(safe-area-inset-top));
  --bottom: calc(16px + env(safe-area-inset-bottom));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg); color: var(--fg);
  font-family: var(--font); font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a, button { touch-action: manipulation; }
h1, h2, p, ol, li { margin: 0; padding: 0; font: inherit; }
ol { list-style: none; }
kbd { font: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--fg); color: var(--bg); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Logo ---------- */
.logo { display: block; fill: currentColor; overflow: visible; }
.logo--inline { display: inline; height: 1em; width: auto; vertical-align: baseline; margin-right: 0.12em; }
.mark { display: block; width: min(60vw, 600px); height: auto; fill: currentColor; overflow: visible; }
.pupil, .lid, .caret { fill: currentColor; }

/* ---------- Scène : le logo seul ---------- */
.stage { min-height: 100svh; display: grid; place-items: center; padding: 16px; position: relative; }
.stage__logo {
  transform-origin: 50% 50%;
  transition: filter 0.6s ease-out, transform 0.6s ease-out, opacity 0.6s ease-out;
}
.js .stage__logo { cursor: pointer; animation: unblur 0.6s ease-out backwards; }
@keyframes unblur { from { filter: blur(12px); transform: scale(0.94); } to { filter: blur(0); transform: none; } }
.intro-pending .mark { opacity: 0; }

.hint {
  position: absolute; left: 0; right: 0; bottom: calc(var(--bottom) + 56px);
  text-align: center; font-size: 13px; color: var(--soft);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.8s ease, transform 0.8s var(--ease);
  pointer-events: none;
}
.hint.is-on { opacity: 1; transform: none; }

/* ---------- Bouton + (tourne et devient ×, comme sur le site actuel) ---------- */
.plus {
  position: fixed; top: var(--top); left: 50%; z-index: 30;
  width: 44px; height: 44px; margin-left: -22px;
  display: none; place-items: center;
}
.js .plus { display: grid; }
/* Le cercle reprend le « o » du logo (mêmes tracés), le + a l'épaisseur des lettres. */
.plus__icon {
  display: block; width: 32px; height: 32px; fill: currentColor;
  transition: transform 0.6s ease-out;
}
.plus__cross { fill: none; stroke: currentColor; stroke-width: 3.6; stroke-linecap: round; }
.plus:hover .plus__icon { transform: scale(1.08); }
.plus:active .plus__icon { opacity: 0.6; }
.is-open .plus__icon { transform: rotate(405deg); }
.is-open .plus:hover .plus__icon { transform: rotate(405deg) scale(1.08); }

/* ---------- Langue ---------- */
.switch--lang {
  position: fixed; top: calc(var(--top) + 6px); right: clamp(10px, 1.6vw, 22px); z-index: 30;
  display: flex; gap: 2px; font-size: 13px;
}
.switch--lang a { display: inline-grid; place-items: center; min-width: 32px; min-height: 32px; padding: 4px; color: var(--soft); text-decoration: none; transition: color 0.2s; }
.switch--lang a[aria-current] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.3em; }
.switch--lang a:hover, .switch--lang a[aria-current] { color: var(--fg); }

/* ---------- Texte ---------- */
.info { display: flex; flex-direction: column; padding: 96px 24px 128px; outline: none; }
.info__inner {
  margin: auto; width: 100%; max-width: 48rem;
  text-align: center; font-size: var(--size); line-height: var(--leading);
}
.statement { margin-bottom: 1rem; text-wrap: pretty; }
.steps { display: flex; flex-direction: column; align-items: center; }
.step { cursor: default; }
.step__n { display: none; }
.contact { margin-top: 2rem; display: flex; flex-direction: column; align-items: center; }
.contact__row { position: relative; }
.contact__link { display: inline-block; padding: 0.1em 0; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; transition: opacity 0.2s; }
.contact__link:hover { opacity: 0.65; }
.copy {
  position: absolute; left: 100%; top: 50%; margin-left: 0.3em; transform: translateY(-50%);
  min-height: 28px; padding: 4px 6px;
  font-size: 13px; color: var(--soft); white-space: nowrap;
  opacity: 0; transition: opacity 0.25s, color 0.2s;
}
.contact__row:hover .copy, .copy:focus-visible, .copy.is-done { opacity: 1; }
.copy:hover { color: var(--fg); }
@media (hover: none) { .copy { opacity: 1; } }
.legal { margin-top: 3rem; font-size: 13px; color: var(--soft); }
.keys { display: none; margin-top: 0.4rem; font-size: 13px; color: var(--soft); gap: 1.2em; justify-content: center; }
@media (hover: hover) and (pointer: fine) { .js .keys { display: flex; } }
.keys kbd { display: inline-block; min-width: 1.6em; padding: 0 0.35em; border: 1px solid var(--faint); border-radius: 4px; line-height: 1.5; }

/* Verbes reliés à la phrase */
.statement, .step { transition: color 0.35s ease; }
.v { text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1px; text-underline-offset: 0.18em; transition: color 0.35s ease, text-decoration-color 0.35s ease; }
.is-linking .statement, .is-linking .step { color: var(--soft); }
.is-linking .v.is-hot, .is-linking .step.is-hot { color: var(--fg); }
.is-linking .v.is-hot { text-decoration-color: currentColor; }

/* ---------- Avec JavaScript : le texte devient un panneau qui monte ---------- */
.js body { overflow: hidden; }
.js .stage { position: fixed; inset: 0; min-height: 0; }
.js .info {
  position: fixed; inset: 0; z-index: 20;
  overflow-y: auto; overscroll-behavior: contain;
  visibility: hidden; opacity: 0; transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.4, 0, 1, 1), opacity 0.4s ease-in, visibility 0s linear 0.5s;
}
.js.is-open .info {
  visibility: visible; opacity: 1; transform: none;
  transition: transform 0.7s var(--ease) 0.25s, opacity 0.2s linear 0.25s, visibility 0s;
}
.is-open .stage__logo { filter: blur(12px); transform: scale(0.94); opacity: 0; }

/* Entrée ligne par ligne */
.js .rv { opacity: 0; transform: translateY(10px); filter: blur(6px); transition: opacity 0.3s, transform 0.3s, filter 0.3s; }
.js.is-open .rv {
  opacity: 1; transform: none; filter: none;
  transition: opacity 0.7s ease-out, transform 0.9s var(--ease), filter 0.7s ease-out;
  transition-delay: calc(0.45s + var(--i) * 45ms);
}
.js.is-open.is-settled .rv { transition-delay: 0s; }

/* ---------- Sélecteur de style ---------- */
.dock {
  position: fixed; left: 50%; bottom: var(--bottom); z-index: 30; transform: translateX(-50%);
  display: none; align-items: center; gap: 14px;
  max-width: calc(100vw - 24px); padding: 8px 16px;
  font-size: 13px; white-space: nowrap;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-radius: 999px;
}
.js .dock { display: flex; }
.dock__label { color: var(--soft); }
.dock button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 2px; color: var(--soft); transition: color 0.2s; }
.dock button:hover { color: var(--fg); }
.dock button[aria-pressed="true"] { color: var(--fg); }
.dock button[aria-pressed="true"] .dock__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.25em; }
.dock__dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--dot);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 28%, transparent);
  transition: transform 0.25s var(--ease);
}
.dock button:hover .dock__dot { transform: scale(1.35); }
.dock button[aria-pressed="true"] .dock__dot { transform: scale(1.35); }
[data-style-btn="original"] { --dot: #f0f0f0; }
[data-style-btn="acide"] { --dot: #00ff3c; }
[data-style-btn="terminal"] { --dot: #0b0b0b; }
[data-style-btn="editorial"] { --dot: #1f2bff; }
[data-style-btn="rouge"] { --dot: #e2251a; }

/* Changement de style : révélation en cercle depuis le bouton cliqué */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Acide : aplat vert ---------- */
html[data-style="acide"] {
  --bg: #00ff3c;
  --fg: #0a0a0a;
  --soft: rgba(10, 10, 10, 0.62);
  --faint: rgba(10, 10, 10, 0.24);
}

/* ---------- Rouge : aplat rouge, texte et logo blancs ---------- */
html[data-style="rouge"] {
  --bg: #e2251a; /* rouge assez profond pour que le blanc atteigne 4,6:1 */
  --fg: #ffffff;
  --soft: #ffffff;
  --faint: rgba(255, 255, 255, 0.4);
}

/* ---------- Terminal : noir, monospace fin, accent vert ---------- */
html[data-style="terminal"] {
  --bg: #0b0b0b;
  --fg: #e8e8e8;
  --soft: rgba(232, 232, 232, 0.54);
  --faint: rgba(232, 232, 232, 0.22);
  --accent: #3dff73;
  --font: "Geist Mono", ui-monospace, Menlo, Consolas, monospace;
  --size: clamp(16px, 1.15vw, 17px);
  --leading: 1.75;
}
[data-style="terminal"] .caret { fill: var(--accent); }
[data-style="terminal"] .info__inner { max-width: 62ch; text-align: left; }
[data-style="terminal"] .steps { align-items: flex-start; margin-top: 0.5rem; }
[data-style="terminal"] .step__n { display: inline; color: var(--soft); margin-right: 2ch; }
[data-style="terminal"] .contact { align-items: flex-start; }
[data-style="terminal"] .contact__title::before { content: "> "; color: var(--accent); }
[data-style="terminal"] .contact__link { color: var(--accent); text-decoration-color: rgba(61, 255, 115, 0.4); }
[data-style="terminal"] .is-linking .v.is-hot { color: var(--accent); }
[data-style="terminal"] .keys { justify-content: flex-start; }

/* ---------- Éditorial : serif bleu sur papier ---------- */
html[data-style="editorial"] {
  --bg: #f4f2ec;
  --fg: #1f2bff;
  --soft: rgba(31, 43, 255, 0.8);
  --faint: rgba(31, 43, 255, 0.3);
  --font: "Instrument Serif", "Times New Roman", Georgia, serif;
  --size: clamp(22px, 2vw, 28px);
  --leading: 1.36;
}
[data-style="editorial"] body { font-weight: 400; }
[data-style="editorial"] .statement { text-wrap: balance; }
[data-style="editorial"] .step__verb { font-style: italic; }
[data-style="editorial"] .dock, [data-style="editorial"] .switch--lang,
[data-style="editorial"] .hint, [data-style="editorial"] .copy,
[data-style="editorial"] .legal, [data-style="editorial"] .keys { font-size: 15px; }

/* ---------- Petits écrans ---------- */
@media (max-width: 560px) {
  .mark { width: 78vw; }
  .dock { gap: 4px; padding: 4px 10px; }
  .dock__label { display: none; }
  .dock button { min-width: 36px; min-height: 36px; padding: 0 4px; }
  .dock .dock__name { display: none; }
  .dock button[aria-pressed="true"] .dock__name { display: inline; }
  .copy { position: static; transform: none; margin-left: 0.5em; }
}

@media (prefers-reduced-motion: reduce) {
  .js .stage__logo { animation: none; }
  .js .info, .js.is-open .info { transform: none; transition: opacity 0.2s linear, visibility 0s; }
  .js .rv, .js.is-open .rv { transform: none; filter: none; transition: opacity 0.2s; transition-delay: 0s; }
  .plus__icon, .stage__logo, .hint { transition: none; }
}
