/* ═══════════════════════════════════════════════
   RAVENMARCH — REVEAL PAGE
   
   The RM logo tiles as a heraldic motif.
   Mobile-first responsive architecture.
   ═══════════════════════════════════════════════ */

:root {
  --void:         #060709;
  --iron:         #0a0b0e;
  --slate:        #12141a;
  --stone:        #1a1d24;
  --wet-stone:    #252830;
  --ash:          #3a3e4a;
  --silver-faint: #6b7080;
  --silver:       #8e93a2;
  --bone:         #b8bcc8;
  --parchment:    #d4d7e0;

  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body:    'Raleway', 'Helvetica Neue', sans-serif;

  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth:  cubic-bezier(0.45, 0, 0.55, 1);
}

/* ── Reset & containment ───────────────────── */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--void);
  color: var(--bone);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
  min-width: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ═══════════════════════════════════════════════
   PRELOADER
   ═══════════════════════════════════════════════ */

.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background: var(--void);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1s var(--ease-out), visibility 1s;
}

.preloader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-line {
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--silver-faint), transparent);
  animation: pulse 1.8s var(--ease-smooth) infinite;
}

@keyframes pulse {
  0%, 100% { width: 30px; opacity: 0.25; }
  50%      { width: 90px; opacity: 0.55; }
}

/* ═══════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════ */

/* Mobile baseline: image flows at natural 16:9 ratio.
   Desktop upgrades to full-viewport cover.            */

.hero {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.hero-bg {
  position: relative;
  width: 100%;
}

.hero-img {
  display: block;
  width: 100%;
  height: auto;
  transform: scale(1.02);
  transition: transform 7s var(--ease-out);
}

.hero.is-visible .hero-img {
  transform: scale(1.0);
}

.hero-overlay-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 30%;
  background: linear-gradient(180deg, rgba(6,7,9,0.5) 0%, transparent 100%);
  pointer-events: none;
}

.hero-overlay-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(0deg, var(--void) 0%, rgba(6,7,9,0.6) 40%, transparent 100%);
  pointer-events: none;
}

/* Vignette via gradients instead of box-shadow to avoid mobile overflow */
.hero-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(90deg,  var(--void) 0%, transparent 15%, transparent 85%, var(--void) 100%);
  opacity: 0.6;
  pointer-events: none;
}

.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 2;
  text-align: center;
  padding: 0 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-whisper {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.15rem, 4vw, 2rem);
  color: var(--parchment);
  letter-spacing: 0.06em;
  opacity: 0.85;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.6);
}

.hero-rule {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(180,185,200,0.3), transparent);
}

.hero-scroll {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: none;
}

.hero-scroll span {
  display: block;
  width: 1px;
  height: 32px;
  background: linear-gradient(180deg, rgba(140,145,162,0.4), transparent);
  animation: scrollDrip 2.8s var(--ease-smooth) infinite;
}

@keyframes scrollDrip {
  0%   { opacity: 0; transform: scaleY(0); transform-origin: top; }
  35%  { opacity: 0.5; transform: scaleY(1); transform-origin: top; }
  100% { opacity: 0; transform: scaleY(1); transform-origin: bottom; }
}

/* ═══════════════════════════════════════════════
   SIGIL TILE SYSTEM
   
   rm_logo.png repeats as a heraldic tiled motif.
   Always grayscale, always low-opacity.
   ═══════════════════════════════════════════════ */

.sigil-tile {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('rm_logo.png');
  background-repeat: repeat;
  background-size: 80px 80px;
  background-position: center center;
  opacity: 0.04;
  filter: grayscale(100%) brightness(0.8) contrast(1.2);
  pointer-events: none;
}

/* Sigil bands — horizontal strips between sections */

.sigil-band {
  position: relative;
  width: 100%;
  height: 100px;
  overflow: hidden;
  background: var(--void);
}

.sigil-band--tall {
  height: 140px;
}

.sigil-fade {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  z-index: 1;
  pointer-events: none;
}

.sigil-fade--top {
  top: 0;
  background: linear-gradient(180deg, var(--void) 0%, transparent 100%);
}

.sigil-fade--bottom {
  bottom: 0;
  background: linear-gradient(0deg, var(--void) 0%, transparent 100%);
}

/* Fragment section sigil backdrop */

.fragments-sigil {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('rm_logo.png');
  background-repeat: repeat;
  background-size: 110px 110px;
  background-position: center center;
  opacity: 0.03;
  filter: grayscale(100%) brightness(0.7) contrast(1.2);
  pointer-events: none;
}

/* Closing sigil field */

.closing-sigil {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('rm_logo.png');
  background-repeat: repeat;
  background-size: 70px 70px;
  background-position: center center;
  opacity: 0.045;
  filter: grayscale(100%) brightness(0.7) contrast(1.2);
  pointer-events: none;
}

.closing-sigil-fade {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(
      ellipse 80% 70% at 50% 50%,
      transparent 0%,
      var(--void) 65%
    );
  z-index: 1;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════
   REVEAL ANIMATIONS
   ═══════════════════════════════════════════════ */

.reveal-el {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1.4s var(--ease-out), transform 1.4s var(--ease-out);
}

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

.scroll-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}

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

/* ═══════════════════════════════════════════════
   FRAGMENTS
   ═══════════════════════════════════════════════ */

.fragments {
  position: relative;
  width: 100%;
  padding: 3.5rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--void);
  overflow: hidden;
}

