/* ============================================
   monopole.city — Design System
   Cottagecore Physics / Zen-Contemplative
   ============================================ */

:root {
  --parchment-cream: #F4F0E8;
  --charcoal-slate: #2C3639;
  --sage-moss: #7A8B6F;
  --fired-terracotta: #C2735C;
  --warm-graphite: #3B3A36;
  --weathered-stone: #8A8578;
  --aged-honey: #D4B896;
  --dusty-ivory: #E8E0D0;

  /* Golden ratio spacing scale */
  --space-1: 1rem;
  --space-2: 1.618rem;
  --space-3: 2.618rem;
  --space-4: 4.236rem;
  --space-5: 6.854rem;
}

/* ============================================
   Reset & Base
   ============================================ */

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  line-height: 1.85;
  letter-spacing: 0.01em;
  color: var(--warm-graphite);
  background: var(--parchment-cream);
  overflow-x: hidden;
}

/* ============================================
   SVG Filters (hidden)
   ============================================ */

.svg-filters {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ============================================
   Typography
   ============================================ */

h1, h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  letter-spacing: 0.04em;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.2rem);
}

blockquote {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  letter-spacing: 0.06em;
  line-height: 1.35;
}

a {
  color: var(--fired-terracotta);
  text-decoration: none;
  position: relative;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--sage-moss);
}

a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--sage-moss);
  transition: width 0.3s ease;
}

a:hover::after {
  width: 100%;
}

/* ============================================
   Fixed Monogram
   ============================================ */

.monogram {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--warm-graphite);
  z-index: 100;
  cursor: pointer;
  transition: color 0.4s ease;
  mix-blend-mode: difference;
}

.monogram--light {
  color: var(--parchment-cream);
}

/* ============================================
   Main & Room Base
   ============================================ */

main {
  width: 100%;
  position: relative;
}

.room {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  will-change: filter, opacity;
  transition: filter 0.1s linear, opacity 0.1s linear;
}

.room-content {
  position: relative;
  z-index: 2;
}

/* ============================================
   Leather Texture Overlays
   ============================================ */

.leather-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(212, 184, 150, 0.02) 2px,
      rgba(212, 184, 150, 0.02) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 3px,
      rgba(138, 133, 120, 0.015) 3px,
      rgba(138, 133, 120, 0.015) 6px
    );
  opacity: 0.12;
}

.leather-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 30% 40%,
    rgba(212, 184, 150, 0.08) 0%,
    transparent 60%
  ),
  radial-gradient(
    ellipse at 70% 60%,
    rgba(138, 133, 120, 0.06) 0%,
    transparent 50%
  );
}

.leather-overlay--light {
  opacity: 0.08;
}

.leather-overlay--dark {
  opacity: 0.12;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(244, 240, 232, 0.03) 2px,
      rgba(244, 240, 232, 0.03) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 3px,
      rgba(212, 184, 150, 0.02) 3px,
      rgba(212, 184, 150, 0.02) 6px
    );
}

.leather-overlay--dark::before {
  background: radial-gradient(
    ellipse at 60% 50%,
    rgba(122, 139, 111, 0.06) 0%,
    transparent 50%
  );
}

/* ============================================
   Room 1: The Field
   ============================================ */

.room-field {
  background: var(--parchment-cream);
  padding: var(--space-4);
}

.monopole-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(80vw, 500px);
  height: min(80vw, 500px);
  opacity: 0.04;
  z-index: 0;
  pointer-events: none;
}

.monopole-watermark svg {
  width: 100%;
  height: 100%;
}

.marble-circle-container {
  position: absolute;
  right: -10%;
  top: 50%;
  transform: translateY(-50%);
  width: min(50vw, 500px);
  height: min(50vw, 500px);
  z-index: 0;
  pointer-events: none;
}

.marble-circle svg {
  width: 100%;
  height: 100%;
  animation: marble-shimmer 8s ease-in-out infinite;
}

@keyframes marble-shimmer {
  0%, 100% { opacity: 0.06; }
  50% { opacity: 0.12; }
}

.room-content--field {
  text-align: center;
  max-width: 800px;
  padding: var(--space-4) var(--space-3);
}

.field-title {
  color: var(--warm-graphite);
  margin-bottom: var(--space-2);
  opacity: 0;
  transform: translateY(20px);
  animation: field-entrance 1.8s cubic-bezier(0.25, 0.1, 0.25, 1.0) 0.3s forwards;
}

.field-subtitle {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--weathered-stone);
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  opacity: 0;
  transform: translateY(15px);
  animation: field-entrance 1.8s cubic-bezier(0.25, 0.1, 0.25, 1.0) 0.8s forwards;
}

