:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #f0ede6;
  --ink: #1c1a33;
  --muted: #5f5c78;
  --line: #e4dfd4;
  --accent: #5a48d8;
  --accent-soft: #ece9fd;
  --gold: #a87a22;
  --night: #14122b;
  --night-2: #2b2360;
  --shadow: 0 1px 2px rgba(20, 18, 43, .06), 0 8px 24px -12px rgba(20, 18, 43, .18);
  --radius: 16px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0e1f; --surface: #18172e; --surface-2: #201f3a; --ink: #ecebf6; --muted: #a4a2c0;
    --line: #2b2a48; --accent: #aa9dff; --accent-soft: #2a2552; --gold: #e2bc6a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.6); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0e1f; --surface: #18172e; --surface-2: #201f3a; --ink: #ecebf6; --muted: #a4a2c0;
  --line: #2b2a48; --accent: #aa9dff; --accent-soft: #2a2552; --gold: #e2bc6a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.6); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.65 var(--sans); overflow-x: hidden; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); }
h3 { font-size: 1.12rem; font-family: var(--sans); font-weight: 600; letter-spacing: 0; }
p { margin: 0 0 1em; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- top bar */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 600 1.15rem var(--serif); white-space: nowrap; }
.brand em, .footer-brand em { font-style: italic; color: var(--accent); font-weight: 500; }
.brand-moon { width: 28px; height: 28px; color: var(--gold); }
.mainnav { display: flex; gap: 4px; margin-left: 16px; }
.mainnav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem; padding: 8px 12px; border-radius: 999px; }
.mainnav a:hover { color: var(--ink); background: var(--surface-2); }
.search-btn { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 220px; height: 40px; padding: 0 10px 0 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; font: 500 .92rem var(--sans); cursor: pointer; }
.search-btn:hover { border-color: var(--accent); }
.search-btn svg, .theme-btn svg, .hero-search svg, .palette-field svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; flex: none; }
.search-btn kbd { margin-left: auto; font: 500 .75rem var(--sans); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.theme-btn { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.theme-btn svg { fill: currentColor; stroke: none; }
.is-home .topbar { background: color-mix(in srgb, var(--night) 88%, transparent); border-bottom-color: rgba(255,255,255,.08); }
.is-home .brand, .is-home .mainnav a:hover { color: #fff; }
.is-home .mainnav a { color: #c9c5ea; }
.is-home .mainnav a:hover { background: rgba(255,255,255,.08); }
.is-home .brand em { color: #b9aeff; }
.is-home .search-btn, .is-home .theme-btn { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: #d9d6f3; }
.is-home .search-btn kbd { border-color: rgba(255,255,255,.2); }

@media (max-width: 820px) {
  .mainnav { display: none; }
  .search-btn { min-width: 0; width: 40px; padding: 0; justify-content: center; }
  .search-btn span, .search-btn kbd { display: none; }
  .brand { font-size: 1.02rem; }
}

/* ---------- hero */
.hero { position: relative; z-index: 5; color: #f2f0ff; padding: 72px 0 88px;
  background: radial-gradient(1200px 500px at 80% -10%, #4b3aa8 0%, transparent 60%), radial-gradient(900px 500px at 0% 110%, #3a2170 0%, transparent 60%), linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%); }
.stars { position: absolute; inset: 0; overflow: hidden; opacity: .7; pointer-events: none;
  background-image: radial-gradient(1px 1px at 20px 30px, #fff 50%, transparent 51%), radial-gradient(1px 1px at 120px 80px, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 200px 20px, #fff 50%, transparent 51%), radial-gradient(1px 1px at 260px 140px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 60px 170px, #cfc8ff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 330px 60px, #fff 50%, transparent 51%);
  background-size: 360px 200px; mask-image: linear-gradient(180deg, #000 30%, transparent 95%); }
.hero-in { position: relative; text-align: center; }
.hero h1 { color: #fff; font-size: clamp(2.3rem, 6.5vw, 4rem); margin-bottom: .35em; }
.hero-sub { color: #cfcbef; font-size: 1.12rem; margin-bottom: 28px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .74rem; font-weight: 600; color: var(--gold); margin-bottom: .8em; }
.eyebrow-light { color: #e6c880; }
.hero-quick { margin-top: 18px; color: #bdb8e3; font-size: .92rem; }
.hero-quick a { color: #fff; }

.hero-search { position: relative; display: flex; align-items: center; gap: 10px; max-width: 640px; margin: 0 auto; background: #fff;
  border-radius: 999px; padding: 8px 8px 8px 20px; box-shadow: 0 20px 50px -20px rgba(0,0,0,.6); color: #5f5c78; text-align: left; }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: 0; font: 400 1.08rem var(--sans); color: #1c1a33; background: transparent; height: 44px; }
.hero-search button { border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: 600 1rem var(--sans); padding: 0 22px; height: 46px; cursor: pointer; }
:root[data-theme="dark"] .hero-search button { background: #5a48d8; }
.hero-search-page { margin: 0 0 32px; border: 1px solid var(--line); box-shadow: var(--shadow); }
@media (max-width: 520px) {
  .hero { padding: 48px 0 64px; }
  .hero-search { padding-left: 14px; }
  .hero-search button { padding: 0 14px; }
}

/* ---------- search results */
.results { list-style: none; margin: 0; padding: 6px; }
.results:empty { display: none; }
.results li a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.results li a strong { display: block; font-weight: 600; }
.results li a span { display: block; color: var(--muted); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results li a:hover, .results li a[aria-selected="true"] { background: var(--accent-soft); }
.results-inline { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); z-index: 20; max-height: 60vh; overflow: auto; }
.results .empty { padding: 12px; color: var(--muted); }

.palette[hidden] { display: none; }
.palette { position: fixed; inset: 0; z-index: 80; }
.palette-backdrop { position: absolute; inset: 0; background: rgba(10, 9, 25, .55); backdrop-filter: blur(3px); }
.palette-box { position: relative; max-width: 620px; margin: 10vh auto 0; background: var(--surface); border-radius: 18px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); overflow: hidden; width: calc(100% - 32px); }
.palette-field { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 400 1.1rem var(--sans); color: var(--ink); }
.palette-esc { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 6px; font: 500 .75rem var(--sans); padding: 3px 8px; cursor: pointer; }
.palette .results { max-height: 60vh; overflow: auto; }

/* ---------- sections, grids, cards */
.section { margin: 64px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.link-more { font-weight: 600; text-decoration: none; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.grid-themes { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s, border-color .15s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.card h3 { margin: 0 0 6px; font-family: var(--serif); font-size: 1.2rem; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.theme-card { display: flex; flex-direction: column; gap: 4px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.theme-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.theme-ico { font-size: 1.8rem; line-height: 1; margin-bottom: 8px; }
.theme-name { font-weight: 600; font-size: 1.05rem; }
.theme-card-lg { padding: 24px; }
.theme-card-lg .theme-name { font: 600 1.35rem var(--serif); }

.daily-in { background: linear-gradient(135deg, var(--accent-soft), var(--surface)); border: 1px solid var(--line); border-radius: 24px; padding: clamp(24px, 5vw, 48px); }
.daily h2 a { color: var(--ink); text-decoration: none; }
.daily p { max-width: 60ch; color: var(--muted); font-size: 1.05rem; }
.btn, .btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: 999px; font: 600 .98rem var(--sans); text-decoration: none; cursor: pointer; }
.btn { background: var(--accent); color: #fff; border: 0; }
:root[data-theme="dark"] .btn { color: #14122b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn { color: #14122b; } }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); }

.steps-list { list-style: none; padding: 0; margin: 0 0 16px; }
.steps-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.steps-list p { color: var(--muted); margin: 0; font-size: .95rem; }
.step-n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: 12px; }

.story { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; color: var(--ink); text-decoration: none; }
.story p { font-family: var(--serif); font-size: 1.08rem; line-height: 1.5; }
.story:hover { border-color: var(--accent); }

/* ---------- A–Z */
.az { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 24px; }
.az-l { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }
.az-l:hover { border-color: var(--accent); color: var(--accent); }
.az-l[aria-current] { background: var(--accent); border-color: var(--accent); color: #fff; }
.az-l.is-empty { opacity: .35; }
@media (max-width: 520px) { .az-l { width: 34px; height: 34px; font-size: .9rem; } }

.dict { columns: 3 220px; column-gap: 32px; }
.dict-group { break-inside: avoid; margin-bottom: 24px; }
.dict-group h2 { font-size: 1.6rem; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.dict-group h2 a { color: var(--ink); text-decoration: none; }
.dict-list { list-style: none; padding: 0; margin: 0; }
.dict-list a { color: var(--ink); text-decoration: none; line-height: 1.9; }
.dict-list a:hover { color: var(--accent); text-decoration: underline; }

.filter { margin: 0 0 20px; }
.filter input { width: 100%; max-width: 420px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 0 18px; font: 400 1rem var(--sans); }
[data-hidden] { display: none !important; }

/* ---------- page headers & breadcrumbs */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 24px 0 0; font-size: .86rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; opacity: .6; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.page-head { margin: 28px 0 32px; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }

/* ---------- dream page */
.dream-head { margin: 28px 0 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .88rem; font-weight: 500; text-decoration: none; }
.chip-soft { background: var(--surface-2); color: var(--muted); }
.essential { position: relative; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 12px; padding: 18px 22px; margin: 0 0 32px; box-shadow: var(--shadow); }
.essential p { margin: 0; font: 500 1.15rem/1.5 var(--serif); }
.essential .essential-label { font: 600 .74rem var(--sans); text-transform: uppercase; letter-spacing: .14em; color: var(--gold); margin-bottom: 6px; }
.prose { font-size: 1.1rem; line-height: 1.75; }
.prose p { margin: 0 0 1.1em; }
.prose h2 { margin-top: 1.6em; }
.prose a { font-weight: 500; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.actions { margin: 28px 0; }

.lead { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 40px 0; padding: 24px 28px; border-radius: 20px; color: #f2f0ff; background: linear-gradient(135deg, var(--night), var(--night-2)); }
.lead-title { font: 600 1.3rem var(--serif); margin-bottom: 4px; }
.lead p { margin: 0; color: #cfcbef; }
.lead .btn { background: #e6c880; color: #14122b; }

.testis { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.testi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.testi p { margin: 10px 0 0; font-size: .98rem; overflow-wrap: anywhere; }
.testi-head { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .9rem; flex: none; }
.more { margin-top: 12px; }
.more summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 10px 0; }
.more .testis { margin-top: 8px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 48px 0 64px; }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; }
.pager a:hover { border-color: var(--accent); }
.pager-next { text-align: right; }

.notfound { padding: 48px 16px 24px; }

/* ---------- footer */
.footer { border-top: 1px solid var(--line); background: var(--surface); padding: 48px 0 56px; margin-top: 80px; }
.footer-in { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-in nav { display: flex; flex-direction: column; gap: 6px; }
.footer-in nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.footer-in nav a:hover { color: var(--accent); }
.footer-brand { font: 600 1.2rem var(--serif); }
.footer-h { font-weight: 600; margin-bottom: 4px; }
@media (max-width: 720px) { .footer-in { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- réponses & formulaire « Racontez votre rêve » */
.reply { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); border-left: 3px solid var(--accent); }
.reply p { margin: 0 0 .6em; font-size: .97rem; }
.reply p:last-child { margin-bottom: 0; }
.reply .reply-label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .86rem; color: var(--accent); }
.reply-label svg { width: 16px; height: 16px; fill: var(--gold); }
.tell-in { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(20px, 4vw, 36px); box-shadow: var(--shadow); }
.tell-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-top: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .92rem; }
.field small { font-weight: 400; color: var(--muted); }
.field-full { grid-column: 1 / -1; }
.field input, .field textarea { width: 100%; font: 400 1rem/1.5 var(--sans); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.tell-form .small { margin: 0; }
.tell-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.tell-msg { margin: 0; font-weight: 500; }
.tell-msg.is-ok { color: #1d8a57; }
.tell-msg.is-err { color: #c2413b; }
.tell-done { text-align: center; padding: 12px 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 620px) { .tell-form { grid-template-columns: 1fr; } }
