/* philosophIAI — version locale
   Le ciel suit la hauteur du soleil : de −18° (nuit) à 0° (lever), puis le jour.
   L'encre bascule du clair au sombre quand le ciel s'éclaire (data-ink sur <html>). */

:root {
  --f-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --f-body: "Spectral", Georgia, serif;
  --f-mono: "Azeret Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --sky-top: #04050d;
  --sky-bot: #070919;

  --ink: #e9e7f5;
  --ink-soft: rgba(233, 231, 245, 0.74);
  --rule: rgba(233, 231, 245, 0.22);
  --accent: #f6a35c;

  --gutter: clamp(20px, 5vw, 56px);
  --rail: 0px;
}
:root[data-ink="dark"] {
  --ink: #101633;
  --ink-soft: #3d4567;
  --rule: rgba(16, 22, 51, 0.2);
  --accent: #b03f17;
}
@media (min-width: 1000px) {
  :root { --rail: clamp(244px, 22vw, 290px); }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: #04050d;
  color: var(--ink);
  font-family: var(--f-body);
  font-size: clamp(1.06rem, 0.98rem + 0.3vw, 1.22rem);
  line-height: 1.6;
  transition: color 0.5s ease;
  overflow-x: hidden;
}
p, h1, h2, h3, dl, dd, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 8px; background: #fff; color: #101633; padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- Ciel ---------- */
.sky, #stars, .sun-wrap { position: fixed; inset: 0; pointer-events: none; }
.sky { z-index: -3; background: linear-gradient(to bottom, var(--sky-top) 0%, var(--sky-top) 28%, var(--sky-bot) 100%); }
#stars { z-index: -2; width: 100%; height: 100%; }
.sun-wrap { z-index: -1; overflow: hidden; }
.sun {
  position: absolute; left: 70%; bottom: 0; width: 220px; height: 220px; margin-left: -110px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #fffaf0 0%, #ffe9bd 55%, #ffd08a 100%);
  box-shadow: 0 0 60px 30px rgba(255, 214, 150, 0.55), 0 0 220px 120px rgba(255, 200, 140, 0.35);
  transform: translateY(140%);
  opacity: 0;
}

/* ---------- Typo utilitaire ---------- */
.mono {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 400;
}
.accent { color: var(--accent); }

/* ---------- En-tête ---------- */
.top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px;
  padding: 22px var(--gutter);
}
.top nav { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; }
.top nav a { text-decoration: none; padding: 6px 0; }
.top nav a:hover, .top nav a[aria-current] { color: var(--accent); }
.top .langs { display: flex; gap: 12px; padding-left: 22px; border-left: 1px solid var(--rule); }

.logo { text-decoration: none; white-space: nowrap; display: inline-flex; align-items: baseline; }
.logo .ph { font-family: var(--f-display); font-style: italic; font-weight: 500; font-size: 1.5rem; letter-spacing: -0.01em; }
.logo .iai { font-family: var(--f-mono); font-size: 0.95rem; letter-spacing: 0.12em; margin-left: 2px; }
.logo .iai b { font-weight: 400; color: var(--accent); }

@media (max-width: 640px) {
  .top { padding-top: 16px; }
  .top nav { gap: 2px 16px; }
  .top .langs { padding-left: 0; border-left: 0; }
  .hero { padding-top: 170px; }
  .page { padding-top: 190px; }
}

/* ---------- Jauge de hauteur du soleil ---------- */
.gauge { display: none; }
@media (min-width: 1000px) {
  .gauge {
    display: block; position: fixed; z-index: 4;
    left: var(--gutter); top: 50%; transform: translateY(-50%);
    width: calc(var(--rail) - var(--gutter) - 24px);
    transition: opacity 0.5s ease;
  }
  .gauge[data-off="true"] { opacity: 0; pointer-events: none; }
}
.gauge .read { display: block; margin-bottom: 26px; }
.gauge .read .deg { font-family: var(--f-mono); font-size: 1.5rem; letter-spacing: -0.02em; font-weight: 400; font-variant-numeric: tabular-nums; display: block; }
.gauge .read .phase { display: block; margin-top: 6px; color: var(--ink-soft); }
.gauge .scale {
  position: relative; height: min(46vh, 420px);
  /* 18 graduations d'un degré */
  background:
    repeating-linear-gradient(to bottom, var(--rule) 0, var(--rule) 1px, transparent 1px, transparent calc(100% / 18)) left top / 9px 100% no-repeat;
  border-left: 1px solid var(--rule);
}
.gauge .scale::after { content: ""; position: absolute; left: 0; bottom: 0; width: 9px; height: 1px; background: var(--rule); }
.gauge .stop {
  position: absolute; left: 0; display: flex; align-items: center; gap: 10px;
  transform: translateY(-50%); text-decoration: none; white-space: nowrap; color: var(--ink-soft);
  letter-spacing: 0.09em;
}
.gauge .stop::before { content: ""; width: 18px; height: 1px; background: currentColor; }
.gauge .stop:hover, .gauge .stop[aria-current="true"] { color: var(--ink); }
.gauge .stop[aria-current="true"]::before { background: var(--accent); height: 2px; }
.gauge .dot {
  position: absolute; left: -6px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 14px 3px color-mix(in srgb, var(--accent) 55%, transparent);
  top: 100%; margin-top: -5.5px;
}
.gauge .cap { display: block; margin-top: 22px; color: var(--ink-soft); font-family: var(--f-body); font-style: italic; font-size: 0.82rem; line-height: 1.45; max-width: 21ch; }

