/* ================================================
   NONRI.DAY — Surrealist Dawn
   Fraunces + Commissioner + Inconsolata
   Sunset-Warm Palette | Floating Panels
   Sky-as-Scroll Gradient | Handless Clocks
   ================================================ */

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

:root {
  --midnight: #1B1040;
  --violet: #4A2C6A;
  --rose: #C7627A;
  --terracotta: #E8956B;
  --amber: #F4A742;
  --parchment: #FFF5E6;
  --shadow-violet: #3D2258;
  --sunbeam: #F4D35E;
  --lavender: #9E8FB0;

  --font-display: 'Fraunces', serif;
  --font-body: 'Commissioner', sans-serif;
  --font-mono: 'Inconsolata', monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(0.95rem, 1.1vw, 1.15rem);
  line-height: 1.65;
  letter-spacing: 0.01em;
  color: var(--parchment);
  background: var(--midnight);
  min-height: 400vh;
  overflow-x: hidden;
  position: relative;
}

/* ================================================
   SKY GRADIENT (scroll-driven via JS)
   ================================================ */
.sky {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    var(--midnight) 0%,
    var(--violet) 35%,
    var(--rose) 55%,
    var(--terracotta) 72%,
    var(--amber) 100%
  );
  background-size: 100% 300%;
  background-position: 0% 0%;
  transition: background-position 0.05s linear;
}

/* ================================================
   CLOUD SILHOUETTES
   ================================================ */
.cloud {
  position: fixed;
  pointer-events: none;
  z-index: 1;
  color: rgba(255, 245, 230, 0.07);
  filter: blur(25px);
}

.cloud--1 {
  width: 60vw;
  height: 18vh;
  top: 25vh;
  left: -15vw;
  animation: driftRight 120s linear infinite;
}

.cloud--2 {
  width: 45vw;
  height: 14vh;
  top: 50vh;
  right: -10vw;
  color: rgba(255, 245, 230, 0.09);
  animation: driftLeft 100s linear infinite;
}

.cloud--3 {
  width: 70vw;
  height: 20vh;
  top: 72vh;
  left: 15vw;
  color: rgba(255, 245, 230, 0.05);
  animation: driftRight 150s linear infinite;
  animation-delay: -40s;
}

.cloud--4 {
  width: 50vw;
  height: 15vh;
  top: 38vh;
  left: 40vw;
  color: rgba(255, 245, 230, 0.06);
  animation: driftLeft 130s linear infinite;
  animation-delay: -60s;
}

@keyframes driftRight {
  0%   { transform: translateX(-30vw); }
  100% { transform: translateX(130vw); }
}

@keyframes driftLeft {
  0%   { transform: translateX(30vw); }
  100% { transform: translateX(-130vw); }
}

/* ================================================
   HANDLESS CLOCKS
   ================================================ */
.clock {
  position: fixed;
  pointer-events: none;
  z-index: 2;
  color: var(--parchment);
  opacity: 0;
  transition: opacity 1.5s ease;
}

.clock.clock--visible {
  opacity: var(--clock-opacity, 0.25);
}

/* Hero clock — below the title, center */
.clock--hero {
  width: 8vw;
  max-width: 100px;
  min-width: 50px;
  top: 68vh;
  left: 50%;
  transform: translateX(-50%);
  --clock-opacity: 0.3;
  animation: rotateClockSlow 60s linear infinite;
}

/* Small scattered clocks — Zone 2 (star-like) */
.clock--sm-1 {
  width: 3vw;
  max-width: 38px;
  min-width: 18px;
  top: 15vh;
  left: 75vw;
  --clock-opacity: 0.2;
  animation: rotateClockSlow 90s linear infinite reverse;
}

.clock--sm-2 {
  width: 4vw;
  max-width: 48px;
  min-width: 22px;
  top: 40vh;
  left: 6vw;
  --clock-opacity: 0.25;
  animation: rotateClockSlow 75s linear infinite;
}

.clock--sm-3 {
  width: 3vw;
  max-width: 36px;
  min-width: 16px;
  top: 65vh;
  left: 88vw;
  --clock-opacity: 0.15;
  animation: rotateClockSlow 50s linear infinite reverse;
}

.clock--sm-4 {
  width: 5vw;
  max-width: 55px;
  min-width: 25px;
  top: 82vh;
  left: 30vw;
  --clock-opacity: 0.2;
  animation: rotateClockSlow 65s linear infinite;
}

