/* Parloire teaser — base: tokens, stage, global layers, chrome (loader / controls / HUD) and a shared UI kit.
 * Scenes style themselves in assets/css/scenes/<id>.css with selectors prefixed by .s-<id>.
 * Design units are stage pixels: 1920×1080 landscape, 1080×1920 portrait (html.is-portrait). */

:root {
  /* « Lumière du soir » — warm night. Cold slate is only used in the prologue (bars 0–2), pure black in the breakdown. */
  --bg: #0E0B0A;            /* Nuit */
  --bg-2: #18130F;          /* windows */
  --card: #221B16;          /* cards */
  --surface: rgba(243, 235, 221, 0.045);
  --surface-2: rgba(243, 235, 221, 0.075);
  --surface-solid: #18130F;
  --line: rgba(243, 235, 221, 0.09);
  --line-2: rgba(243, 235, 221, 0.16);
  --ink: #F3EBDD;           /* Ivoire */
  --ink-2: #B6A996;         /* muted */
  --ink-3: #7A6E62;         /* Taupe */
  --slate-bg: #0A0D11;      /* prologue */
  --slate-ink: #9FA9B4;
  --slate-line: rgba(94, 107, 120, 0.2);
  --lamp: #F3D9A8;          /* lamplight */
  --flash: #FFF3E0;
  --grad-1: #F3D9A8; --grad-2: #E3A062; --grad-3: #D9737F; --grad-4: #8F5A93;
  --brand-grad: linear-gradient(100deg, var(--grad-1), var(--grad-2) 35%, var(--grad-3) 68%, var(--grad-4));
  --brand-1: var(--grad-1); --brand-2: var(--grad-3); --brand-3: var(--grad-4);

  /* app accents (also set from brand.js) */
  --mail: #F0C987;   --mail-2: #E3A062;
  --drive: #D98B4E;  --drive-2: #B8642F;
  --photos: #EE8296; --photos-2: #D65A7A;
  --visio: #B48DE0;  --visio-2: #8A63C4;
  --search: #A9C7D6; --search-2: #F3EBDD;

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; /* Iowan ships with macOS/iOS; one face everywhere on Apple so line lengths stay as designed */
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI Variable", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 30px;
  --shadow-win: 0 50px 140px -40px rgba(0, 0, 0, 0.85), 0 20px 50px -24px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(243, 235, 221, 0.06);
  --shadow-pop: 0 24px 60px -18px rgba(0, 0, 0, 0.75);
  --stage-scale: 1;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ global background */
#bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 110%, var(--bg-2), var(--bg) 60%);
  transition: background-color .3s;
  --acc-a: #7c6cff; --acc-b: #ff7a59; --bg-level: 0.8; }
#bg .orb { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%;
  left: calc(50% - 35vmax); top: calc(50% - 35vmax);
  opacity: calc(var(--bg-level) * 0.55); mix-blend-mode: screen; will-change: transform; }
#bg .orb-0 { background: radial-gradient(closest-side, var(--acc-a), transparent 72%); margin: -18vmax 0 0 -26vmax; }
#bg .orb-1 { background: radial-gradient(closest-side, var(--acc-b), transparent 70%); margin: 16vmax 0 0 22vmax; opacity: calc(var(--bg-level) * 0.42); }
#bg .orb-2 { background: radial-gradient(closest-side, var(--acc-a), transparent 66%); width: 46vmax; height: 46vmax; margin: 18vmax 0 0 -30vmax; opacity: calc(var(--bg-level) * 0.25); }
#bg .orb-3 { background: radial-gradient(closest-side, var(--acc-b), transparent 66%); width: 40vmax; height: 40vmax; margin: -22vmax 0 0 30vmax; opacity: calc(var(--bg-level) * 0.22); }
#bg .grain { position: absolute; inset: -50%; opacity: 0.045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
#bg .vignette { position: absolute; inset: 0; background: radial-gradient(130% 100% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.6)); }