/* Lecture compacte (mobile) */
.pill {
  position: fixed; z-index: 4; left: 14px; bottom: 14px;
  display: inline-flex; gap: 8px; align-items: center;
  padding: 8px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--sky-top) 78%, transparent);
  border: 1px solid var(--rule);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-variant-numeric: tabular-nums;
  transition: opacity 0.5s ease;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.pill[data-off="true"] { opacity: 0; }
@media (min-width: 1000px) { .pill { display: none; } }

/* ---------- Colonne de contenu ---------- */
.col {
  padding-left: calc(var(--gutter) + var(--rail));
  padding-right: var(--gutter);
  max-width: calc(var(--rail) + 880px + var(--gutter) * 2);
}
.col.wide { max-width: calc(var(--rail) + 1120px + var(--gutter) * 2); }

/* ---------- Ouverture ---------- */
.hero { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-top: 120px; padding-bottom: 90px; }
.hero h1 { font-weight: 400; line-height: 0.9; margin: 26px 0 0; display: flex; align-items: baseline; flex-wrap: nowrap; }
.hero h1 .ph { font-family: var(--f-display); font-style: italic; font-weight: 400; font-size: clamp(3.1rem, 12.2vw, 9rem); letter-spacing: -0.025em; }
.hero h1 .iai {
  position: relative; display: inline-flex; margin-left: 0.06em;
  font-family: var(--f-mono); font-weight: 400; font-size: clamp(2rem, 7.9vw, 5.8rem); letter-spacing: 0.04em;
}
.hero h1 .iai span { display: inline-block; width: 0.78em; text-align: center; }
.hero h1 .iai .a { color: var(--accent); }
.hero h1 .iai i {
  position: absolute; font-style: normal; font-family: var(--f-mono); font-size: clamp(0.5rem, 1vw, 0.66rem);
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; width: 66.6%;
  height: 0.9em; border: 1px solid var(--rule);
}
.hero h1 .iai i.fr { left: 0; bottom: 100%; margin-bottom: 0.2em; border-bottom: 0; }
.hero h1 .iai i.en { right: 0; top: 100%; margin-top: 0.6em; border-top: 0; }
.hero h1 .iai i em { position: absolute; left: 0; font-style: normal; }
.hero h1 .iai i.fr em { bottom: 100%; padding-bottom: 5px; }
.hero h1 .iai i.en em { top: 100%; padding-top: 5px; }

