
:root {
  --dark: #38232f;
  --dark-light: #513440;
  --rose: #bf8b9b;
  --pink: #e8b8c4;
  --cream: #f8efe8;
  --paper: #fff8ef;
  --brown: #634850;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--dark);
  color: var(--cream);
  font-family: "DM Sans", sans-serif;
  overflow-x: hidden;
}

button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }

h1, h2, h3 {
  font-family: "Playfair Display", serif;
  font-weight: 400;
}

h1 { font-size: clamp(2.1rem, 7vw, 3.8rem); }
h2 { font-size: clamp(2rem, 6vw, 3rem); }

.eyebrow {
  letter-spacing: 3px;
  font-size: 10px;
  font-weight: 700;
  color: var(--pink);
}

.muted { color: #d6b9c6; font-size: 13px; }

.screen {
  min-height: 100svh;
  padding: 40px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.lock-screen, .gift-screen, .loading-screen {
  background:
    radial-gradient(ellipse at 75% 15%, #85566d55, transparent 45%),
    radial-gradient(ellipse at 10% 90%, #bd839044, transparent 45%),
    var(--dark);
}

.lock-content, .gift-content, .loading-content {
  width: 100%;
  max-width: 390px;
  position: relative;
  z-index: 2;
}

.mini-flower {
  font-size: 34px;
  color: var(--pink);
  margin-bottom: 20px;
}

.lock-content h1 { margin: 12px 0; }

.pin-dots {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 34px 0 24px;
}

.pin-dots span {
  width: 12px;
  height: 12px;
  border: 1px solid var(--pink);
  border-radius: 50%;
  transition: .25s;
}

.pin-dots span.filled {
  background: var(--pink);
  box-shadow: 0 0 12px #e8b8c480;
}

.pin-error { color: #ffb4c0; min-height: 18px; font-size: 12px; }

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 270px;
  margin: 0 auto;
}

.keypad button {
  background: #ffffff0d;
  border: 1px solid #ffffff10;
  border-radius: 16px;
  color: white;
  min-height: 64px;
  font-size: 22px;
  transition: .2s;
}

.keypad button:active {
  background: var(--rose);
  transform: scale(.94);
}

.hint {
  margin-top: 32px;
  font-size: 12px;
  color: #c6a5b3;
}

/* Gift */
.gift-content h2 { margin-bottom: 8px; }

.gift-button {
  position: relative;
  display: block;
  width: 210px;
  height: 240px;
  background: none;
  border: 0;
  margin: 55px auto 25px;
  filter: drop-shadow(0 20px 25px #0005);
}

.gift-body {
  position: absolute;
  width: 170px;
  height: 145px;
  background: linear-gradient(135deg, #ffe9e6, #e7b0bb);
  bottom: 20px;
  left: 20px;
  border-radius: 4px 4px 12px 12px;
}

.gift-lid {
  position: absolute;
  width: 190px;
  height: 42px;
  background: #f9d8de;
  left: 10px;
  top: 38px;
  border-radius: 6px;
  z-index: 3;
  transition: transform 1s ease;
}

.gift-ribbon-v {
  position: absolute;
  width: 30px;
  height: 180px;
  background: #bd718b;
  left: 90px;
  top: 38px;
  z-index: 4;
  transition: transform 1s ease;
}

.gift-ribbon-h {
  position: absolute;
  height: 25px;
  width: 170px;
  background: #bd718b;
  left: 20px;
  top: 115px;
  z-index: 2;
}

.gift-bow {
  position: absolute;
  top: -10px;
  left: 73px;
  font-size: 70px;
  color: #f0a6bc;
  z-index: 5;
  transition: transform 1s ease;
}

.gift-caption { color: var(--pink); font-style: italic; }

.gift-button.opened .gift-lid,
.gift-button.opened .gift-bow {
  transform: translateY(-110px) rotate(-14deg);
}

.gift-button.opened .gift-ribbon-v {
  transform: translateY(-35px);
}

/* Loading */
.loading-content h2 { font-style: italic; }

.progress-track {
  height: 5px;
  background: #ffffff25;
  border-radius: 10px;
  margin: 35px 10px 15px;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: var(--pink);
  transition: width .2s;
}

/* Preview */
.preview-screen {
  background: linear-gradient(160deg, #f5e7e3, #d9adbb);
  color: var(--brown);
}

.preview-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 600px;
}

.preview-content .eyebrow { color: #a66f86; }

.script-heading {
  font-style: italic;
  margin: 12px 0;
}

.preview-grid, .photo-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 14px;
}

.preview-grid { margin: 45px 0; }

.polaroid, .gallery-photo {
  margin: 0;
  padding: 9px 9px 25px;
  background: white;
  box-shadow: 0 10px 28px #54364230;
  transform: rotate(-4deg);
}

.polaroid:nth-child(even),
.gallery-photo:nth-child(even) {
  transform: rotate(5deg);
}

.polaroid img, .gallery-photo img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
}

.polaroid figcaption, .gallery-photo figcaption {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: 12px;
  padding-top: 12px;
  text-align: center;
}

.romantic-button {
  padding: 15px 32px;
  background: var(--dark);
  color: white;
  border: 0;
  border-radius: 30px;
  box-shadow: 0 8px 20px #38232f40;
}

/* Main Page */
.main-page {
  background: var(--cream);
  color: var(--brown);
}

.story-hero {
  min-height: 95svh;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 25px;
  background: linear-gradient(170deg, #f5e6e2, #f9f1e9);
}

.story-hero .eyebrow,
.section-heading .eyebrow { color: #ae788c; }

.story-hero h1 { margin: 20px 0; }
.story-hero em { color: #b67d91; }

.story-hero > p:not(.eyebrow) {
  max-width: 320px;
  line-height: 1.9;
}

.scroll-hint {
  margin-top: 70px;
  font-size: 12px;
  letter-spacing: 2px;
}

.story-section {
  padding: 90px 20px;
  max-width: 750px;
  margin: auto;
}

.section-heading {
  text-align: center;
  margin-bottom: 45px;
}

.section-heading h2 { margin: 12px 0; }
.section-heading > p:last-child { line-height: 1.8; }

.video-gallery { display: grid; gap: 28px; }

.video-card {
  background: var(--paper);
  padding: 14px;
  border-radius: 18px;
  box-shadow: 0 8px 30px #63485012;
}

.video-card h3 { font-size: 18px; margin: 5px 0 15px; }

.video-card video {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: contain;
  background: #231820;
  border-radius: 12px;
}

/* Love Letter */
.letter-section { padding-top: 40px; }

.letter-paper {
  background: #fff9ef;
  padding: 55px 27px;
  border: 1px solid #e8d8cc;
  box-shadow: 0 12px 45px #63485018;
  position: relative;
  text-align: center;
}

.letter-decoration {
  font-size: 32px;
  color: var(--rose);
}

.letter-paper h2 {
  margin: 22px 0 35px;
  font-style: italic;
}

#letterContent p {
  font-family: "Playfair Display", serif;
  font-size: 16px;
  line-height: 2.1;
  margin-bottom: 25px;
}

.letter-signature {
  margin-top: 40px;
  font-family: "Playfair Display", serif;
  font-style: italic;
  color: #b0748d;
  font-size: 22px;
}

.photo-gallery { gap: 35px 20px; }

/* Ending */
.ending-section {
  min-height: 100svh;
  background: linear-gradient(160deg, #634252, #38232f);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 70px 30px;
}

.ending-content { max-width: 440px; }
.ending-heart { font-size: 70px; color: var(--pink); }

.ending-content h2 {
  font-style: italic;
  line-height: 1.4;
}

.ending-content > p { line-height: 1.9; }

.ending-line {
  width: 55px;
  height: 1px;
  background: var(--pink);
  margin: 35px auto;
}

.ending-signature {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: 21px;
}

/* Floating Music Button */
.music-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  background: #b77d94;
  color: white;
  border: 1px solid #ffffff60;
  border-radius: 50%;
  z-index: 100;
  font-size: 24px;
  box-shadow: 0 5px 20px #0003;

  /* Main page visibility fix */
.main-page:not(.hidden) {
  display: block;
  min-height: 100vh;
  background: #f8efe8;
}

.story-hero {
  position: relative;
  z-index: 1;
  opacity: 1;
  visibility: visible;
}

.story-hero h1,
.story-hero p,
.story-hero span {
  visibility: visible;
}
}

/* ==========================================
   VIDEO AUTOPLAY - CINEMATIC STYLE
========================================== */

.video-card {
  overflow: hidden;
}

.video-card video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #241820;
  border-radius: 12px;
  pointer-events: none;
}

.video-card video::-webkit-media-controls {
  display: none !important;
}

.video-card h3 {
  font-family: "Playfair Display", serif;
  font-size: 18px;
  margin-bottom: 15px;
}

