/* =========================================================
   INTRO SCENE — Wooden desk with vintage objects
   ========================================================= */

#intro-scene {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1.5s var(--ease-gentle), visibility 1.5s;
  overflow: hidden;
}

#intro-scene.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Wooden desk surface */
.desk {
  position: relative;
  width: 100%;
  height: 100%;
  background:
    /* Wood grain lines */
    repeating-linear-gradient(
      88deg,
      transparent,
      transparent 40px,
      rgba(0, 0, 0, 0.03) 40px,
      rgba(0, 0, 0, 0.03) 41px
    ),
    repeating-linear-gradient(
      92deg,
      transparent,
      transparent 80px,
      rgba(0, 0, 0, 0.02) 80px,
      rgba(0, 0, 0, 0.02) 82px
    ),
    linear-gradient(175deg, var(--wood-light) 0%, var(--wood) 40%, var(--wood-dark) 100%);
  overflow: hidden;
}

/* Soft vignette */
.desk::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(20, 12, 6, 0.4) 100%);
  pointer-events: none;
}

/* Warm ambient light */
.desk::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 30%;
  width: 50%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(255, 220, 180, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

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

/* =========================================================
   EDITABLE: Closed notebook on desk (click to open)
   ========================================================= */
.closed-notebook {
  position: relative;
  width: 280px;
  height: 380px;
  cursor: pointer;
  z-index: 20;
  transform: perspective(1200px) rotateX(8deg);
  transition: transform 0.6s var(--ease-gentle), box-shadow 0.6s;
  animation: notebook-breathe 4s ease-in-out infinite;
}

.closed-notebook:hover {
  transform: perspective(1200px) rotateX(5deg) scale(1.02);
}

.closed-notebook:active {
  transform: perspective(1200px) rotateX(10deg) scale(0.98);
}

@keyframes notebook-breathe {
  0%, 100% { transform: perspective(1200px) rotateX(8deg) translateY(0); }
  50% { transform: perspective(1200px) rotateX(8deg) translateY(-3px); }
}

/* Leather cover */
.notebook-cover {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, var(--leather-light) 0%, transparent 50%),
    linear-gradient(160deg, var(--leather) 0%, var(--leather-dark) 100%);
  border-radius: 4px 12px 12px 4px;
  box-shadow:
    4px 8px 24px var(--shadow-deep),
    inset 2px 0 8px rgba(255, 255, 255, 0.08),
    inset -2px 0 8px rgba(0, 0, 0, 0.2);
}

/* Leather texture overlay */
.notebook-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 128 128' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  border-radius: inherit;
}

/* Spine */
.notebook-cover::after {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 18px;
  background: linear-gradient(90deg, var(--leather-dark), var(--leather));
  border-radius: 4px 0 0 4px;
  box-shadow: inset -2px 0 4px rgba(0, 0, 0, 0.3);
}

/* EDITABLE: Title on notebook cover */
.notebook-title {
  position: absolute;
  top: 65%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-script);
  font-size: 1.8rem;
  color: var(--gold-muted);
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.05em;
  line-height: 1.4;
  width: 70%;
}

/* Elastic band */
.notebook-elastic {
  position: absolute;
  right: -6px;
  top: 30%;
  bottom: 30%;
  width: 8px;
  background: var(--leather-dark);
  border-radius: 4px;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.2);
}

/* Click hint */
.open-hint {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-hand);
  font-size: 1.1rem;
  color: rgba(255, 240, 220, 0.7);
  white-space: nowrap;
  animation: hint-fade 3s ease-in-out infinite;
}

