:root {
  color-scheme: light;
  --bg: #f5f3ed;
  --bg-deep: #e9e3d8;
  --surface: rgba(255, 253, 248, .78);
  --surface-solid: #fffdf8;
  --surface-soft: rgba(232, 226, 214, .72);
  --ink: #202f3a;
  --muted: #657078;
  --line: rgba(32, 47, 58, .15);
  --gold: #8b6937;
  --gold-bright: #b98a3f;
  --gold-soft: rgba(139, 105, 55, .13);
  --blue: #386b87;
  --shadow: 0 24px 80px rgba(32, 47, 58, .13);
  --shadow-card: 0 20px 48px rgba(42, 36, 25, .24);
  --star-rgb: 139, 105, 55;
  --trail-rgb: 56, 107, 135;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: Manrope, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --page: 1120px;
  --header: 72px;
  --card-ratio: 816 / 1524;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --gold-foil: linear-gradient(135deg, rgba(221, 189, 133, 0) 0%, rgba(221, 189, 133, .32) 45%, rgba(255, 248, 231, .68) 50%, rgba(221, 189, 133, .32) 55%, rgba(221, 189, 133, 0) 100%);
}

:root[data-theme='nuit'] {
  color-scheme: dark;
  --bg: #080e22;
  --bg-deep: #050817;
  --surface: rgba(20, 33, 42, .68);
  --surface-solid: #14212a;
  --surface-soft: rgba(34, 54, 64, .66);
  --ink: #f4efe5;
  --muted: #aebbc0;
  --line: rgba(216, 205, 181, .17);
  --gold: #ddbd85;
  --gold-bright: #f3d295;
  --gold-soft: rgba(221, 189, 133, .13);
  --blue: #91bbd0;
  --shadow: 0 30px 100px rgba(0, 0, 0, .36);
  --shadow-card: 0 26px 65px rgba(0, 0, 0, .58), 0 0 42px rgba(221, 189, 133, .12);
  --star-rgb: 221, 189, 133;
  --trail-rgb: 145, 187, 208;
}

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

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  background: var(--bg);
}

body {
  position: relative;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 18%, color-mix(in srgb, var(--gold) 13%, transparent), transparent 36%),
    radial-gradient(circle at 10% 82%, color-mix(in srgb, var(--blue) 8%, transparent), transparent 32%),
    linear-gradient(145deg, var(--bg), var(--bg-deep));
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  isolation: isolate;
  transition: color .35s ease, background .35s ease;
}

body::before {
  position: fixed;
  z-index: -3;
  inset: 0;
  pointer-events: none;
  content: '';
  opacity: .23;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

body.calc-open { overflow: hidden; }

button,
input,
textarea { font: inherit; }

button,
a {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { text-decoration: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

svg {
  display: block;
  width: 1.3rem;
  height: 1.3rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 4px;
}

h1:focus,
h2:focus { outline: 0; }

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

#ambient-canvas {
  position: fixed;
  z-index: -2;
  inset: 0;
  pointer-events: none;
}

/* Transition cinématique des vues */
#app-container > section,
#app-container > article {
  animation: view-enter .68s var(--ease-out-expo) both;
}

.skip-link {
  position: fixed;
  z-index: 500;
  top: -100px;
  left: 14px;
  padding: 11px 15px;
  color: var(--bg);
  background: var(--ink);
  border-radius: 9px;
}

.skip-link:focus { top: 12px; }

.page-width {
  width: min(calc(100% - 48px), var(--page));
  margin-inline: auto;
}

.app-header {
  position: relative;
  z-index: 90;
  height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: env(safe-area-inset-top) max(24px, calc((100vw - var(--page)) / 2)) 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 68%, transparent);
  backdrop-filter: blur(22px) saturate(130%);
  -webkit-backdrop-filter: blur(22px) saturate(130%);
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: none;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
  transition: transform .35s var(--ease-spring);
}

.brand:hover img { transform: scale(1.06) rotate(-4deg); }

.brand span {
  font: 400 1.22rem/1 var(--serif);
  letter-spacing: -.015em;
}

.desktop-nav {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 58%, transparent);
}

.desktop-nav > * {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: .68rem;
  font-weight: 650;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.desktop-nav > *:hover,
.desktop-nav > *[aria-current='page'] {
  color: var(--ink);
  background: var(--surface-solid);
}

.header-actions { display: flex; align-items: center; gap: 7px; }

.header-button,
.overlay-close,
.overlay-theme {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: var(--muted);
  background: transparent;
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease;
}

.header-button:hover,
.overlay-close:hover,
.overlay-theme:hover {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
  transform: translateY(-1px);
}

body[data-view='history'] .journal-button,
body[data-view='saved-entry'] .journal-button {
  color: var(--gold);
  border-color: color-mix(in srgb, var(--gold) 30%, transparent);
  background: var(--gold-soft);
}

.header-button span { font-size: .73rem; font-weight: 650; }
.theme-button { width: 44px; padding: 0; }
.theme-button .sun-icon,
.overlay-theme .sun-icon { display: none; }
:root[data-theme='nuit'] .theme-button .moon-icon,
:root[data-theme='nuit'] .overlay-theme .moon-icon { display: none; }
:root[data-theme='nuit'] .theme-button .sun-icon,
:root[data-theme='nuit'] .overlay-theme .sun-icon { display: block; }

.bottom-nav { display: none; }

/* Accueil — la carte est l’expérience, pas une rubrique parmi d’autres. */
.ritual-home {
  width: min(calc(100% - 48px), 1040px);
  min-height: calc(100svh - var(--header));
  margin-inline: auto;
  display: grid;
  grid-template-rows: auto auto auto auto;
  align-content: center;
  justify-items: center;
  padding: clamp(24px, 4svh, 50px) 0 26px;
}

.home-title-block {
  position: relative;
  z-index: 35;
  text-align: center;
  display: grid;
  justify-items: center;
}

.ritual-date,
.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: .68rem;
  font-weight: 650;
  letter-spacing: .19em;
  text-transform: uppercase;
}

.home-title-block h1 {
  margin: 11px 0 0;
  font: 400 clamp(3.75rem, 7.2vw, 6.15rem)/.86 var(--serif);
  letter-spacing: -.055em;
}

.home-title-block h1 span,
.home-title-block h1 em { display: inline; }
.home-title-block h1 em { margin-left: .08em; color: var(--gold); font-weight: 400; }

