/* Les polices sont servies par Hinoa (pas d'appel à Google Fonts : aucune adresse IP transmise). */
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/instrument-serif-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/instrument-serif-latin-400-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/instrument-serif-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/instrument-serif-latin-ext-400-italic.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/instrument-sans-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/instrument-sans-latin-400-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/instrument-sans-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/instrument-sans-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/instrument-sans-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/instrument-sans-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/instrument-sans-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 200; font-display: swap; src: url(fonts/jost-latin-200-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 300; font-display: swap; src: url(fonts/jost-latin-300-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/jost-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 200; font-display: swap; src: url(fonts/jost-latin-ext-200-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 300; font-display: swap; src: url(fonts/jost-latin-ext-300-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/jost-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Hinoa, sous la lune de Hina. Une interface pour le soir : la nuit indigo sur l'océan,
   la lumière crème de la lune, l'ocre du tapa. Un seul élément vit en continu, la lune.
   Tout le reste répond à la main.
   Courbes et durées : fortes et courtes (ease-out cubic-bezier(0.23, 1, 0.32, 1), moins de 300 ms). */

:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1526;
  --surface: #162038;
  --surface-2: #1d2a47;
  --line: #2a3754;
  --ink: #f1ecdf;
  --muted: #a3abbf;
  --accent: #e9dbb0;
  --accent-ink: #141a2b;
  --tapa: #c8956a;
  --sans: "Instrument Sans", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --t-press: 120ms;
  --t-hover: 140ms;
  --t-enter: 240ms;
  --radius: 12px;
  --shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.6);
}
/* Le clair : choisi avec le bouton, ou par le système si rien n'a été choisi. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f0e4;
  --surface: #ede4d2;
  --surface-2: #e3d8c2;
  --line: #d2c5ab;
  --ink: #182033;
  --muted: #5e6578;
  --accent: #1f2b4a;
  --accent-ink: #f6f0e4;
  --tapa: #a86f3f;
  --shadow: 0 8px 24px -12px rgba(24, 32, 51, 0.25);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f6f0e4;
    --surface: #ede4d2;
    --surface-2: #e3d8c2;
    --line: #d2c5ab;
    --ink: #182033;
    --muted: #5e6578;
    --accent: #1f2b4a;
    --accent-ink: #f6f0e4;
    --tapa: #a86f3f;
    --shadow: 0 8px 24px -12px rgba(24, 32, 51, 0.25);
  }
}

* { box-sizing: border-box; }
/* Pendant la bascule jour-nuit, toutes les couleurs glissent sur 1,6 s, comme une aube. */
html.theme-shift, html.theme-shift *, html.theme-shift *::before, html.theme-shift *::after {
  transition-property: background-color, color, border-color, box-shadow, fill, stroke !important;
  transition-duration: 1600ms !important;
  transition-timing-function: cubic-bezier(0.45, 0, 0.2, 1) !important;
}
/* Un élément caché le reste, même s'il porte une classe qui règle son affichage. */
[hidden] { display: none !important; }
html { scrollbar-color: var(--line) transparent; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  caret-color: var(--accent);
  accent-color: var(--accent);
}
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--ink); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* La lumière de fond : un canvas en basse définition, étiré sur tout l'écran, derrière tout. */
.aether {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  z-index: 0; pointer-events: none;
}
.top, main { position: relative; z-index: 1; }

/* Le rail : une ligne d'ambre en haut de l'écran, qui avance à chaque réponse. */
.rail { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 10; pointer-events: none; }
.rail span { display: block; height: 100%; width: 0; background: var(--tapa); transition: width 400ms var(--ease-in-out); }

/* L'en-tête, comme le modèle : une pilule flottante et floutée, alignée sur le cadre du grand
   écran. Trois liens à gauche, la marque au centre, un bouton blanc à droite. */
:root { --frame: clamp(1rem, 6.5vw, 5.5rem); }
.top {
  position: fixed; top: 1.1rem; left: var(--frame); right: var(--frame); z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
  padding: 0.5rem 0.55rem 0.5rem 1.3rem; border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 45%, transparent); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
body[data-screen="intro"] .top { background: rgb(14 21 38 / 0.35); border-color: rgb(244 239 228 / 0.14); color: #f4efe4; }
body[data-screen="intro"] .top .top-nav a, body[data-screen="intro"] .brand { color: #f4efe4; }
.top-nav { display: flex; gap: 1.3rem; }
.top-nav a { color: var(--ink); text-decoration: none; font-size: 0.82rem; letter-spacing: 0.01em; white-space: nowrap; opacity: 0.9; transition: opacity var(--t-hover) ease; }
.top-right { justify-self: end; display: flex; align-items: center; gap: 0.75rem; }
.top-cta {
  padding: 0.6rem 1rem; border-radius: 999px; border: 0; font: 500 0.85rem var(--sans); cursor: pointer;
  background: #ffffff; color: #0e1526; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease;
}
.top-cta:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .top-nav a:hover { opacity: 1; } .top-cta:hover { background: #f1ecdf; } }
@media (max-width: 760px) {
  .top { grid-template-columns: auto 1fr; padding-inline-start: 1rem; }
  .top-nav { display: none; }
  .brand { justify-self: start; }
  .top-note { display: none; }
}
.icon-btn.store svg { width: 1.05rem; height: 1.05rem; }
.icon-btn.store[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.brand { font: 500 1.1rem/1 "Jost", var(--sans); letter-spacing: 0.02em; color: var(--ink); text-decoration: none; justify-self: center; }
.top-right { display: flex; align-items: center; gap: 0.75rem; }
.icon-btn {
  width: 2.4rem; height: 2.4rem; padding: 0; justify-content: center;
  border-radius: 999px; background: transparent; color: var(--ink); border: 1px solid var(--line);
}
.icon-btn svg { width: 1.15rem; height: 1.15rem; }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { border-color: var(--muted); transform: translateY(-1px); } }
.icon-btn:active { transform: translateY(1px) scale(0.985); }
/* Le bouton de thème montre l'autre thème, celui qu'on obtiendra en cliquant. */
#theme-toggle .sun { display: none; }
#theme-toggle .moon { display: block; }
:root[data-theme="light"] #theme-toggle .sun { display: block; }
:root[data-theme="light"] #theme-toggle .moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) #theme-toggle .sun { display: block; }
  :root:not([data-theme="dark"]) #theme-toggle .moon { display: none; }
}
.top .ghost.small { text-decoration: none; }
@media (max-width: 600px) { .top-note { display: none; } }
.brand:hover { color: var(--accent); }
.top-note { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; min-height: 1.4em; transition: opacity var(--t-hover) ease; }

main { width: min(100% - 2rem, 40rem); margin: 0 auto; padding: 6.5rem 0 6rem; outline: none; }
body[data-screen="intro"] main { padding-top: 0; }
body[data-screen="intro"] .orb-wrap { display: none; }

.orb-wrap { display: grid; place-items: center; margin: 0 0 2rem; }
.orb { width: 240px; height: 240px; border-radius: 50%; transition: width 400ms var(--ease-in-out), height 400ms var(--ease-in-out); }
body[data-screen="question"] .orb { width: 124px; height: 124px; }
@media (max-width: 600px) {
  .orb { width: 170px; height: 170px; }
  body[data-screen="question"] .orb { width: 96px; height: 96px; }
  .orb-wrap { margin-bottom: 1.25rem; }
}

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.06; letter-spacing: -0.02em; text-wrap: balance; margin: 0 0 1rem; }
h1 { font-size: clamp(2.5rem, 6vw, 4rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h3 { font-size: 1.5rem; }
p { text-wrap: pretty; }
.lead { font-size: 1.2rem; max-width: 34rem; margin: 0 0 1.75rem; }
.help { color: var(--muted); max-width: 34rem; margin: 0 0 1.5rem; }
.fine { color: var(--muted); font-size: 0.9rem; max-width: 32rem; }
.actions { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.5rem; flex-wrap: wrap; }

/* Les écrans : l'accueil est en place dès la première image ; les autres arrivent en fondu
   parce qu'ils répondent à un clic. */
.screen[hidden] { display: none; }
.screen:not([data-screen="intro"]) {
  opacity: 1; transform: none;
  transition: opacity var(--t-enter) var(--ease-out), transform var(--t-enter) var(--ease-out);
  @starting-style { opacity: 0; transform: translateY(8px); }
}

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }

/* Les choix : une liste. La ligne choisie se remplit d'encre, de gauche à droite. */
.options { display: grid; gap: 0.5rem; margin-bottom: 1.75rem; }
.options.grid { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
.option {
  position: relative;
  display: grid; grid-template-columns: 1fr auto; gap: 0.1rem 1rem; align-items: center;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 82%, transparent); color: var(--ink);
  cursor: pointer; overflow: hidden;
  transition: border-color var(--t-hover) ease, transform var(--t-press) var(--ease-out), opacity var(--t-enter) var(--ease-out);
  opacity: 1;
  @starting-style { opacity: 0; }
  transition-delay: 0ms, 0ms, calc(var(--i, 0) * 40ms);
}
.option:active { transform: scale(0.985); }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option::before {
  content: ""; position: absolute; inset: 0; background: var(--ink);
  clip-path: circle(0 at var(--x, 0%) var(--y, 50%));
  transition: clip-path 260ms var(--ease-out);
}
.options.chosen .option:not(:has(input:checked)) { opacity: 0.45; transition: opacity 240ms var(--ease-out); }
.option > * { position: relative; }
.option small { grid-column: 1; color: var(--muted); font-size: 0.88rem; transition: color 200ms ease; }
.option .mark { grid-column: 2; grid-row: 1 / span 2; width: 1.1rem; height: 1.1rem; color: var(--bg); opacity: 0; transition: opacity var(--t-hover) ease; }
.option .mark path { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset 220ms var(--ease-out) 60ms; }
.option:has(input:checked) { color: var(--bg); border-color: var(--ink); }
.option:has(input:checked) .mark { color: var(--tapa); }
.option:has(input:checked)::before { clip-path: circle(150% at var(--x, 0%) var(--y, 50%)); }
.option:has(input:checked) small { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.option:has(input:checked) .mark { opacity: 1; }
.option:has(input:checked) .mark path { stroke-dashoffset: 0; }
@media (hover: hover) and (pointer: fine) {
  .option:hover { border-color: var(--muted); }
  .option:has(input:checked):hover { border-color: var(--ink); }
}
/* Le morphing : la page qui arrive naît de la précédente (joué en script), donc pas d'entrée
   CSS en plus ; l'encre et la coche d'un choix déjà fait se posent après la boîte. Les
   fantômes de l'ancienne page sont figés à leur place, par-dessus. */
.options.morphed .option { transition-delay: 0ms; @starting-style { opacity: 1; } }
.options.morphed .option::before { transition: clip-path 600ms var(--ease-out) 320ms; @starting-style { clip-path: circle(0 at 50% 50%); } }
.options.morphed .option .mark { transition-delay: 500ms; @starting-style { opacity: 0; } }
.options.morphed .option .mark path { transition-delay: 560ms; @starting-style { stroke-dashoffset: 24; } }
.morph-ghost { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
.morph-ghost > * { position: absolute; margin: 0; box-sizing: border-box; will-change: transform, opacity, filter; }
.morph-ghost .option::before { transition: none; }

input[type="text"], textarea, .feedback input:not([type="range"]) {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.95rem 1.1rem; margin-bottom: 1.75rem;
  transition: border-color var(--t-hover) ease, box-shadow var(--t-hover) ease;
}
input[type="text"]:focus, textarea:focus, .feedback input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
textarea { min-height: 7rem; resize: vertical; }
::placeholder { color: var(--muted); opacity: 0.8; }

/* Boutons : un pas vers le haut au survol, un pas vers le bas à la pression. */
button, a.primary {
  font: 500 1rem var(--sans);
  border-radius: 999px; padding: 0.85rem 1.5rem;
  cursor: pointer; border: 1px solid transparent; text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.5rem;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, border-color var(--t-hover) ease, color var(--t-hover) ease, opacity var(--t-hover) ease;
}
.primary { background: var(--accent); color: var(--accent-ink); }
.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
@media (hover: hover) and (pointer: fine) {
  .primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); transform: translateY(-1px); }
  .ghost:hover { border-color: var(--muted); transform: translateY(-1px); }
}
.primary:active, .ghost:active { transform: translateY(1px) scale(0.985); }
button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.small { font-size: 0.9rem; padding: 0.5rem 1rem; }

.nav { display: flex; justify-content: space-between; gap: 0.75rem; }
.nav[data-auto] #q-next { visibility: hidden; }
.controls { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0 0 1.5rem; }

.progress { margin: 0 0 1.5rem; }
.bar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--tapa); transition: width 240ms var(--ease-in-out); }
.progress p { color: var(--muted); margin: 0.6rem 0 0; font-size: 0.95rem; }

.player {
  margin: 0 0 2.5rem; display: grid; gap: 0.9rem; justify-items: start;
  padding: 1.25rem; background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  opacity: 1; transform: none;
  transition: opacity var(--t-enter) var(--ease-out), transform var(--t-enter) var(--ease-out);
  @starting-style { opacity: 0; transform: translateY(8px); }
}
.player audio { width: 100%; }

/* Le script se lit comme un texte ; chaque paragraphe arrive en fondu. */
.script { font: 400 1.2rem/1.7 var(--serif); max-width: 36rem; }
.script h3 { font: italic 1.05rem var(--serif); color: var(--muted); margin: 2.4rem 0 0.6rem; }
.script p {
  margin: 0 0 0.5rem; opacity: 1;
  transition: opacity 300ms var(--ease-out);
  @starting-style { opacity: 0; }
}
.script.reading p { opacity: 0.38; }
.script p.now { opacity: 1; }
.script .pause { display: block; color: var(--muted); font: 400 0.8rem var(--sans); margin: 0 0 1rem; }

.field { display: grid; gap: 0.4rem; color: var(--muted); margin-bottom: 0.5rem; }
.field input { margin-bottom: 1.25rem; color: var(--ink); }
#login-form input[type="email"] {
  width: 100%; font: inherit; background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 0.95rem 1.1rem;
  transition: border-color var(--t-hover) ease, box-shadow var(--t-hover) ease;
}
#login-form input[type="email"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
#login-note { margin-top: 1rem; min-height: 1.4em; }

