/* ============================================================
   matsurika.day — Jasmine Celestial Editorial
   Duotone palette: Indigo Void × Moon Cream
   Fonts: Cormorant Garamond, IM Fell English, Lora, Petit Formal Script
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
  --indigo-void: #130A22;
  --velvet-plum: #3D1F5C;
  --jasmine-dusk: #C9A7D4;
  --moon-cream: #F5EFE0;
  --chrome-gold: #D4AF6A;
  --blush-wash: #E8C7D8;
  --star-white: #FAF6FF;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-sub: 'IM Fell English', Georgia, serif;
  --font-body: 'Lora', Georgia, serif;
  --font-accent: 'Petit Formal Script', cursive;
}

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

html {
  font-size: 16px;
}

body {
  background-color: var(--indigo-void);
  color: var(--moon-cream);
  font-family: var(--font-body);
  overflow: hidden;
}

/* --- Main Scroll Container --- */
#main-scroll {
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
  height: 100vh;
  scroll-behavior: smooth;
}

/* --- Base Section --- */
.section {
  height: 100vh;
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
}

/* ============================================================
   WATERCOLOR WASH OVERLAYS
   ============================================================ */
.wash {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  animation: bloom 1.2s ease-out forwards;
}

@keyframes bloom {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1); opacity: 0.35; }
}

.wash-1 {
  width: 45vw;
  height: 55vh;
  top: -10%;
  left: -5%;
  background: radial-gradient(ellipse, var(--blush-wash) 0%, var(--jasmine-dusk) 50%, transparent 80%);
  border-radius: 40% 60% 55% 45% / 45% 55% 60% 40%;
  filter: blur(24px);
  animation-delay: 0.2s;
}

.wash-2 {
  width: 35vw;
  height: 45vh;
  bottom: 5%;
  right: 2%;
  background: radial-gradient(ellipse, var(--jasmine-dusk) 0%, var(--velvet-plum) 50%, transparent 80%);
  border-radius: 55% 45% 40% 60% / 60% 40% 45% 55%;
  filter: blur(24px);
  animation-delay: 0.5s;
}

.wash-3 {
  width: 30vw;
  height: 35vh;
  top: 40%;
  left: 30%;
  background: radial-gradient(ellipse, var(--blush-wash) 0%, var(--jasmine-dusk) 50%, transparent 80%);
  border-radius: 45% 55% 60% 40% / 40% 60% 55% 45%;
  filter: blur(24px);
  animation-delay: 0.8s;
}

/* ============================================================
   CHROME GRADIENT RULES
   ============================================================ */
.chrome-rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--chrome-gold), var(--star-white), var(--chrome-gold), transparent);
  width: 100%;
  margin: 0.75rem 0;
}

.chrome-rule-thin {
  height: 0.5px;
  opacity: 0.6;
  margin: 0.25rem 0;
}

.chrome-rule-triple {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 60%;
  margin: 1.5rem auto;
}

/* ============================================================
   SECTION 1: THE COVER SPREAD
   ============================================================ */
#cover-spread {
  background: var(--indigo-void);
}

.cover-grid {
  display: grid;
  grid-template-columns: 2fr 3fr;
  height: 100%;
  position: relative;
  z-index: 2;
}

/* Cover Left — Jasmine & Watercolor bleed */
.cover-left {
  background: radial-gradient(ellipse at 20% 50%, var(--blush-wash) 0%, var(--velvet-plum) 40%, var(--indigo-void) 70%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-right: 1px solid rgba(201, 167, 212, 0.2);
}

.jasmine-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

#jasmine-branch {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: sway 8s ease-in-out infinite;
  transform-origin: center bottom;
}

@keyframes sway {
  0%, 100% { transform: rotate(-1deg) translateX(-2px); }
  50%       { transform: rotate(1deg) translateX(2px); }
}

/* Hero Stars */
.hero-star {
  position: absolute;
  filter: drop-shadow(0 0 8px var(--chrome-gold));
}

.star-gold {
  width: 16px;
  height: 16px;
  background: var(--chrome-gold);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.star-small {
  width: 8px;
  height: 8px;
  background: var(--star-white);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* Cover Right — Masthead */
.cover-right {
  background: var(--moon-cream);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4vh 5vw 3vh;
  position: relative;
}

.cover-right::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 30%, rgba(232, 199, 216, 0.4) 0%, transparent 60%);
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 0;
}

.cover-masthead-area {
  position: relative;
  z-index: 1;
  padding-top: 6vh;
}

