/* ============================================================
   03 — GRAIN · room.css
   Cinema texture as atmosphere. The photograph is the subject;
   everything here exists to stay quiet around it.
   ============================================================ */

@font-face {
  font-family: "Fraunces Var";
  src: url("/vendor/fonts/Fraunces-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader Italic Var";
  src: url("/vendor/fonts/Newsreader-Italic-Variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk Var";
  src: url("/vendor/fonts/SpaceGrotesk-Variable.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter Var";
  src: url("/vendor/fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #f2ece2;
  --ink-dim: rgba(242, 236, 226, 0.62);
  --ink-faint: rgba(242, 236, 226, 0.38);
  --void: #0a0908;
  --amber: #e0a25c;
  --amber-dim: rgba(224, 162, 92, 0.55);
  --line: rgba(242, 236, 226, 0.16);
  --scrim-top: rgba(6, 5, 4, 0.55);
  --scrim-bottom: rgba(6, 5, 4, 0.72);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

/* visually-hidden text alternative for the shader-rendered photographs
   (the canvas is aria-hidden and there is no <img>) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--void);
  color: var(--ink);
  min-height: 100%;
}

body {
  font-family: "Inter Var", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Stacking, low to high: canvas (1) < reel background-image (auto/0,
   fallback only) < scrim (2) < text (3) < notes panel (4) < chrome (20).
   The canvas paints the shader-treated photo OVER the plain CSS
   background-image fallback, and UNDER all readable text. */

/* ---------------- fixed WebGL canvas ---------------- */

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
  background: var(--void);
}

body.no-webgl #gl { display: none; }

/* ---------------- chrome ---------------- */

.chrome {
  position: fixed;
  z-index: 20;
  font-family: "Space Grotesk Var", sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  mix-blend-mode: difference;
  opacity: 0.72;
  transition: opacity 0.3s var(--ease);
}

.chrome--index {
  top: clamp(16px, 3vw, 28px);
  left: clamp(16px, 3vw, 28px);
}
.chrome--index:hover { opacity: 1; }

.chrome--label {
  top: clamp(16px, 3vw, 28px);
  right: clamp(16px, 3vw, 28px);
}

/* ---------------- rail nav ---------------- */

.railnav {
  position: fixed;
  right: clamp(14px, 2.6vw, 26px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.railnav__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-faint);
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.4s var(--ease), transform 0.4s var(--ease);
}
.railnav__dot.is-active {
  background: var(--amber);
  transform: scale(1.7);
}

@media (max-width: 640px) {
  .railnav { display: none; }
}

/* ---------------- reel sections ---------------- */

.reel {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  width: 100%;
  overflow: hidden;
  display: flex;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body.no-webgl .reel {
  filter: grayscale(0.12) contrast(1.06) saturate(0.9);
}

.reel__scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    to top,
    var(--scrim-bottom) 0%,
    rgba(6, 5, 4, 0.28) 32%,
    rgba(6, 5, 4, 0) 58%
  );
}

.reel__inner {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: clamp(24px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 620px;
}

/* per-section compositional anchor — deliberately varied so the
   eye doesn't land in the same place three times in a row */
.reel__inner--a { margin-top: auto; align-self: flex-start; }
.reel__inner--b { margin-bottom: auto; align-self: flex-start; padding-top: clamp(72px, 12vh, 140px); }
.reel__inner--c { margin-top: auto; align-self: flex-end; text-align: right; }

.eyebrow {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Space Grotesk Var", sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.reel__inner--c .eyebrow { flex-direction: row-reverse; }

.eyebrow__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--amber-dim);
  color: var(--amber);
  font-size: 10px;
}

.title {
  margin: 0;
  font-family: "Fraunces Var", serif;
  font-weight: 340;
  font-style: normal;
  font-variation-settings: "opsz" 144, "SOFT" 40, "WONK" 0;
  font-size: clamp(3.4rem, 9vw, 7.5rem);
  line-height: 0.92;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.35);
}

.line {
  margin: 2px 0 6px;
  max-width: 34em;
  font-family: "Newsreader Italic Var", serif;
  font-style: italic;
  font-variation-settings: "opsz" 18;
  font-size: clamp(1rem, 1.6vw, 1.22rem);
  line-height: 1.5;
  color: var(--ink-dim);
}
.reel__inner--c .line { margin-left: auto; }

/* ---------------- intensity control ---------------- */

.intensity {
  display: inline-flex;
  align-self: flex-start;
  gap: 2px;
  padding: 3px;
  border-radius: 100px;
  background: rgba(10, 9, 8, 0.38);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.reel__inner--c .intensity { align-self: flex-end; }

.intensity__btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font-family: "Space Grotesk Var", sans-serif;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.intensity__btn:hover { color: var(--ink); }
.intensity__btn.is-active {
  background: var(--ink);
  color: var(--void);
}

/* ---------------- notes ---------------- */

.notes {
  position: relative;
  z-index: 4;
  background: var(--void);
  border-top: 1px solid var(--line);
  padding: clamp(56px, 10vh, 120px) clamp(20px, 5vw, 64px) clamp(64px, 12vh, 140px);
}

.notes__inner { max-width: 980px; margin: 0 auto; }

.notes__kicker {
  margin: 0 0 28px;
  font-family: "Space Grotesk Var", sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber-dim);
}

.notes__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 4vw, 48px);
}

.notes__block h2 {
  margin: 0 0 10px;
  font-family: "Space Grotesk Var", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.notes__block p {
  margin: 0;
  font-family: "Inter Var", sans-serif;
  font-size: 14px;
  line-height: 1.68;
  color: var(--ink-dim);
  font-weight: 350;
}

@media (max-width: 860px) {
  .notes__grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------------- mobile ---------------- */

@media (max-width: 640px) {
  .reel__inner { max-width: 100%; padding: 20px; gap: 12px; }
  .reel__inner--a, .reel__inner--c { align-self: stretch; text-align: left; }
  .reel__inner--c .eyebrow { flex-direction: row; }
  .reel__inner--c .line { margin-left: 0; }
  .reel__inner--c .intensity { align-self: flex-start; }
  .reel__inner--b { padding-top: clamp(64px, 16vh, 100px); }
  .title { font-size: clamp(2.6rem, 15vw, 4.2rem); }
  .line { font-size: 0.98rem; }
}

/* ---------------- reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
  .chrome, .railnav__dot, .intensity__btn { transition: none; }
}
