:root {
  --pink: #ff9ebb;
  --pink-dark: #e8618f;
  --purple: #b28dff;
  --cream: #fff5f8;
  --text: #5a3d4d;
  --shadow: rgba(232, 97, 143, 0.25);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: 'Segoe UI', 'Poppins', sans-serif;
  background: linear-gradient(180deg, #fff0f5 0%, #ffe4ee 40%, #f6e6ff 100%);
  color: var(--text);
}

/* GİRİŞ KİLİDİ */
#gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #ffd3e2 0%, #ffb8d1 45%, #d9b8ff 100%);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#gate.unlocked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  border-radius: 28px;
  padding: 44px 34px;
  max-width: 360px;
  width: 88%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(200, 60, 120, 0.35);
}

.gate-heart {
  font-size: 2.4rem;
  margin: 0 0 6px;
  animation: beat 1.2s infinite;
}

.gate-card h2 {
  font-family: 'Segoe UI', sans-serif;
  font-size: 1.25rem;
  color: var(--pink-dark);
  margin: 0 0 8px;
}

.gate-hint {
  font-size: 0.8rem;
  color: var(--text);
  opacity: 0.7;
  margin: 0 0 22px;
}

#gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#gate-input {
  padding: 12px 16px;
  border-radius: 14px;
  border: 2px solid #ffcfe0;
  font-size: 1rem;
  text-align: center;
  outline: none;
  background: #fff;
  color: var(--text);
}

#gate-input:focus { border-color: var(--pink-dark); }

#gate-form button {
  padding: 12px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--pink-dark), var(--purple));
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
}

.gate-error {
  margin: 14px 0 0;
  font-size: 0.85rem;
  color: #d1266b;
  opacity: 0;
  height: 0;
  transition: opacity 0.25s ease;
}

.gate-error.show { opacity: 1; height: auto; }

.gate-card.shake { animation: shake 0.4s; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

#hearts-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  pointer-events: none;
}

section {
  padding: 80px 20px;
  max-width: 900px;
  margin: 0 auto;
}

/* SCROLL REVEAL */
.reveal {
  opacity: 0;
  transform: translateY(70px);
  transition: opacity 0.9s cubic-bezier(.2,.7,.3,1), transform 0.9s cubic-bezier(.2,.7,.3,1);
  will-change: opacity, transform;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

h1, h2 {
  font-family: 'Brush Script MT', cursive;
  text-align: center;
}

h2 {
  font-size: 2.2rem;
  color: var(--pink-dark);
  margin-bottom: 40px;
}

/* HERO */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.eyebrow {
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--purple);
  margin-bottom: 10px;
}

.hero h1 {
  font-size: 4.5rem;
  margin: 0;
  color: var(--pink-dark);
  text-shadow: 0 4px 20px var(--shadow);
}

.heart {
  color: #ff4d7d;
  display: inline-block;
  animation: beat 1.2s infinite;
}

@keyframes beat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.2); }
  40% { transform: scale(1); }
}

.subtitle {
  font-size: 1.3rem;
  color: var(--text);
  margin-top: 10px;
  font-style: italic;
}

.scroll-hint {
  display: inline-block;
  margin-top: 50px;
  color: var(--pink-dark);
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.7;
  animation: bob 2s infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* COUNTERS */
.counters {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
}

.counter-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  border-radius: 24px;
  padding: 30px 25px;
  box-shadow: 0 10px 30px var(--shadow);
  text-align: center;
  flex: 1 1 320px;
  max-width: 380px;
}

.counter-card h2 {
  font-size: 1.4rem;
  margin-bottom: 20px;
  font-family: inherit;
}

.counter {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.time-box {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  border-radius: 14px;
  padding: 12px 8px;
  min-width: 60px;
}

.time-box span {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
}

.time-box small {
  font-size: 0.65rem;
  text-transform: uppercase;
  opacity: 0.85;
}

.counter-date {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--pink-dark);
  opacity: 0.8;
}

/* MESSAGE */
.letter {
  background: rgba(255, 255, 255, 0.65);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 10px 30px var(--shadow);
  line-height: 1.8;
  font-size: 1.05rem;
}

.letter .signature {
  text-align: right;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--pink-dark);
  margin-top: 20px;
}

/* STICKY MUSIC WIDGET */
.music-widget {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: calc(100vw - 32px);
}

.music-toggle-btn {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  background: transparent;
  box-shadow: 0 8px 22px var(--shadow);
  flex-shrink: 0;
  z-index: 2;
}

.note-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
  z-index: 2;
}

.disc {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at center, #2b2b2b 0%, #2b2b2b 20%, var(--pink-dark) 21%, var(--purple) 100%);
  position: relative;
  animation: spin 6s linear infinite paused;
}

.disc.playing { animation-play-state: running; }

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

