/* Olaf Hund — accueil en diptyque, rendu 3D (Three.js)
   Les décors (feutre, béton, chêne) sont dans les scènes 3D ; ce fichier ne gère que la mise en page. */

:root {
  --page: #2a2b2e;
  --ink-light: #d6d8d9;
  --ink-dim: #9a9fa3;
  --signal: #ff5b1f;
  --gap: 12px;
  --head: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body {
  background: var(--page);
  color: var(--ink-light);
  font: 400 16px/1.5 "Familjen Grotesk", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: 0; padding: 0;
}
/* Les boutons invisibles redeviennent visibles quand on y arrive au clavier */
.sr-only:focus-within {
  position: absolute; left: 16px; bottom: 56px; z-index: 5;
  width: auto; height: auto; clip: auto; overflow: visible; white-space: normal;
  display: flex; flex-wrap: wrap; gap: 6px; list-style: none;
}
.sr-only:focus-within button {
  font: inherit; font-size: 14px; padding: 6px 10px; border-radius: 6px; border: 0;
  background: rgba(20, 22, 25, .85); color: #fff;
}
.sr-only:focus-within #lcd-text { display: none; }

/* En-tête */
.site-head {
  height: var(--head);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 calc(var(--gap) * 2);
}
.wordmark { font-weight: 600; font-size: 21px; letter-spacing: -0.015em; text-decoration: none; }
.site-nav { display: flex; gap: 26px; font-size: 15px; }
.site-nav a { text-decoration: none; color: var(--ink-dim); }
.site-nav a:hover { color: var(--ink-light); }

/* Diptyque */
.diptych {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap);
  height: calc(100vh - var(--head));
  height: calc(100dvh - var(--head));
  min-height: 560px;
  padding: 0 calc(var(--gap) * 2) calc(var(--gap) * 2);
}

.panel {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}
.panel--player { background: #e6e5e1; }   /* mur blanc du lecteur mural */
.panel--pile { background: #b9bbb6; }

.stage { position: absolute; inset: 0; }
.stage canvas {
  display: block; width: 100%; height: 100%;
  touch-action: pan-y;               /* on peut toujours faire défiler la page au doigt */
  opacity: 0; transition: opacity .6s ease;
}
.stage.is-rendered canvas { opacity: 1; }
.stage-wait {
  position: absolute; inset: 0; margin: 0; display: grid; place-items: center;
  font-size: 15px; color: rgba(38, 41, 44, .6);
  pointer-events: none;              /* sinon il intercepte les clics sur la scène 3D */
  transition: opacity .4s ease;
}
.stage.is-rendered .stage-wait { opacity: 0; }

/* Touche photographique : vignettage et grain très léger, au-dessus du rendu 3D */
.stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 75% 70% at 50% 45%, transparent 55%, rgba(0, 0, 0, .32)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%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)' opacity='.5'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  opacity: .55;
}

/* Légendes posées sur l'image, comme un cartel */
.caption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  margin: 0; padding: 40px 24px 18px;
  font-size: 15px; line-height: 1.4;
  pointer-events: none;
}
.panel--player .caption { color: #2a2c2f; background: linear-gradient(transparent, rgba(232, 231, 227, .75)); }
.panel--pile .caption { color: #26292c; background: linear-gradient(transparent, rgba(200, 202, 197, .6)); }

/* Petits écrans : panneaux empilés */
@media (max-width: 760px) {
  :root { --gap: 8px; --head: 56px; }
  .site-head { padding: 0 16px; }
  .site-nav { gap: 14px; font-size: 14px; }
  .site-nav a:nth-child(n+4) { display: none; }
  .diptych { grid-template-columns: 1fr; height: auto; min-height: 0; padding: 0 16px 16px; }
  .panel--player { height: 128vw; }
  .panel--pile { height: 112vw; }
  .caption { padding: 32px 16px 14px; }
}