/* Bannière "Carte tirée aujourd'hui" dans le bloc titre */
.today-drawn-banner {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  padding: 8px 14px 8px 10px;
  border: 1px solid color-mix(in srgb, var(--gold) 38%, var(--line));
  border-radius: 999px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface-solid) 82%, var(--gold-soft));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-align: left;
  transition: transform .28s var(--ease-out-expo), border-color .28s ease, box-shadow .28s ease;
  animation: copy-arrives .55s .15s var(--ease-out-expo) both;
}

.today-drawn-banner:hover,
.today-drawn-banner:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .14), 0 0 24px color-mix(in srgb, var(--gold) 22%, transparent);
  transform: translateY(-2px);
}

.today-drawn-photo {
  width: 26px;
  aspect-ratio: var(--card-ratio);
  display: block;
  overflow: hidden;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .24);
}

.today-drawn-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.today-drawn-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.today-drawn-copy small {
  color: var(--gold);
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.today-drawn-copy strong {
  margin-top: 2px;
  font: 400 1.15rem/1 var(--serif);
}

.today-drawn-banner .history-arrow svg {
  width: 15px;
  height: 15px;
  color: var(--gold);
  transition: transform .25s ease;
}

.today-drawn-banner:hover .history-arrow svg {
  transform: translateX(3px);
}

.tarot-deck {
  position: relative;
  --fan-card-width: 88px;
  --fan-card-half: -44px;
  --fan-radius: 410px;
  --fan-top: 10px;
  width: min(100%, 900px);
  height: 500px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  isolation: isolate;
}

.deck-aura {
  position: absolute;
  z-index: -1;
  top: 8px;
  left: 50%;
  width: min(58vw, 430px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--gold) 22%, transparent), transparent 64%),
    conic-gradient(from 20deg, transparent, color-mix(in srgb, var(--blue) 13%, transparent), transparent 34%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 70%);
  transform: translateX(-50%);
  animation: aura-breathe 5s ease-in-out infinite;
}

.deck-aura::before,
.deck-aura::after {
  position: absolute;
  inset: 7%;
  content: '';
  border: 1px solid color-mix(in srgb, var(--gold) 34%, transparent);
  border-radius: 50%;
  animation: aura-turn 42s linear infinite;
}

.deck-aura::after {
  inset: 18%;
  border-style: dashed;
  border-color: color-mix(in srgb, var(--blue) 28%, transparent);
  animation-direction: reverse;
  animation-duration: 56s;
}

.fan {
  position: absolute;
  inset: 0 0 76px;
  overflow: visible;
}

.fan-card {
  position: absolute;
  z-index: var(--z);
  top: var(--fan-top);
  left: 50%;
  width: var(--fan-card-width);
  aspect-ratio: var(--card-ratio);
  margin-left: var(--fan-card-half);
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  transform: rotate(var(--angle));
  transform-origin: 50% var(--fan-radius);
  transition: opacity .38s ease, filter .38s ease;
}

.fan-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: -4px 9px 22px rgba(20, 16, 11, .34);
  pointer-events: none;
  user-select: none;
  transition: transform .38s var(--ease-spring), box-shadow .32s ease, filter .32s ease;
}

.fan-card:hover,
.fan-card:focus-visible {
  z-index: 1000 !important;
}

.fan-card:hover img,
.fan-card:focus-visible img {
  box-shadow: 0 22px 52px rgba(0, 0, 0, .5), 0 0 38px color-mix(in srgb, var(--gold) 42%, transparent);
  transform: translateY(-44px) scale(1.15);
  filter: brightness(1.06);
}

.fan-card:active img { transform: translateY(-34px) scale(1.08); }

.draw-call {
  position: absolute;
  z-index: 30;
  top: 290px;
  right: 7%;
  left: 7%;
  display: grid;
  justify-items: center;
  color: var(--ink);
  text-align: center;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}

.draw-call::before {
  width: 44px;
  height: 1px;
  margin-bottom: 11px;
  content: '';
  background: var(--gold);
  box-shadow: 0 0 16px var(--gold);
}

.draw-call strong {
  max-width: 7.3em;
  font: 400 clamp(2.5rem, 4.7vw, 3.75rem)/.92 var(--serif);
  letter-spacing: -.035em;
  text-wrap: balance;
}

.draw-call small {
  margin-top: 11px;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 650;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.tarot-deck.is-drawing .fan-card {
  pointer-events: none;
}

.tarot-deck.is-drawing .fan-card:not(.is-selected) {
  opacity: 0;
  filter: blur(5px);
}

.tarot-deck.is-drawing .fan-card:not(.is-selected) img {
  transform: translateY(34px) scale(.88);
}

.tarot-deck.is-drawing .fan-card.is-selected {
  z-index: 1100 !important;
}

.tarot-deck.is-drawing .fan-card.is-selected img {
  will-change: transform;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .58), 0 0 65px color-mix(in srgb, var(--gold) 55%, transparent);
  transform: translateY(-76px) scale(1.24);
  filter: brightness(1.1);
}

.tarot-deck.is-drawing .draw-call { opacity: 0; transform: translateY(12px); }
.tarot-deck.is-drawing .deck-aura { animation: aura-open .65s var(--ease-out-expo) forwards; }

.home-dock {
  width: min(100%, 780px);
  display: grid;
  gap: 9px;
}

.quick-doors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.quick-door {
  min-width: 0;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--muted);
  background: var(--surface);
  box-shadow: 0 12px 35px rgba(0, 0, 0, .05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: color .25s ease, border-color .25s ease, transform .28s var(--ease-out-expo), background .25s ease, box-shadow .25s ease;
}

button.quick-door { width: 100%; }

.quick-door:hover,
.quick-door:focus-visible {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--gold) 55%, transparent);
  background: color-mix(in srgb, var(--surface-solid) 86%, transparent);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .09);
  transform: translateY(-4px);
}

.quick-door-featured { border-color: color-mix(in srgb, var(--gold) 35%, transparent); }

.door-icon {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--gold);
  background: var(--gold-soft);
  transition: transform .3s var(--ease-spring), background .25s ease;
}

.quick-door:hover .door-icon {
  transform: scale(1.08);
  background: color-mix(in srgb, var(--gold) 22%, transparent);
}

