@font-face {
  font-family: "Geist";
  src: url("/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --bg: #0b0b0d;
  --fg: #f2f1ec;
  --muted: #9a9aa1;
  --faint: #5c5c63;
  --line: rgba(242, 241, 236, 0.1);
  --accent: #c6ff4d;
  --accent-ink: #0b0b0d;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 76px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding-left: clamp(20px, 4vw, 48px);
  padding-right: clamp(20px, 4vw, 48px);
}

/* WebGL stage sits behind everything. */
#stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
  pointer-events: none;
}
.no-webgl #stage { display: none; }

main, .site-footer { position: relative; z-index: 1; }

/* Header: a veil that melts into the page, with no visible lower edge. */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  height: var(--header-h);
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 -36px 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(11, 11, 13, 0.99) 0%, rgba(11, 11, 13, 0.97) 48%, rgba(11, 11, 13, 0.6) 72%, rgba(11, 11, 13, 0.16) 88%, rgba(11, 11, 13, 0) 100%);
  opacity: 0;
  transition: opacity 240ms ease;
  pointer-events: none;
}
.site-header.is-scrolled::before { opacity: 1; }
.header-row {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.brand-mark { width: 22px; height: 22px; color: var(--fg); }
.brand-core { fill: var(--accent); }
.brand-name {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.brand-name span { font-weight: 400; color: var(--muted); }
.menu { display: flex; gap: 32px; margin-left: auto; margin-right: 32px; }
.menu a {
  font-size: 15px;
  color: var(--muted);
  transition: color 160ms ease;
}
.menu a:hover { color: var(--fg); }
.menu-toggle {
  display: none;
  appearance: none;
  border: 0;
  background: none;
  margin: 0 -8px 0 0;
  padding: 0 8px;
  height: 44px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
}
.when-open { display: none; }
.menu-toggle[aria-expanded="true"] .when-open { display: inline; }
.menu-toggle[aria-expanded="true"] .when-closed { display: none; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.lang-toggle {
  display: inline-flex;
  align-items: center;
}
.lang-toggle button {
  appearance: none;
  border: 0;
  background: none;
  margin: 0;
  padding: 0 6px;
  height: 32px;
  min-width: 32px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--faint);
  cursor: pointer;
  border-radius: 6px;
  transition: color 160ms ease;
}
.lang-toggle button + button { position: relative; }
.lang-toggle button + button::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 10px;
  margin-top: -5px;
  background: var(--faint);
  opacity: 0.6;
}
.lang-toggle button:hover { color: var(--muted); }
.lang-toggle button[aria-pressed="true"] { color: var(--fg); cursor: default; }
.lang-toggle button:focus-visible,
.menu a:focus-visible,
.menu-toggle:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

/* Panels: one full screen per scene. */
.panel {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 24px) 0 48px;
}
.panel .wrap { display: flex; }
.panel[data-side="right"] .copy { margin-left: auto; }
.copy { width: 100%; max-width: 520px; }

/* Hero */
.hero .copy { max-width: 640px; }
h1 {
  /* Sized so the longest headline line fits the 640px hero column (EN ~6.8em, FR ~7.3em). */
  font-size: clamp(52px, 6.2vw, 92px);
  line-height: 0.96;
  letter-spacing: -0.05em;
  font-weight: 640;
}
html[lang="fr"] h1 { font-size: clamp(48px, 5.7vw, 84px); }
h1 .hit { color: var(--accent); }
h1 .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.2em;
  margin-bottom: -0.2em;
}
h1 .line > span {
  display: inline-block;
  transform: translateY(105%);
  animation: rise 1100ms var(--ease-out) forwards;
}
h1 .line:nth-child(2) > span { animation-delay: 90ms; }

.lead {
  margin-top: 32px;
  max-width: 44ch;
  font-size: clamp(17px, 1.3vw, 19px);
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
  opacity: 0;
  animation: fade-up 900ms var(--ease-out) 520ms forwards;
}
.actions {
  margin-top: 40px;
  opacity: 0;
  animation: fade-up 900ms var(--ease-out) 640ms forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 22px;
  border-radius: 2px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}
button.btn { appearance: none; border: 0; font-family: inherit; cursor: pointer; }
.btn-quiet { background: none; color: var(--fg); box-shadow: inset 0 0 0 1px rgba(242, 241, 236, 0.28); }
.btn-quiet:hover { background: rgba(242, 241, 236, 0.08); }
.btn svg { width: 16px; height: 16px; transition: transform 200ms var(--ease-out); }
.btn:hover { background: #d4ff73; }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: scale(0.97); }

/* Section copy */
.kicker {
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.copy h2 {
  margin-top: 14px;
  font-size: clamp(34px, 3.6vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 560;
  text-wrap: balance;
}
.copy .body {
  margin-top: 22px;
  max-width: 42ch;
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.6;
  color: var(--muted);
  text-wrap: pretty;
}

.reveal > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
}
.reveal.is-in > * { opacity: 1; transform: none; }
.reveal.is-in > :nth-child(2) { transition-delay: 80ms; }
.reveal.is-in > :nth-child(3) { transition-delay: 160ms; }

/* Closing */
.closing .copy { max-width: 640px; }
.closing h2 {
  font-size: clamp(40px, 5vw, 76px);
  line-height: 0.98;
}
.closing-mail {
  margin-top: 28px;
  font-size: clamp(20px, 2vw, 28px);
  letter-spacing: -0.02em;
  color: var(--accent);
}
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Footer */
.site-footer { padding: 0 0 32px; }
.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--faint);
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--muted); transition: color 160ms ease; }
.footer-links a:hover { color: var(--fg); }