.share { margin: 0 0 2.5rem; display: grid; gap: 0.6rem; }
.share-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.share-row .icon-btn { text-decoration: none; }

.foot {
  width: min(100% - 2rem, 40rem); margin: 0 auto; padding: 2rem 0 3rem;
  border-top: 1px solid var(--line); display: grid; gap: 1.25rem; position: relative; z-index: 1;
}

.feedback {
  margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); display: grid; gap: 0.5rem;
  opacity: 1; transition: opacity var(--t-enter) var(--ease-out);
  @starting-style { opacity: 0; }
}
.feedback label { display: grid; gap: 0.4rem; color: var(--muted); }
.feedback input { margin-bottom: 1rem; }
.scale { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 1rem; }

.library { margin-top: 3.5rem; }
.library ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.library li { display: flex; gap: 0.5rem; align-items: center; }
.library .row {
  flex: 1; display: grid; gap: 0.1rem; text-align: left; font-weight: 400;
  color: var(--ink); background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.85rem 1.1rem;
}
@media (hover: hover) and (pointer: fine) { .library .row:hover { border-color: var(--muted); transform: translateY(-1px); } }
.library .row strong { font: italic 1.25rem var(--serif); }
.library .row span { color: var(--muted); font-size: 0.9rem; }

/* Le grand écran d'accueil, comme le modèle : la photographie plein écran au-dessus des
   nuages (la lune la nuit, le soleil le jour) ; le titre en capitales fines sur deux lignes,
   la première à gauche, la seconde à droite ; un court texte en bas à droite ; deux lignes
   verticales alignées sur la navigation, des repères « + » à mi-hauteur, une ligne de base. */