/* Large final clock — behind the last panel */
.clock--lg-final {
  width: 15vw;
  max-width: 200px;
  min-width: 80px;
  bottom: 15vh;
  right: 18vw;
  --clock-opacity: 0.08;
  animation: rotateClockSlow 40s linear infinite;
}

@keyframes rotateClockSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Re-center hero clock rotation */
.clock--hero {
  animation: rotateClockHero 60s linear infinite;
}

@keyframes rotateClockHero {
  from { transform: translateX(-50%) rotate(0deg); }
  to   { transform: translateX(-50%) rotate(360deg); }
}

/* ================================================
   DEPTH CONTAINER
   ================================================ */
.depth-container {
  position: relative;
  z-index: 3;
  perspective: 1200px;
}

/* ================================================
   ZONES
   ================================================ */
.zone {
  position: relative;
  min-height: 100vh;
  z-index: 3;
}

.zone-1 {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.zone-2 {
  min-height: 100vh;
  position: relative;
  padding: 5vh 0;
}

.zone-3 {
  min-height: 100vh;
  position: relative;
  padding: 5vh 0;
}

.zone-4 {
  min-height: 130vh;
  position: relative;
  padding: 5vh 0 15vh;
}

/* ================================================
   PANELS — Floating Architecture
   ================================================ */
.panel {
  position: relative;
  background: rgba(255, 245, 230, 0.08);
  padding: 2rem 2.25rem;
  border-radius: 2px;
  opacity: 0;
  transform: scale(0.92) translateZ(0px);
  transition:
    opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.35s ease;
}

.panel.visible {
  opacity: 1;
  transform: scale(1) translateZ(0px);
}

/* Depth layers */
.panel[data-depth="1"].visible {
  transform: scale(1) translateZ(-20px);
}

.panel[data-depth="2"].visible {
  transform: scale(1) translateZ(-50px);
}

.panel[data-depth="3"].visible {
  transform: scale(1) translateZ(-80px);
}

/* Colored shadows (not black) */
.panel:not(.panel--hero) {
  box-shadow: 8px 10px 30px rgba(61, 34, 88, 0.5);
}

/* Hover glow */
.panel:hover {
  box-shadow: 0 0 24px var(--sunbeam), 8px 10px 30px rgba(61, 34, 88, 0.4);
  transform: scale(1.02) translateZ(0px);
  cursor: default;
}

/* ================================================
   PANEL SIZES
   ================================================ */
.panel--small {
  width: min(20vw, 240px);
  min-height: 12vh;
  padding: 1.5rem 1.75rem;
}

.panel--medium {
  width: min(38vw, 460px);
  min-height: 20vh;
  margin: 6vh auto;
}

.panel--large {
  width: min(52vw, 600px);
  min-height: 28vh;
  margin: 5vh auto;
}

/* ================================================
   PANEL POSITIONS
   ================================================ */

/* Zone 1: Hero */
.panel--hero {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: none !important;
  min-height: auto;
  padding: 3rem;
}

.panel--hero:hover {
  box-shadow: none !important;
  transform: scale(1);
}

/* Zone 2: Word panels — staggered from left */
.panel--word {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 10vh;
}

.panel--word-1 {
  position: absolute;
  left: 8vw;
  top: 12vh;
}

.panel--word-2 {
  position: absolute;
  left: 16vw;
  top: 44vh;
}

.panel--word-3 {
  position: absolute;
  left: 6vw;
  top: 76vh;
}

/* Zone 3: Right-aligned, left-aligned panels */
.panel--right {
  margin-left: auto;
  margin-right: 8vw;
}

.panel--left {
  margin-left: 8vw;
  margin-right: auto;
}

.panel--float-left {
  position: absolute;
  left: 5vw;
  top: 15vh;
}

/* Zone 4: Scattered small panels */
.panel--scatter-1 {
  position: absolute;
  right: 8vw;
  top: 3vh;
}

.panel--scatter-2 {
  position: absolute;
  left: 60vw;
  top: 30vh;
}

.panel--scatter-3 {
  position: absolute;
  right: 12vw;
  top: 48vh;
}

.panel--scatter-4 {
  position: absolute;
  left: 5vw;
  top: 62vh;
}

.panel--morning {
  margin-top: 8vh;
}

.panel--final {
  margin-top: 20vh;
  position: relative;
  z-index: 5;
}

/* ================================================
   TEXT COLOR TRANSITIONS (dark-on-light for lower zones)
   ================================================ */

/* Zone 1 & 2: light text on dark sky */
.zone-1 .panel,
.zone-2 .panel {
  color: var(--parchment);
}

/* Zone 3 & 4: dark text on light panel */
.zone-3 .panel:not(.panel--float-left),
.zone-4 .panel {
  background: rgba(255, 245, 230, 0.88);
  color: var(--midnight);
}

.zone-3 .panel--float-left {
  background: rgba(255, 245, 230, 0.15);
  color: var(--parchment);
}

.zone-3 .panel:not(.panel--float-left) .panel__heading,
.zone-4 .panel .panel__heading {
  color: var(--midnight);
}

.zone-3 .panel:not(.panel--float-left) .panel__body,
.zone-3 .panel:not(.panel--float-left) .panel__body-sm,
.zone-4 .panel .panel__body,
.zone-4 .panel .panel__body-sm {
  color: var(--midnight);
}

/* ================================================
   TYPOGRAPHY
   ================================================ */
.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3rem, 8vw, 10rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--parchment);
  font-variation-settings: 'opsz' 144;
  text-align: center;
}