.door-icon svg { width: 18px; height: 18px; }
.quick-door > span:last-child { min-width: 0; display: grid; text-align: left; }
.quick-door strong { overflow: hidden; color: var(--ink); font-size: .77rem; text-overflow: ellipsis; white-space: nowrap; }
.quick-door small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: .58rem; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }

.home-secondary-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.home-text-link {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 52%, transparent);
  font-size: .7rem;
  font-weight: 600;
  text-align: left;
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease;
}

.home-text-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-text-link svg { width: 17px; height: 17px; }
.home-text-link svg:last-child { margin-left: auto; transition: transform .25s ease; }
.home-text-link:hover { color: var(--ink); border-color: color-mix(in srgb, var(--gold) 48%, var(--line)); background: var(--surface); transform: translateY(-1px); }
.home-text-link:hover svg:last-child { transform: translateX(3px); }
.home-more-link { color: var(--gold); }
.counter-line { margin: 9px 0 0; color: var(--muted); font-size: .62rem; }

/* Tirage ouvert */
.reading-page { min-height: calc(100svh - var(--header)); padding: 26px 0 90px; }

.reading-toolbar,
.page-topline {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.round-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: .72rem;
  font-weight: 650;
  transition: color .2s ease, border-color .2s ease, transform .2s ease;
}

.round-action:hover { color: var(--ink); border-color: var(--gold); transform: translateY(-2px); }
.round-action svg { width: 17px; height: 17px; }

.reading-reveal {
  position: relative;
  min-height: calc(100svh - var(--header) - 98px);
  display: grid;
  grid-template-columns: minmax(270px, .82fr) minmax(320px, 1.18fr);
  align-items: center;
  gap: clamp(42px, 8vw, 120px);
  padding: 34px 6% 84px;
}

.reading-card-scene {
  position: relative;
  width: min(100%, 335px);
  justify-self: end;
  perspective: 1200px;
  transform-style: preserve-3d;
  animation: card-arrives .88s var(--ease-out-expo) both;
}

.reading-card-scene::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  content: '';
  border-radius: 17px;
  opacity: var(--glare-opacity, .38);
  background: radial-gradient(circle at var(--gx, 44%) var(--gy, 34%), rgba(255, 248, 215, .42), rgba(221, 189, 133, .12) 32%, transparent 65%);
  transition: opacity .3s ease;
}

.reading-photo {
  position: relative;
  z-index: 2;
  width: 100%;
  aspect-ratio: var(--card-ratio);
  display: block;
  overflow: visible;
  border: 0;
  border-radius: 17px;
  background: transparent;
  box-shadow: none;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .16s ease-out;
}

.reading-photo img,
.history-photo img,
.saved-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
  filter: drop-shadow(0 20px 30px rgba(33, 27, 19, .32));
}

.card-orbit {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  width: 126%;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--gold) 32%, transparent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: orbit-turn 24s linear infinite;
}

.card-orbit::before {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 7px;
  height: 7px;
  content: '';
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 18px var(--gold);
}

.orbit-two {
  width: 154%;
  border-color: color-mix(in srgb, var(--blue) 22%, transparent);
  animation-direction: reverse;
  animation-duration: 32s;
}

.reading-heading { animation: copy-arrives .7s .14s var(--ease-out-expo) both; }
.reading-heading .eyebrow { animation: copy-arrives .6s .18s var(--ease-out-expo) both; }
.reading-heading h1 {
  margin: 13px 0 12px;
  font: 400 clamp(4rem, 7vw, 7rem)/.88 var(--serif);
  letter-spacing: -.052em;
  animation: copy-arrives .72s .24s var(--ease-out-expo) both;
}

.reading-keywords {
  margin: 0 0 33px;
  color: var(--gold);
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .16em;
  text-transform: uppercase;
  animation: copy-arrives .72s .32s var(--ease-out-expo) both;
}

.reading-heading blockquote {
  position: relative;
  max-width: 620px;
  margin: 0;
  padding: 23px 0 0 26px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font: italic 400 clamp(1.35rem, 2.2vw, 2rem)/1.35 var(--serif);
  animation: copy-arrives .82s .42s var(--ease-out-expo) both;
}

.reading-heading blockquote::before { position: absolute; top: 18px; left: 0; content: '“'; color: var(--gold); font-size: 2.2rem; }

.scroll-invitation {
  position: absolute;
  bottom: 18px;
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
  padding: 0;
  border: 0;
  background: transparent;
  font-size: .61rem;
  font-weight: 650;
  letter-spacing: .16em;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.scroll-invitation i { width: 1px; height: 28px; background: linear-gradient(var(--gold), transparent); animation: scroll-pulse 1.8s ease-in-out infinite; }

.reading-content {
  padding-top: 72px;
  scroll-margin-top: calc(var(--header) + 16px);
}

.reading-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.reading-section {
  min-height: 310px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: clamp(22px, 3vw, 34px);
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .07);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform .3s var(--ease-out-expo), border-color .3s ease;
}

.reading-section:hover {
  transform: translateY(-3px);
}

.reading-grid .reading-section:nth-child(1) { animation: copy-arrives .75s .52s var(--ease-out-expo) both; }
.reading-grid .reading-section:nth-child(2) { animation: copy-arrives .75s .64s var(--ease-out-expo) both; }
.reading-grid .reading-section:nth-child(3) { animation: copy-arrives .75s .76s var(--ease-out-expo) both; }

