/* BRUMAIRE — Concept Nº 01. Original stylesheet. */

@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/spacegrotesk-var.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibmplexmono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibmplexmono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --ink: #0B0B0C;
  --ink-warm: #14110c;
  --bone: #F2EFE6;
  --bone-dim: rgba(242, 239, 230, 0.62);
  --bone-faint: rgba(242, 239, 230, 0.38);
  --bronze: #A87B4F;
  --bronze-deep: #7d5a36;
  --ember: #E8632B;
  --line: rgba(242, 239, 230, 0.16);
  --display: "Space Grotesk", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 0.9, 0.28, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: linear-gradient(180deg, var(--ink) 0%, var(--ink-warm) 45%, var(--ink) 100%);
  background-attachment: fixed;
  color: var(--bone);
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ---------- fixed 3D stage ---------- */
#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  touch-action: pan-y;
  cursor: grab;
}
#stage.dragging { cursor: grabbing; }

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(11, 11, 12, 0.55) 100%),
    linear-gradient(180deg, rgba(11,11,12,0.35) 0%, transparent 18%, transparent 82%, rgba(11,11,12,0.5) 100%);
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
  pointer-events: none;
  background: linear-gradient(180deg, rgba(11,11,12,0.72), transparent);
}
.nav a { pointer-events: auto; text-decoration: none; }
.wordmark {
  font-weight: 700;
  letter-spacing: 0.34em;
  font-size: 0.95rem;
}
.nav-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--bone-faint);
  text-transform: uppercase;
  transition: opacity 0.4s var(--ease);
}
body.scrolled .nav-tag { opacity: 0; }
.nav nav { margin-left: auto; display: flex; gap: 1.5rem; }
.nav nav a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-dim);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.nav nav a:hover { color: var(--bone); border-color: var(--bronze); }

/* ---------- panels ---------- */
main { position: relative; z-index: 2; }

.panel {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: clamp(5rem, 12vh, 8rem) clamp(1.25rem, 7vw, 6rem) 4rem;
  pointer-events: none;
}
.panel a, .panel button { pointer-events: auto; }

.copy { max-width: 30rem; }
.panel.flip .copy { margin-left: auto; text-align: right; }
.panel.flip .opt-row { justify-content: flex-end; }
.panel.flip .specs li { flex-direction: row-reverse; }

.kicker {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 1.4rem;
}

h1, h2 {
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: clamp(3.2rem, 9vw, 7rem); margin-bottom: 1.4rem; }
h2 { font-size: clamp(2.2rem, 5.4vw, 4.2rem); margin-bottom: 1.25rem; }

.lede { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--bone-dim); }
.copy > p:not(.kicker):not(.lede):not(.reference):not(.fineprint) {
  color: var(--bone-dim);
  margin-bottom: 1rem;
  max-width: 26rem;
}
.panel.flip .copy > p { margin-left: auto; }

.hint {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bone-faint);
}
.drag-icon {
  width: 2.2rem; height: 1.1rem;
  border: 1px solid var(--bone-faint);
  border-radius: 1rem;
  position: relative;
}
.drag-icon::after {
  content: "";
  position: absolute;
  top: 50%; left: 0.45rem;
  width: 0.35rem; height: 0.35rem;
  border-radius: 50%;
  background: var(--bronze);
  transform: translateY(-50%);
  animation: nudge 2.6s var(--ease) infinite;
}
@keyframes nudge {
  0%, 100% { left: 0.45rem; }
  50% { left: 1.35rem; }
}