.cover-label {
  font-family: var(--font-sub);
  font-size: 0.85rem;
  color: var(--velvet-plum);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.masthead-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(60px, 7vw, 96px);
  letter-spacing: 0.06em;
  color: var(--indigo-void);
  line-height: 1.0;
  margin: 0.5rem 0;
}

.masthead-kanji {
  display: block;
  font-size: clamp(28px, 3.5vw, 48px);
  color: var(--velvet-plum);
  letter-spacing: 0.12em;
  font-weight: 400;
  font-style: italic;
  margin-top: 0.3rem;
}

.masthead-subtitle {
  font-family: var(--font-body);
  font-size: clamp(13px, 1.2vw, 17px);
  line-height: 1.8;
  color: var(--velvet-plum);
  max-width: 420px;
  margin: 1rem 0;
}

.star-dividers {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin: 1rem 0;
}

.star-divider {
  font-size: 1rem;
  color: var(--chrome-gold);
  animation: twinkle 2s ease-in-out infinite;
}

.star-divider:nth-child(2) { animation-delay: 0.4s; }
.star-divider:nth-child(3) { animation-delay: 0.8s; }
.star-divider:nth-child(4) { animation-delay: 1.2s; }
.star-divider:nth-child(5) { animation-delay: 1.6s; }

@keyframes twinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.8); }
}

.cover-tagline {
  font-family: var(--font-accent);
  font-size: clamp(20px, 2vw, 28px);
  color: var(--jasmine-dusk);
  margin-top: 0.5rem;
}

.cover-right-bottom {
  position: relative;
  z-index: 1;
  padding-bottom: 2vh;
}

/* ============================================================
   RHINESTONE BORDER
   ============================================================ */
.rhinestone-border {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 0.5rem 0;
}

.rhinestone-border .diamond {
  width: 6px;
  height: 6px;
  background: var(--chrome-gold);
  transform: rotate(45deg);
  opacity: 0.7;
  animation: float-crystal 3s ease-in-out infinite;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: default;
}

.rhinestone-border .diamond:hover {
  transform: rotate(45deg) scale(1.4) translateY(-6px);
  opacity: 1;
  background: var(--star-white);
  filter: drop-shadow(0 0 4px var(--chrome-gold));
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, filter 0.2s ease;
}

@keyframes float-crystal {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50%       { transform: rotate(45deg) translateY(-4px); }
}

/* ============================================================
   SECTION 2: THE FEATURE WELL
   ============================================================ */
#feature-well {
  background: var(--velvet-plum);
}

.wash-feature-1 {
  width: 50vw;
  height: 60vh;
  top: 20%;
  left: 38%;
  background: radial-gradient(ellipse, var(--blush-wash) 0%, var(--jasmine-dusk) 40%, transparent 75%);
  border-radius: 60% 40% 50% 50% / 50% 50% 40% 60%;
  filter: blur(30px);
  transform: rotate(15deg);
  animation: bloom 1.4s ease-out 0.3s forwards;
  opacity: 0;
}

.wash-feature-2 {
  width: 25vw;
  height: 40vh;
  bottom: 10%;
  left: 5%;
  background: radial-gradient(ellipse, var(--jasmine-dusk) 0%, var(--blush-wash) 50%, transparent 80%);
  border-radius: 45% 55% 40% 60% / 55% 45% 60% 40%;
  filter: blur(20px);
  animation: bloom 1.4s ease-out 0.6s forwards;
  opacity: 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  height: 100%;
  position: relative;
  z-index: 2;
}

.feature-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6vh 4vw 6vh 6vw;
}

.pull-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(32px, 4.5vw, 72px);
  line-height: 1.2;
  color: var(--star-white);
  letter-spacing: 0.02em;
  margin-bottom: 2rem;
  border: none;
  padding: 0;
}

.feature-body {
  font-family: var(--font-body);
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.9;
  color: var(--moon-cream);
  max-width: 520px;
  margin-bottom: 1.2rem;
  opacity: 0.92;
}

.feature-rule {
  max-width: 400px;
  margin: 1rem 0;
}

.feature-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6vh 4vw;
  gap: 2rem;
}

/* Mini Star Chart */
.star-chart {
  border: 1px solid rgba(201, 167, 212, 0.3);
  padding: 1rem;
  background: rgba(19, 10, 34, 0.6);
}

#mini-star-chart {
  width: 100%;
  height: auto;
}

.star-chart-label {
  font-family: var(--font-sub);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--jasmine-dusk);
  text-align: center;
  margin-top: 0.5rem;
}

/* Palette Swatch Strip */
.palette-swatch-strip {
  display: flex;
  gap: 2px;
  height: 20px;
}

.swatch {
  flex: 1;
  height: 100%;
}

