/* ============================================================
   MAWAR — The Black Rose Manifesto
   styles.css
   ============================================================ */

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

:root {
  /* Palette */
  --void:       #050507;
  --obsidian:   #0b0b10;
  --silver-dim: #8a8a9a;
  --silver:     #c2c2d0;
  --silver-hi:  #e8e8f0;
  --gold:       #D4AF37;
  --gold-dim:   #a0832a;
  --gold-glow:  rgba(212, 175, 55, 0.18);

  /* Typography */
  --font-display: 'Cinzel', serif;
  --font-body:    'Cormorant Garamond', serif;

  /* Motion */
  --ease-luxury: cubic-bezier(0.16, 1, 0.3, 1);

  /* Spacing */
  --gap-xs: 0.5rem;
  --gap-sm: 1rem;
  --gap-md: 2rem;
  --gap-lg: 4rem;
}

html {
  font-size: 16px;
  scroll-behavior: auto; /* GSAP controls scroll */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--void);
  color: var(--silver);
  font-family: var(--font-body);
  font-weight: 200;
  overflow-x: hidden;
  cursor: none;
}

/* ── Custom Cursor ────────────────────────────────────────── */
#cursor,
#cursor-trail {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
}

#cursor {
  width: 8px;
  height: 8px;
  background: var(--gold);
  transform: translate(-50%, -50%);
  transition: transform 0.1s var(--ease-luxury),
              width 0.3s var(--ease-luxury),
              height 0.3s var(--ease-luxury);
}

#cursor-trail {
  width: 32px;
  height: 32px;
  border: 1px solid var(--gold-dim);
  transform: translate(-50%, -50%);
  opacity: 0.5;
  transition: transform 0.35s var(--ease-luxury),
              opacity 0.3s ease;
}

/* ── Loader ───────────────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: var(--void);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader__sigil {
  font-family: var(--font-display);
  font-size: clamp(4rem, 15vw, 12rem);
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 1px var(--gold);
  letter-spacing: 0.05em;
  opacity: 0;
}

/* ── Noise Overlay ────────────────────────────────────────── */
.noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 1;
}

/* ── Gold Accent Lines ────────────────────────────────────── */
.accent-line {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--gold-dim) 20%,
    var(--gold-dim) 80%,
    transparent 100%
  );
  opacity: 0;
  z-index: 100;
  pointer-events: none;
}

.accent-line--left  { left: clamp(1.5rem, 4vw, 4rem); }
.accent-line--right { right: clamp(1.5rem, 4vw, 4rem); }

/* ── Main Wrapper ─────────────────────────────────────────── */
#smooth-wrapper {
  position: relative;
}

/* ── Panels ───────────────────────────────────────────────── */
.panel {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(4rem, 8vw, 8rem) clamp(2rem, 8vw, 8rem);
}

.panel--title     { background: var(--void); }
.panel--time      { background: var(--obsidian); }
.panel--precision { background: var(--void); }
.panel--bloom     { background: var(--obsidian); }
.panel--coda      { background: var(--void); }

/* ── Panel Inner ──────────────────────────────────────────── */
.panel__inner {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  width: 100%;
}

.panel__inner--center {
  text-align: center;
  margin: 0 auto;
}

.panel__inner--right {
  margin-left: auto;
  text-align: right;
}

/* ── Background Glyph ─────────────────────────────────────── */
.panel__bg-glyph {
  position: absolute;
  font-family: var(--font-display);
  font-size: clamp(20rem, 50vw, 60rem);
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 1px rgba(212, 175, 55, 0.04);
  right: -5%;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 0;
  line-height: 1;
  letter-spacing: -0.05em;
  user-select: none;
}

/* ── Typography ───────────────────────────────────────────── */
.eyebrow {
  font-family: var(--font-display);
  font-size: clamp(0.55rem, 1.1vw, 0.8rem);
  font-weight: 400;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: var(--gap-md);
  display: block;
}

.display-title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 12vw, 11rem);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: var(--silver-hi);
  margin-bottom: var(--gap-md);
}

.display-title em {
  font-style: italic;
  font-weight: 300;
}

.display-title .title-sub {
  font-size: clamp(1.8rem, 5vw, 4.5rem);
  font-weight: 300;
  color: var(--gold);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  display: block;
  margin-top: 0.4em;
}

.line-wrap {
  display: block;
  overflow: hidden;
}

.line {
  display: block;
}

.tagline {
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 2vw, 1.35rem);
  font-weight: 200;
  font-style: italic;
  color: var(--silver-dim);
  letter-spacing: 0.06em;
  margin-top: var(--gap-md);
}

/* ── Chapter Number ───────────────────────────────────────── */
.chapter-num {
  font-family: var(--font-display);
  font-size: clamp(0.5rem, 1vw, 0.7rem);
  font-weight: 400;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold-dim);
  display: block;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

/* ── Manifesto Heading ────────────────────────────────────── */
.manifesto-heading {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 9vw, 9rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--silver-hi);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.manifesto-heading--light {
  color: var(--silver);
}

.manifesto-heading--gold {
  color: transparent;
  -webkit-text-stroke: 1px var(--gold-dim);
}

.mh__row {
  display: block;
  overflow: hidden;
}