/* Le défilement traverse les nuages : le grand écran reste collé pendant 2,6 écrans de
   défilement (--p va de 0 à 1, posé par le script). L'image s'approche, trois bancs de nuages
   montent du bas à des vitesses différentes et recouvrent tout, le titre tient puis s'efface,
   et la page apparaît à travers les nuages. */
.hero-scroll { width: 100vw; margin: 0 0 3.5rem calc(50% - 50vw); height: 260svh; --p: 0; }
.hero {
  position: sticky; top: 0; width: 100%;
  height: 100svh; min-height: 38rem; overflow: hidden; color: #f4efe4; background: #0e1526;
  opacity: calc(1 - max(0, var(--p) - 0.86) / 0.14);
}
.hero > img { transform: scale(calc(1 + var(--p) * 0.14)) translateY(calc(var(--p) * -3%)); filter: brightness(calc(1 - var(--p) * 0.25)); transform-origin: center 65%; will-change: transform; }
.clouds { position: absolute; inset: 0; pointer-events: none; }
.hero .clouds img { position: absolute; inset: auto; bottom: 0; left: 50%; width: auto; height: auto; max-width: none; object-fit: fill; will-change: transform; }
/* Les fragments (c3 à l'arrière, c2 devant) montent plus haut et plus vite que le banc (c1),
   qui finit sa course le bas toujours sous l'écran : rien ne se découvre derrière lui. */
