/* ─────────────────────────────────────────
   Reset & Base Styles
   ───────────────────────────────────────── */

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

/* ─────────────────────────────────────────
   CSS Custom Properties
   Color palette, layout constants
   ───────────────────────────────────────── */

:root {
  /* Poster palette */
  --bg-deep: #110d20;
  --bg-mid: #1a1535;
  --sky-top: #0e0a1c;
  --sky-bottom: #1e1840;
  --trunk-far: #2a2250;
  --trunk-mid: #231c42;
  --trunk-near: #1c1635;
  --trunk-front: #120e22;
  --snow-base: #6878a0;
  --snow-light: #8090b5;
  --snow-highlight: #c4a898;
  --snow-warm: #d4b0a0;
  --accent: #cc2828;
  --accent-dark: #7a1a25;
  --frost: #b8c0d8;
  --frost-dim: #9898b8;
  --text-primary: #c0c4d8;
  --text-dim: #8886ab;

  /* Layout constants */
  --letterbox-h: 48px;
  --snow-ground-h: 22vh;
}

/* ─────────────────────────────────────────
   HTML & Body Defaults
   Main page: overflow hidden, horizontal scroll handled by JS
   ───────────────────────────────────────── */

html {
  background: var(--bg-deep);
  overflow: hidden;
  cursor: none;
}

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* ─────────────────────────────────────────
   Loading Screen
   Two halves split apart to reveal content,
   shrinking to match --letterbox-h for seamless transition
   ───────────────────────────────────────── */

#loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
}

.loader-half {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  background: #000;
  transition: height 0.6s steps(12);
}
.loader-top { top: 0; }
.loader-bottom { bottom: 0; }

/* Split state: halves shrink to letterbox bar height */
#loader.split .loader-top { height: var(--letterbox-h); }
#loader.split .loader-bottom { height: var(--letterbox-h); }

#loader.done .loader-rings { opacity: 0; }

.loader-rings {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  z-index: 100000;
  transition: opacity 0.4s steps(6);
}

.loader-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(220, 215, 225, 0.9);
  transform: translate(-50%, -50%);
}

.loader-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(220, 215, 225, 0.85);
  transform: translate(-50%, -50%);
  animation: loader-pulse 1.6s steps(16) infinite;
}

.loader-ring-1 {
  width: 20px;
  height: 20px;
  animation-delay: 0s;
}
.loader-ring-2 {
  width: 20px;
  height: 20px;
  animation-delay: 0.2s;
}
.loader-ring-3 {
  width: 20px;
  height: 20px;
  animation-delay: 0.4s;
}

@keyframes loader-pulse {
  0%   { width: 20px; height: 20px; opacity: 0.85; }
  8%   { width: 26px; height: 26px; opacity: 0.8; }
  20%  { width: 40px; height: 40px; opacity: 0.65; }
  30%  { width: 55px; height: 55px; opacity: 0.5; }
  45%  { width: 70px; height: 70px; opacity: 0.35; }
  55%  { width: 65px; height: 65px; opacity: 0.4; }
  70%  { width: 45px; height: 45px; opacity: 0.55; }
  82%  { width: 30px; height: 30px; opacity: 0.7; }
  92%  { width: 22px; height: 22px; opacity: 0.82; }
  100% { width: 20px; height: 20px; opacity: 0.85; }
}

/* ─────────────────────────────────────────
   Horizontal Scroll Container
   Flex row of 100vw sections, moved by
   transform: translateX() in JS (no native scroll)
   ───────────────────────────────────────── */

#scroll-container {
  position: relative;
  z-index: 14;
  display: flex;
  width: fit-content;
  height: 100vh;
  will-change: transform;
  transition: none;
}

.section {
  position: relative;
  width: 100vw;
  height: 100vh;
  flex-shrink: 0;
  overflow: hidden;
}

/* ─────────────────────────────────────────
   Sky Gradient
   Fixed background behind all forest layers
   ───────────────────────────────────────── */

#sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    180deg,
    var(--sky-top) 0%,
    #14102a 25%,
    var(--sky-bottom) 50%,
    #1a1538 70%,
    #1e1840 100%
  );
}