.fragments--cinematic {
  padding: 4.5rem 1.25rem;
  background:
    radial-gradient(ellipse at center, rgba(18,20,26,0.45) 0%, var(--void) 60%);
}

.fragments-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  text-align: center;
}

.frag-rule {
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ash), transparent);
}

.frag-line {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.05rem, 4vw, 1.7rem);
  color: var(--silver);
  letter-spacing: 0.04em;
  line-height: 1.8;
}

.frag-line--large {
  font-size: clamp(1.25rem, 5vw, 2.5rem);
  font-weight: 300;
  font-style: italic;
  color: var(--bone);
  letter-spacing: 0.04em;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════
   TEASER VIDEO
   ═══════════════════════════════════════════════ */

.teaser {
  position: relative;
  width: 100%;
  padding: 3rem 0.75rem 3.5rem;
  background: var(--void);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.teaser-label {
  margin-bottom: 1.5rem;
  text-align: center;
}

.teaser-label span {
  font-family: var(--font-body);
  font-weight: 200;
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--silver-faint);
}

.teaser-stage {
  width: 100%;
  max-width: 1000px;
}

.teaser-frame {
  position: relative;
  background: var(--iron);
  padding: 3px;
  border: 1px solid var(--wet-stone);
  transition: border-color 0.5s var(--ease-out);
}

.teaser-frame:hover {
  border-color: var(--ash);
}

/* Corner accents */
.teaser-frame::before,
.teaser-frame::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-style: solid;
  border-color: var(--ash);
  opacity: 0.3;
  pointer-events: none;
  transition: opacity 0.5s;
}

.teaser-frame::before {
  top: -1px; left: -1px;
  border-width: 1px 0 0 1px;
}

.teaser-frame::after {
  bottom: -1px; right: -1px;
  border-width: 0 1px 1px 0;
}

.teaser-frame:hover::before,
.teaser-frame:hover::after {
  opacity: 0.55;
}

.teaser-frame video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #000;
}

.teaser-sub {
  margin-top: 1.25rem;
  text-align: center;
}

.teaser-sub span {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ash);
}

/* ═══════════════════════════════════════════════
   CLOSING
   ═══════════════════════════════════════════════ */

.closing {
  position: relative;
  width: 100%;
  padding: 5rem 1.25rem 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  overflow: hidden;
  background: var(--void);
}

.closing-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.closing-rule {
  width: 44px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ash), transparent);
}

.closing-whisper {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1rem, 3.5vw, 1.4rem);
  color: var(--silver);
  letter-spacing: 0.05em;
  font-style: italic;
}

.closing-cta {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.65rem;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--silver-faint);
  margin-top: 0.5rem;
  opacity: 0.6;
}

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */

.foot {
  width: 100%;
  padding: 2rem 1.25rem;
  text-align: center;
  background: var(--void);
  border-top: 1px solid rgba(58,62,74,0.1);
}

.foot p {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ash);
  opacity: 0.6;
}

/* ═══════════════════════════════════════════════
   GRAIN
   ═══════════════════════════════════════════════ */

.grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9990;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px;
}

/* ═══════════════════════════════════════════════
   DESKTOP ENHANCEMENTS
   (mobile is the baseline — scale UP)
   ═══════════════════════════════════════════════ */

@media (min-width: 768px) {
  /* Hero upgrades to fullscreen cover on desktop */
  .hero {
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }

  .hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  .hero-img {
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    transform: scale(1.04);
  }

  .fragments {
    padding: 8rem 2rem;
  }

  .fragments--cinematic {
    padding: 10rem 2rem;
  }

  .fragments-inner {
    gap: 1.8rem;
  }

  .sigil-band {
    height: 180px;
  }

  .sigil-band--tall {
    height: 240px;
  }

  .teaser {
    padding: 5rem 2rem 6rem;
  }

  .teaser-label {
    margin-bottom: 2.5rem;
  }

  .teaser-frame {
    padding: 4px;
  }

  .teaser-frame::before,
  .teaser-frame::after {
    width: 20px;
    height: 20px;
  }

  .closing {
    padding: 10rem 2rem 8rem;
    min-height: 55vh;
  }

  .hero-content {
    padding: 0 2rem 8vh;
  }

  .hero-vignette {
    background:
      linear-gradient(90deg, var(--void) 0%, transparent 12%, transparent 88%, var(--void) 100%);
  }

  .hero-scroll {
    display: block;
  }
}

@media (min-width: 1200px) {
  .sigil-tile {
    background-size: 120px 120px;
  }

  .fragments-sigil {
    background-size: 160px 160px;
  }

  .closing-sigil {
    background-size: 110px 110px;
  }
}

/* ── Small phones ──────────────────────────── */

@media (max-width: 380px) {
  .fragments {
    padding: 2.5rem 1rem;
  }

  .fragments--cinematic {
    padding: 3rem 1rem;
  }

  .fragments-inner {
    gap: 0.9rem;
  }

  .teaser {
    padding: 2.5rem 0.5rem 3rem;
  }

  .sigil-tile {
    background-size: 60px 60px;
  }

  .fragments-sigil {
    background-size: 70px 70px;
  }

  .closing-sigil {
    background-size: 50px 50px;
  }

  .closing {
    padding: 4rem 1rem 3rem;
    min-height: 35vh;
  }

  .sigil-band {
    height: 70px;
  }

  .sigil-band--tall {
    height: 100px;
  }
}

/* ═══════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-img { transform: scale(1) !important; }

  .reveal-el, .scroll-reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