.reading-section-lead {
  position: relative;
  grid-column: 1 / -1;
  min-height: 330px;
  overflow: hidden;
  color: #fffaf0;
  background:
    radial-gradient(circle at 88% 12%, rgba(221, 189, 133, .22), transparent 28%),
    linear-gradient(135deg, #0b2940, #143b50 68%, #0c2e42);
  border-color: rgba(221, 189, 133, .28);
  box-shadow: 0 25px 70px rgba(8, 35, 63, .22);
}

.reading-section-lead::after {
  position: absolute;
  right: -90px;
  bottom: -130px;
  width: 330px;
  aspect-ratio: 1;
  content: '';
  border: 1px solid rgba(221, 189, 133, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(221, 189, 133, .035), 0 0 0 82px rgba(221, 189, 133, .025);
}

.reading-section-lead > * { position: relative; z-index: 1; }
.reading-section.reading-section-lead .section-number { color: #e5c57e; }
.reading-section.reading-section-lead h2 { max-width: 720px; color: #fffaf0; font-size: clamp(2.3rem, 4vw, 3.7rem); }
.reading-section.reading-section-lead p { max-width: 860px; color: rgba(255, 250, 240, .76); font-size: 1rem; }
.reading-section:nth-child(2) { border-top: 3px solid color-mix(in srgb, #a55d4a 72%, var(--line)); }
.reading-section:nth-child(3) { border-top: 3px solid color-mix(in srgb, var(--gold) 72%, var(--line)); }

.insight-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-number {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--gold) 44%, var(--line));
  border-radius: 50%;
  color: var(--gold);
  background: color-mix(in srgb, var(--gold-soft) 68%, transparent);
  font: 650 .71rem/1 var(--sans);
}

.reading-section-lead .section-number {
  border-color: rgba(229, 197, 126, .42);
  background: rgba(229, 197, 126, .11);
}

.reading-section h2 { margin: 0; font: 400 clamp(1.7rem, 2.6vw, 2.45rem)/1.05 var(--serif); }
.reading-section p { margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.9; }

.journal-note {
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: clamp(30px, 7vw, 100px);
  margin-top: 18px;
  padding: clamp(28px, 4vw, 54px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
  animation: copy-arrives .8s .88s var(--ease-out-expo) both;
}

.journal-note h2 { margin: 10px 0 0; font: 400 clamp(2rem, 4vw, 3.8rem)/1 var(--serif); }

/* Pastilles d'ancrage d'intention dans la note */
.intention-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.intention-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border: 1px solid color-mix(in srgb, var(--gold) 34%, var(--line));
  border-radius: 999px;
  color: var(--ink);
  background: var(--gold-soft);
  font-size: .7rem;
  font-weight: 650;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.intention-pill:hover,
.intention-pill.is-active {
  color: var(--ink);
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 26%, var(--surface-solid));
  transform: translateY(-2px);
}

.journal-note textarea,
.saved-note textarea {
  width: 100%;
  min-height: 155px;
  resize: vertical;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: var(--surface-soft);
  line-height: 1.7;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.journal-note textarea:focus,
.saved-note textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
  outline: 0;
}

.journal-note textarea::placeholder,
.saved-note textarea::placeholder { color: var(--muted); }
.save-status,
.saved-note p { margin: 9px 2px 0; color: var(--muted); font-size: .68rem; }

.reading-home-return {
  width: 100%;
  min-height: 86px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding: 15px 19px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 14px 42px rgba(0, 0, 0, .06);
  text-align: left;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.reading-home-return:hover {
  border-color: color-mix(in srgb, var(--gold) 65%, transparent);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .11);
  transform: translateY(-3px);
}

.reading-home-return-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #fffaf0;
  background: #102f43;
  border-radius: 50%;
}

.reading-home-return-icon svg { width: 20px; height: 20px; }
.reading-home-return > span:nth-child(2) { display: grid; }
.reading-home-return small { color: var(--gold); font-size: .58rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.reading-home-return strong { margin-top: 3px; font: 400 1.55rem/1.1 var(--serif); }
.reading-home-return > svg { color: var(--gold); }

.reading-end-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 11px; padding: 18px 0 0; }

.button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: .78rem;
  font-weight: 700;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.button:hover { transform: translateY(-3px); }
.button-primary { color: var(--bg); background: var(--ink); box-shadow: 0 14px 35px rgba(0, 0, 0, .16); }
.button-secondary { color: var(--ink); border-color: var(--line); background: var(--surface); }
.text-link { min-height: 48px; display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; color: var(--gold); font-size: .75rem; font-weight: 700; }
.text-link svg { width: 17px; }

/* Journal et pages secondaires */
.secondary-page { min-height: calc(100svh - var(--header)); padding: 28px 0 90px; }
.page-heading { padding: 58px 0 38px; border-bottom: 1px solid var(--line); }
.page-heading h1 { margin: 10px 0 0; font: 400 clamp(3.5rem, 7vw, 6.5rem)/.9 var(--serif); letter-spacing: -.05em; }
.page-heading > p:last-child { margin: 17px 0 0; color: var(--muted); font-size: .8rem; }

/* Miroir Systémique (Synthèse vivante dans Mon Journal) */
.journal-mirror {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  margin: 22px 0 4px;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--gold) 36%, var(--line));
  border-radius: 22px;
  background:
    radial-gradient(circle at 92% 14%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 40%),
    color-mix(in srgb, var(--surface-solid) 84%, var(--gold-soft));
  box-shadow: 0 16px 46px rgba(0, 0, 0, .06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.mirror-stat {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 8px 10px;
  border-radius: 14px;
}

.mirror-photo {
  width: 52px;
  aspect-ratio: var(--card-ratio);
  display: block;
  flex-shrink: 0;
  border-radius: 6px;
}

.mirror-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .22));
}

.mirror-stat small {
  display: block;
  color: var(--gold);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.mirror-stat strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font: 400 1.45rem/1.05 var(--serif);
}

.mirror-stat span.mirror-sub {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .68rem;
}

.history-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 26px; }
.journal-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 14px 0 4px; }
.journal-tools button { min-height: 70px; display: flex; align-items: center; gap: 13px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: color-mix(in srgb, var(--surface) 78%, transparent); text-align: left; transition: border-color .2s ease, transform .2s ease; }
.journal-tools button:not(:disabled):hover { border-color: var(--gold); transform: translateY(-2px); }
.journal-tools button > svg { color: var(--gold); }
.journal-tools strong,
.journal-tools small { display: block; }
.journal-tools strong { font-size: .75rem; }
.journal-tools small { margin-top: 2px; color: var(--muted); font-size: .58rem; }

.history-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color .25s ease, transform .28s var(--ease-out-expo), box-shadow .25s ease;
}

.history-item:hover {
  border-color: var(--gold);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .08);
  transform: translateY(-3px);
}