/* ─────────────────────────────────────────
   Stars
   Positioned by JS, animated with CSS twinkle
   ───────────────────────────────────────── */

#stars {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #d0c8e0;
  border-radius: 50%;
  opacity: 0;
  animation: twinkle var(--dur) ease-in-out infinite;
  animation-delay: var(--delay);
}

@keyframes twinkle {
  0%, 100% { opacity: 0.05; }
  50% { opacity: var(--max-opacity); }
}

/* ─────────────────────────────────────────
   Ambient Glow
   Subtle warm radial behind the forest
   ───────────────────────────────────────── */

#ambient-glow {
  position: fixed;
  top: 20vh;
  left: 30vw;
  width: 40vw;
  height: 40vh;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(140, 50, 40, 0.08) 0%,
    rgba(100, 40, 35, 0.04) 40%,
    transparent 70%
  );
  z-index: 2;
  pointer-events: none;
}

/* ─────────────────────────────────────────
   Parallax Trunk Layers (Forest SVGs)
   4 fixed layers at increasing z-index and opacity.
   Parallax rates (set in JS): far 0.08, mid 0.2, near 0.4, front 0.65
   ───────────────────────────────────────── */

.forest-layer {
  position: fixed;
  bottom: 0;
  left: 0;
  pointer-events: none;
  will-change: transform;
}

#trunks-far {
  z-index: 3;
  opacity: 0.5;
}

#trunks-mid {
  z-index: 4;
  opacity: 0.7;
}

#trunks-near {
  z-index: 5;
  opacity: 0.85;
}

#trunks-front {
  z-index: 10;
  opacity: 1;
}

/* ─────────────────────────────────────────
   Snow Ground Layers
   3 fixed SVG layers synced to trunk parallax rates.
   Sit between trunk layers in z-order.
   ───────────────────────────────────────── */

#snow-ground-far {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 6;
  pointer-events: none;
  will-change: transform;
}

#snow-ground-mid {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 7;
  pointer-events: none;
  will-change: transform;
}

#snow-ground-near {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 9;
  pointer-events: none;
  will-change: transform;
}

/* ─────────────────────────────────────────
   Snow Particles Canvas
   150-flake rAF loop with jitter stop-motion feel
   ───────────────────────────────────────── */

#snow-canvas {
  position: fixed;
  inset: 0;
  z-index: 11;
  pointer-events: none;
}

/* ─────────────────────────────────────────
   Mouse Glow
   Soft radial that follows the cursor
   ───────────────────────────────────────── */

#mouse-glow {
  position: fixed;
  left: 0;
  top: 0;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 190, 210, 0.1) 0%, rgba(180, 170, 195, 0.04) 40%, transparent 70%);
  pointer-events: none;
  z-index: 11;
  will-change: transform;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* ─────────────────────────────────────────
   Custom Cursor
   Concentric rings that collapse on hover.
   Driven by cursor.js on all pages.
   ───────────────────────────────────────── */

#custom-cursor {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cursor-ring {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  border: 1px solid rgba(220, 215, 225, 0.85);
  will-change: transform;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  aspect-ratio: 1;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: rgba(220, 215, 225, 0.9);
  border: none;
}

.cursor-ring-1 { width: 20px; height: 20px; }
.cursor-ring-2 { width: 36px; height: 36px; }
.cursor-ring-3 { width: 52px; height: 52px; }

/* Hover state: all rings collapse to dot size with staggered delay */
#custom-cursor.hovering .cursor-ring-1 {
  width: 6px;
  height: 6px;
  transition-delay: 0s;
}
#custom-cursor.hovering .cursor-ring-2 {
  width: 6px;
  height: 6px;
  transition-delay: 0.06s;
}
#custom-cursor.hovering .cursor-ring-3 {
  width: 6px;
  height: 6px;
  transition-delay: 0.12s;
}

/* Hide native cursor globally */
*, *::before, *::after {
  cursor: none !important;
}

/* ─────────────────────────────────────────
   Vignette Overlay
   Darkens edges for cinematic framing
   ───────────────────────────────────────── */

