/* Courbe Maîtresse · Domaine de Combe-Ardine (démo Décanté)
   Clair-obscur : une pièce presque noire, une seule lumière sur l'étiquette.
   Le texte reprend les couleurs de l'étiquette (crème, or de la dorure, rouge de la capsule). */
:root {
  --night: #100C09;
  --paper: #EDE3CF;
  --paper-2: #F4ECDB;
  --ink: #EDE3CF;
  --ink-2: rgba(237,227,207,.66);
  --line: rgba(237,227,207,.16);
  --red: #C6506A;
  --gold: #C9A35A;
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Archivo', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --gut: clamp(16px, 4vw, 64px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; overflow-x: clip; }
body { background: var(--night); color: var(--ink); font: 400 18px/1.55 var(--serif); -webkit-font-smoothing: antialiased; }
body.is-loading { overflow: hidden; }
a { color: inherit; }
em { font-style: italic; font-weight: 400; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; touch-action: pan-y; cursor: grab; }
body.is-dragging, body.is-dragging #scene { cursor: grabbing; user-select: none; }
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(110% 85% at 62% 48%, transparent 45%, rgba(0,0,0,.55)); }
/* grain de pellicule */
.vignette::after { content: ''; position: absolute; inset: 0; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }   /* grain fixe : animé et en mode de fusion, il coûtait une recomposition de tout l'écran à chaque image */
@keyframes grain { 0% { translate: 0 0; } 20% { translate: -4% 3%; } 40% { translate: 3% -2%; } 60% { translate: -2% -4%; } 80% { translate: 4% 2%; } 100% { translate: 0 0; } }

.eyebrow { font: 500 12px/1.4 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 14px; }
.btn { font: 600 15px/1 var(--sans); letter-spacing: .04em; border: 0; border-radius: 999px; padding: 15px 26px; cursor: pointer;
  background: var(--paper); color: var(--night); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; transition: background .25s, transform .2s; }
.btn:hover { background: var(--gold); }
.btn:active { transform: scale(.97); }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn-line:hover { background: transparent; color: var(--gold); }
.btn-sm { padding: 11px 18px; font-size: 14px; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* ------------------------------------------------------------ accessibilité */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: fixed; top: 12px; left: 12px; z-index: 60; padding: 12px 18px; border-radius: 999px; background: var(--paper); color: var(--night);
  font: 600 15px/1 var(--sans); text-decoration: none; translate: 0 -160%; transition: translate .2s; }
.skip:focus { translate: 0 0; }
#story:focus, #gate:focus, #gate-nope:focus { outline: none; }        /* cibles de focus programmé, pas des commandes */
/* la scène 3D a le focus : un cadre au bord de l'écran (le contour du canvas plein écran tomberait hors champ) */
#scene:focus-visible { outline: none; }
#scene:focus-visible + .vignette { box-shadow: inset 0 0 0 3px var(--red); }
/* commandes de la scène : tourner la bouteille sans la souris, mettre en pause les animations */
.stage-ctl { position: fixed; right: var(--gut); bottom: 22px; z-index: 20; display: flex; gap: 8px; }
.ctl { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; cursor: pointer; color: var(--ink);
  background: rgba(16,12,9,.75); box-shadow: inset 0 0 0 1.5px rgba(237,227,207,.55); transition: color .25s, box-shadow .25s; }
.ctl:hover { color: var(--gold); box-shadow: inset 0 0 0 1.5px currentColor; }
.ctl svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ctl .i-play { display: none; fill: currentColor; stroke: none; }
#pause[aria-pressed="true"] .i-pause { display: none; }
#pause[aria-pressed="true"] .i-play { display: block; }
body.is-paused .scroll-cue::after, body.is-paused .hint svg { animation-play-state: paused; }
.noscript { position: relative; z-index: 2; margin: 0; padding: 96px var(--gut) 0; }