.clouds .c3 { width: max(70vw, 42rem); opacity: 0.9; transform: translate3d(calc(8% - var(--p) * 16%), calc(104% - var(--p) * 150%), 0) scale(1.04); }
.clouds .c2 { width: max(90vw, 50rem); transform: translate3d(calc(-62% + var(--p) * -8%), calc(112% - var(--p) * 160%), 0); }
.clouds .c1 { width: max(125vw, 64rem); min-height: 125svh; object-fit: cover; object-position: top; transform: translate3d(calc(-50% + var(--p) * 4%), calc(104% - var(--p) * 82%), 0) scale(calc(1 + var(--p) * 0.06)); transform-origin: center bottom; }
.clouds .day { display: none; }
:root[data-theme="light"] .clouds .day { display: block; }
:root[data-theme="light"] .clouds .night { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .clouds .day { display: block; }
  :root:not([data-theme="dark"]) .clouds .night { display: none; }
}
.hero .frame, .hero .baseline { opacity: calc(1 - max(0, var(--p) - 0.35) / 0.25); }
.hero-text { opacity: calc(0.95 - max(0, var(--p) - 0.3) / 0.2 * 0.95) !important; }
.hero-title { transform: translateY(calc(var(--p) * -6%)); opacity: calc(1 - max(0, var(--p) - 0.55) / 0.2); }
.hero-scroll-hint {
  position: absolute; bottom: 1.5rem; left: 0; right: 0; margin: 0; text-align: center;
  font: 400 0.68rem var(--sans); letter-spacing: 0.22em; text-transform: uppercase; opacity: calc(0.7 - var(--p) * 3);
}
.hero-scroll-hint::after { content: ""; display: block; width: 1px; height: 1.6rem; margin: 0.5rem auto 0; background: rgb(244 239 228 / 0.6); animation: hint 2.4s var(--ease-in-out) infinite; }
@keyframes hint { 0%, 100% { transform: scaleY(0.3); transform-origin: top; opacity: 0.3; } 50% { transform: scaleY(1); opacity: 0.9; } }
@media (prefers-reduced-motion: reduce) {
  .hero-scroll { height: auto; }
  .hero { position: relative; opacity: 1; }
  .hero > img { transform: none; filter: none; }
  .clouds, .hero-scroll-hint::after { display: none; }
  .hero .frame, .hero .baseline, .hero-title, .hero-text { opacity: 1 !important; transform: none; }
}
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 70%; }
.hero .day { display: none; }
:root[data-theme="light"] .hero .day { display: block; }
:root[data-theme="light"] .hero .night { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .hero .day { display: block; }
  :root:not([data-theme="dark"]) .hero .night { display: none; }
}
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, #0e1526 0%, rgb(14 21 38 / 0.6) 14%, transparent 40%, transparent 80%, var(--bg) 100%); pointer-events: none; }
.hero .frame { position: absolute; top: 4.6rem; bottom: 4.5rem; left: var(--frame); right: var(--frame); border-inline: 1px solid rgb(244 239 228 / 0.28); pointer-events: none; }
.hero .frame::before, .hero .frame::after { content: "+"; position: absolute; top: 56%; transform: translate(-50%, -50%); font: 300 1.05rem "Jost", sans-serif; color: rgb(244 239 228 / 0.8); }
.hero .frame::before { left: 0; }
.hero .frame::after { left: 100%; }
.hero .baseline { position: absolute; bottom: 4.5rem; left: var(--frame); right: var(--frame); border-top: 1px solid rgb(244 239 228 / 0.28); pointer-events: none; }
.hero-title {
  position: absolute; inset: 0; margin: 0; display: grid; align-content: start;
  padding: clamp(7rem, 22vh, 13rem) var(--frame) 0;
  font: 300 clamp(3.2rem, 9.4vw, 8.8rem) / 1 "Jost", var(--sans); text-transform: uppercase; letter-spacing: 0.035em;
  text-shadow: 0 2px 30px rgb(0 0 0 / 0.25);
}
.hero-title .l1 { justify-self: start; }
.hero-title .l2 { justify-self: end; margin-top: 0.02em; }
.hero-title .night, .hero-title .day { opacity: 1; filter: blur(0); transform: none; transition: opacity 900ms var(--ease-out), filter 900ms var(--ease-out), transform 900ms var(--ease-out); @starting-style { opacity: 0; filter: blur(10px); transform: translateY(12px); } }
.hero-title .l2 { transition-delay: 160ms; }
.hero-title .day { display: none; }
:root[data-theme="light"] .hero-title .day { display: block; }
:root[data-theme="light"] .hero-title .night { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .hero-title .day { display: block; }
  :root:not([data-theme="dark"]) .hero-title .night { display: none; }
}
.hero-text { position: absolute; right: calc(var(--frame) + 0.9rem); top: 60%; margin: 0; max-width: 17rem; font-size: 0.82rem; line-height: 1.55; opacity: 0.95; text-shadow: 0 1px 16px rgb(0 0 0 / 0.4);
  transition: opacity 900ms var(--ease-out) 400ms; @starting-style { opacity: 0; } }