/* Legal page: plain reading layout, no WebGL. One language block shows at a time. */
html[lang="fr"] [data-lang-block="en"],
html:not([lang="fr"]) [data-lang-block="fr"] { display: none; }
.legal { padding: calc(var(--header-h) + clamp(40px, 8vh, 96px)) 0 clamp(64px, 10vh, 120px); }
.legal-body { max-width: 680px; }
.legal .legal-title {
  font-size: clamp(36px, 4.2vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 560;
  text-wrap: balance;
}
.legal-updated { margin-top: 16px; font-size: 14px; color: var(--faint); }
.legal section { margin-top: clamp(48px, 7vh, 72px); scroll-margin-top: calc(var(--header-h) + 24px); }
.legal h2 {
  font-size: clamp(24px, 2.2vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 560;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.legal h3 {
  margin: 32px 0 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--accent);
}
.legal p {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty;
}
.legal a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.legal a:hover { text-decoration-color: var(--accent); }
.legal-facts { margin: 20px 0 0; display: grid; gap: 0; }
.legal-facts > div {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.legal-facts dt { color: var(--faint); }
.legal-facts dd { margin: 0; color: var(--fg); }

@keyframes rise { to { transform: none; } }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* Portrait screens: sculpture on top, copy at the bottom. Matches scene.js (aspect < 0.95). */
@media (max-aspect-ratio: 19/20) {
  .panel {
    align-items: flex-end;
    padding-bottom: clamp(40px, 8vh, 80px);
  }
  .panel[data-side="right"] .copy { margin-left: 0; }
  .copy { position: relative; }
  /* Soft veil behind the copy: full width, and it dissolves above and below the text. */
  .copy::before {
    content: "";
    position: absolute;
    inset: -110px -50vw;
    z-index: -1;
    background: linear-gradient(to bottom, rgba(11, 11, 13, 0) 0, rgba(11, 11, 13, 0.1) 24px, rgba(11, 11, 13, 0.42) 62px, rgba(11, 11, 13, 0.8) 110px, rgba(11, 11, 13, 0.86) 50%, rgba(11, 11, 13, 0.8) calc(100% - 110px), rgba(11, 11, 13, 0.42) calc(100% - 62px), rgba(11, 11, 13, 0.1) calc(100% - 24px), rgba(11, 11, 13, 0) 100%);
    pointer-events: none;
  }
  .reveal > * { transform: translateY(18px); }
}

@media (max-width: 560px) {
  :root { --header-h: 64px; }
  h1 { font-size: min(62px, calc((100vw - 40px) / 6.7)); }
  html[lang="fr"] h1 { font-size: min(58px, calc((100vw - 40px) / 7.4)); }
  .lead { margin-top: 20px; font-size: 16px; }
  .actions { margin-top: 28px; }
  .copy h2 { font-size: 32px; }
  .btn { width: 100%; justify-content: center; }
  .header-actions { gap: 12px; }
  .footer-row { flex-direction: column; gap: 4px; }
  .footer-links { margin-top: 8px; }
  .legal-facts > div { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  h1 .line > span,
  .lead,
  .actions { animation: none; transform: none; opacity: 1; }
  .reveal > * { opacity: 1; transform: none; transition: none; }
  .btn, .btn svg, .closing-mail { transition: none; }
}

/* Landscape: the copy stays in its half, clear of the letters. */
@media (min-aspect-ratio: 19/20) {
  .copy { max-width: min(520px, 44vw); }
  .hero .copy, .closing .copy { max-width: min(640px, 44vw); }
}
/* Phones held sideways. */
@media (min-aspect-ratio: 19/20) and (max-height: 480px) {
  :root { --header-h: 56px; }
  .panel { padding: calc(var(--header-h) + 8px) 0 16px; }
  h1, html[lang="fr"] h1, .closing h2 { font-size: min(44px, 5.4vw); }
  .copy h2 { font-size: min(32px, 4.4vw); }
  .lead { margin-top: 14px; font-size: 15px; line-height: 1.45; }
  .copy .body { margin-top: 12px; font-size: 15px; line-height: 1.45; }
  .actions, .contact-actions, .closing-mail { margin-top: 16px; }
  .btn { height: 44px; padding: 0 16px; }
}

/* Small screens: the menu opens over the whole page. */
@media (max-width: 899px) {
  .menu-toggle { display: block; }
  .brand, .header-actions { position: relative; z-index: 2; }
  .menu {
    position: fixed;
    inset: 0;
    z-index: 1;
    margin: 0;
    padding: calc(var(--header-h) + 32px) clamp(20px, 4vw, 48px) 32px;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    background: var(--bg);
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, visibility 0s linear 200ms;
  }
  .menu a {
    padding: 14px 0;
    font-size: clamp(32px, 9.4vw, 44px);
    line-height: 1.1;
    letter-spacing: -0.04em;
    font-weight: 560;
    color: var(--fg);
  }
  .menu-open .menu { opacity: 1; visibility: visible; transition-delay: 0s; }
  .menu-open, .menu-open body { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .menu, .site-header::before { transition: none; }
}