#vignette {
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 60% 50% at 50% 50%,
      transparent 15%,
      rgba(8, 5, 15, 0.85) 100%
    );
}

/* ─────────────────────────────────────────
   Film Grain & Scratch Texture
   Grain: SVG noise shifted by animation.
   Flicker: canvas-drawn dust/scratches (~2-3% of frames).
   Scratches: vertical noise overlay.
   ───────────────────────────────────────── */

#grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 13;
  pointer-events: none;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  animation: grainShift 0.4s steps(5) infinite;
}

#film-flicker {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}

#scratches {
  position: fixed;
  inset: 0;
  z-index: 13;
  pointer-events: none;
  opacity: 0.025;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.02 0.8' numOctaves='3' seed='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23s)'/%3E%3C/svg%3E");
}

@keyframes grainShift {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, -7%); }
  40% { transform: translate(6%, -3%); }
  60% { transform: translate(-7%, 4%); }
  80% { transform: translate(4%, -6%); }
  100% { transform: translate(0, 0); }
}

/* ─────────────────────────────────────────
   Letterbox Bars
   Fixed top/bottom cinematic bars.
   Top: site name + contact link.
   Bottom: progress dot navigation.
   ───────────────────────────────────────── */

.letterbox {
  position: fixed;
  left: 0;
  right: 0;
  height: var(--letterbox-h);
  background: #000;
  z-index: 30;
  display: flex;
  align-items: center;
  padding: 0 2.5rem;
}

.letterbox-top {
  top: 0;
  justify-content: space-between;
}

.letterbox-bottom {
  bottom: 0;
  justify-content: center;
}

.letterbox-name {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 0.62rem;
  color: var(--frost);
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.letterbox-contact {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 0.62rem;
  color: var(--frost);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
  transition: color 0.3s ease;
}

.letterbox-contact::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.letterbox-contact:hover {
  color: var(--frost);
}

.letterbox-contact:hover::after {
  width: 100%;
}

/* ─────────────────────────────────────────
   Bottom Bar Progress Navigation
   Dot + dash chain; active dot gets accent glow
   ───────────────────────────────────────── */

.progress-bar {
  display: flex;
  align-items: center;
  gap: 0;
}

.progress-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(122, 122, 154, 0.3);
  border: none;
  padding: 0;
  transition: all 0.5s ease;
  flex-shrink: 0;
  position: relative;
}

/* Invisible hit area enlargement */
.progress-dot::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
}

.progress-dot.active {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(204, 40, 40, 0.35);
}

.progress-dot:hover:not(.active) {
  background: rgba(122, 122, 154, 0.6);
}

.progress-dash {
  width: 24px;
  height: 1px;
  background: rgba(122, 122, 154, 0.2);
  flex-shrink: 0;
}

/* ─────────────────────────────────────────
   Section Content Layout
   Shared wrapper for all horizontal-scroll sections.
   Padding accounts for letterbox bars and snow ground.
   ───────────────────────────────────────── */

.section-content {
  position: relative;
  z-index: 15;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 2rem;
  padding-top: 60px;
  padding-bottom: calc(var(--snow-ground-h) + var(--letterbox-h));
  text-align: center;
}

/* ─────────────────────────────────────────
   Typography
   Heading font: Cormorant Garamond
   Body font: Inter
   ───────────────────────────────────────── */

h1, h2, h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  letter-spacing: 0.08em;
}

/* ─────────────────────────────────────────
   Word-by-Word Reveal System
   .stagger-text wraps .word > .word-inner spans
   (created by splitTextIntoWords() in main.js).
   Each word slides up with 0.07s staggered delay.
   ───────────────────────────────────────── */