/* Feature Captions */
.feature-captions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.caption-item {
  font-family: var(--font-sub);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--jasmine-dusk);
  text-transform: uppercase;
}

/* ============================================================
   SECTION 3: THE GALLERY FOLIO
   ============================================================ */
#gallery-folio {
  background: var(--moon-cream);
  display: flex;
  flex-direction: column;
}

.wash-gallery-1 {
  width: 40vw;
  height: 50vh;
  top: 50%;
  right: 5%;
  background: radial-gradient(ellipse, var(--blush-wash) 0%, var(--jasmine-dusk) 50%, transparent 80%);
  border-radius: 55% 45% 50% 50% / 45% 55% 45% 55%;
  filter: blur(28px);
  animation: bloom 1.6s ease-out 0.2s forwards;
  opacity: 0;
}

.gallery-header {
  text-align: center;
  padding: 4vh 2vw 2vh;
  position: relative;
  z-index: 2;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(44px, 6vw, 80px);
  letter-spacing: 0.06em;
  color: var(--indigo-void);
}

.gallery-rule {
  max-width: 300px;
  margin: 0.5rem auto;
}

.section-subtitle {
  font-family: var(--font-sub);
  font-style: italic;
  font-size: clamp(13px, 1.1vw, 16px);
  color: var(--velvet-plum);
  letter-spacing: 0.06em;
}

/* Gallery Masonry */
.gallery-masonry {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  flex: 1;
  gap: 4px;
  padding: 1vh 1.5vw 2vh;
  position: relative;
  z-index: 2;
}

.gallery-cell {
  position: relative;
  overflow: hidden;
}

.cell-tall {
  grid-row: span 2;
}

.cell-wide {
  grid-column: span 1;
}

.cell-tall-right {
  grid-row: span 2;
}

.cell-inner {
  width: 100%;
  height: 100%;
}

.watercolor-vignette {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
  min-height: 120px;
}

.vignette-indigo {
  background: radial-gradient(ellipse at 40% 30%, var(--velvet-plum) 0%, var(--indigo-void) 70%);
}

.vignette-rose {
  background: radial-gradient(ellipse at 60% 40%, var(--blush-wash) 0%, var(--jasmine-dusk) 60%, var(--velvet-plum) 100%);
}

.vignette-gold {
  background: radial-gradient(ellipse at 50% 50%, var(--chrome-gold) 0%, var(--velvet-plum) 60%, var(--indigo-void) 100%);
}

.vignette-plum {
  background: radial-gradient(ellipse at 30% 60%, var(--jasmine-dusk) 0%, var(--velvet-plum) 50%, var(--indigo-void) 90%);
}

.vignette-blush {
  background: radial-gradient(ellipse at 70% 30%, var(--blush-wash) 0%, var(--jasmine-dusk) 60%, var(--velvet-plum) 100%);
}

.vignette-cream {
  background: radial-gradient(ellipse at 20% 70%, var(--moon-cream) 0%, var(--blush-wash) 40%, var(--jasmine-dusk) 80%);
}

.vignette-content {
  position: relative;
  z-index: 1;
}

.vignette-label {
  font-family: var(--font-accent);
  font-size: 1.4rem;
  color: var(--chrome-gold);
  display: block;
  margin-bottom: 0.3rem;
}

.vignette-text {
  font-family: var(--font-body);
  font-size: clamp(11px, 0.9vw, 13px);
  line-height: 1.6;
  color: var(--star-white);
}

.vignette-cream .vignette-text,
.vignette-rose .vignette-text {
  color: var(--indigo-void);
}

/* Crystal Halo — box-shadow border */
.crystal-halo {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(201, 167, 212, 0.4), inset 0 0 0 7px rgba(201, 167, 212, 0.1);
  pointer-events: none;
  z-index: 3;
  transition: box-shadow 0.3s ease;
}

/* ============================================================
   SECTION 4: THE CONSTELLATION MAP
   ============================================================ */
#constellation-map {
  background: var(--indigo-void);
}

.star-field {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.star-field .star-dot {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, var(--star-white) 0%, transparent 70%);
  animation: drift linear infinite;
}

@keyframes drift {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-20px); }
}

.constellation-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 2fr 3fr;
  height: 100%;
}

.constellation-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6vh 4vw;
  gap: 3rem;
  border-right: 1px solid rgba(201, 167, 212, 0.15);
}

.large-star-ornament {
  width: clamp(80px, 10vw, 120px);
  filter: drop-shadow(0 0 8px var(--chrome-gold));
}

.constellation-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8vh 6vw;
  position: relative;
}

