/* Fabula — pages générées (portfolio, apps, pages légales).
   Chaque page d'app prend l'identité de l'app qu'elle présente : build.py écrit
   ses couleurs et sa police dans un <style> en tête (--sky, --band, --deep,
   --accent, --display…). Cette feuille ne fait que la mise en page.
   La page Géodyssée, écrite à la main, garde style.css. */

@font-face { font-family: "Bebas Neue"; src: url(/assets/fonts/bebasneue.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Varela Round"; src: url(/assets/fonts/varelaround.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Lilita One"; src: url(/assets/fonts/lilitaone.woff2) format("woff2"); font-display: swap; }

:root {
  /* Valeurs neutres (portfolio) ; une page d'app les redéfinit. */
  --sky: #F4F5F7; --sky-ink: #15181D; --sky-dim: rgba(21,24,29,.72);
  --band: #15181D; --band-ink: #FFFFFF;
  --deep: #15181D; --deep-ink: #FFFFFF;
  --accent: #15181D; --accent-ink: #FFFFFF;
  --page: #FFFFFF; --ink: #15181D; --dim: rgba(21,24,29,.72); --line: rgba(21,24,29,.12);
  --display: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display-tt: none; --display-w: 800; --display-ls: -.02em;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1120px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --sky: #111317; --sky-ink: #EEF0F3; --sky-dim: rgba(238,240,243,.72);
          --page: #0B0D10; --ink: #EEF0F3; --dim: rgba(238,240,243,.70); --line: rgba(238,240,243,.14); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: var(--display-w); text-transform: var(--display-tt); letter-spacing: var(--display-ls); line-height: 1.05; margin: 0 0 .45em; text-wrap: balance; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.2rem; line-height: 1.2; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
.skip { position: absolute; left: -9999px; top: 0; background: var(--page); color: var(--ink); padding: 10px 14px; z-index: 99; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- Haut de page : la couleur « ciel » de l'app ---------- */
.top { background: var(--sky); color: var(--sky-ink); position: relative; }
.bar .wrap { display: flex; align-items: center; gap: 14px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: var(--display-w); text-transform: var(--display-tt); font-size: 1.2rem; text-decoration: none; letter-spacing: var(--display-ls); }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: .92rem; font-weight: 600; }
.bar-end a { text-decoration: none; color: var(--sky-dim); }
.bar-end a:hover { color: var(--sky-ink); }
.lang { border: 1.5px solid currentColor; border-radius: 999px; padding: 3px 11px; font-size: .8rem; letter-spacing: .04em; }
@media (max-width: 520px) { .back { display: none; } }

.hero { padding-block: clamp(20px, 4vw, 44px) 0; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 24px clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 5.6vw, 4.6rem); line-height: .98; max-width: 15ch; }
.hero .lead { font-size: clamp(1.05rem, 1.7vw, 1.24rem); line-height: 1.45; color: var(--sky-dim); max-width: 44ch; font-weight: 500; }
.hero-note { font-size: .92rem; color: var(--sky-dim); margin-top: 14px; max-width: 52ch; }
/* La première capture tient en entier dans la fenêtre à l'ouverture :
   hauteur = écran moins l'en-tête (68 px) et les marges. */
.hero-shot { position: relative; z-index: 2; display: flex; justify-content: center; }
.hero-shot img { height: min(calc(100svh - 68px - 2 * clamp(20px, 4vw, 44px)), 820px); width: auto; max-width: 100%; border-radius: clamp(18px, 2.4vw, 32px); box-shadow: 0 28px 60px rgba(0,0,0,.24); }
.top.has-edge .hero { padding-bottom: 0; }
@media (max-width: 760px) {
  /* Sur téléphone : titre, bouton, puis la capture ; l'accroche passe dessous. */
  .hero { grid-template-columns: 1fr; gap: 16px; }
  .hero-text { display: contents; }
  .hero h1 { order: 1; margin: 0; }
  .hero .store { order: 2; justify-self: start; }
  .hero-shot { order: 3; }
  .hero .lead { order: 4; margin: 8px 0 0; }
  .hero-note { order: 5; margin: 0 0 24px; }
  .hero-shot img { height: min(calc(100svh - 68px - 230px), 600px); min-height: 340px; }
}
.store { display: inline-flex; align-items: center; gap: 10px; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 700; font-size: 1.02rem; padding: 13px 22px 13px 18px; border-radius: 14px; transition: transform .15s ease; }
.store svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.store:hover { transform: translateY(-1px); }
.store.soon { opacity: .7; cursor: default; }
@media (prefers-reduced-motion: reduce) { .store { transition: none; } .store:hover { transform: none; } }

.top.flat { background: linear-gradient(to bottom, var(--sky) calc(100% - clamp(70px, 10vw, 120px)), var(--band) 0); }
@media (max-width: 760px) { .top.flat { background: var(--sky); } }
.edge { display: block; width: 100%; height: clamp(60px, 9vw, 120px); margin-top: calc(-1 * clamp(60px, 9vw, 120px) + 10px); position: relative; z-index: 1; }
@media (max-width: 760px) { .edge { margin-top: 0; } }

/* Motif « crochets » : les coins de l'icône Anecdote autour du titre. */
.brackets h1 { position: relative; padding: .28em .5em; display: inline-block; }
.brackets h1::before, .brackets h1::after { content: ""; position: absolute; width: .5em; height: .42em; border: 3px solid currentColor; }
.brackets h1::before { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.brackets h1::after { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }

/* ---------- Fonctionnalités : la couleur principale de l'app ---------- */
.band { background: var(--band); color: var(--band-ink); padding-block: clamp(40px, 6vw, 64px) clamp(48px, 7vw, 80px); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px 40px; margin-top: 26px; }
.features h3 { margin-bottom: .3em; }
.features p { margin: 0; opacity: .82; font-size: 1rem; line-height: 1.5; }

/* ---------- Texte ---------- */
.story { padding-block: clamp(48px, 7vw, 88px); }
.story section { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px 48px; padding-block: 32px; border-top: 1px solid var(--line); }
.story section:first-child { border-top: 0; padding-top: 0; }
.story h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
.story p { color: var(--dim); max-width: 62ch; }
@media (max-width: 760px) { .story section { grid-template-columns: 1fr; } }

.shots { padding-block: 0 clamp(48px, 7vw, 88px); }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin-top: 20px; }
.strip figure { margin: 0; scroll-snap-align: start; }
.strip img { border-radius: 18px; border: 1px solid var(--line); }
.strip figcaption { font-size: .88rem; color: var(--dim); margin-top: 8px; }

.faq { padding-block: clamp(48px, 7vw, 80px); border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); max-width: 780px; }
.faq summary { cursor: pointer; padding: 18px 0; font-weight: 650; font-size: 1.06rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--dim); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--dim); margin: 0 0 18px; max-width: 66ch; }