.stagger-text .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.stagger-text .word-inner {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.stagger-text.visible .word-inner {
  transform: translateY(0);
}

/* ─────────────────────────────────────────
   Section 0: Title / Hero
   Full-viewport intro with animated title lines
   ───────────────────────────────────────── */

.title-section .section-content {
  justify-content: center;
}

.main-title {
  font-size: clamp(3.5rem, 9vw, 8rem);
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 0.92;
  text-shadow: 0 0 60px rgba(204, 40, 40, 0.15);
}

.title-line {
  display: block;
}

.title-small {
  font-size: 0.32em;
  font-weight: 300;
  letter-spacing: 0.55em;
  color: var(--frost-dim);
  margin-bottom: 0.25em;
  text-shadow: none;
  opacity: 0;
}

.title-visible .title-small {
  animation: fadeUp 1.8s ease-out 0.4s forwards;
}

.title-large {
  opacity: 0;
}

.title-visible .title-large {
  animation: fadeUp 1.8s ease-out 0.7s forwards;
}

.subtitle {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(0.62rem, 1vw, 0.8rem);
  color: var(--frost-dim);
  letter-spacing: 0.6em;
  text-transform: lowercase;
  margin-top: 2.5rem;
  opacity: 0;
}

.title-visible .subtitle {
  animation: fadeUp 2s ease-out 1.2s forwards;
}

/* Decorative dashes flanking the subtitle */
.subtitle::before,
.subtitle::after {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--frost-dim);
  vertical-align: middle;
  opacity: 0.3;
}

.subtitle::before { margin-right: 1.2em; }
.subtitle::after { margin-left: 1.2em; }

.scroll-hint {
  position: absolute;
  bottom: calc(var(--snow-ground-h) + var(--letterbox-h) + 4px);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.58rem;
  color: var(--frost-dim);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  text-align: center;
  text-indent: 0.35em;
  opacity: 0;
}

.title-visible .scroll-hint {
  animation: fadeUpCentered 1.5s ease-out 2s forwards, pulse 3s ease-in-out 3.5s infinite;
}

/* Arrow character below hint text */
.scroll-hint::after {
  content: '\2192';
  display: block;
  font-size: 1.1rem;
  margin-top: 10px;
  opacity: 0.4;
  text-indent: 0;
}

/* ─────────────────────────────────────────
   Title / Hero Keyframes
   ───────────────────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUpCentered {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* ─────────────────────────────────────────
   Section 1: About
   Left-aligned text block with label, bio, detail
   ───────────────────────────────────────── */

.about-section .section-content {
  align-items: flex-start;
  text-align: left;
  padding-left: 12vw;
  padding-right: 12vw;
  max-width: 100vw;
}

/* Shared section label (used in About & Contact) */
.section-label {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.58rem;
  color: var(--accent);
  letter-spacing: 0.45em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 1.6s ease-out;
}

/* Animated accent line that grows on reveal */
.section-label::before {
  content: '';
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.5s;
}

.section-label.visible {
  opacity: 0.8;
  transform: translateY(0);
}

.section-label.visible::before {
  width: 32px;
}

.about-text {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(1.6rem, 3.2vw, 2.8rem);
  line-height: 1.5;
  color: var(--frost);
  max-width: 640px;
  opacity: 0;
  transition: opacity 1.6s ease-out 0.3s;
}

.about-text.visible {
  opacity: 0.95;
}

.about-detail {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.9;
  max-width: 460px;
  margin-top: 1.5rem;
  opacity: 0;
  transform: translateY(25px);
  transition: all 1.8s ease-out 0.8s;
}

.about-detail.visible {
  opacity: 0.7;
  transform: translateY(0);
}

/* ─────────────────────────────────────────
   Sections 2-4: Projects
   Side-by-side layout: info block + image
   ───────────────────────────────────────── */

.project-section .section-content {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 4vw;
  padding: 2rem 8vw;
  padding-top: 60px;
  padding-bottom: calc(var(--snow-ground-h) + var(--letterbox-h));
  text-align: left;
}

.project-info {
  max-width: 380px;
  opacity: 0;
  transform: translateY(30px);
  transition: all 1.8s ease-out;
}

.project-info.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-number {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(2.2rem, 3.5vw, 3rem);
  color: var(--accent);
  letter-spacing: -0.02em;
  opacity: 0.2;
  line-height: 1;
}

.project-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  color: var(--frost);
  margin: 0.5rem 0 0;
  line-height: 1.15;
  letter-spacing: 0.02em;
  transition: letter-spacing 0.5s cubic-bezier(0.16, 1, 0.3, 1), color 0.4s ease;
}