.constellation-eyebrow {
  font-family: var(--font-sub);
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--jasmine-dusk);
  margin-bottom: 1rem;
}

.constellation-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 6.5vw, 96px);
  letter-spacing: 0.06em;
  color: var(--star-white);
  line-height: 1.05;
  margin-bottom: 1.5rem;
}

.constellation-title em {
  color: var(--chrome-gold);
}

.constellation-body {
  font-family: var(--font-body);
  font-size: clamp(13px, 1.05vw, 15px);
  line-height: 1.9;
  color: var(--moon-cream);
  max-width: 460px;
  margin-bottom: 1.2rem;
  opacity: 0.88;
}

/* Star Cluster (Orion's belt inspired) */
.star-cluster {
  position: relative;
  height: 60px;
  margin-top: 2rem;
}

.cluster-star {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--chrome-gold);
  border-radius: 50%;
  animation: cluster-twinkle 2.5s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.4s);
  filter: drop-shadow(0 0 3px var(--chrome-gold));
}

@keyframes cluster-twinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.3; transform: scale(0.6); }
}

/* Rhinestone border in constellation section */
#rhinestone-constellation {
  width: 100%;
  justify-content: center;
  background: rgba(61, 31, 92, 0.3);
  padding: 1rem;
  border: 1px solid rgba(201, 167, 212, 0.2);
}

#rhinestone-constellation .diamond {
  background: var(--jasmine-dusk);
}

/* ============================================================
   SECTION 5: THE COLOPHON FOOTER
   ============================================================ */
#colophon {
  background: var(--velvet-plum);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wash-colophon-1 {
  width: 60vw;
  height: 70vh;
  top: 15%;
  left: 20%;
  background: radial-gradient(ellipse, var(--jasmine-dusk) 0%, var(--velvet-plum) 50%, transparent 80%);
  border-radius: 50% 50% 45% 55% / 55% 45% 50% 50%;
  filter: blur(32px);
  animation: bloom 1.6s ease-out 0.2s forwards;
  opacity: 0;
}

.colophon-container {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  max-width: 600px;
  padding: 3vh 3vw;
}

.colophon-content {
  padding: 3vh 0;
}

.colophon-script {
  font-family: var(--font-accent);
  font-size: clamp(42px, 5vw, 64px);
  color: var(--star-white);
  margin-bottom: 0.3rem;
}

.colophon-kanji {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.5vw, 32px);
  color: var(--jasmine-dusk);
  letter-spacing: 0.2em;
  margin-bottom: 1.5rem;
}

.colophon-divider {
  color: var(--chrome-gold);
  font-size: 1rem;
  letter-spacing: 1.2rem;
  margin: 1.5rem 0;
}

.colophon-mono {
  font-family: monospace;
  font-size: clamp(9px, 0.8vw, 11px);
  letter-spacing: 0.12em;
  color: var(--moon-cream);
  opacity: 0.75;
  text-transform: uppercase;
  line-height: 2;
}

.colophon-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(16px, 1.5vw, 20px);
  color: var(--star-white);
  margin-top: 1.5rem;
}

/* Footer Stars */
.star-scatter-footer {
  position: relative;
  height: 40px;
  margin-top: 1.5rem;
}

.footer-star {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--chrome-gold);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: twinkle 2.5s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.5s);
}

.footer-star:nth-child(1) { left: 10%; top: 50%; }
.footer-star:nth-child(2) { left: 28%; top: 20%; }
.footer-star:nth-child(3) { left: 50%; top: 60%; }
.footer-star:nth-child(4) { left: 70%; top: 25%; }
.footer-star:nth-child(5) { left: 88%; top: 55%; }

/* ============================================================
   BACKGROUND SCATTER STARS (Pseudo-element constellation dust)
   ============================================================ */
#cover-spread::before,
#feature-well::before,
#gallery-folio::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle, var(--chrome-gold) 0%, transparent 70%),
    radial-gradient(circle, var(--star-white) 0%, transparent 70%),
    radial-gradient(circle, var(--jasmine-dusk) 0%, transparent 70%),
    radial-gradient(circle, var(--chrome-gold) 0%, transparent 70%),
    radial-gradient(circle, var(--star-white) 0%, transparent 70%),
    radial-gradient(circle, var(--jasmine-dusk) 0%, transparent 70%);
  background-size: 3px 3px, 2px 2px, 4px 4px, 2px 2px, 3px 3px, 2px 2px;
  background-position:
    15% 12%, 40% 25%, 65% 8%, 80% 40%, 22% 68%, 55% 80%;
  background-repeat: no-repeat;
  opacity: 0.3;
}