@media (max-width: 760px) {
  .hero { min-height: 32rem; margin-bottom: 2rem; }
  .hero-title { padding-top: clamp(7rem, 20vh, 10rem); letter-spacing: 0.02em; }
  .hero-text { right: calc(var(--frame) + 0.8rem); left: calc(var(--frame) + 0.8rem); top: auto; bottom: 6.5rem; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .hero-title .night, .hero-title .day, .hero-text { transition: none; @starting-style { opacity: 1; filter: none; transform: none; } } }

/* Fonctionnement : quatre temps, numérotés en italique serif, une ligne chacun. */
.how { list-style: none; counter-reset: etape; margin: 0 0 2.5rem; padding: 0; display: grid; gap: 0.6rem; }
.how li { counter-increment: etape; display: grid; grid-template-columns: 2rem 1fr; align-items: baseline; gap: 0.6rem; padding: 0.75rem 0; border-top: 1px solid var(--line); }
.how li::before { content: counter(etape); font: italic 1.3rem var(--serif); color: var(--accent); }

/* RGPD : la note sous le bouton d'accueil, le bloc du pied de page, le dialogue de consentement. */
.rgpd-note { margin-top: 0.75rem; }
.rgpd { display: grid; gap: 0.4rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.rgpd .fine, .rgpd-note.fine { max-width: none; }
.fine a, .help a { color: var(--accent); }
.consent .help { max-width: none; margin-bottom: 0.6rem; }
.consent-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; color: var(--muted); font-size: 0.9rem; line-height: 1.5; margin: 0.4rem 0 0.8rem; }
.check input { margin-top: 0.3rem; accent-color: var(--accent); }
.ghost.danger { color: var(--tapa); border-color: color-mix(in srgb, var(--tapa) 50%, transparent); }

/* Le pied de page : les outils qui ne sont plus dans l'en-tête. */
.foot-tools { display: flex; gap: 0.6rem; align-items: center; }
.foot-nav a { color: var(--muted); text-decoration: none; border-bottom: 1px solid transparent; transition: color var(--t-hover) ease, border-color var(--t-hover) ease; }
.foot-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
@media (hover: hover) and (pointer: fine) { .foot-nav a:hover { color: var(--ink); border-color: var(--ink); } }

/* Les visuels : des photographies calmes, dans la palette du site. Une grande (la mer la
   nuit, l'aube le jour), deux petites dessous. Elles se fondent dans la page par un léger
   assombrissement et n'arrivent qu'une fois le reste en place. */
.mood { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 2.5rem 0 1rem; }
.mood figure { margin: 0; position: relative; border-radius: calc(var(--radius) * 1.3); overflow: hidden; aspect-ratio: 16 / 10; background: var(--surface);
  opacity: 1; transition: opacity 700ms var(--ease-out); @starting-style { opacity: 0; } }
.mood figure:first-of-type, .mood figure.day:nth-of-type(2) { grid-column: 1 / -1; aspect-ratio: 16 / 7; }
.mood img { display: block; width: 100%; height: 100%; object-fit: cover; filter: saturate(0.9) brightness(0.92); transition: transform 1.2s var(--ease-out), filter 600ms ease; }
@media (hover: hover) and (pointer: fine) { .mood figure:hover img { transform: scale(1.03); filter: saturate(1) brightness(1); } }
.mood figcaption { position: absolute; left: 0.9rem; bottom: 0.7rem; font: italic 1rem var(--serif); color: #f1ecdf; text-shadow: 0 1px 12px rgb(0 0 0 / 0.5); }
/* Le jour montre l'aube et le soleil voilé, la nuit la mer et la lune. */
.mood .day { display: none; }
:root[data-theme="light"] .mood .day { display: block; }
:root[data-theme="light"] .mood .night { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .mood .day { display: block; }
  :root:not([data-theme="dark"]) .mood .night { display: none; }
}
.illustration { display: block; width: min(100%, 14rem); height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 50%; margin: 0 0 1.5rem; filter: saturate(0.9); }
.studio-child { display: block; width: min(100%, 22rem); border-radius: calc(var(--radius) * 1.3); margin: 0 0 1.5rem; }
.free .ripples { position: absolute; right: 0; top: -0.5rem; width: 7rem; aspect-ratio: 1; border-radius: 50%; object-fit: cover; opacity: 0.55; pointer-events: none; filter: saturate(0.8); }
.free { position: relative; }
@media (max-width: 600px) { .free .ripples { display: none; } }

/* L'écriture libre : la zone de texte, le micro, puis ce qu'on a compris, en mots. */
.free textarea { margin-bottom: 0.6rem; min-height: 11rem; }
.free-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.free-row .ghost { display: inline-flex; align-items: center; gap: 0.5rem; }
.free-row .ghost svg { width: 1.1rem; height: 1.1rem; }
.free-row .ghost.recording { border-color: var(--tapa); color: var(--tapa); }
.free-row .ghost.recording svg { animation: pulse 2s var(--ease-out) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.55; transform: scale(0.9); } }
.analysis { display: grid; gap: 0.8rem; padding: 1.1rem 1.2rem; margin-bottom: 1.75rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.analysis-title { font: italic 1.3rem var(--serif); margin: 0; color: var(--accent); }
.analysis-resume { margin: 0; }
.analysis .options { margin: 0.4rem 0 0; }
.analysis .fine { margin: 0; }
.analysis .alert { color: var(--tapa); }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.chips .fine { margin-inline-end: 0.3rem; }
.chip { padding: 0.25rem 0.7rem; border-radius: 999px; border: 1px solid var(--line); font-size: 0.9rem;
  background: color-mix(in srgb, var(--surface) 85%, transparent); }
.locked { display: grid; gap: 0.8rem; justify-items: start; margin-bottom: 1rem; }

/* Le choix de la langue, à la première visite : une carte au centre, le reste de la page
   floutée derrière. S'ouvre et se ferme en fondu, comme tout le reste. */
.lang {
  width: min(100% - 2rem, 34rem); padding: 1.75rem clamp(1.1rem, 4vw, 2rem) 1.5rem; margin: auto;
  color: var(--ink); background: color-mix(in srgb, var(--bg) 88%, var(--surface)); border: 1px solid var(--line); border-radius: calc(var(--radius) * 1.6);
  box-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.5);
  opacity: 1; transform: none; filter: blur(0);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out), filter 500ms var(--ease-out), display 500ms allow-discrete, overlay 500ms allow-discrete;
  @starting-style { opacity: 0; transform: translateY(14px) scale(0.98); filter: blur(8px); }
}
.lang:not([open]) { opacity: 0; transform: translateY(10px) scale(0.98); filter: blur(8px); }
.lang::backdrop {
  background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(18px) saturate(1.1); -webkit-backdrop-filter: blur(18px) saturate(1.1);
  transition: opacity 600ms var(--ease-out), display 600ms allow-discrete, overlay 600ms allow-discrete;
  @starting-style { opacity: 0; }
}
.lang:not([open])::backdrop { opacity: 0; }
.lang-kicker { font: italic 1.3rem var(--serif); color: var(--accent); margin: 0 0 0.4rem; }
.lang h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); margin-bottom: 1.25rem; }
.lang .options { margin-bottom: 0; }
.lang .option { padding: 0.75rem 1rem; font: inherit; text-align: start; width: 100%; }
.lang .option.picked { color: var(--bg); border-color: var(--ink); }
.lang .option.picked::before { clip-path: circle(150% at var(--x, 50%) var(--y, 50%)); }
.lang .option.picked .mark { opacity: 1; color: var(--tapa); }
.lang .option.picked .mark path { stroke-dashoffset: 0; }
.lang .help { margin-bottom: 1rem; }
#q-title .w { display: inline-block; }