.mh__row--indent {
  padding-left: clamp(2rem, 6vw, 6rem);
}

.mh__word {
  display: inline-block;
}

/* ── Body Prose ───────────────────────────────────────────── */
.body-prose {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  font-weight: 200;
  font-style: italic;
  line-height: 1.8;
  color: var(--silver-dim);
  max-width: 42ch;
  letter-spacing: 0.03em;
  margin-top: clamp(1rem, 2vw, 1.5rem);
}

.panel__inner--center .body-prose,
.panel__inner--right .body-prose {
  margin-left: auto;
  margin-right: auto;
}

.panel__inner--right .body-prose {
  margin-left: auto;
  margin-right: 0;
}

/* ── Gold Rule ────────────────────────────────────────────── */
.gold-rule {
  width: clamp(4rem, 15vw, 10rem);
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--gold),
    transparent
  );
  margin: var(--gap-md) 0;
}

.panel__inner--center .gold-rule {
  margin-left: auto;
  margin-right: auto;
}

.panel__inner--right .gold-rule {
  margin-left: auto;
  margin-right: 0;
}

.gold-rule--short {
  width: clamp(2rem, 6vw, 5rem);
}

/* ── Scroll Hint ──────────────────────────────────────────── */
.scroll-hint {
  position: absolute;
  bottom: clamp(1.5rem, 4vh, 3rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.scroll-hint__label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.scroll-hint__arrow {
  display: block;
  width: 1px;
  height: clamp(2rem, 5vh, 4rem);
  background: linear-gradient(to bottom, var(--gold-dim), transparent);
  animation: arrowPulse 2.5s ease-in-out infinite;
}

@keyframes arrowPulse {
  0%, 100% { opacity: 0; transform: scaleY(0); transform-origin: top; }
  50%       { opacity: 1; transform: scaleY(1); transform-origin: top; }
}

/* ── Float Orbs ───────────────────────────────────────────── */
.float-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
}

.float-orb--a {
  width: clamp(20rem, 40vw, 40rem);
  height: clamp(20rem, 40vw, 40rem);
  background: radial-gradient(circle, rgba(212, 175, 55, 0.04), transparent 70%);
  top: -10%;
  right: -15%;
}

.float-orb--b {
  width: clamp(25rem, 50vw, 50rem);
  height: clamp(25rem, 50vw, 50rem);
  background: radial-gradient(circle, rgba(194, 194, 208, 0.04), transparent 70%);
  bottom: -15%;
  left: -15%;
}

/* ── Precision Grid ───────────────────────────────────────── */
.precision-grid {
  position: absolute;
  left: clamp(2rem, 8vw, 6rem);
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  z-index: 0;
  opacity: 0;
}

.precision-grid span {
  display: block;
  width: clamp(1.5rem, 3vw, 2.5rem);
  height: clamp(1.5rem, 3vw, 2.5rem);
  border: 1px solid rgba(212, 175, 55, 0.15);
}

/* ── Rose Symbol ──────────────────────────────────────────── */
.rose-symbol {
  font-size: clamp(1.5rem, 4vw, 3rem);
  color: var(--gold);
  display: block;
  margin-top: var(--gap-md);
  opacity: 0;
}

/* ── Coda ─────────────────────────────────────────────────── */
.coda-wordmark {
  font-family: var(--font-display);
  font-size: clamp(4rem, 18vw, 16rem);
  font-weight: 900;
  letter-spacing: 0.25em;
  color: transparent;
  -webkit-text-stroke: 1px var(--silver-dim);
  line-height: 1;
  margin-bottom: var(--gap-lg);
  text-transform: uppercase;
  opacity: 0;
}

.coda-verse {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  font-weight: 200;
  font-style: italic;
  line-height: 2;
  color: var(--silver);
  letter-spacing: 0.05em;
  margin: var(--gap-md) auto;
  max-width: 38ch;
}

.coda-verse em {
  color: var(--gold);
  font-style: italic;
}

.coda-footer {
  font-family: var(--font-display);
  font-size: clamp(0.5rem, 1vw, 0.7rem);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--silver-dim);
  opacity: 0.5;
  margin-top: var(--gap-lg);
}

/* ── Initial Hidden States for GSAP ──────────────────────── */
.reveal-word,
.reveal-rule,
.reveal-tag,
.reveal-hint {
  opacity: 0;
}

.reveal-line {
  transform: translateY(110%);
}

.st-fade  { opacity: 0; }
.st-rule  { opacity: 0; transform: scaleX(0); }
.st-prose { opacity: 0; transform: translateY(2rem); }
.st-grid  { opacity: 0; }
.st-rose  { opacity: 0; transform: scale(0.5); }

.mh__word {
  opacity: 0;
  transform: translateY(60px);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .panel__inner--right {
    text-align: left;
    margin-left: 0;
  }
  .panel__inner--right .gold-rule,
  .panel__inner--right .body-prose {
    margin-left: 0;
    margin-right: auto;
  }
  .precision-grid {
    display: none;
  }
  .mh__row--indent {
    padding-left: clamp(1rem, 4vw, 2.5rem);
  }
  .accent-line { display: none; }
  body { cursor: auto; }
  #cursor, #cursor-trail { display: none; }
}

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