.word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 3.5rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--parchment);
  font-variation-settings: 'opsz' 144;
  display: block;
  text-align: center;
}

.panel__heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 3.5rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1rem;
  font-variation-settings: 'opsz' 72;
}

.panel__timestamp {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 0.75rem;
}

.panel__body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0.01em;
}

.panel__body-sm {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.9rem;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

/* ================================================
   DOOR ARCHWAYS
   ================================================ */
.door-arch {
  position: absolute;
  top: 12%;
  width: 44px;
  height: 88px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(
    180deg,
    var(--shadow-violet) 0%,
    rgba(61, 34, 88, 0.3) 60%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

.door-arch--left {
  left: -22px;
}

.door-arch--right {
  right: -22px;
}

.panel.visible .door-arch {
  opacity: 0.65;
}

/* ================================================
   HORIZON LINES
   ================================================ */
.horizon {
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--lavender) 20%,
    var(--rose) 50%,
    var(--lavender) 80%,
    transparent 100%
  );
  opacity: 0.3;
  z-index: 3;
  position: relative;
  margin: 2vh 0;
}

.horizon--warm {
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--terracotta) 20%,
    var(--amber) 50%,
    var(--terracotta) 80%,
    transparent 100%
  );
  opacity: 0.35;
}

/* ================================================
   RESPONSIVE (< 768px)
   ================================================ */
@media (max-width: 768px) {

  .zone-2 {
    display: flex;
    flex-direction: column;
    gap: 3vh;
    padding: 8vh 0;
  }

  .panel--small {
    position: relative !important;
    width: 82vw !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    margin: 2vh auto !important;
  }

  .panel--medium {
    width: 90vw;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .panel--large {
    width: 92vw;
  }

  .panel--right,
  .panel--left {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .panel--float-left {
    position: relative !important;
    top: auto !important;
    left: auto !important;
  }

  .panel--scatter-1,
  .panel--scatter-2,
  .panel--scatter-3,
  .panel--scatter-4 {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
  }

  .zone-4 {
    display: flex;
    flex-direction: column;
    min-height: auto;
    padding-bottom: 10vh;
  }

  .panel--final {
    margin-top: 5vh;
  }

  .hero-title {
    font-size: clamp(2.5rem, 12vw, 5rem);
  }

  .clock--hero {
    width: 14vw;
    top: 72vh;
  }

  .clock--sm-1,
  .clock--sm-3,
  .clock--sm-4 {
    display: none;
  }

  .clock--lg-final {
    display: none;
  }

  .cloud--3,
  .cloud--4 {
    display: none;
  }

  .door-arch {
    width: 32px;
    height: 64px;
    border-radius: 16px 16px 0 0;
  }

  .door-arch--left {
    left: -16px;
  }

  .door-arch--right {
    right: -16px;
  }
}

/* ================================================
   RESPONSIVE (769px - 1024px)
   ================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  .panel--small {
    width: min(25vw, 260px);
  }

  .panel--medium {
    width: min(45vw, 480px);
  }

  .panel--large {
    width: min(55vw, 580px);
  }
}

/* ================================================
   SELECTION COLOR
   ================================================ */
::selection {
  background: var(--rose);
  color: var(--parchment);
}