.history-entry {
  min-width: 0;
  min-height: 154px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 17px;
  padding: 16px;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.history-entry:hover { color: var(--ink); }
.history-photo { width: 76px; aspect-ratio: var(--card-ratio); display: block; overflow: visible; border-radius: 8px; transition: transform .3s var(--ease-spring); }
.history-entry:hover .history-photo { transform: scale(1.05) rotate(-1.5deg); }
.history-copy { min-width: 0; display: grid; }
.history-copy small { color: var(--gold); font-size: .58rem; font-weight: 650; text-transform: uppercase; }
.history-copy strong { margin-top: 4px; font: 400 1.55rem/1.05 var(--serif); }
.history-copy > span { margin-top: 8px; overflow: hidden; color: var(--muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.history-arrow svg { width: 18px; color: var(--gold); transition: transform .25s ease; }
.history-entry:hover .history-arrow svg { transform: translateX(3px); }

.history-delete {
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  align-self: stretch;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-soft) 55%, transparent);
  transition: color .2s ease, background .2s ease;
}

.history-delete:hover,
.history-delete:focus-visible {
  color: #a8443d;
  background: color-mix(in srgb, #a8443d 11%, var(--surface));
}

.history-delete svg { width: 18px; height: 18px; }

.empty-journal { max-width: 560px; margin: 75px auto; padding: 50px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); text-align: center; }
.empty-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 50%; color: var(--gold); background: var(--gold-soft); }
.empty-journal h2 { font: 400 2.5rem/1 var(--serif); }

.saved-heading { display: grid; grid-template-columns: 225px minmax(0, 1fr); align-items: center; gap: clamp(34px, 8vw, 100px); padding: 54px 7%; }
.saved-photo {
  width: 225px;
  aspect-ratio: var(--card-ratio);
  display: block;
  overflow: visible;
  border: 0;
  border-radius: 13px;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .16s ease-out;
}
.saved-heading h1 { margin: 10px 0 24px; font: 400 clamp(3.4rem, 7vw, 6.3rem)/.9 var(--serif); }
.saved-heading blockquote { margin: 0; color: var(--muted); font: italic 400 1.35rem/1.45 var(--serif); }

.saved-analysis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.saved-analysis section { min-height: 285px; display: flex; flex-direction: column; gap: 24px; padding: 26px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); }
.saved-analysis h2 { margin: 0; font: 400 1.75rem/1.1 var(--serif); }
.saved-analysis p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.85; }
.saved-analysis .saved-analysis-lead {
  grid-column: 1 / -1;
  color: #fffaf0;
  background: linear-gradient(135deg, #0b2940, #143b50);
  border-color: rgba(221, 189, 133, .25);
}
.saved-analysis .saved-analysis-lead .section-number { color: #e5c57e; border-color: rgba(229, 197, 126, .42); background: rgba(229, 197, 126, .11); }
.saved-analysis .saved-analysis-lead h2 { font-size: clamp(2rem, 3.5vw, 3rem); }
.saved-analysis .saved-analysis-lead p { max-width: 850px; color: rgba(255, 250, 240, .76); }
.saved-note { margin-top: 14px; padding: 28px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); }
.saved-note label { display: block; margin-bottom: 12px; font: 400 1.8rem var(--serif); }
.saved-new-draw { display: flex; margin: 24px auto 0; }
.saved-actions { display: flex; align-items: center; gap: 7px; }
.round-action-danger:hover,
.round-action-danger:focus-visible { color: #b35149; border-color: #b35149; }

:root[data-theme='nuit'] .history-delete:hover,
:root[data-theme='nuit'] .history-delete:focus-visible,
:root[data-theme='nuit'] .round-action-danger:hover,
:root[data-theme='nuit'] .round-action-danger:focus-visible {
  color: #f0b0aa;
  border-color: #f0b0aa;
}

.more-page { padding-bottom: 54px; }

.school-hero {
  display: grid;
  grid-template-columns: clamp(144px, 15vw, 164px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 6vw, 76px);
  padding: 48px clamp(0px, 5vw, 58px) 55px;
  border-bottom: 1px solid var(--line);
}

.school-hero > img {
  width: 100%;
  height: auto;
  aspect-ratio: 986 / 1005;
  object-fit: contain;
  border: 1px solid color-mix(in srgb, var(--gold) 32%, transparent);
  border-radius: 50%;
  box-shadow: 0 20px 50px rgba(32, 47, 58, .12);
}

.school-hero h1 {
  margin: 10px 0 18px;
  font: 400 clamp(4rem, 8vw, 7rem)/.86 var(--serif);
  letter-spacing: -.052em;
}

.school-manifesto {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
  font: 400 clamp(1.2rem, 2.4vw, 1.75rem)/1.35 var(--serif);
}

.school-manifesto em { color: var(--gold); }

.school-paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.school-path {
  position: relative;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .055);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.school-path-primary {
  grid-column: 1 / -1;
  min-height: 230px;
  color: #fffaf0;
  background:
    radial-gradient(circle at 88% 15%, rgba(221, 189, 133, .2), transparent 27%),
    linear-gradient(135deg, #0b2940, #143b50);
  border-color: rgba(221, 189, 133, .26);
}

.school-path.school-path-primary p { color: rgba(255, 250, 240, .72); }
.school-path.school-path-primary .school-path-number,
.school-path.school-path-primary small,
.school-path.school-path-primary .school-path-arrow { color: #e5c57e; }

.school-path:hover {
  border-color: color-mix(in srgb, var(--gold) 62%, transparent);
  box-shadow: 0 25px 65px rgba(0, 0, 0, .1);
  transform: translateY(-5px);
}

.school-path-top { display: inline-flex; align-items: center; gap: 11px; padding-right: 56px; }
.school-path-number {
  width: 31px;
  height: 31px;
  display: grid;
  flex: 0 0 31px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--gold) 48%, var(--line));
  border-radius: 50%;
  color: var(--gold);
  background: var(--gold-soft);
  font: 650 .69rem/1 var(--sans);
}
.school-path-primary .school-path-number { border-color: rgba(229, 197, 126, .4); background: rgba(229, 197, 126, .1); }
.school-path-copy { width: 100%; margin-top: auto; padding-top: 34px; }
.school-path small { color: var(--gold); font-size: .62rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.school-path strong { display: block; font: 400 clamp(1.8rem, 3.3vw, 2.7rem)/1 var(--serif); }
.school-path p { max-width: 330px; margin: 17px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.7; }
.school-path-arrow {
  position: absolute;
  top: clamp(22px, 3vw, 32px);
  right: clamp(22px, 3vw, 32px);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  border-radius: 50%;
  color: var(--gold);
}
.school-path-arrow svg { width: 16px; height: 16px; }

.more-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 0;
}

.more-list > * {
  min-width: 0;
  min-height: 90px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  text-align: left;
  transition: border-color .2s ease, transform .2s ease;
}

.more-list > *:hover { border-color: var(--gold); transform: translateY(-3px); }
.more-list > *.install-card { grid-column: 1 / -1; min-height: 82px; border-color: color-mix(in srgb, var(--gold) 44%, var(--line)); background: linear-gradient(110deg, color-mix(in srgb, var(--gold-soft) 72%, var(--surface)), var(--surface)); }
.more-list > *.install-card strong { font: 400 1.35rem/1.1 var(--serif); }
.more-list > *.install-card small { white-space: normal; }
.more-list > *.install-card:disabled { cursor: default; opacity: .72; }
.more-list > *.install-card:disabled:hover { border-color: color-mix(in srgb, var(--gold) 44%, var(--line)); transform: none; }
.more-list strong { display: block; overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.more-list small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: .59rem; text-overflow: ellipsis; white-space: nowrap; }
.more-list > * > svg { color: var(--gold); }
.more-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: var(--gold); background: var(--gold-soft); }

.newsletter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 4vw, 52px);
  margin-top: 18px;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--ink) 96%, var(--blue));
  color: var(--bg);
  box-shadow: var(--shadow);
}