.disc-hole {
  position: absolute;
  top: 50%; left: 50%;
  width: 12px; height: 12px;
  background: #fff5f8;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.music-panel {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-radius: 20px 20px 20px 10px;
  padding: 18px 18px 26px;
  margin-bottom: -14px;
  box-shadow: 0 10px 30px var(--shadow);
  width: min(260px, calc(100vw - 32px));
  transform-origin: bottom left;
  transform: scale(0.85) translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.music-panel.open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.song-title {
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--pink-dark);
  font-size: 0.9rem;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

#play-btn {
  background: var(--pink-dark);
  color: #fff;
  border: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  flex-shrink: 0;
}

input[type="range"] {
  flex: 1;
  accent-color: var(--pink-dark);
}

#time-display {
  font-size: 0.7rem;
  white-space: nowrap;
  color: var(--text);
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.volume-row input { flex: 1; }

/* GALLERY */
.gallery-hint {
  text-align: center;
  margin-top: -24px;
  margin-bottom: 40px;
  font-size: 0.85rem;
  color: var(--pink-dark);
  opacity: 0.75;
}

.gallery-grid {
  display: flex;
  flex-direction: column;
  scroll-snap-type: y proximity;
}

.gallery-item {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  padding: 60px 10px;
}

.gallery-item .frame {
  position: relative;
  background: #fff;
  padding: 18px 18px 70px;
  border-radius: 8px;
  box-shadow: 0 20px 45px var(--shadow);
  width: min(420px, 88vw);
  cursor: pointer;
  transform: perspective(900px) rotate(var(--tilt, 0deg));
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.gallery-item:nth-child(odd) .frame { --tilt: -4deg; }
.gallery-item:nth-child(even) .frame { --tilt: 4deg; }

.gallery-item .frame:hover {
  transform: perspective(900px) rotate(0deg) scale(1.04);
  box-shadow: 0 26px 55px var(--shadow);
}

.gallery-item .frame::before,
.gallery-item .frame::after {
  content: '';
  position: absolute;
  width: 110px;
  height: 110px;
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
  opacity: 0.9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath d='M10 110 C 30 80, 20 40, 60 10' stroke='%23e8618f' stroke-width='2' fill='none' opacity='0.55'/%3E%3Cellipse cx='25' cy='90' rx='10' ry='5' fill='%23ff9ebb' opacity='0.65' transform='rotate(-30 25 90)'/%3E%3Cellipse cx='35' cy='65' rx='9' ry='5' fill='%23b28dff' opacity='0.55' transform='rotate(-10 35 65)'/%3E%3Cellipse cx='45' cy='40' rx='8' ry='4' fill='%23ff9ebb' opacity='0.6' transform='rotate(20 45 40)'/%3E%3Cellipse cx='55' cy='20' rx='7' ry='4' fill='%23b28dff' opacity='0.55' transform='rotate(40 55 20)'/%3E%3C/svg%3E");
}

.gallery-item .frame::before {
  top: -30px;
  left: -30px;
}

.gallery-item .frame::after {
  bottom: -30px;
  right: -30px;
  transform: rotate(180deg);
}

.gallery-item .media {
  position: relative;
  line-height: 0;
  border-radius: 4px;
  overflow: hidden;
  background: linear-gradient(135deg, #ffd6e6, #e3d3ff);
}

/* Görsel oranına göre otomatik boyutlanır; yatay/dikey fark etmeksizin
   kırpma yapılmadan tam görünür. */
.gallery-item img,
.gallery-item video {
  display: block;
  width: 100%;
  height: auto;
}

.gallery-item .placeholder-label {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  font-size: 0.85rem;
  color: var(--pink-dark);
}

/* Görsel yoksa (placeholder), gösterecek gerçek görsel olmadığından
   sabit bir kutu boyutu veriyoruz. */
.gallery-item.placeholder .media {
  aspect-ratio: 4/5;
}

.gallery-item.placeholder .media img { display: none; }
.gallery-item.placeholder .placeholder-label { display: flex; }

.gallery-item .caption {
  margin: 16px 0 0;
  padding: 4px 10px;
  font-family: 'Brush Script MT', cursive;
  font-size: 1.3rem;
  text-align: center;
  color: var(--text);
  outline: none;
  border-bottom: 1px dashed transparent;
}

.gallery-item .caption:hover,
.gallery-item .caption:focus {
  border-bottom-color: var(--pink);
}

.gallery-item .caption:empty {
  margin: 8px 0 0;
  min-height: 1px;
}

.floating-heart {
  position: fixed;
  z-index: 500;
  pointer-events: none;
  font-size: 1.4rem;
  animation: float-up 1.1s ease-out forwards;
}

@keyframes float-up {
  0% { transform: translateY(0) scale(0.6); opacity: 1; }
  100% { transform: translateY(-120px) scale(1.2); opacity: 0; }
}

/* FOOTER */
footer {
  text-align: center;
  padding: 30px;
  font-size: 0.8rem;
  color: var(--text);
  opacity: 0.6;
}

@media (max-width: 480px) {
  .hero h1 { font-size: 3rem; }
  .time-box { min-width: 50px; padding: 10px 6px; }

  .gallery-item .frame::before,
  .gallery-item .frame::after {
    width: 70px;
    height: 70px;
  }

  .gallery-item .frame::before { top: -14px; left: -14px; }
  .gallery-item .frame::after { bottom: -14px; right: -14px; }
}