.scroll-cue {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1.5rem;
  height: 3.2rem;
  pointer-events: auto;
  display: block;
}
.scroll-cue span {
  display: block;
  width: 1px;
  height: 100%;
  margin: 0 auto;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.scroll-cue span::after {
  content: "";
  position: absolute;
  top: -40%; left: 0;
  width: 100%; height: 40%;
  background: var(--bronze);
  animation: cue 2.2s var(--ease) infinite;
}
@keyframes cue {
  to { top: 110%; }
}

/* reveal on scroll */
[data-panel] .copy > * {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
[data-panel].in .copy > *:nth-child(1) { transition-delay: 0.05s; }
[data-panel].in .copy > *:nth-child(2) { transition-delay: 0.14s; }
[data-panel].in .copy > *:nth-child(3) { transition-delay: 0.23s; }
[data-panel].in .copy > *:nth-child(4) { transition-delay: 0.32s; }
[data-panel].in .copy > *:nth-child(5) { transition-delay: 0.41s; }
[data-panel].in .copy > *:nth-child(6) { transition-delay: 0.5s; }
[data-panel].in .copy > *:nth-child(7) { transition-delay: 0.59s; }
[data-panel].in .copy > * { opacity: 1; transform: none; }
.hero.in .copy > * { opacity: 1; transform: none; }

/* ---------- specs ---------- */
.specs { list-style: none; margin-top: 2rem; display: grid; gap: 0.9rem; }
.specs li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--bone-faint);
  text-transform: uppercase;
}
.specs span {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--bronze);
  letter-spacing: 0;
  min-width: 5.5rem;
}

/* ---------- configurator ---------- */
.configurator-copy { max-width: 32rem; }
.options { margin-top: 1.6rem; }
.opt-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-faint);
  margin-bottom: 0.6rem;
}
.opt-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.opt-row button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 1.15rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone-dim);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), background 0.3s var(--ease);
}
.opt-row button:hover { border-color: var(--bronze); color: var(--bone); }
.opt-row button.is-active {
  border-color: var(--bronze);
  color: var(--bronze);
  background: rgba(168, 123, 79, 0.1);
}

.reference {
  margin-top: 1.8rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  color: var(--bone-dim);
}
.reference span { color: var(--ember); }

.fineprint {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: var(--bone-faint);
  max-width: 26rem;
}
.fineprint a { color: var(--bone-dim); text-decoration: underline; text-underline-offset: 3px; }
.fineprint a:hover { color: var(--bronze); }

/* ---------- atelier / cta ---------- */
.cta {
  display: inline-block;
  margin-top: 1.6rem;
  background: var(--bronze);
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 0.9rem 1.8rem;
  border-radius: 999px;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.cta:hover { background: var(--bone); transform: translateY(-2px); }

/* ---------- footer ---------- */
.footer { min-height: 70vh; align-items: flex-end; padding-bottom: 3rem; }
.wordmark-foot {
  margin-top: 2rem;
  font-weight: 700;
  letter-spacing: 0.34em;
  font-size: 0.8rem;
  color: var(--bone-faint);
}

/* ---------- fallback (WebGL unavailable) ---------- */
#fallback {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  padding: 5rem 1.5rem 2rem;
  background: radial-gradient(ellipse 90% 60% at 50% 32%, #241b12 0%, var(--ink) 68%);
}
#fallback[hidden] { display: none; }
.fb-watch { display: flex; justify-content: center; }
.fb-ring {
  width: min(56vw, 300px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 9px solid var(--bronze);
  background: #0c0c0e;
  overflow: hidden;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.6), inset 0 0 0 2px rgba(0, 0, 0, 0.45);
}
#fallback-dial { width: 100%; height: 100%; }
.fb-dial-canvas { width: 100%; height: 100%; display: block; }
#fallback p {
  max-width: 36ch;
  text-align: center;
  color: var(--bone);
  font-size: 0.95rem;
  line-height: 1.6;
  text-wrap: balance;
}
@media (max-width: 759px) {
  #fallback { justify-content: flex-start; }
  .fb-watch { margin-top: 12vh; }
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .nav-tag { display: none; }
  .nav nav { gap: 1rem; }
  .panel {
    align-items: flex-end;
    padding-bottom: 12vh;
  }
  .panel.flip .copy { margin-left: 0; text-align: left; }
  .panel.flip .opt-row { justify-content: flex-start; }
  .panel.flip .specs li { flex-direction: row; }
  .copy { max-width: 100%; }
  .copy > p { text-shadow: 0 1px 12px rgba(11,11,12,0.9); }
  h1, h2 { text-shadow: 0 2px 18px rgba(11,11,12,0.9); }
  .scroll-cue { display: none; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  [data-panel] .copy > * { opacity: 1; transform: none; transition: none; }
  .drag-icon::after, .scroll-cue span::after { animation: none; }
  .cta:hover { transform: none; }
}
