:root {
  --cream: #f1efe9;
  --cream-deep: #e8e2d6;
  --gold: #a8926e;
  --gold-deep: #6c5a3a;
  --ink: #5c4718;
  --ink-soft: rgba(107, 86, 38, 0.7);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --dissolve-ms: 600ms;
}

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

html, body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--cream);
  color: var(--ink);
  font-family: "Cormorant Garamond", Georgia, serif;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; }
a { color: inherit; }

/* ===== Kapı intro ===== */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--cream);
  transition: opacity var(--dissolve-ms) ease, visibility var(--dissolve-ms);
}

.intro.is-dissolving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-stage {
  position: relative;
  width: min(100vw, 28rem);
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--cream);
}

.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.1);
  transform-origin: center center;
  background: var(--cream) url("assets/kemer/intro-poster.jpg") center / cover no-repeat;
}

.intro-tap {
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: calc(8vh + var(--safe-bottom));
  gap: 0.35rem;
  -webkit-tap-highlight-color: transparent;
  color: var(--gold);
}

.intro-tap.is-hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.intro-tap-label {
  font-family: "Cormorant SC", "Cormorant Garamond", serif;
  font-size: 0.82rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-deep);
  background: rgba(241, 239, 233, 0.72);
  border: 1px solid rgba(168, 146, 110, 0.35);
  padding: 0.7rem 1.25rem;
  backdrop-filter: blur(4px);
}

.intro-tap-hint {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.7;
  animation: tap-hint 2s ease-in-out infinite;
}

@keyframes tap-hint {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  .intro-tap-hint { animation: none; }
  .intro-video { transform: none; }
}

/* ===== Page ===== */
.page {
  position: relative;
  min-height: 100dvh;
  background: var(--cream);
}

.page[hidden] { display: none !important; }

.page.is-shown {
  animation: page-in var(--dissolve-ms) ease;
}

@keyframes page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.invite {
  max-width: 28rem;
  margin: 0 auto;
  padding-bottom: calc(2rem + var(--safe-bottom));
}

.music-toggle {
  position: fixed;
  top: calc(0.85rem + var(--safe-top));
  right: 0.85rem;
  z-index: 50;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 50%;
  border: 1px solid rgba(168, 146, 110, 0.45);
  background: rgba(241, 239, 233, 0.92);
  color: var(--gold-deep);
  backdrop-filter: blur(6px);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: 0 4px 14px rgba(28, 25, 23, 0.08);
}

.music-toggle .music-icon {
  width: 1.15rem;
  height: 1.15rem;
  grid-area: 1 / 1;
}

.music-toggle .music-icon-on { display: none; }
.music-toggle .music-icon-off { display: block; opacity: 0.75; }

.music-toggle[hidden] { display: none !important; }

.music-toggle.playing {
  border-color: var(--gold);
  color: var(--ink);
  background: rgba(250, 248, 243, 0.96);
}

.music-toggle.playing .music-icon-on { display: block; }
.music-toggle.playing .music-icon-off { display: none; }

/* ===== Davetiye çerçevesi ===== */
.frame-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 1080 / 1920;
  max-height: none;
  overflow: hidden;
  background: var(--cream);
}

.frame-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.frame-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18% 14% 26%;
}

.photo-wrap {
  width: clamp(5.5rem, 28%, 8.5rem);
  aspect-ratio: 1;
  margin: 0 auto 4%;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid rgba(168, 146, 110, 0.55);
  box-shadow: 0 0 0 5px rgba(241, 239, 233, 0.85);
  flex-shrink: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.photo-wrap:hover,
.photo-wrap:focus-visible {
  transform: scale(1.04);
  box-shadow:
    0 0 0 5px rgba(241, 239, 233, 0.95),
    0 12px 28px rgba(28, 25, 23, 0.16);
}

.photo-wrap:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
}

.names {
  margin: 0 0 0.35rem;
  line-height: 1.1;
}

.names .name {
  display: block;
  font-family: "Great Vibes", cursive;
  font-weight: 400;
  font-size: clamp(1.5rem, 6.6vw, 2.15rem);
  color: var(--gold-deep);
}

.names .amp {
  display: block;
  font-style: italic;
  font-size: 0.85rem;
  color: var(--gold);
  margin: 0.08rem 0;
}

.invite-line {
  margin: 0 0 0.7rem;
  font-size: clamp(0.82rem, 3.25vw, 0.95rem);
  font-style: italic;
  color: var(--ink-soft);
}

.families {
  margin: 0 0 0.75rem;
  font-size: clamp(0.7rem, 2.9vw, 0.83rem);
  color: var(--ink-soft);
  line-height: 1.35;
}

.families p { margin: 0; }
.families .dot {
  display: block;
  width: 3px;
  height: 3px;
  margin: 0.4rem auto;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.7;
}

.event {
  margin-top: auto;
  margin-bottom: 0;
  padding-bottom: 0.5rem;
  position: relative;
  top: -9%;
  /* Kabartma üstünde okunurluk: koyu mürekkep + ince halo */
  --event-ink: #2f2410;
  --event-ink-mid: #3d3016;
  --event-gold: #5a4728;
  text-shadow:
    0 0 8px rgba(241, 239, 233, 0.9),
    0 1px 0 rgba(241, 239, 233, 0.75);
}

