/* ==========================================================
   1 Jour 1 Ulysse — styles
   Palette inspirée d'un berger australien noir tricolore :
   noir profond, blanc et une touche de feu (cuivre).
   Thème clair uniquement, même si l'appareil est en mode sombre.
   ========================================================== */

/* Polices hébergées sur le site (licence OFL, voir fonts/) :
   aucune requête vers Google ou un autre service. */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/fraunces-opsz-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/fraunces-opsz-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-wght-normal.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #faf8f5;
  --ink: #1b1916;
  --muted: #6e665b;
  --line: #ece7df;
  --accent: #a45f2a;
  --accent-soft: #f5ebe1;
  --ok: #2f7a4b;
  --ok-soft: #e8f3ec;
  --ko: #b23b3b;
  --ko-soft: #f8e9e9;
  --chart-deep: #1f5096;
  --chart-light: #3a90c8;
  --shadow: 0 1px 2px rgb(27 25 22 / .06), 0 18px 50px -20px rgb(27 25 22 / .3);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 16px;
  --maxw: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.muted { color: var(--muted); }
.kicker {
  margin: 0 0 .35rem;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- En-tête ---------- */
.top {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.4rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand-num { color: var(--accent); font-style: italic; }
.top-nav { display: flex; gap: 1.4rem; }
.top-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 500;
  transition: color .2s;
}
.top-nav a:hover { color: var(--ink); }

main { max-width: var(--maxw); margin: 0 auto; padding: 0 1rem; }

/* ---------- Photo du jour ---------- */
.daily { padding: 1rem 0 4.5rem; text-align: center; }

.birthday {
  display: inline-block;
  margin: 0 0 1.4rem;
  padding: .45rem 1rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: .92rem;
}

.day-head { margin-bottom: 1.6rem; }
.day-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -.02em;
}
.day-title .year { color: var(--muted); font-style: italic; font-weight: 300; }

.photo-frame {
  margin: 0 auto;
  display: flex;
  justify-content: center;
  min-height: 240px;
}
.photo-btn {
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: var(--radius);
  max-width: 100%;
}
#photo {
  max-height: min(76vh, 860px);
  width: auto;
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--line);
  opacity: 0;
  transform: translateY(6px) scale(.995);
  transition: opacity .45s ease, transform .45s ease;
}
#photo.ready { opacity: 1; transform: none; }

.empty {
  width: min(100%, 560px);
  padding: 3rem 1.5rem;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}
.empty p { margin: .3rem 0; }
.empty strong { color: var(--ink); }
.empty-paw { font-size: 2.2rem; display: block; margin-bottom: .6rem; }
code {
  font-size: .88em;
  padding: .1em .4em;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--ink);
}

.day-nav {
  margin: 1.8rem auto 0;
  max-width: 520px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .75rem;
}
.nav-btn {
  background: none;
  border: 0;
  padding: .5rem .25rem;
  color: var(--muted);
  font-weight: 500;
  font-size: .95rem;
  transition: color .2s;
}
#prev { grid-column: 1; justify-self: start; }
#next { grid-column: 3; justify-self: end; }
.nav-btn:not(:disabled):hover { color: var(--ink); }
.nav-btn:disabled { opacity: .3; }
.today-btn {
  grid-column: 2;
  padding: .45rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: .88rem;
  font-weight: 500;
  transition: border-color .2s;
}
.today-btn:hover { border-color: var(--accent); }

/* ---------- Archives ---------- */
.archives, .about { border-top: 1px solid var(--line); padding: 3.5rem 0; scroll-margin-top: 1rem; }

.section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  margin-bottom: 2rem;
  text-align: center;
}
h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  letter-spacing: -.015em;
}
.section-head p { margin: 0; font-size: .92rem; }

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.1rem;
}
.grid li { width: 160px; }
.tile {
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: center;
}
.tile-img {
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
  outline: 2px solid transparent;
  outline-offset: 3px;
  transition: outline-color .2s;
}
.tile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.tile:hover .tile-img img { transform: scale(1.04); }
.tile-missing {
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  background: var(--surface);
  border: 1.5px dashed var(--line);
  opacity: .7;
}
.tile[aria-current="true"] .tile-img { outline-color: var(--accent); }
.tile-date {
  display: block;
  margin-top: .5rem;
  font-size: .85rem;
  color: var(--muted);
}
.tile-date b { display: block; color: var(--ink); font-weight: 500; }
.tile-date small { font-size: .78rem; }