/* Mouvement réduit : les fondus et les couleurs restent, les déplacements disparaissent. */
@media (prefers-reduced-motion: reduce) {
  .screen:not([data-screen="intro"]), .player { transform: none; @starting-style { transform: none; } }
  #q-title { filter: none; @starting-style { filter: none; } }
  html.theme-shift, html.theme-shift * { transition-duration: 300ms !important; }
  .option, .primary, .ghost, .library .row { transition-property: opacity, color, background-color, border-color; }
  .option::before { transition: none; }
  .orb { transition: none; }
  .free-row .ghost.recording svg { animation: none; }
  .lang, .lang:not([open]) { transform: none; filter: none; @starting-style { transform: none; filter: none; } }
}

/* --- Réglages, compte, journal, science ------------------------------------ */
.block { padding: 1.25rem 0; border-top: 1px solid var(--line); display: grid; gap: 0.6rem; }
.block:first-child { border-top: 0; padding-top: 0; }
.block h3 { margin: 0; }
.block .help { margin: 0; }
.account-grid { display: grid; margin-bottom: 2rem; }
.settings { display: grid; }
.row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); cursor: pointer; }
.switch input { width: 1.1rem; height: 1.1rem; margin: 0; }
.field select, .field input[type="text"], .field input[type="time"], .row input[type="time"] {
  font: inherit; color: var(--ink); background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 0.7rem 0.9rem;
}
.field select { width: 100%; }
.field.inline { display: inline-flex; align-items: center; gap: 0.6rem; margin: 0; }
.field.inline select { width: auto; padding: 0.45rem 0.7rem; font-size: 0.9rem; }
.file-btn { cursor: pointer; }
.controls.secondary { gap: 0.6rem 0.9rem; align-items: center; }
.settings .nav { margin-top: 1.5rem; }
#settings-note, #sync-note, #referral-note, #rappel-note { min-height: 1.4em; margin: 0; }