/* ------------------------------------------------------------------ stage */
#stage { position: fixed; left: 0; top: 0; z-index: 1; transform-origin: 0 0; pointer-events: none; }
#camera { position: absolute; inset: 0; transform-origin: 50% 50%; }
.scene { position: absolute; inset: 0; }
.interactive, .interactive * { pointer-events: auto; }
#door { position: fixed; inset: 0; z-index: 4; pointer-events: none; opacity: 0; transform-origin: 50% 50%; will-change: transform, opacity;
  background: linear-gradient(90deg, transparent 0%, var(--door-tint, #F3D9A8) 22%, #FFEBD0 40%, #FFF1DC 50%, #FFEBD0 60%, var(--door-tint, #F3D9A8) 78%, transparent 100%); mix-blend-mode: screen; }
#flash { position: fixed; inset: 0; z-index: 5; pointer-events: none; opacity: 0; background: var(--flash-color, #fff); mix-blend-mode: screen; }

/* ------------------------------------------------------------------ loader (« Sound on » → « Cliquez pour découvrir ») */
#loader { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; text-align: center;
  background: radial-gradient(60% 55% at 50% 44%, rgba(243, 217, 168, 0.09), transparent 70%), var(--bg);
  transition: opacity 0.8s ease, transform 0.9s cubic-bezier(0.7, 0, 0.2, 1); }
#loader.is-leaving { opacity: 0; transform: scale(1.05); pointer-events: none; }
#loader[hidden], html.is-still #loader { display: none; }
.ld-inner { display: grid; justify-items: center; gap: 26px; padding: 24px; }
.ld-logo { width: 84px; height: 84px; margin-bottom: 6px; opacity: 0.95; }
.ld-logo svg { width: 100%; height: 100%; display: block; }
.ld-sound { display: inline-flex; align-items: center; gap: 0.42em; margin: 0; color: var(--ink);
  font-family: var(--font-display); font-style: italic; font-size: clamp(38px, 5.2vw, 72px); line-height: 1; letter-spacing: -0.01em; }
.ld-phones { width: 0.62em; height: 0.62em; color: var(--lamp); flex: none; }
.ld-eq { display: inline-flex; align-items: flex-end; gap: 0.07em; height: 0.5em; margin-left: 0.08em; }
.ld-eq i { display: block; width: 0.07em; height: 100%; border-radius: 0.04em; background: var(--lamp); transform-origin: 50% 100%;
  animation: ld-eq 0.952s ease-in-out infinite alternate; }   /* 0.952 s = 2 beats at 126 BPM */
.ld-eq i:nth-child(2) { animation-delay: -0.24s; animation-duration: 0.714s; }
.ld-eq i:nth-child(3) { animation-delay: -0.48s; }
.ld-eq i:nth-child(4) { animation-delay: -0.12s; animation-duration: 0.595s; }
.ld-eq i:nth-child(5) { animation-delay: -0.36s; animation-duration: 0.833s; }
@keyframes ld-eq { 0% { transform: scaleY(0.25); } 100% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .ld-eq i { animation: none; transform: scaleY(0.6); } }
/* progress and « Cliquez pour découvrir » share one slot, so the swap doesn't move anything */
.ld-slot { display: grid; place-items: center; min-height: 64px; margin-top: 8px; }
.ld-slot > * { grid-area: 1 / 1; }
.ld-progress { display: grid; justify-items: center; gap: 18px; transition: opacity 0.3s ease; }
#loader.is-ready { cursor: pointer; }
#loader.is-ready .ld-progress { opacity: 0; }
.ld-go { position: relative; display: inline-flex; align-items: center; gap: 14px; border: 0; border-radius: 999px; padding: 14px 28px 14px 16px;
  cursor: pointer; font: 600 17px/1 var(--font-ui); background: var(--ink); color: var(--bg); box-shadow: 0 10px 40px -10px rgba(243, 217, 168, 0.45);
  opacity: 0; transform: translateY(8px); transition: opacity 0.45s ease 0.15s, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.15s, box-shadow 0.3s ease; }
.ld-go[hidden] { display: none; }
#loader.is-ready .ld-go { opacity: 1; transform: none; }
.ld-go:hover { box-shadow: 0 16px 50px -10px rgba(255, 255, 255, 0.45); }
.ld-go:focus-visible { outline: 3px solid var(--lamp); outline-offset: 4px; }
.ld-go__play { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--lamp); }
.ld-go__play svg { width: 14px; height: 14px; margin-left: 2px; }
.ld-go__ring { position: absolute; inset: -8px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.25); pointer-events: none;
  animation: ld-ring 1.905s ease-out infinite; }   /* one bar at 126 BPM */
