/* ─────────────────────────────────────────────────────
   RESET & ROOT
───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:   #D90429;
  --black: #111111;
  --white: #FFFFFF;
  --paper: #FFFFFF;
  --gray:  #6D6D6D;
  --rule:  #E3E3DE;
  --rule-strong: #D4D4CE;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans:  'Inter', system-ui, sans-serif;
}

/* scroll-behavior removed — Lenis handles smooth scrolling */

body {
  background: #FFFFFF;
  color: var(--black);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─────────────────────────────────────────────────────
   SCROLL PROGRESS BAR
───────────────────────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 1px;
  width: 0%;
  background: var(--red);
  z-index: 10000;
  pointer-events: none;
  transform-origin: left;
}

/* ─────────────────────────────────────────────────────
   FILM GRAIN OVERLAY
───────────────────────────────────────────────────── */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 400px 400px;
}

/* ─────────────────────────────────────────────────────
   LOADER  —  black split-curtain
───────────────────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

/* Two black panels that split apart on exit */
.ldr-panel {
  position: absolute;
  left: 0;
  right: 0;
  background: var(--black);
  transition: transform 1.05s cubic-bezier(0.76, 0, 0.24, 1);
}

.ldr-top { top: 0; bottom: 50%; }
.ldr-bot { top: 50%; bottom: 0; }

#loader.exit .ldr-top { transform: translateY(-100%); }
#loader.exit .ldr-bot { transform: translateY(100%); }

/* Content centered over panels */
.ldr-inner {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

#loader.exit .ldr-inner { opacity: 0; }

/* ─────────────────────────────────────────────────────
   LOGO DRAW-IN ANIMATION
───────────────────────────────────────────────────── */
.ldr-logo {
  opacity: 1; /* paths animate themselves */
}

.ldr-logo svg { width: 64px; height: auto; }

/* All paths start as outlines only */
.ldr-logo path {
  fill: transparent;
  stroke: #D90429;
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

/* Staggered draw-in per path, then fill */
.ldr-logo path:nth-child(1) {
  animation:
    ldrPathDraw 0.70s cubic-bezier(0.16, 1, 0.3, 1) 0.10s both,
    ldrPathFill 0.25s ease                           0.68s both;
}
.ldr-logo path:nth-child(2) {
  animation:
    ldrPathDraw 0.40s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both,
    ldrPathFill 0.25s ease                           0.48s both;
}
.ldr-logo path:nth-child(3) {
  animation:
    ldrPathDraw 0.40s cubic-bezier(0.16, 1, 0.3, 1) 0.30s both,
    ldrPathFill 0.25s ease                           0.63s both;
}
.ldr-logo path:nth-child(4) {
  animation:
    ldrPathDraw 0.40s cubic-bezier(0.16, 1, 0.3, 1) 0.18s both,
    ldrPathFill 0.25s ease                           0.51s both;
}
.ldr-logo path:nth-child(5) {
  animation:
    ldrPathDraw 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.22s both,
    ldrPathFill 0.25s ease                           0.58s both;
}
.ldr-logo path:nth-child(6) {
  animation:
    ldrPathDraw 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.28s both,
    ldrPathFill 0.25s ease                           0.72s both;
}

@keyframes ldrPathDraw {
  from { stroke-dashoffset: 1; }
  to   { stroke-dashoffset: 0; }
}

@keyframes ldrPathFill {
  from { fill: transparent; }
  to   { fill: #D90429;     }
}

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

.ldr-name {
  font-family: var(--sans);
  font-size: 0.58rem;
  font-weight: 400;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
  opacity: 0;
  animation: ldrUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both;
}

.ldr-bar-wrap {
  width: 64px;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  opacity: 0;
  animation: ldrUp 0.5s ease 0.62s both;
}

.ldr-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--red);
  animation: ldrFill 1.05s cubic-bezier(0.4, 0, 0.2, 1) 0.4s forwards;
}

@keyframes ldrFill { to { width: 100%; } }

/* ─────────────────────────────────────────────────────
   UTILITIES
───────────────────────────────────────────────────── */
.label {
  font-family: var(--sans);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray);
}

/* Clip-reveal: text slides up from inside a hidden wrapper */
.line-wrap {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}

.line-text {
  display: block;
  transform: translateY(105%);
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.line-text.d1 { transition-delay: 0.10s; }
.line-text.d2 { transition-delay: 0.24s; }

/* Generic fade-up reveal */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.r1 { transition-delay: 0.10s; }
.reveal.r2 { transition-delay: 0.22s; }
.reveal.r3 { transition-delay: 0.34s; }
.reveal.r4 { transition-delay: 0.46s; }

.reveal.visible { opacity: 1; transform: translateY(0); }

/* ─────────────────────────────────────────────────────
   REDUCED MOTION
───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  /* Immediately show all reveal elements */
  .reveal,
  .line-text { opacity: 1; transform: none; }

  /* Show blockquote border instantly */
  .about-right blockquote::before { height: 100%; transition: none; }

  /* Show heritage dividers at full size */
  .heritage-divider.reveal { height: 90px; }

  /* Disable scroll progress and grain */
  #scroll-progress,
  .grain { display: none; }
}

/* ─────────────────────────────────────────────────────
   FOCUS VISIBLE
───────────────────────────────────────────────────── */
:focus { outline: none; }

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

/* Pill-shaped buttons get a matching outline */
.btn-submit:focus-visible {
  outline-offset: 4px;
  border-radius: 999px;
}