.programme { margin: 1.5rem 0 0; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 82%, transparent); display: grid; gap: 0.5rem; }
.programme .steps { display: flex; gap: 0.3rem; }
.programme .steps i {
  flex: 1; height: 12px; background: var(--line);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
  transition: background-color var(--t-hover) ease;
}
.programme .steps i.done { background: var(--tapa); }

.chart { margin: 0 0 1.5rem; }
.chart svg { width: 100%; height: auto; display: block; }
.journal { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.5rem; }
.journal li { display: grid; gap: 0.15rem; padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 82%, transparent); }
.journal li span { color: var(--muted); font-size: 0.9rem; }

.prose { max-width: 36rem; }
.prose p { margin: 0 0 1rem; }

/* La frise de tapa : triangles et traits, le motif de l'étoffe que Hina bat sous la lune. */
.tapa {
  height: 14px; margin: 0 0 1.5rem; color: var(--tapa); opacity: 0.8;
  background:
    repeating-linear-gradient(135deg, currentColor 0 1px, transparent 1px 8px) top / 100% 5px no-repeat,
    repeating-linear-gradient(45deg, currentColor 0 1px, transparent 1px 8px) bottom / 100% 5px no-repeat;
}
.foot .tapa { margin: -2rem 0 1.5rem; }

/* --- Accessibilité : taille du texte et contraste renforcé ----------------- */
:root[data-text="large"] { font-size: 112.5%; }
:root[data-text="xl"] { font-size: 125%; }
:root[data-contrast="high"] { --ink: #ffffff; --muted: #d6cfc4; --line: #5a534a; --accent: #ffc46b; }
:root[data-contrast="high"][data-theme="light"] { --ink: #000000; --muted: #3d3832; --line: #8a8178; --accent: #8a5200; --accent-ink: #ffffff; }
@media (prefers-color-scheme: light) {
  :root[data-contrast="high"]:not([data-theme="dark"]) { --ink: #000000; --muted: #3d3832; --line: #8a8178; --accent: #8a5200; --accent-ink: #ffffff; }
}
:root[data-contrast="high"] .aether { opacity: 0.35; }

/* --- Impression : seulement le titre et le script --------------------------- */
@media print {
  .aether, .rail, .top, .foot, .orb-wrap, .controls, .progress, .player, .share, .feedback, #shared-note { display: none !important; }
  body { background: #fff; color: #000; }
  main { width: 100%; }
  .script { font-size: 12pt; max-width: none; }
  .script h3, .script .pause { color: #555; }
}