@keyframes ld-ring { 0% { transform: scale(0.96); opacity: 0.9; } 100% { transform: scale(1.16); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ld-go__ring { animation: none; opacity: 0; } }
.ld-bar { position: relative; width: min(260px, 60vw); height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.ld-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; display: block; border-radius: 2px; background: var(--brand-grad, var(--lamp)); }
.ld-pct { margin: 0; color: var(--ink-2); font: 500 13px/1 var(--font-mono); letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }

/* « Activer le son »: shown only if the browser refused to start the music with sound (autoplay policy) */
#unmute { position: fixed; left: 50%; top: 22px; z-index: 16; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 20px 11px 16px; border-radius: 999px; border: 1px solid rgba(243, 217, 168, 0.4); cursor: pointer;
  background: rgba(24, 19, 15, 0.72); color: var(--ink); font: 600 15px/1 var(--font-ui);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 10px 40px -12px rgba(243, 217, 168, 0.45); transition: opacity 0.35s ease, transform 0.35s ease; }
#unmute[hidden] { display: none; }
#unmute svg { width: 20px; height: 20px; color: var(--lamp); }
#unmute::after { content: ""; position: absolute; inset: -6px; border-radius: 999px; border: 1px solid rgba(243, 217, 168, 0.35);
  animation: unmute-ring 1.905s ease-out infinite; pointer-events: none; }   /* one bar at 126 BPM */
#unmute:hover { background: rgba(40, 31, 24, 0.85); }
#unmute:focus-visible { outline: 3px solid var(--lamp); outline-offset: 4px; }
#unmute.is-leaving { opacity: 0; transform: translateX(-50%) translateY(-8px); pointer-events: none; }
@keyframes unmute-ring { 0% { transform: scale(0.97); opacity: 0.9; } 100% { transform: scale(1.14); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #unmute::after { animation: none; opacity: 0; } }

/* ------------------------------------------------------------------ transport controls */
#controls { position: fixed; left: 50%; bottom: 18px; z-index: 15; transform: translate(-50%, 12px); width: min(560px, calc(100vw - 28px));
  display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; border-radius: 999px;
  background: rgba(24, 19, 15, 0.66); border: 1px solid var(--line); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  opacity: 0; pointer-events: none; transition: opacity 0.35s ease, transform 0.35s ease; }
html.started:not(.is-still).ui-awake #controls,
html[data-mode="paused"].started #controls,
html[data-mode="ended"] #controls { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
html.started:not(.is-still) #controls:focus-within { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#ctl-track:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; border-radius: 6px; }
.ctl-btn { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: transparent; color: var(--ink); }
.ctl-btn:hover { background: var(--surface-2); }
.ctl-btn:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.ctl-btn svg { width: 18px; height: 18px; }
#ctl-play { background: var(--ink); color: var(--bg); }
#ctl-play .i-pause { display: none; }
#ctl-play.is-playing .i-pause { display: block; }
#ctl-play.is-playing .i-play { display: none; }
#ctl-mute .i-off { display: none; }
html.is-muted #ctl-mute .i-off { display: block; }
html.is-muted #ctl-mute .i-on { display: none; }
#ctl-track { position: relative; flex: 1; height: 26px; cursor: pointer; touch-action: none; }
#ctl-track::before { content: ""; position: absolute; left: 0; right: 0; top: 12px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.14); }
#ctl-fill { position: absolute; left: 0; top: 12px; height: 3px; border-radius: 3px; background: var(--brand-grad); width: 0; }
#ctl-track .tick { position: absolute; top: 9px; width: 1px; height: 9px; background: rgba(255, 255, 255, 0.28); }
#ctl-time { font: 500 12px/1 var(--font-mono); color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 78px; text-align: right; }

/* ------------------------------------------------------------------ debug HUD */
#hud { position: fixed; left: 14px; top: 14px; z-index: 30; padding: 10px 12px 10px 40px; border-radius: 12px; max-width: 520px;
  background: rgba(0, 0, 0, 0.7); border: 1px solid rgba(255, 255, 255, 0.15); font: 12px/1.5 var(--font-mono); color: #d8ffd8; pointer-events: none; white-space: pre-wrap; }
#hud .hud-t { font-size: 18px; color: #fff; }
#hud .hud-beat { position: absolute; left: 12px; top: 14px; width: 18px; height: 18px; border-radius: 4px; background: #333; }
#hud .hud-beat.on { background: #48ff7a; }
#hud .hud-beat.down { background: #ff4f6d; }
#hud .hud-err { color: #ff9a9a; }

/* ================================================================== shared UI kit (ui-*) */
.ui-eyebrow { font: 600 22px/1 var(--font-ui); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-2); }
.ui-display { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.025em; line-height: 0.95; }
.ui-headline { font: 700 120px/0.95 var(--font-ui); letter-spacing: -0.045em; }
.ui-grad-text { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ui-kinetic .w { display: inline-block; white-space: nowrap; }
.ui-kinetic .c { display: inline-block; will-change: transform, opacity; }

/* glass window with a top bar — the base of every invented app screen */
.ui-window { position: absolute; border-radius: var(--r-xl); overflow: hidden; background: linear-gradient(180deg, rgba(34, 27, 22, 0.94), rgba(24, 19, 15, 0.96));
  border: 1px solid var(--line-2); box-shadow: var(--shadow-win); color: var(--ink); font-family: var(--font-ui); }
.ui-window__bar { height: 58px; display: flex; align-items: center; gap: 16px; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); }
.ui-dots { display: flex; gap: 9px; }
.ui-dots i { width: 13px; height: 13px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); display: block; }
.ui-window__title { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.ui-window__title svg { width: 26px; height: 26px; }
.ui-search { flex: 1; max-width: 520px; margin: 0 auto; height: 36px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; padding: 0 14px; color: var(--ink-3); font-size: 15px; }
.ui-search svg { width: 17px; height: 17px; }
.ui-kbd { font: 600 12px/1 var(--font-mono); padding: 4px 7px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--ink-2); background: rgba(255, 255, 255, 0.05); }