/* ---------- Fin de page : la couleur sombre de l'app ---------- */
.end { background: var(--deep); color: var(--deep-ink); padding-block: clamp(48px, 7vw, 80px) 28px; }
.end h2 { max-width: 20ch; }
.end .note { opacity: .75; font-size: .92rem; margin-top: 14px; }
.foot { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; margin-top: clamp(40px, 6vw, 64px); padding-top: 20px; border-top: 1px solid color-mix(in srgb, var(--deep-ink) 20%, transparent); font-size: .88rem; }
.foot ul { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; margin: 0; padding: 0; }
.foot a { opacity: .8; text-decoration: none; }
.foot a:hover { opacity: 1; text-decoration: underline; }
.foot b { font-family: var(--display); margin-right: auto; }

/* ---------- Anecdote du jour ---------- */
.fact { max-width: 720px; }
.fact-meta { font-size: .9rem; color: var(--dim); margin: 0 0 .5em; }
.fact > p:not(.fact-meta):not(.fact-source) { font-size: 1.1rem; }
.fact-source { font-size: .9rem; color: var(--dim); margin-top: 1.4em; }
.fact-list { list-style: none; margin: 18px 0 0; padding: 0; }
.fact-list li { padding: 18px 0; border-top: 1px solid var(--line); }
.fact-list h3 { margin-bottom: .25em; }
.fact-list p:not(.fact-meta) { color: var(--dim); margin: 0; }
.fact-more { margin-top: 18px; font-weight: 650; }
.picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 32px; list-style: none; padding: 0; margin: 18px 0 0; }
.picks li { border-top: 1px solid var(--line); padding: 14px 0; }
.picks a { text-decoration: none; font-weight: 650; }
.picks a:hover { text-decoration: underline; }
.fact-cta { margin: 2.4em 0; padding: 26px 28px; border-radius: 20px; background: var(--band); color: var(--band-ink); }
.fact-cta h2 { font-size: 1.6rem; }
.fact-cta p { opacity: .82; }
.section { padding-block: clamp(40px, 6vw, 72px); }
.section + .section { border-top: 1px solid var(--line); }
.section .lead { color: var(--dim); max-width: 60ch; }

/* ---------- Documents (légal, anecdote seule) ---------- */
.doc { max-width: 760px; padding-block: clamp(36px, 6vw, 64px); }
.doc h1 { font-size: clamp(2rem, 4.4vw, 2.8rem); }
.doc h2 { font-size: 1.4rem; margin-top: 2em; }
.doc h3 { font-size: 1.1rem; margin-top: 1.5em; }
.doc p, .doc li { color: var(--dim); }
.doc ul { padding-left: 20px; }
.doc li { margin-bottom: .5em; }
.doc a:not(.store) { color: var(--ink); }
.doc .picks { padding-left: 0; }
.doc .fact-cta p { color: inherit; }
.fact-cta .store { background: var(--band-ink); color: var(--band); }
.doc .updated { font-size: .9rem; margin-bottom: 2.2em; }
.doc table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .93rem; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc-back { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); font-weight: 650; }
.doc-back a { text-decoration: none; }
.top.slim { padding-bottom: 4px; }

/* ---------- Portfolio ---------- */
.intro { padding-block: clamp(36px, 7vw, 80px) clamp(28px, 4vw, 44px); }
.intro h1 { font-size: clamp(2.3rem, 5.6vw, 4rem); max-width: 17ch; }
.intro .lead { color: var(--sky-dim); max-width: 54ch; font-size: 1.15rem; }
.apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 14px; padding-block: 8px clamp(48px, 7vw, 88px); }
.app { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 16px; align-items: start; padding: 22px; border-radius: 22px; text-decoration: none; background: var(--t-bg); color: var(--t-ink); transition: transform .15s ease; }
.app:hover { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .app { transition: none; } .app:hover { transform: none; } }
.app img { width: 64px; height: 64px; border-radius: 15px; grid-row: span 3; }
.app h2 { font-family: var(--t-font); text-transform: var(--t-tt); font-weight: var(--t-w); letter-spacing: var(--t-ls); font-size: 1.3rem; line-height: 1.15; margin: 0; }
.app p { margin: 0; font-size: .96rem; line-height: 1.45; opacity: .85; }
.app .meta { font-size: .85rem; opacity: .75; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bar { background: var(--sky); color: var(--sky-ink); }
.end-foot { padding-block: 0 28px; }
.end-foot .foot { margin-top: 0; }
footer.end:not(.after-cta) { padding-top: 0; }