.project-title:hover {
  letter-spacing: 0.06em;
  color: var(--accent);
}

.project-rule {
  width: 32px;
  height: 1px;
  background: rgba(204, 40, 40, 0.3);
  margin: 1.2rem 0;
}

.project-desc {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.74rem;
  color: var(--text-dim);
  line-height: 1.85;
  margin-bottom: 1.4rem;
}

.project-tags {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.tag {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.58rem;
  color: var(--frost-dim);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.4rem 0.9rem;
  border: 1px solid rgba(122, 122, 154, 0.15);
  background: transparent;
  transition: all 0.35s ease;
  cursor: default;
}

.tag:hover {
  background: rgba(204, 40, 40, 0.1);
  border-color: rgba(204, 40, 40, 0.25);
  color: var(--frost);
}

/* ─────────────────────────────────────────
   Project Image / Gallery Thumbnail
   ───────────────────────────────────────── */

.project-gallery {
  width: 32vw;
  max-width: 400px;
  opacity: 0;
  transform: translateY(30px);
  transition: all 1.8s ease-out 0.3s;
}

.project-gallery.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-img {
  aspect-ratio: 4/3;
  border: 1px solid rgba(180, 160, 200, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 1px 4px rgba(0, 0, 0, 0.25);
}

.project-img-inner {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, rgba(26, 21, 53, 0.7), rgba(17, 13, 32, 0.85));
}

/* Subtle light-leak sheen on images */
.project-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(180, 160, 200, 0.03) 50%, transparent 60%);
  pointer-events: none;
}

/* ─────────────────────────────────────────
   Section 5: Contact
   Centered heading + link row
   ───────────────────────────────────────── */

.contact-section .section-content {
  justify-content: center;
  align-items: center;
}

.contact-section .section-label {
  justify-content: center;
}

/* Contact label gets a second accent line (::after) in addition to ::before */
.contact-section .section-label::after {
  content: '';
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.7s;
}

.contact-section .section-label.visible::after {
  width: 32px;
}

.contact-heading {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  color: var(--frost);
  letter-spacing: 0.06em;
  line-height: 1.15;
  margin-bottom: 1rem;
  opacity: 0;
  transition: opacity 1.6s ease-out;
}

.contact-heading.visible {
  opacity: 0.95;
}

.contact-links {
  display: flex;
  gap: 2.5rem;
  margin-top: 0.8rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 1.8s ease-out 0.6s;
}

.contact-links.visible {
  opacity: 1;
  transform: translateY(0);
}

.contact-link {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.72rem;
  color: var(--frost-dim);
  text-decoration: none;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 0.6rem 0;
  position: relative;
  transition: color 0.4s ease;
}

/* Underline expands from center on hover */
.contact-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1), left 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-link:hover {
  color: var(--frost);
}

.contact-link:hover::after {
  width: 100%;
  left: 0;
}

.ending-text {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--frost);
  letter-spacing: 0.04em;
  margin-top: 2rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 1.2s ease-out 0.6s;
}

.ending-text.visible {
  opacity: 0.6;
  transform: translateY(0);
}

/* ─────────────────────────────────────────
   Ambient Light Flicker
   Decorative radial glow with breathing animation
   ───────────────────────────────────────── */

.lantern-glow {
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(204, 40, 40, 0.03), transparent 70%);
  pointer-events: none;
  animation: lanternFlicker 4s ease-in-out infinite;
  z-index: 7;
}

@keyframes lanternFlicker {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  30% { opacity: 1; transform: scale(1.05); }
  60% { opacity: 0.6; transform: scale(0.98); }
}

/* ─────────────────────────────────────────
   Section 6: Gallery Path Entry
   Clickable area at end of horizontal scroll
   leading to gallery.html. Includes SVG path
   art and a glowing hover effect.
   ───────────────────────────────────────── */

.path-section .section-content {
  justify-content: flex-end;
  align-items: center;
  padding-bottom: var(--letterbox-h);
}