.event-label {
  margin: 0 0 0.4rem;
  font-family: "Cormorant SC", serif;
  letter-spacing: 0.38em;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--event-gold);
}

.event-date {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 0 0 0.35rem;
}

.event-date .month,
.event-date .year {
  font-family: "Cormorant SC", serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--event-ink-mid);
}

.event-date .day {
  font-size: clamp(1.6rem, 7vw, 2.1rem);
  font-weight: 600;
  line-height: 1;
  color: var(--event-ink);
  border-left: 1px solid rgba(47, 36, 16, 0.28);
  border-right: 1px solid rgba(47, 36, 16, 0.28);
  padding: 0 0.55rem;
}

.event-time,
.event-venue,
.event-address {
  margin: 0 0 0.25rem;
  color: var(--event-ink-mid);
}

.event-time {
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.event-venue {
  margin-top: 0.55rem;
  font-family: "Cormorant SC", serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--event-ink);
}

.event-address {
  font-size: 0.8rem;
  line-height: 1.45;
  margin-bottom: 0.55rem;
  font-weight: 500;
  color: var(--event-ink-mid);
}

.map-link {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  font-weight: 500;
  color: var(--event-gold);
  border-bottom: 1px solid rgba(90, 71, 40, 0.45);
  padding-bottom: 0.1rem;
}

/* ===== Panels ===== */
.panel {
  margin: 1.25rem 1rem;
  padding: 1.35rem 1.1rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(168, 146, 110, 0.18);
  box-shadow: 0 12px 28px rgba(108, 90, 58, 0.1);
}

.panel h2 {
  margin: 0 0 0.9rem;
  font-family: "Cormorant SC", serif;
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.hint {
  margin: 0.7rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
}

.countdown div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.6rem 0.15rem;
  background: var(--cream);
  border: 1px solid rgba(168, 146, 110, 0.18);
}

.countdown span {
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.countdown small {
  font-family: "Cormorant SC", serif;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0.6rem 1.4rem;
  border: 1px solid rgba(168, 146, 110, 0.45);
  background: linear-gradient(180deg, #c4ae85, var(--gold-deep));
  color: #faf7f0;
  text-decoration: none;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: "Cormorant SC", serif;
  font-size: 0.72rem;
  cursor: pointer;
}

.btn-ghost {
  background: transparent;
  color: var(--gold-deep);
}

.rsvp {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.9rem;
  text-align: left;
}

.rsvp input[type="text"],
.rsvp input[type="number"],
.rsvp textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(168, 146, 110, 0.25);
  background: #fffcf7;
  color: var(--ink);
}

.rsvp input:focus,
.rsvp textarea:focus {
  outline: 1px solid var(--gold);
  border-color: var(--gold);
}

.choice {
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.choice label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.rsvp .btn { width: 100%; }

.status {
  margin: 0.2rem 0 0;
  min-height: 1.2rem;
  font-size: 0.85rem;
  color: var(--gold-deep);
  text-align: center;
}

.status.error { color: #8b3a3a; }

.footer {
  text-align: center;
  padding: 1.25rem 1rem 0.5rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.footer-names {
  font-family: "Great Vibes", cursive;
  font-size: 1.4rem;
  color: var(--gold-deep);
  margin: 0 0 0.3rem;
}

.footer-note {
  font-style: italic;
  margin: 0.3rem 0 0;
}

/* Reveals after door opens */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.frame-scene.is-open .reveal {
  opacity: 1;
  transform: none;
}

.frame-scene.is-open .reveal:nth-child(1) { transition-delay: 0.1s; }
.frame-scene.is-open .reveal:nth-child(2) { transition-delay: 0.22s; }
.frame-scene.is-open .reveal:nth-child(3) { transition-delay: 0.34s; }
.frame-scene.is-open .reveal:nth-child(4) { transition-delay: 0.46s; }
.frame-scene.is-open .reveal:nth-child(5) { transition-delay: 0.58s; }

.reveal-section {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal-section.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-section, .page.is-shown {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }
}

@media (min-width: 640px) {
  body {
    background: #1a1610;
  }
  .intro { background: #1a1610; }
  .intro-stage {
    height: min(100dvh, 56rem);
    border-radius: 1rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  }
  .invite {
    margin: 1.5rem auto;
    background: var(--cream);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  }
}

/* ===== Fotoğraf büyütme ===== */
.photo-zoom {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(26, 22, 16, 0.72);
  backdrop-filter: blur(4px);
  animation: photo-zoom-in 0.22s ease;
}

.photo-zoom[hidden] { display: none !important; }

.photo-zoom img {
  width: min(86vw, 22rem);
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  transform: scale(1.02);
}

.photo-zoom-close {
  position: absolute;
  top: calc(0.75rem + env(safe-area-inset-top, 0px));
  right: 0.9rem;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 50%;
  background: rgba(250, 248, 243, 0.18);
  color: #faf7f0;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

@keyframes photo-zoom-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .photo-zoom { animation: none; }
  .photo-wrap { transition: none; }
}
