/* Home page only; palette and typefaces live in base.css. */
html,
body {
  height: 100%;
  overflow: hidden;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.brand {
  position: fixed;
  left: 50%;
  top: 9vh;
  transform: translateX(-50%);
  z-index: 2;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

.brand h1 {
  margin: 0;
  font-size: clamp(40px, 4vw, 64px);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

.brand .tagline {
  margin: 8px 0 0;
  font-size: clamp(17px, 1.4vw, 22px);
  font-weight: 300;
  font-style: italic;
  color: var(--ink-soft);
}

/* Scene-anchored labels: a blurred ghost always visible, a sharp copy faded in by the beam. */
.marks {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.mark {
  --lit: 0;
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  white-space: nowrap;
  color: var(--ink);
}

.mark {
  pointer-events: auto;
  text-decoration: none;
  padding: 10px 16px;
}

.label {
  display: grid;
}

.label > span {
  grid-area: 1 / 1;
}

.ghost {
  filter: blur(3.5px);
  opacity: calc(0.42 - var(--lit) * 0.42);
  will-change: opacity;
}

.sharp {
  opacity: var(--lit);
  will-change: opacity;
}

.mark .label {
  font-size: clamp(22px, 2.1vw, 34px);
  font-weight: 300;
  letter-spacing: 0.01em;
}

/* Labels floating on the sea read light on the dark facets. */
.mark.is-wet {
  color: #f1f2f2;
}

.mark:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}

/* ── Focus: an element's page over the zoomed scene ─────────────────────── */
.brand,
.marks {
  transition: opacity 0.6s ease;
}

body.is-focused .brand,
body.is-focused .marks {
  opacity: 0;
  pointer-events: none;
}

/* A plate of fog on the right; the scene behind it is already soft (macro pass). */
.panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  width: 66.6vw; /* the subject keeps the left third */
  overflow-y: auto;
  box-sizing: border-box;
  padding: 64px clamp(24px, 5vw, 96px) 72px clamp(48px, 7vw, 140px);
  background: linear-gradient(to right, rgba(226, 227, 227, 0), rgba(226, 227, 227, 0.78) 9rem, rgba(226, 227, 227, 0.9));
  opacity: 0;
  transform: translateX(2rem);
  transition: opacity 0.7s ease 0.45s, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.4s;
  /* A left panel scrolls along its inner edge, in the middle of the screen: keep it faint. */
  scrollbar-width: thin;
  scrollbar-color: rgba(47, 51, 56, 0.25) transparent;
}

/* Elements on the right of the scene keep their place: their page opens on the
   left, its column against the scene side, like a mirror of the right panel. */
.panel.is-left {
  right: auto;
  left: 0;
  padding-right: clamp(48px, 7vw, 140px);
  padding-left: max(clamp(24px, 5vw, 96px), calc(66.6vw - 38rem - clamp(48px, 7vw, 140px)));
  background: linear-gradient(to left, rgba(226, 227, 227, 0), rgba(226, 227, 227, 0.78) 9rem, rgba(226, 227, 227, 0.9));
  transform: translateX(-2rem);
}

.panel.is-open,
.panel.is-left.is-open {
  opacity: 1;
  transform: none;
}

.panel .edito {
  max-width: 38rem;
  margin: 0;
  padding: 0;
}

.panel-close {
  margin-bottom: 7vh;
  padding: 0.55em 1.2em;
  border: 1px solid rgba(47, 51, 56, 0.35);
  border-radius: 2px;
  background: none;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.panel-close:hover {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.35);
}

.panel-close:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .panel {
    transition: none;
  }
}