#path-glow {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 70vh;
  border-radius: 140px 140px 0 0;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(180, 80, 80, 0.08) 0%, rgba(160, 60, 70, 0.03) 50%, transparent 80%),
    linear-gradient(to top, rgba(180, 80, 80, 0.06) 0%, rgba(160, 60, 70, 0.03) 40%, transparent 75%);
  filter: blur(18px);
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: background 0.6s ease, opacity 0.8s ease;
  will-change: transform;
}

#path-glow.visible {
  opacity: 1;
}

/* Intensified glow on hover */
#path-glow.glowing {
  background:
    radial-gradient(ellipse at 50% 35%, rgba(204, 40, 40, 0.3) 0%, rgba(180, 50, 60, 0.12) 50%, transparent 80%),
    linear-gradient(to top, rgba(204, 40, 40, 0.2) 0%, rgba(180, 50, 60, 0.08) 40%, transparent 75%);
}

.forest-path {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  max-width: 900px;
  height: calc(50vh);
  opacity: 0;
  transition: opacity 1.5s ease-out;
  z-index: 2;
  text-decoration: none;
  color: inherit;
  display: block;
}

.forest-path.visible {
  opacity: 1;
}

.forest-path-svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: calc(22vh - 48px);
  pointer-events: none;
  overflow: hidden;
  filter: blur(2px);
}

.forest-path:hover .forest-path-svg {
  filter: blur(2px) brightness(1.15);
}

.path-label {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--frost-dim);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  z-index: 2;
  transition: color 0.4s ease;
}

.forest-path:hover .path-label {
  color: var(--frost);
}

.path-arrow {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.4rem;
  color: var(--frost-dim);
  opacity: 0.5;
  z-index: 2;
  animation: path-arrow-bob 2s ease-in-out infinite;
  transition: opacity 0.4s ease, color 0.4s ease;
}

.forest-path:hover .path-arrow {
  opacity: 0.7;
  color: var(--frost);
}

@keyframes path-arrow-bob {
  0%, 100% { transform: translateX(-50%) translateY(0px); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ─────────────────────────────────────────
   Scrollable Inner Pages (Vertical Scroll Mode)
   html.page-scrollable + body.page-scrollable
   switches from horizontal scroll to native
   vertical scroll for project + gallery pages.
   ───────────────────────────────────────── */

html.page-scrollable {
  overflow-x: hidden;
  overflow-y: auto;
}

html.page-scrollable body {
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  min-height: 100vh;
}


/* ─────────────────────────────────────────
   Case Study Pages (cs- prefix)
   Vertical scroll project detail pages.
   Includes navigation, hero image, metadata grid,
   body text, quotes, and image layouts.
   ───────────────────────────────────────── */

.cs-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 80px 4vw 120px;
}

/* Back button navigation */
.cs-nav {
  margin-bottom: 3rem;
}

.cs-back {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.6rem;
  color: var(--frost-dim);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-decoration: none;
  background: none;
  border: 1px solid rgba(122, 122, 154, 0.15);
  padding: 0.5rem 1.2rem;
  transition: all 0.35s ease;
  display: inline-block;
}

.cs-back:hover {
  color: var(--frost);
  border-color: rgba(204, 40, 40, 0.25);
}

.cs-back-bottom {
  margin-top: 3rem;
  align-self: center;
}

/* Hero image wrapper */
.cs-hero-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  margin-bottom: 3rem;
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.5),
    0 2px 6px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
}


.cs-hero-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

/* Header: number + title */
.cs-header {
  margin-bottom: 1.5rem;
}

.cs-number {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: 1rem;
  color: var(--accent);
  opacity: 0.35;
  letter-spacing: 0.1em;
}

.cs-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--frost);
  letter-spacing: 0.04em;
  margin-top: 0.3rem;
}

/* Horizontal separator */
.cs-sep {
  width: 100%;
  height: 1px;
  background: rgba(180, 160, 200, 0.08);
  margin: 2.5rem 0;
}

/* Description and body text */
.cs-desc {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.85;
  max-width: 560px;
}

.cs-role {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.68rem;
  color: var(--frost-dim);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 0.6rem;
}

.cs-role strong {
  color: var(--frost);
  font-weight: 400;
}

/* Metadata grid (timeline, tools, etc.) */
.cs-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 3rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.cs-meta-item {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  line-height: 1.6;
}