@keyframes field-entrance {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Room 2: The Threshold
   ============================================ */

.room-threshold {
  background: linear-gradient(
    180deg,
    var(--parchment-cream) 0%,
    var(--dusty-ivory) 100%
  );
  padding: var(--space-4);
}

.room-content--threshold {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  gap: var(--space-4);
}

.text-column--left {
  flex: 0 0 40%;
  position: relative;
  padding-left: var(--space-4);
}

.threshold-text {
  color: var(--warm-graphite);
  max-width: 45ch;
}

.vein-container {
  flex: 1;
  position: relative;
  height: 80vh;
  max-height: 700px;
  overflow: hidden;
}

.marble-vein-svg {
  width: 100%;
  height: 100%;
}

.vein-path {
  opacity: 0.4;
}

.vein-path-1 {
  stroke-dasharray: 2200;
  stroke-dashoffset: 2200;
  transition: stroke-dashoffset 2.5s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.vein-path-2 {
  stroke-dasharray: 2200;
  stroke-dashoffset: 2200;
  transition: stroke-dashoffset 3s cubic-bezier(0.25, 0.1, 0.25, 1.0) 0.3s;
}

.vein-path-3 {
  stroke-dasharray: 2200;
  stroke-dashoffset: 2200;
  transition: stroke-dashoffset 3.5s cubic-bezier(0.25, 0.1, 0.25, 1.0) 0.5s;
}

.vein-path-4 {
  stroke-dasharray: 2200;
  stroke-dashoffset: 2200;
  transition: stroke-dashoffset 4s cubic-bezier(0.25, 0.1, 0.25, 1.0) 0.7s;
}

.vein-path.vein-drawn {
  stroke-dashoffset: 0;
}

/* Botanical accents */
.botanical {
  position: absolute;
  pointer-events: none;
  transition: filter 0.6s ease;
  filter: blur(1px);
}

.botanical:hover,
.botanical.botanical--focused {
  filter: blur(0px);
}

.botanical--rosemary {
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 200px;
}

/* ============================================
   Room 3: The Study
   ============================================ */

.room-study {
  background: var(--charcoal-slate);
  padding: var(--space-4);
}

.monopole-symbol-study {
  position: absolute;
  right: 10%;
  top: 50%;
  transform: translateY(-50%);
  width: min(40vw, 350px);
  height: min(40vw, 350px);
  z-index: 1;
  pointer-events: none;
  opacity: 0.15;
}

.monopole-symbol-study svg {
  width: 100%;
  height: 100%;
}

.room-content--study {
  max-width: 600px;
  margin-right: auto;
  margin-left: 10%;
  text-align: left;
}

.study-quote {
  color: var(--parchment-cream);
  margin-bottom: var(--space-3);
}

.study-text {
  color: var(--dusty-ivory);
  max-width: 55ch;
  margin-bottom: var(--space-2);
}

.study-text--secondary {
  color: var(--weathered-stone);
  font-size: clamp(0.85rem, 1.1vw, 0.95rem);
}

/* ============================================
   Room 4: The Return
   ============================================ */

.room-return {
  background: var(--parchment-cream);
  padding: var(--space-4);
}

.city-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(8rem, 20vw, 16rem);
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--warm-graphite);
  opacity: 0.08;
  z-index: 0;
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
}

.botanical--return {
  position: absolute;
  left: 5%;
  bottom: 10%;
  width: 40px;
  height: 220px;
  z-index: 1;
}

.botanical--return-right {
  left: auto;
  right: 5%;
  bottom: 15%;
  width: 35px;
  height: 200px;
}

.room-content--return {
  max-width: 600px;
  text-align: left;
  padding: var(--space-3);
  z-index: 2;
}

.return-text {
  color: var(--warm-graphite);
  max-width: 55ch;
}

/* ============================================
   Room 5: The Endpoint
   ============================================ */

.room-endpoint {
  background: var(--charcoal-slate);
  flex-direction: column;
  gap: var(--space-3);
}

.room-content--endpoint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
}

.endpoint-text {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  letter-spacing: 0.06em;
  color: var(--parchment-cream);
  line-height: 1.35;
}

.monopole-final {
  width: 140px;
  height: 140px;
  animation: monopole-pulse 4s ease-in-out infinite;
}

.monopole-final svg {
  width: 100%;
  height: 100%;
}

@keyframes monopole-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* ============================================
   Marble Vein Section Dividers
   ============================================ */

.room::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--dusty-ivory) 20%,
    var(--aged-honey) 50%,
    var(--dusty-ivory) 80%,
    transparent 100%
  );
  opacity: 0.3;
  z-index: 3;
}

.room-endpoint::after {
  display: none;
}

/* ============================================
   Blur-Focus State Classes (driven by JS)
   ============================================ */

.room--blurred {
  filter: blur(12px);
  opacity: 0.3;
}

.room--focused {
  filter: blur(0px);
  opacity: 1;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 900px) {
  .room-content--threshold {
    flex-direction: column;
  }

  .text-column--left {
    flex: none;
    width: 100%;
    padding-left: var(--space-2);
  }

  .vein-container {
    height: 40vh;
    width: 100%;
  }

  .room-content--study {
    margin-left: var(--space-2);
  }

  .monopole-symbol-study {
    right: 5%;
    width: min(30vw, 200px);
    height: min(30vw, 200px);
  }

  .marble-circle-container {
    right: -20%;
    width: min(60vw, 350px);
    height: min(60vw, 350px);
  }
}

@media (max-width: 600px) {
  .room {
    padding: var(--space-2);
  }

  .monogram {
    top: var(--space-1);
    left: var(--space-1);
  }

  .room-content--study {
    margin-left: var(--space-1);
  }

  .botanical--return,
  .botanical--return-right {
    display: none;
  }

  .city-watermark {
    font-size: clamp(5rem, 18vw, 10rem);
  }
}