/* ------------------------------------------------------------ porte d'âge */
#gate { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; text-align: center;
  background: radial-gradient(60% 50% at 50% 45%, #2a1f16, var(--night)); transition: opacity .7s, visibility .7s; }
#gate.is-gone { opacity: 0; visibility: hidden; }
.gate-in { max-width: 480px; }
.gate-mark { width: 64px; fill: none; stroke: var(--ink); stroke-width: 1.4; margin-bottom: 18px; }
.gate-mark circle { fill: var(--red); stroke: none; }
.gate-name { color: var(--gold); }
.gate-name { font: italic 400 clamp(52px, 10vw, 84px)/1 var(--serif); margin: 0 0 22px; }
.gate-q { font-size: 20px; margin: 0 0 22px; }
.gate-bar { height: 2px; background: var(--line); margin: 0 auto 24px; max-width: 220px; overflow: hidden; }
.gate-bar i { display: block; height: 100%; width: 5%; background: var(--gold); transition: width .3s; }
#gate.is-ready .gate-bar { opacity: 0; }
.gate-btns { display: flex; gap: 12px; justify-content: center; }
#gate-yes:disabled { opacity: .7; cursor: progress; }
#gate-yes .gate-ok, #gate.is-ready #gate-yes .gate-load { display: none; }
#gate.is-ready #gate-yes .gate-ok { display: inline; }
.gate-nope { font-style: italic; margin-top: 20px; }
.evin { font: 400 12px/1.5 var(--mono); letter-spacing: .04em; color: var(--ink-2); margin-top: 34px; }

/* ------------------------------------------------------------ en-tête et rail */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; gap: 28px; padding: 18px var(--gut); pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 500 22px/1 var(--serif); letter-spacing: .02em; }
/* halo sombre sous les textes posés à nu sur la scène : l'étiquette éclairée passe parfois dessous */
.brand span, .top-link, .hint { text-shadow: 0 0 1px #100C09, 0 0 3px #100C09, 0 0 6px rgba(16,12,9,.95), 0 0 12px rgba(16,12,9,.85), 0 0 20px rgba(16,12,9,.6); }
.brand svg { width: 34px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.brand circle { fill: var(--red); stroke: none; }
.top-link { margin-left: auto; font: 500 14px/1 var(--sans); text-decoration: none; border-bottom: 1px solid var(--line); padding: 6px 8px 4px; border-radius: 3px 3px 0 0; background: rgba(16,12,9,.7); }
.top-link:hover { color: var(--gold); border-color: currentColor; }

.rail { position: fixed; right: var(--gut); top: 50%; translate: 0 -50%; z-index: 20; display: flex; flex-direction: column; gap: 6px; }
.rail a { display: flex; align-items: center; justify-content: flex-start; gap: 12px; text-decoration: none; padding: 6px 0; flex-direction: row-reverse; }
.rail i { width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink), 0 0 0 2px rgba(16,12,9,.6); transition: background .3s, transform .3s; flex: none; }
.rail span { background: rgba(16,12,9,.75); padding: 5px 8px; border-radius: 3px; font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; opacity: 0; translate: 6px 0; transition: opacity .3s, translate .3s; }
.rail a:hover span, .rail a.is-on span, .rail a:focus-visible span { opacity: 1; translate: 0 0; }
.rail a.is-on i { background: var(--gold); box-shadow: 0 0 0 2px rgba(16,12,9,.6); transform: scale(1.25); }

/* ------------------------------------------------------------ chapitres */
#story { position: relative; z-index: 2; pointer-events: none; }
.chap { min-height: 170vh; display: flex; align-items: center; padding: 0 var(--gut); }
.chap-intro { min-height: 100vh; padding-top: 70px; }
.chap-fin { min-height: 120vh; }
.card { position: relative; pointer-events: auto; width: min(440px, 38vw); padding: 34px 34px 30px; background: rgba(16,12,9,.8);
  border: 0; border-left: 1px solid var(--gold); box-shadow: none;
  opacity: 0; translate: 0 30px; transition: opacity .8s, translate .8s cubic-bezier(.2,.7,.2,1); }
.card.is-in, .card:focus-within { opacity: 1; translate: 0 0; }
.num { position: absolute; right: 18px; bottom: -0.16em; z-index: -1; font: italic 300 clamp(150px, 14vw, 210px)/1 var(--serif); color: transparent;
  -webkit-text-stroke: 1px rgba(201,163,90,.3); pointer-events: none; user-select: none; }
.card h2 { font: 400 clamp(32px, 3.2vw, 44px)/1.05 var(--serif); margin: 0 0 16px; letter-spacing: -.01em; }
.card > p { margin: 0 0 18px; color: var(--ink-2); }
.card.intro { background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; width: min(520px, 42vw); }
.intro h1 { font: 400 clamp(64px, 8.4vw, 132px)/.88 var(--serif); margin: 0 0 24px; letter-spacing: -.02em; }
.intro h1 em { color: var(--gold); }
.lead { font-size: 21px; max-width: 30ch; }
.scroll-cue { font: 500 12px/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; margin-top: 36px !important; color: var(--ink) !important; }
.scroll-cue::after { content: ''; display: block; width: 1px; height: 46px; background: var(--gold); margin-top: 14px; animation: cue 2s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

.hint { position: absolute; left: 62%; bottom: 7vh; translate: -50% 0; margin: 0; display: flex; align-items: center; gap: 10px;
  font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; transition: opacity .6s; }
.hint svg { width: 36px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; animation: sway 2.4s ease-in-out infinite; }
.hint.is-done { opacity: 0; }
@keyframes sway { 50% { translate: 6px 0; } }

.dates { list-style: none; margin: 4px 0 0; padding: 0; border-top: 1px solid var(--line); }
.dates li { display: grid; grid-template-columns: 74px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 16px; line-height: 1.4; }
.dates b { font: italic 300 28px/1 var(--serif); color: var(--gold); }
.faits { margin: 4px 0 0; border-top: 1px solid var(--line); }
.faits div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.faits dt { font: 500 11px/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.faits dd { margin: 3px 0 0; font-size: 17px; line-height: 1.4; }
.det summary { display: none; }
.card-link { display: inline-block; margin-top: 18px; font: 600 14px/1.3 var(--sans); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.card-link:hover { color: var(--gold); }

.buy h2 em { color: var(--gold); }
.buy-row { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 18px; }
.price { font: 400 46px/1 var(--serif); }
.qty { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; }
.qty button { width: 40px; height: 40px; border: 0; background: none; font: 400 22px/1 var(--sans); cursor: pointer; color: var(--ink); }
.qty output { min-width: 28px; text-align: center; font: 500 16px/1 var(--mono); }
.buy .btn { width: 100%; justify-content: center; }
.buy-note { font: italic 400 15px/1.4 var(--serif); min-height: 21px; margin: 12px 0 0 !important; }
.more { list-style: none; padding: 0; margin: 14px 0 0; font: 500 14px/1.4 var(--sans); }
.more li { padding: 9px 0; border-top: 1px solid var(--line); }
.more a { text-decoration: none; }
.more a:hover { color: var(--gold); }

.foot { position: relative; z-index: 2; padding: 28px var(--gut) 34px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  font: 400 12px/1.5 var(--mono); color: var(--ink-2); }
.foot { padding-right: calc(var(--gut) + 156px); }      /* place des commandes de la scène, en bas à droite */
.foot p { margin: 0; }
.foot .evin { margin: 0; }

/* ------------------------------------------------------------ téléphone */
@media (max-width: 860px) {
  body { font-size: 16px; }
  .top { padding: 14px 16px; gap: 14px; }
  .top-link { display: none; }
  .top .btn-sm { margin-left: auto; }
  .rail { display: none; }
  .stage-ctl { top: 68px; bottom: auto; right: 12px; gap: 6px; }
  .foot { padding-right: 16px; }
  .chap { min-height: 150svh; align-items: flex-end; padding: 0 12px; }
  .chap .card { margin-bottom: 25svh; }
  .chap-intro { min-height: 100svh; padding-top: 0; }
  .chap-intro .card.intro { margin-bottom: 9svh; width: 100%; }
  .chap-fin .card { margin-bottom: 12svh; }
  .card { width: 100%; padding: 22px 20px 18px; background: rgba(16,12,9,.86); border-left: 0; border-top: 1px solid var(--gold); }
  .num { font-size: 120px; right: 12px; bottom: auto; top: 6px; }
  .card h2 { font-size: 30px; }
  .card > p { font-size: 15.5px; margin-bottom: 12px; }
  .intro h1 { font-size: 64px; margin-bottom: 12px; }
  .lead { font-size: 17px; }
  .scroll-cue { display: none; }
  .chap-intro { flex-direction: column; align-items: stretch; justify-content: flex-end; }
  .hint { position: static; translate: none; margin: 0 0 7svh; font-size: 11px; }
  .chap-intro .card.intro { margin-bottom: 18px; }
  .intro .eyebrow { letter-spacing: .12em; }
  .card { max-height: none; }
  .det summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none;
    font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; padding: 12px 0 4px; border-top: 1px solid var(--line); }
  .det summary::-webkit-details-marker { display: none; }
  .det summary::after { content: '+'; font-size: 18px; color: var(--gold); }
  .det[open] summary::after { content: '−'; }
  .card-link { margin-top: 10px; }
  .dates li { grid-template-columns: 58px 1fr; font-size: 14.5px; padding: 8px 0; }
  .dates b { font-size: 21px; }
  .faits div { padding: 7px 0; }
  .faits dd { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; translate: none; }
  .hint svg, .scroll-cue::after, .vignette::after { animation: none; }
}

/* Les lignes qui montrent un détail de l'étiquette : un petit viseur à droite, et, quand le
   projecteur est dessus (survol à la souris, appui au doigt), la ligne s'éclaire avec lui. */
[data-spot] { position: relative; padding-right: 34px !important; cursor: pointer; transition: background .35s, box-shadow .35s; }
[data-spot]::after { content: ''; position: absolute; right: 6px; top: 50%; width: 15px; height: 15px; translate: 0 -50%; border-radius: 50%;
  border: 1px solid var(--gold); background: radial-gradient(circle, var(--gold) 0 2px, transparent 2.6px); opacity: .5; transition: opacity .3s, scale .3s; }
[data-spot]:hover::after, [data-spot].is-lit::after { opacity: 1; scale: 1.15; }
[data-spot].is-lit { background: linear-gradient(90deg, rgba(201,163,90,.14), rgba(201,163,90,0) 85%); box-shadow: -10px 0 0 rgba(201,163,90,.14), inset 2px 0 0 -0px transparent; }
.dates li[data-spot] { grid-template-columns: 74px 1fr; }
.hint { max-width: min(34ch, 60vw); line-height: 1.5; text-wrap: balance; }
.hint-mouse { display: none; }
@media (hover: hover) and (pointer: fine) { .hint { display: block; text-align: center; max-width: 46ch; } .hint svg { display: block; margin: 0 auto 10px; } .hint-mouse { display: inline; } }
@media (max-width: 859px) { .dates li[data-spot] { grid-template-columns: 58px 1fr; } }
@media (prefers-reduced-motion: reduce) { [data-spot], [data-spot]::after { transition: none; } }
/* l'indice de manipulation se place dans le premier écran (sans cela, il partait en bas de page) */
.chap-intro { position: relative; }
@media (min-width: 860px) { .hint { left: 66%; bottom: 3vh; } }

/* ------------------------------------------------------------ la gamme
   Le sélecteur de cuvée : au milieu de l'en-tête sur ordinateur, sous l'en-tête à gauche sur
   téléphone (pastilles seules). La pastille reprend la couleur de la capsule. */
.gamme { position: fixed; z-index: 21; top: 12px; left: 50%; translate: -50% 0; display: flex; align-items: center; gap: 14px;
  padding: 5px 8px 5px 16px; border-radius: 999px; background: rgba(16,12,9,.72); box-shadow: inset 0 0 0 1px var(--line); }
.gamme-t { margin: 0; font: 500 10.5px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.gamme ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.gamme button { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 9px; align-items: center; text-align: left;
  min-height: 40px; padding: 4px 14px 4px 10px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); cursor: pointer; font: inherit; transition: background .25s, color .25s; }
.gamme button i { grid-row: 1 / 3; width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1.5px rgba(237,227,207,.35); transition: box-shadow .25s, scale .25s; }
.gamme button span { font: 400 15.5px/1.1 var(--serif); white-space: nowrap; }
.gamme button small { font: 500 9.5px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; opacity: .8; }
.gamme button:hover { color: var(--ink); background: rgba(237,227,207,.07); }
.gamme button.is-on { color: var(--ink); background: rgba(237,227,207,.12); }
.gamme button.is-on i { box-shadow: 0 0 0 2px var(--night), 0 0 0 3.5px var(--gold); scale: 1.05; }
.gamme button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
body.is-loading .gamme { visibility: hidden; }
/* le texte s'efface le temps du changement de bouteille (projecteur éteint) */
#story { transition: opacity .35s; }
body.is-swapping #story { opacity: 0; transition-duration: .18s; }
[data-spot].spot-off { padding-right: 0 !important; cursor: auto; }
[data-spot].spot-off::after { display: none; }
@media (max-width: 1239px) { .gamme-t { display: none; } .gamme { padding-left: 8px; } .gamme button small { display: none; } .gamme button { grid-template-rows: auto; } .gamme button i { grid-row: auto; } }
@media (max-width: 1039px) { .gamme { top: 62px; left: var(--gut); translate: none; } }
@media (max-width: 859px) {
  .gamme { top: 66px; left: 10px; padding: 3px; gap: 0; }
  .gamme button { min-width: 40px; padding: 0; justify-content: center; grid-template-columns: auto; }
  .gamme button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .gamme button.is-on { background: none; }
}
@media (prefers-reduced-motion: reduce) { #story, .gamme button, .gamme button i { transition: none; } }
/* les capitales accentuées (Équidistance) ont besoin d'air sous la ligne du dessus */
.intro h1 { padding-top: .14em; }