@keyframes hint-fade {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* =========================================================
   Desk decorations
   ========================================================= */

/* Coffee mug */
.desk-coffee {
  position: absolute;
  bottom: 18%;
  left: 12%;
  width: 70px;
  height: 80px;
  z-index: 15;
}

.mug-body {
  width: 60px;
  height: 55px;
  background: linear-gradient(135deg, #e8e0d4 0%, #d4ccc0 100%);
  border-radius: 4px 4px 8px 8px;
  box-shadow: 2px 4px 8px var(--shadow-deep);
  position: relative;
}

.mug-body::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  height: 20px;
  background: var(--coffee);
  border-radius: 2px;
  opacity: 0.8;
}

.mug-handle {
  position: absolute;
  right: -14px;
  top: 12px;
  width: 18px;
  height: 28px;
  border: 4px solid #d4ccc0;
  border-left: none;
  border-radius: 0 12px 12px 0;
}

/* Steam */
.mug-steam {
  position: absolute;
  top: -20px;
  left: 20px;
  width: 30px;
  height: 30px;
}

.mug-steam span {
  position: absolute;
  width: 2px;
  height: 15px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  animation: steam-rise 3s ease-in-out infinite;
}

.mug-steam span:nth-child(1) { left: 5px; animation-delay: 0s; }
.mug-steam span:nth-child(2) { left: 15px; animation-delay: 1s; }
.mug-steam span:nth-child(3) { left: 25px; animation-delay: 2s; }

@keyframes steam-rise {
  0% { opacity: 0; transform: translateY(0) scaleX(1); }
  50% { opacity: 0.6; transform: translateY(-10px) scaleX(1.2); }
  100% { opacity: 0; transform: translateY(-20px) scaleX(0.8); }
}

/* Fountain pen */
.desk-pen {
  position: absolute;
  bottom: 22%;
  right: 18%;
  width: 120px;
  height: 12px;
  transform: rotate(-25deg);
  z-index: 15;
}

.pen-body {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #1a1a2e 0%, #2d2d4a 60%, var(--gold) 60%, var(--gold-muted) 100%);
  border-radius: 2px 6px 6px 2px;
  box-shadow: 1px 2px 4px var(--shadow-deep);
}

.pen-nib {
  position: absolute;
  left: -8px;
  top: 2px;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-right: 10px solid var(--gold-muted);
}

/* Vintage camera */
.desk-camera {
  position: absolute;
  top: 15%;
  right: 10%;
  width: 90px;
  height: 70px;
  z-index: 15;
  transform: rotate(8deg);
}

.camera-body {
  width: 80px;
  height: 55px;
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
  border-radius: 6px;
  box-shadow: 2px 4px 10px var(--shadow-deep);
  position: relative;
}

.camera-lens {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  background: radial-gradient(circle, #444 30%, #222 60%, #111 100%);
  border-radius: 50%;
  border: 3px solid #333;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5);
}

.camera-flash {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 16px;
  height: 10px;
  background: #f0e6d3;
  border-radius: 2px;
  opacity: 0.8;
}

/* Letters & postcards */
.desk-letter {
  position: absolute;
  width: 100px;
  height: 70px;
  background: var(--paper);
  box-shadow: 1px 2px 6px var(--shadow-soft);
  z-index: 12;
}

.desk-letter--1 {
  top: 20%;
  left: 8%;
  transform: rotate(-12deg);
}

.desk-letter--2 {
  top: 25%;
  left: 14%;
  transform: rotate(5deg);
  background: var(--paper-aged);
  z-index: 11;
}

.desk-postcard {
  position: absolute;
  bottom: 15%;
  right: 8%;
  width: 110px;
  height: 75px;
  background: linear-gradient(135deg, #d4e8f0 0%, #b8d4e0 100%);
  transform: rotate(6deg);
  box-shadow: 2px 3px 8px var(--shadow-soft);
  z-index: 14;
}

.desk-postcard::after {
  content: '✉';
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 1.2rem;
  opacity: 0.4;
}

/* Dried flowers on desk */
.desk-flowers {
  position: absolute;
  top: 12%;
  left: 20%;
  z-index: 16;
  transform: rotate(-15deg);
}

.desk-flowers .dried-stem {
  width: 3px;
  height: 60px;
  background: var(--sage);
  margin: 0 auto;
  opacity: 0.6;
}

.desk-flowers .dried-bloom {
  font-size: 1.5rem;
  text-align: center;
  filter: saturate(0.5);
  margin-top: -5px;
}

/* Small romantic decoration — heart locket */
.desk-locket {
  position: absolute;
  bottom: 40%;
  left: 25%;
  font-size: 1.7rem;
  opacity: 1;
  transform: rotate(20deg);
  z-index: 14;
  animation: locket-shine 3s ease-in-out infinite;
}

@keyframes locket-shine {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

/* =========================================================
   Falling flower petals
   ========================================================= */
.petals-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 50;
}

.petal {
  position: absolute;
  top: -30px;
  width: 12px;
  height: 14px;
  background: var(--rose-soft);
  border-radius: 50% 0 50% 0;
  opacity: 0.7;
  animation: petal-fall linear infinite;
  filter: blur(0.3px);
}

.petal:nth-child(odd) {
  background: #f0c4c4;
  border-radius: 0 50% 0 50%;
}

@keyframes petal-fall {
  0% {
    transform: translateY(-30px) rotate(0deg) translateX(0);
    opacity: 0;
  }
  10% { opacity: 0.7; }
  90% { opacity: 0.5; }
  100% {
    transform: translateY(110vh) rotate(720deg) translateX(80px);
    opacity: 0;
  }
}