.ui-glass { background: rgba(34, 27, 22, 0.66); border: 1px solid var(--line-2); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); box-shadow: var(--shadow-pop); }
.ui-chip { display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px; font: 600 22px/1 var(--font-ui); letter-spacing: -0.01em; white-space: nowrap;
  background: rgba(34, 27, 22, 0.78); border: 1px solid var(--line-2); color: var(--ink); box-shadow: var(--shadow-pop); }
.ui-chip svg { width: 22px; height: 22px; }
.ui-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; font: 700 13px/1 var(--font-ui); background: var(--ink); color: var(--bg); }
.ui-descriptor { font: 600 20px/1 var(--font-ui); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.ui-italic { font-family: var(--font-display); font-style: italic; font-weight: 400; letter-spacing: -0.02em; }
.ui-avatar { display: inline-grid; place-items: center; border-radius: 50%; font-weight: 700; color: #fff; flex: none; letter-spacing: -0.02em; }
.ui-btn { display: inline-flex; align-items: center; gap: 10px; border-radius: 12px; padding: 10px 16px; font-weight: 600; font-size: 15px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); }
.ui-icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; flex: none; }
.ui-app-icon { display: inline-block; flex: none; }
.ui-app-icon svg { width: 100%; height: 100%; display: block; }
.ui-photo { position: relative; overflow: hidden; background: #222; }
.ui-photo svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* logo — « toit-guillemet » mark + split wordmark « parl|oire ». Size with font-size on .pl-logo (word = 1em). */
.pl-logo { display: inline-flex; flex-direction: column; align-items: center; gap: 0.08em; font-size: 120px; line-height: 1; color: var(--ink); white-space: nowrap; }
.pl-logo--row { flex-direction: row; gap: 0.28em; }
.pl-logo__mark { width: 0.95em; height: 0.95em; display: inline-block; flex: none; }
.pl-logo--row .pl-logo__mark { width: 0.9em; height: 0.9em; margin-bottom: 0.08em; }
.pl-logo__mark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.pl-word { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.02em; display: inline-flex; }
.pl-word .parl, .pl-word .oire { display: inline-block; }
.pl-word .oire { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 0.04em; }
.ui-app-icon { filter: drop-shadow(0 6px 22px rgba(243, 217, 168, 0.18)); }