.newsletter .eyebrow { color: var(--gold-bright); }
.newsletter h2 { margin: 9px 0 8px; font: 400 clamp(2.2rem, 4vw, 3.6rem)/.96 var(--serif); }
.newsletter p { margin: 0; color: color-mix(in srgb, var(--bg) 70%, transparent); font-size: .78rem; }
.newsletter form { min-width: 0; }
.email-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.email-row input {
  min-width: 0;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--bg) 24%, transparent);
  border-radius: 13px;
  color: var(--bg);
  background: color-mix(in srgb, var(--bg) 9%, transparent);
  outline: 0;
}
.email-row input::placeholder { color: color-mix(in srgb, var(--bg) 56%, transparent); }
.email-row input:focus { border-color: var(--gold-bright); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold-bright) 18%, transparent); }
.newsletter .button-primary { color: var(--ink); background: var(--bg); box-shadow: none; }
.newsletter #email-status { grid-column: 1 / -1; margin-top: 9px; color: var(--gold-bright); }
.newsletter-privacy { display: block; margin-top: 10px; color: color-mix(in srgb, var(--bg) 55%, transparent); font-size: .61rem; line-height: 1.5; }

.contact-line {
  padding: 28px 0 0;
  color: var(--muted);
  font-size: .62rem;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
}

.status-page { width: min(calc(100% - 40px), 560px); min-height: calc(100svh - var(--header)); display: grid; align-content: center; justify-items: center; margin: auto; text-align: center; }
.status-logo { width: 90px; margin-bottom: 23px; border-radius: 50%; }
.status-page h1 { margin: 12px 0; font: 400 3rem/1 var(--serif); }
.status-page > p:not(.eyebrow) { color: var(--muted); }

.image-holder { position: relative; }
.image-fallback { position: absolute; inset: 0; display: none; align-content: center; justify-items: center; padding: 20px; color: var(--gold); background: var(--surface-solid); font-family: var(--serif); text-align: center; }
.image-fallback small { display: block; color: var(--muted); font: 650 .6rem var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.image-missing .image-fallback { display: grid; }

/* Calculette plein écran */
.calc-overlay { position: fixed; z-index: 300; inset: 0; display: flex; flex-direction: column; background: var(--bg); animation: view-enter .35s var(--ease-out-expo) both; }
.calc-topbar { height: 64px; display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 12px; padding: 0 max(14px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); background: var(--surface-solid); }
.calc-topbar strong { text-align: center; font: 400 1.25rem var(--serif); }
.calc-overlay iframe { width: 100%; min-height: 0; flex: 1; border: 0; background: var(--bg); }

.toast { position: fixed; z-index: 500; right: 18px; bottom: 18px; max-width: min(360px, calc(100% - 36px)); padding: 14px 18px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: var(--surface-solid); box-shadow: var(--shadow); font-size: .78rem; animation: toast-in .25s ease both; }
.update-toast { display: flex; align-items: center; gap: 14px; }
.update-toast > span { flex: 1; }
.update-toast button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--gold); border-radius: 9px; color: var(--ink); background: var(--gold-soft); font-size: .68rem; font-weight: 700; }
.update-toast button svg { width: 15px; height: 15px; }

.install-dialog { width: min(520px, calc(100% - 28px)); max-height: min(720px, calc(100svh - 28px)); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 25px; color: var(--ink); background: var(--surface-solid); box-shadow: 0 35px 120px rgba(0, 0, 0, .35); }
.install-dialog::backdrop { background: rgba(4, 9, 20, .64); backdrop-filter: blur(8px); }
.install-dialog-inner { display: grid; justify-items: center; padding: clamp(26px, 6vw, 46px); text-align: center; }
.install-dialog img { margin-bottom: 18px; border-radius: 20px; box-shadow: 0 12px 30px rgba(32, 47, 58, .18); }
.install-dialog h2 { margin: 7px 0 18px; font: 400 clamp(2.3rem, 8vw, 3.4rem)/.95 var(--serif); }
.install-dialog p,
.install-dialog ol { margin: 0 0 22px; color: var(--muted); font-size: .82rem; line-height: 1.75; }
.install-dialog ol { width: 100%; padding-left: 22px; text-align: left; }
.install-dialog li + li { margin-top: 8px; }
.install-dialog strong { color: var(--ink); }
.install-dialog .install-journal-note { padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--gold) 42%, var(--line)); border-radius: 13px; background: var(--gold-soft); font-size: .72rem; text-align: left; }