.thesis {
  font-family: var(--f-display); font-style: italic; font-weight: 400;
  font-size: clamp(1.9rem, 4.3vw, 3.3rem); line-height: 1.1; letter-spacing: -0.01em;
  max-width: 19ch; margin-top: clamp(64px, 11vh, 120px);
}
.hero .lede { max-width: 54ch; margin-top: 26px; color: var(--ink-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 14px 30px; margin-top: 38px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  padding: 13px 20px; border: 1px solid var(--ink); border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}
.btn:hover { background: var(--ink); color: var(--sky-top); }
.link { text-decoration: underline; text-decoration-color: var(--rule); padding: 6px 0; }
.link:hover { color: var(--accent); }

/* ---------- Avant l'aube ---------- */
.before { padding-top: 12vh; padding-bottom: 22vh; }
.before h2, .day h2 {
  font-family: var(--f-display); font-weight: 400; font-style: italic;
  font-size: clamp(1.9rem, 3.8vw, 2.9rem); line-height: 1.1; letter-spacing: -0.01em; margin-top: 14px; max-width: 22ch;
}
.before .intro { max-width: 56ch; margin-top: 22px; color: var(--ink-soft); }
.now { margin-top: 40px; border-top: 1px solid var(--rule); max-width: 720px; }
.now li { padding: 18px 0; border-bottom: 1px solid var(--rule); font-family: var(--f-display); font-size: clamp(1.35rem, 2.3vw, 1.7rem); line-height: 1.25; }
.now li small { display: block; font-family: var(--f-body); font-size: 0.95rem; line-height: 1.5; color: var(--ink-soft); margin-top: 6px; max-width: 58ch; }

/* ---------- Les quatre questions ---------- */
.q { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding-top: 16vh; padding-bottom: 16vh; }
.q .where { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.q .where .mono:first-child { color: var(--accent); }
.q .skynote { font-style: italic; color: var(--ink-soft); font-size: 0.98rem; margin-top: 8px; max-width: 46ch; }
.q h2 { margin-top: clamp(36px, 7vh, 70px); }
.q .question {
  font-family: var(--f-display); font-style: italic; font-weight: 400;
  font-size: clamp(2.5rem, 6.4vw, 5.2rem); line-height: 1.02; letter-spacing: -0.02em;
  margin-top: 14px; max-width: 15ch; text-wrap: balance;
}
.q .body { margin-top: 30px; max-width: 56ch; }
.q .body p + p { margin-top: 0.9em; }

.triad { margin-top: 38px; max-width: 680px; border-top: 1px solid var(--rule); }
.triad > div { display: grid; grid-template-columns: 132px 1fr; gap: 6px 18px; padding: 14px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.triad dt { display: flex; align-items: center; gap: 9px; }
.triad dt::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--ink); }
.triad .known dt::before { background: var(--ink); }
.triad .argued dt::before { background: linear-gradient(to right, var(--ink) 50%, transparent 50%); }
.triad dd { font-size: 0.97rem; line-height: 1.5; color: var(--ink-soft); }
@media (max-width: 560px) { .triad > div { grid-template-columns: 1fr; } }

.q .onward { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 12px 30px; align-items: center; }
.q .bridge { margin-top: 46px; font-style: italic; color: var(--ink-soft); max-width: 46ch; }
.q .bridge a { font-style: normal; white-space: nowrap; }

/* ---------- Le jour ---------- */
.day { padding-top: clamp(90px, 16vh, 170px); padding-bottom: clamp(60px, 10vh, 110px); }
.day .intro { max-width: 58ch; margin-top: 20px; color: var(--ink-soft); }
.who .body { max-width: 58ch; margin-top: 26px; }
.who .body p + p { margin-top: 0.9em; }
.who h2 { font-size: clamp(2.4rem, 5.6vw, 4.4rem); max-width: 16ch; line-height: 1.02; }

.essays { margin-top: 44px; border-top: 1px solid var(--ink); }
.essays li { border-bottom: 1px solid var(--rule); }
.essays a { display: grid; grid-template-columns: 170px 1fr; gap: 6px 28px; padding: 26px 0; text-decoration: none; }
.essays .meta { color: var(--ink-soft); padding-top: 0.75em; display: flex; flex-direction: column; gap: 6px; }
.essays h3 { font-family: var(--f-display); font-weight: 500; font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.1; letter-spacing: -0.01em; }
.essays a:hover h3 { color: var(--accent); }
.essays p { margin-top: 8px; color: var(--ink-soft); max-width: 60ch; }
@media (max-width: 640px) { .essays a { grid-template-columns: 1fr; } .essays .meta { flex-direction: row; gap: 14px; padding-top: 0; } }

.fragment { margin-top: 40px; max-width: 760px; border-left: 2px solid var(--accent); padding-left: clamp(18px, 3vw, 34px); }
.fragment blockquote { margin: 0; font-family: var(--f-display); font-size: clamp(1.5rem, 2.8vw, 2.05rem); line-height: 1.28; }
.vote { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.vote button {
  font: inherit; font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink); background: transparent; border: 1px solid var(--ink); border-radius: 999px; padding: 12px 18px; cursor: pointer;
}
.vote button:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.vote button[aria-pressed="true"] { background: var(--ink); color: #eef3f7; }
.vote-note { margin-top: 16px; min-height: 1.6em; color: var(--ink-soft); font-size: 0.97rem; max-width: 58ch; }

.carnet { margin-top: 44px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 34px 30px; }
@media (max-width: 1180px) { .carnet { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .carnet { grid-template-columns: 1fr; } }
.carnet h3 { font-weight: 400; padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.carnet h3 a { text-decoration: none; }
.carnet li { padding: 13px 0; border-bottom: 1px solid var(--rule); font-size: 1rem; line-height: 1.4; }

.foot { margin-top: clamp(60px, 10vh, 120px); padding-top: 26px; padding-bottom: 90px; }
.foot .inner { border-top: 1px solid var(--rule); padding-top: 26px; display: flex; flex-wrap: wrap; gap: 14px 30px; justify-content: space-between; color: var(--ink-soft); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--accent); }

/* ---------- Page manifeste ---------- */
.page { padding-top: 150px; padding-bottom: 60px; }
.page h1 { font-family: var(--f-display); font-style: italic; font-weight: 400; font-size: clamp(3rem, 8.6vw, 6.6rem); line-height: 0.98; letter-spacing: -0.025em; margin-top: 16px; max-width: 11ch; }
.page .polaris { margin-top: 26px; font-style: italic; color: var(--ink-soft); max-width: 44ch; font-size: 0.98rem; }
.page section { margin-top: clamp(70px, 12vh, 120px); max-width: 62ch; }
.page section h2 { color: var(--accent); margin-bottom: 20px; }
.page section p + p { margin-top: 0.95em; }
.page .big { font-family: var(--f-display); font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.22; }
.rules { border-top: 1px solid var(--rule); margin-top: 6px; }
.rules li { padding: 22px 0; border-bottom: 1px solid var(--rule); }
.rules h3 { font-family: var(--f-display); font-weight: 500; font-style: italic; font-size: clamp(1.5rem, 2.6vw, 1.9rem); line-height: 1.15; }
.rules p { margin-top: 6px; color: var(--ink-soft); }