.archives-empty { margin: 0; }
.more-wrap { text-align: center; }
.toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-top: 1.6rem;
  padding: .55rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 500;
  font-size: .92rem;
  transition: border-color .2s;
}
.toggle-btn:hover { border-color: var(--accent); }
.toggle-arrow { font-size: 1.1rem; line-height: 1; color: var(--accent); transition: transform .25s ease; }
.toggle-btn[aria-expanded="true"] .toggle-arrow { transform: rotate(180deg); }
.grid li.reveal { animation: tile-in .45s ease both; }
.grid li.leaving { animation: tile-out .35s ease both; }
@keyframes tile-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes tile-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(-8px); }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }

/* ---------- Présentation ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 3rem;
  align-items: center;
}
.about-photo {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--accent-soft);
  box-shadow: var(--shadow);
}
.about-photo:empty { display: none; }
.about:has(.about-photo:empty) { grid-template-columns: 1fr; max-width: 680px; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-text h2 { margin-bottom: 1rem; }
.about-desc { margin: 0 0 1.8rem; max-width: 52ch; color: var(--muted); }
.about-desc p { margin: 0 0 .9rem; }
.about-desc p:last-child { margin-bottom: 0; }

.facts {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.facts div { background: var(--surface); padding: .85rem 1rem; }
.facts dt {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.facts dd { margin: .15rem 0 0; font-family: var(--serif); font-size: 1.12rem; }

/* ---------- Bouton « Revenir en haut » ---------- */
.to-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 50;
  width: 2.9rem;
  height: 2.9rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgb(255 255 255 / .92);
  color: var(--accent);
  font-size: 1.25rem;
  line-height: 1;
  box-shadow: 0 8px 24px -12px rgb(27 25 22 / .45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s, border-color .2s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--accent); }

/* ---------- Badge du quiz (page d'accueil) ---------- */
.quiz-badge {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-top: 1.6rem;
  padding: .5rem 1rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.quiz-badge:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -10px rgb(164 95 42 / .6); }
.quiz-badge-dot {
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
.quiz-badge.is-done { background: var(--surface); color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
.quiz-badge.is-done .quiz-badge-dot { background: var(--ok); animation: none; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgb(164 95 42 / .45); }
  50% { box-shadow: 0 0 0 5px rgb(164 95 42 / 0); }
}

/* ---------- Quiz ---------- */
.quiz { padding: 1rem 0 4rem; text-align: center; }
.quiz-date { margin: .5rem 0 0; font-size: .95rem; }
.quiz-figure { margin: 0 auto; max-width: 720px; }
#quiz-img {
  margin: 0 auto;
  max-height: min(62vh, 640px);
  width: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--line);
}
.credit { margin-top: .7rem; font-size: .75rem; color: var(--muted); }
.credit a { color: inherit; }