@keyframes view-enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes aura-breathe { 0%,100% { opacity: .65; transform: translateX(-50%) scale(.96); } 50% { opacity: 1; transform: translateX(-50%) scale(1.06); } }
@keyframes aura-open { to { opacity: 1; transform: translateX(-50%) scale(1.42); } }
@keyframes aura-turn { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes orbit-turn { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes card-arrives { 0% { opacity: 0; transform: translateY(34px) scale(.88) rotateY(-28deg); filter: brightness(1.35); } 100% { opacity: 1; transform: none; filter: brightness(1); } }
@keyframes copy-arrives { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes scroll-pulse { 0%,100% { opacity: .25; transform: scaleY(.5); transform-origin: top; } 50% { opacity: 1; transform: scaleY(1); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 900px) {
  .desktop-nav { display: none; }

  .ritual-home {
    width: min(calc(100% - 36px), 720px);
    grid-template-rows: auto auto auto auto;
    justify-items: stretch;
    padding: 20px 0 18px;
  }

  .home-title-block { text-align: center; }
  .home-title-block h1 { margin-top: 6px; font-size: clamp(2.75rem, 12vw, 4.6rem); line-height: .86; }
  .ritual-date { font-size: .59rem; }

  .tarot-deck {
    --fan-card-width: clamp(62px, 10vw, 74px);
    --fan-card-half: clamp(-37px, -5vw, -31px);
    --fan-radius: clamp(280px, 45vw, 330px);
    --fan-top: 8px;
    width: 100%;
    height: clamp(430px, 60vw, 500px);
    min-height: 0;
  }
  .fan { inset: 0 0 48px; }
  .draw-call { top: clamp(282px, 43vw, 330px); }
  .draw-call strong { font-size: clamp(2.2rem, 6.2vw, 3.15rem); }
  .draw-call small { margin-top: 9px; }
  .deck-aura { top: 0; width: min(88vw, 390px); }

  .quick-doors { gap: 8px; }
  .quick-door { min-height: 78px; border-radius: 14px; }
  .door-icon { width: 33px; height: 33px; }
  .counter-line { display: none; }

  .school-hero { padding-inline: 0; }

  .reading-reveal { grid-template-columns: .8fr 1.2fr; gap: 45px; padding-inline: 2%; }
  .reading-card-scene { width: min(100%, 280px); }
  .reading-section { min-height: 0; }
  .reading-section-lead { min-height: 330px; }
  .journal-note { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  :root { --header: 64px; }
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .page-width { width: min(calc(100% - 28px), var(--page)); }
  .app-header { position: sticky; top: 0; padding-inline: 14px; }
  .brand img { width: 38px; height: 38px; }
  .brand span { font-size: 1.06rem; }
  .journal-button span { display: none; }
  .header-button { padding: 0; width: 44px; }

  .bottom-nav {
    position: fixed;
    z-index: 120;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: calc(64px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 5px max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
    box-shadow: 0 -12px 38px rgba(0, 0, 0, .08);
    backdrop-filter: blur(22px) saturate(135%);
    -webkit-backdrop-filter: blur(22px) saturate(135%);
  }

  .bottom-nav > * {
    min-width: 0;
    min-height: 54px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    color: var(--muted);
    background: transparent;
    font-size: .56rem;
    font-weight: 650;
  }

  .bottom-nav svg { width: 19px; height: 19px; }
  .bottom-nav > *[aria-current='page'] { color: var(--gold); background: var(--gold-soft); }

  .ritual-home { width: min(calc(100% - 24px), 560px); min-height: calc(100svh - var(--header) - 66px); grid-template-rows: auto auto auto auto; padding: 13px 0 12px; }
  .home-title-block h1 { font-size: clamp(2.55rem, 12.5vw, 3.55rem); }
  .today-drawn-banner { margin-top: 10px; padding: 6px 12px 6px 8px; }
  .today-drawn-copy strong { font-size: 1rem; }
  .tarot-deck {
    --fan-card-width: clamp(48px, 14.8vw, 72px);
    --fan-card-half: clamp(-36px, -7.4vw, -24px);
    --fan-radius: clamp(145px, 46vw, 260px);
    --fan-top: 8px;
    height: clamp(286px, 78vw, 400px);
    min-height: 0;
  }
  .fan { inset: -2px 0 38px; }
  .fan-card:hover img,
  .fan-card:focus-visible img { transform: translateY(-30px) scale(1.12); }
  .tarot-deck.is-drawing .fan-card.is-selected img { transform: translateY(-43px) scale(1.16); }
  .draw-call { top: clamp(174px, 52vw, 280px); right: 3%; left: 3%; }
  .draw-call::before { margin-bottom: 10px; }
  .draw-call strong { max-width: 8.6em; font-size: clamp(1.95rem, 8.1vw, 2.75rem); }
  .draw-call small { max-width: 90%; font-size: .57rem; line-height: 1.35; }
  .deck-aura { width: min(80vw, 300px); }
  .home-dock { gap: 6px; }
  .quick-doors { gap: 6px; }
  .quick-door { min-height: 70px; flex-direction: column; gap: 5px; padding: 7px 4px; }
  .door-icon { width: 30px; height: 30px; }
  .door-icon svg { width: 16px; height: 16px; }
  .quick-door > span:last-child { text-align: center; }
  .quick-door strong { font-size: .67rem; }
  .quick-door small { font-size: .5rem; }
  .home-secondary-links { gap: 6px; }
  .home-text-link { min-height: 44px; padding: 0 10px; border-radius: 12px; font-size: .61rem; }
  .home-text-link svg:last-child { display: none; }

  .reading-page { padding-top: 14px; }
  .reading-toolbar { min-height: 46px; }
  .round-action { min-width: 44px; padding: 0 11px; }
  .round-action span { display: none; }
  .reading-reveal { min-height: calc(100svh - var(--header) - 60px); grid-template-columns: 1fr; grid-template-rows: minmax(330px, 1fr) auto 48px; gap: 10px; padding: 8px 4px 12px; text-align: center; }
  .reading-card-scene { width: min(48vw, 185px); justify-self: center; align-self: center; }
  .card-orbit { width: 132%; }
  .orbit-two { width: 160%; }
  .reading-heading .eyebrow { display: none; }
  .reading-heading h1 { margin: 6px 0 4px; font-size: clamp(3rem, 15vw, 4.5rem); }
  .reading-keywords { margin: 0 0 13px; font-size: .58rem; }
  .reading-heading blockquote { max-width: 390px; margin-inline: auto; padding: 13px 10px 0; font-size: 1.13rem; }
  .reading-heading blockquote::before { display: none; }
  .scroll-invitation { position: relative; bottom: auto; left: auto; align-self: end; transform: none; }
  .scroll-invitation i { height: 18px; }

  .reading-content { padding-top: 35px; }
  .reading-grid { grid-template-columns: 1fr; gap: 9px; }
  .reading-section { gap: 20px; padding: 25px; border-radius: 18px; }
  .reading-section-lead { min-height: 0; }
  .reading-section h2 { font-size: 1.85rem; }
  .reading-section-lead h2 { font-size: 2.35rem; }
  .reading-section p { font-size: .88rem; }
  .journal-note { gap: 22px; margin-top: 9px; padding: 25px; border-radius: 18px; }
  .journal-note h2 { font-size: 2.25rem; }
  .reading-home-return { min-height: 78px; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; margin-top: 9px; padding: 12px 14px; border-radius: 17px; }
  .reading-home-return-icon { width: 42px; height: 42px; }
  .reading-home-return strong { font-size: 1.35rem; }
  .reading-end-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .reading-end-actions .text-link { grid-column: 1 / -1; justify-self: center; }
  .button { padding-inline: 14px; }

  .secondary-page { padding-top: 14px; }
  .page-heading { padding: 38px 0 25px; }
  .page-heading h1 { font-size: 4rem; }
  .journal-mirror { grid-template-columns: 1fr; padding: 14px; border-radius: 18px; }
  .journal-tools { gap: 7px; margin-top: 10px; }
  .journal-tools button { min-height: 67px; padding: 10px 12px; }
  .journal-tools small { font-size: .54rem; }
  .history-list { grid-template-columns: 1fr; padding-top: 14px; }
  .history-item { grid-template-columns: minmax(0, 1fr) 46px; }
  .history-entry { min-height: 130px; grid-template-columns: 61px minmax(0, 1fr) auto; padding: 12px; }
  .history-photo { width: 61px; }
  .history-copy strong { font-size: 1.35rem; }
  .saved-heading { grid-template-columns: 105px minmax(0, 1fr); gap: 20px; padding: 35px 0; }
  .saved-photo { width: 105px; }
  .saved-heading h1 { margin-bottom: 12px; font-size: 3rem; }
  .saved-heading blockquote { font-size: 1rem; }
  .saved-analysis { grid-template-columns: 1fr; }
  .saved-analysis .saved-analysis-lead { grid-column: auto; }
  .saved-analysis section { min-height: 0; }
  .saved-analysis h2 { margin: 0; }
  .school-hero { grid-template-columns: 1fr; justify-items: center; gap: 16px; padding: 24px 0 35px; text-align: center; }
  .school-hero > img { width: 116px; height: auto; }
  .school-hero h1 { margin-top: 8px; font-size: clamp(3.7rem, 17vw, 5rem); }
  .school-manifesto { font-size: 1.18rem; }
  .school-paths { grid-template-columns: 1fr; gap: 9px; margin-top: 12px; }
  .school-path { min-height: 196px; padding: 23px; border-radius: 19px; }
  .school-path-copy { padding-top: 28px; }
  .school-path strong { font-size: 2rem; }
  .more-list { grid-template-columns: 1fr; gap: 7px; margin-top: 9px; }
  .more-list > * { min-height: 74px; border-radius: 15px; }
  .more-list > *.install-card { min-height: 78px; }
  .more-list strong { font-size: .75rem; }
  .more-list small { font-size: .57rem; }
  .newsletter { grid-template-columns: 1fr; gap: 24px; margin-top: 12px; padding: 26px 22px; border-radius: 19px; }
  .email-row { grid-template-columns: 1fr; }
  .email-row .button { width: 100%; }
  .contact-line { padding-bottom: 18px; }
  .toast { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); left: 12px; max-width: none; text-align: center; }
}

@media (max-width: 380px) {
  .brand span { display: none; }
  .draw-call strong { font-size: 1.82rem; }
  .home-title-block h1 { font-size: 2.48rem; }
  .ritual-date { font-size: .53rem; letter-spacing: .13em; }
  .quick-door { min-height: 65px; }
  .quick-door small { display: none; }
  .home-text-link { font-size: .57rem; }
  .reading-card-scene { width: 155px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
/* Journal complet, sans modifier la composition des cartes. */
.journal-pagination { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 24px 0; }
.journal-pagination span { color: var(--muted); font-size: .75rem; }
.journal-insights-help { margin: 10px 4px 18px; color: var(--muted); font-size: .78rem; }
.journal-insights-help summary { cursor: pointer; padding: 8px 0; }
.journal-insights-help p { max-width: 75ch; }
button:disabled { cursor: default; opacity: .55; }
/* Newsletter: Wix controls the fields and records the subscription. */
.newsletter-fields { display: grid; gap: 14px; margin: 0 0 12px; }
.newsletter-field { display: grid; gap: 7px; }
.newsletter-field input { width: 100%; min-width: 0; min-height: 52px; padding: 13px 16px; border: 1px solid color-mix(in srgb, var(--bg) 30%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--bg) 9%, transparent); color: inherit; font: inherit; font-size: 16px; }
.newsletter-field input::placeholder { color: color-mix(in srgb, var(--bg) 65%, transparent); }
.newsletter-field input:focus { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.newsletter-consent { display: grid; grid-template-columns: 20px 1fr; align-items: start; gap: 9px; font-size: .85rem; line-height: 1.5; }
.newsletter-consent input { margin-top: 4px; width: 17px; height: 17px; }
.newsletter-consent small { grid-column: 2; }
.newsletter-fields [aria-invalid="true"] { outline: 2px solid #aa4141; }
.newsletter-fields small { color: var(--gold-bright); }
#newsletter-mount [hidden] { display: none !important; }
#newsletter-mount a { display: inline-block; margin: 10px 0; color: inherit; text-decoration: underline; }
.newsletter-retry { color: inherit; border: 1px solid currentColor; margin-top: 12px; }
.newsletter-privacy { grid-column: 1 / -1; margin-top: -20px; }

.newsletter-reassurance { display: block; margin-top: 10px; font-size: .8rem; }
#wix-newsletter-form .button-primary { max-width: 100%; white-space: normal; }

/* One compact invitation: introduction + aligned signup controls. */
.newsletter > div { min-width: 0; }
.newsletter h2 { margin-bottom: 16px; }
.newsletter p:not(.eyebrow) { font-size: .88rem; line-height: 1.65; }
.newsletter .eyebrow { font-size: .65rem; }
.newsletter-field label { font-size: .8rem; font-weight: 600; }
.newsletter-field small:empty, .newsletter #email-status:empty { display: none; }
#wix-newsletter-form .button-primary { width: 100%; min-height: 52px; padding: 14px 16px; font-size: .82rem; line-height: 1.4; border-radius: 14px; }
.newsletter-reassurance { margin-top: 12px; text-align: center; color: color-mix(in srgb, var(--bg) 75%, transparent); font-size: .73rem; }
@media (max-width: 760px) {
  .newsletter { grid-template-columns: 1fr; gap: 24px; padding: 28px 22px; }
  .newsletter h2 { margin-bottom: 12px; }
}