.cs-meta-label {
  font-weight: 400;
  color: var(--frost);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.3rem;
}

.cs-meta-value {
  font-weight: 300;
  color: var(--text-dim);
}

/* Section titles within case study */
.cs-section-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  color: var(--frost);
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
}

.cs-body {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.85;
  max-width: 560px;
  margin-bottom: 1.5rem;
}

/* Pull quote with accent border */
.cs-quote {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--frost);
  line-height: 1.7;
  border-left: 2px solid rgba(204, 40, 40, 0.3);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  opacity: 0.8;
}

/* Image layouts: single row and side-by-side pair */
.cs-image-row {
  margin-bottom: 0.75rem;
}

.cs-image-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.cs-img-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.45),
    0 1px 4px rgba(0, 0, 0, 0.25);
}


.cs-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

.cs-img.portrait {
  aspect-ratio: 3/4;
}

.cs-tags {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ─────────────────────────────────────────
   Gallery Page (gallery- prefix)
   Vertical-scroll masonry grid of selected works
   ───────────────────────────────────────── */

.gallery-inner {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 80px 4vw 120px;
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.gallery-heading {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--frost);
  letter-spacing: 0.06em;
}

.gallery-back {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.6rem;
  color: var(--frost-dim);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-decoration: none;
  background: none;
  border: 1px solid rgba(122, 122, 154, 0.15);
  padding: 0.5rem 1.2rem;
  transition: all 0.35s ease;
  display: inline-block;
}

.gallery-back:hover {
  color: var(--frost);
  border-color: rgba(204, 40, 40, 0.25);
}

.gallery-rule {
  width: 100%;
  height: 1px;
  background: rgba(180, 160, 200, 0.08);
  margin-bottom: 2.5rem;
}

/* CSS columns masonry layout */
.gallery-grid {
  columns: 3;
  column-gap: 0.75rem;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, rgba(26, 21, 53, 0.7), rgba(17, 13, 32, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  transition: transform 0.4s ease, border-color 0.4s ease;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.45),
    0 1px 4px rgba(0, 0, 0, 0.25);
}

.gallery-item:hover {
  transform: scale(1.02);
  border-color: rgba(204, 40, 40, 0.2);
}

/* Light-leak sheen overlay */
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(180, 160, 200, 0.03) 50%, transparent 60%);
  pointer-events: none;
}

.gallery-item img {
  width: 100%;
  display: block;
}

/* ─────────────────────────────────────────
   Skip Link & Accessibility
   ───────────────────────────────────────── */

/* Skip link -- visually hidden until focused */
.skip-link {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  background: var(--bg-deep);
  color: var(--frost);
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--accent);
  z-index: 100000;
  transition: transform 0.25s ease;
}

.skip-link:focus {
  transform: translateX(-50%) translateY(8px);
}

/* Focus-visible -- subtle outline for keyboard navigation */
a:focus-visible,
button:focus-visible,
[data-href]:focus-visible,
[tabindex="0"]:focus-visible,
.progress-dot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Remove default focus ring for mouse users */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
[data-href]:focus:not(:focus-visible),
[tabindex="0"]:focus:not(:focus-visible),
.progress-dot:focus:not(:focus-visible) {
  outline: none;
}

/* ─────────────────────────────────────────
   Responsive / Media Queries
   ───────────────────────────────────────── */

@media (max-width: 768px) {
  .project-section .section-content {
    flex-direction: column;
    gap: 2rem;
    padding: 2rem 6vw;
    padding-bottom: calc(var(--snow-ground-h) + var(--letterbox-h) + 12px);
    text-align: center;
  }

  .letterbox {
    padding: 0 1.2rem;
  }

  .project-gallery {
    width: 80vw;
    max-width: none;
  }

  .project-info {
    max-width: 80vw;
    text-align: center;
  }

  .project-rule {
    margin-left: auto;
    margin-right: auto;
  }

  .about-section .section-content {
    padding-left: 8vw;
    padding-right: 8vw;
    align-items: center;
    text-align: center;
  }

  .gallery-grid {
    columns: 2;
  }
}