.choices {
  margin: 2rem auto 0;
  max-width: 620px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.choice {
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.3;
  transition: border-color .2s, background .2s;
}
.choice:not(:disabled):hover { border-color: var(--accent); }
.choice:disabled { opacity: .55; }
.choice.is-correct { opacity: 1; border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.choice.is-wrong { opacity: 1; border-color: var(--ko); background: var(--ko-soft); color: var(--ko); }

.verdict {
  margin: 1.6rem auto 0;
  max-width: 620px;
  padding: 1.2rem 1.4rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.verdict p { margin: 0; }
.verdict-title { font-family: var(--serif); font-size: 1.35rem; }
.verdict.is-correct .verdict-title { color: var(--ok); }
.verdict.is-wrong .verdict-title { color: var(--ko); }
.verdict-answer { margin-top: .3rem !important; }
.verdict-more { margin-top: .5rem !important; font-size: .9rem; }
.verdict-more a { color: var(--accent); }

.stats {
  margin: 2rem auto 0;
  max-width: 620px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.stats div { background: var(--surface); padding: .75rem .5rem; }
.stats dt { font-size: .68rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: .15rem 0 0; font-family: var(--serif); font-size: 1.05rem; }

.res-ok { color: var(--ok); }
.res-ko { color: var(--ko); }
.top-nav a[aria-current="page"] { color: var(--ink); }

/* ---------- Crédits et mentions légales ---------- */
.legal-page { max-width: 760px; padding-bottom: 3rem; }
.legal-page .day-title { text-align: center; margin: 1rem 0 2.5rem; }
.legal-page section { border-top: 1px solid var(--line); padding: 2rem 0; }
.legal-page h2 { font-size: 1.4rem; margin-bottom: .8rem; }
.legal-page p { color: var(--muted); margin: 0 0 .8rem; }
.legal-page a { color: var(--accent); }
.credit-list { margin: 1rem 0 0; padding-left: 1.1rem; font-size: .85rem; color: var(--muted); }
.credit-list li { margin-bottom: .3rem; overflow-wrap: anywhere; }
.credit-list strong { color: var(--ink); font-weight: 500; }
.foot a { color: inherit; }

/* ---------- Âge en années humaines ---------- */
.age-section { border-top: 1px solid var(--line); padding: 3.5rem 0; scroll-margin-top: 1rem; }
.age-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.6rem 1.6rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.age-readout { margin: 0 0 1.4rem; text-align: center; }
.age-human {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  line-height: 1.05;
  color: var(--ink);
}
.age-sentence { display: block; margin-top: .4rem; color: var(--muted); font-size: .95rem; }
.age-slider-label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .4rem;
}
.age-dog-value {
  margin-left: .4rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--chart-deep);
}
.age-slider { width: 100%; accent-color: var(--chart-deep); height: 1.6rem; cursor: pointer; }
.age-slider-scale { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); }
.age-reset { display: block; margin: .9rem auto 0; }
.age-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: 1.6rem 0 .4rem; font-size: .82rem; color: var(--muted); }
.age-legend span { display: inline-flex; align-items: center; gap: .45rem; }
.key { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--chart-deep); }
.key-dna { border-top-color: var(--chart-light); }
.key-seven { border-top: 2px dashed #9a9188; }

.age-chart { position: relative; width: 100%; touch-action: pan-y; }
.age-chart svg { display: block; overflow: visible; }
.g-grid { stroke: var(--line); stroke-width: 1; }
.g-tick, .g-axis { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.g-label { fill: var(--muted); font-size: 12px; font-family: var(--sans); }
.g-vet { fill: none; stroke: var(--chart-deep); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.g-dna { fill: none; stroke: var(--chart-light); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.g-seven { fill: none; stroke: #9a9188; stroke-width: 1.5; stroke-dasharray: 5 5; stroke-linecap: round; }
.g-ulysse { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 3; opacity: .45; }
.g-ulysse-label { fill: var(--ink); font-size: 11px; font-weight: 600; font-family: var(--sans); }
.g-cross { stroke: var(--chart-deep); stroke-width: 1; opacity: .35; }
.g-dot-ring { fill: var(--surface); }
.g-dot { fill: var(--chart-deep); }
.g-hit { fill: transparent; cursor: crosshair; }
.g-tip {
  position: absolute;
  pointer-events: none;
  min-width: 11rem;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px -14px rgb(27 25 22 / .45);
  font-size: .8rem;
  color: var(--muted);
}
.g-tip-head { color: var(--muted); margin-bottom: .25rem; }
.g-tip-row { display: flex; align-items: center; gap: .45rem; color: var(--ink); font-weight: 600; }
.g-tip-row span { color: var(--muted); font-weight: 400; }

.age-table { margin-top: 1rem; font-size: .88rem; }
.age-table summary { cursor: pointer; color: var(--chart-deep); font-weight: 500; }
.age-table table { width: 100%; margin-top: .8rem; border-collapse: collapse; }
.age-table th, .age-table td { padding: .35rem .5rem; border-bottom: 1px solid var(--line); text-align: right; font-weight: 400; }
.age-table th[scope="row"], .age-table thead th:first-child { text-align: left; }
.age-table thead th { color: var(--muted); font-size: .75rem; }
.age-source { margin: 1.1rem 0 0; font-size: .78rem; line-height: 1.6; color: var(--muted); }
.age-source a { color: var(--chart-deep); }

.age-mood {
  max-width: 560px;
  margin: 2.6rem auto 0;
  padding: 0 1rem;
  text-align: center;
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--ink);
}
.age-mood::before { content: "🐾"; display: block; font-style: normal; font-size: 1.1rem; margin-bottom: .9rem; opacity: .8; }
.age-mood p { margin: 0 0 .8rem; }
.age-mood p:last-child { margin-bottom: 0; color: var(--accent); }

/* ---------- En souvenir de Rocket ---------- */
.rocket { border-top: 1px solid var(--line); padding: 3.5rem 0 4rem; scroll-margin-top: 1rem; }
.rocket .section-head .kicker { margin: 0; }
.rocket-text { max-width: 560px; margin: 0 auto 2rem; text-align: center; color: var(--muted); }
.rocket-text p { margin: 0 0 .7rem; }
.rocket-text p:last-child { margin-bottom: 0; color: var(--ink); }
.rocket-gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .9rem;
}
.rocket-gallery li { width: 168px; }
.rocket-photo { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 12px; }
.rocket-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 12px;
  background: var(--line);
  box-shadow: var(--shadow);
  transition: transform .3s ease;
}
.rocket-photo:hover img { transform: translateY(-2px); }

/* ---------- Ordres appris ---------- */
.orders-page { padding: 1rem 0 4rem; }
.orders-page .section-head { margin-bottom: 2.2rem; }
.orders {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 680px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.orders li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  padding: .85rem 1.2rem;
  background: var(--surface);
}
.orders li + li { border-top: 1px solid var(--line); }
.order { font-family: var(--serif); font-size: 1.12rem; white-space: nowrap; }
.note { color: var(--muted); font-size: .92rem; text-align: right; }
/* ---------- Pied de page ---------- */
.foot {
  border-top: 1px solid var(--line);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
  text-align: center;
  font-size: .85rem;
  color: var(--muted);
}

.foot p { margin: 0; }
.foot .legal { margin-top: .9rem; font-size: .75rem; line-height: 1.7; opacity: .8; }

/* ---------- Visionneuse ---------- */
.lightbox {
  padding: 0;
  border: 0;
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  background: transparent;
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgb(10 9 8 / .96); }
.lb-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.lb-fig img { max-width: min(86vw, 1400px); max-height: 82vh; border-radius: 8px; }
.lb-cap {
  max-width: 86vw;
  color: rgb(255 255 255 / .8);
  font-size: .85rem;
  text-align: center;
  line-height: 1.4;
}
.lb-btn {
  position: fixed;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / .12);
  color: #fff;
  line-height: 1;
  transition: background .2s;
}
.lb-btn:hover { background: rgb(255 255 255 / .24); }
.lb-btn[hidden] { display: none; }
.lb-close { top: max(1rem, env(safe-area-inset-top)); right: max(1rem, env(safe-area-inset-right)); width: 2.6rem; height: 2.6rem; font-size: 1.6rem; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); width: 3rem; height: 3rem; font-size: 2rem; padding-bottom: .2rem; }
.lb-prev { left: max(1rem, env(safe-area-inset-left)); }
.lb-next { right: max(1rem, env(safe-area-inset-right)); }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .top { padding: 1rem 1rem .5rem; flex-direction: column; gap: .55rem; }
  .brand { font-size: 1.2rem; }
  .top-nav { gap: 1.2rem; flex-wrap: wrap; justify-content: center; }
  .top-nav a { font-size: .88rem; }
  .daily { padding-bottom: 3rem; }
  #photo { max-height: 68vh; }
  .nav-label { display: none; }
  .nav-btn { font-size: 1.3rem; padding: .4rem .8rem; }
  .grid { gap: .8rem; }
  .grid li { width: calc((100% - 1.6rem) / 3); }
  .about { grid-template-columns: 1fr; gap: 2rem; }
  .about-photo { width: 100%; max-width: 420px; margin: 0 auto; }
  .orders li { flex-direction: column; gap: .15rem; }
  .note { text-align: left; }
  .age-card { padding: 1.2rem 1rem 1rem; }
  .rocket-gallery { gap: .7rem; }
  .lb-fig img { max-width: 100vw; max-height: 74vh; border-radius: 0; }
  .lb-prev, .lb-next { top: auto; bottom: max(1rem, env(safe-area-inset-bottom)); transform: none; }
  .lb-cap { padding: 0 4.5rem; max-width: 100vw; }
  .rocket-gallery li { width: calc((100% - 1.4rem) / 3); }
  .stats dt { font-size: .62rem; letter-spacing: .08em; }
  .stats dd { font-size: .98rem; }
  .choice { font-size: .98rem; padding: .8rem .6rem; }
}

/* Animations réduites (réglage de l'appareil) : on garde de simples fondus, sans mouvement */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grid li.reveal { animation-name: fade-in; }
  .grid li.leaving { animation-name: fade-out; }
  .tile:hover .tile-img img, .quiz-badge:hover { transform: none; }
  .quiz-badge-dot { animation: none; }
  #photo, .to-top { transform: none; }
}
