/* ============================================================
   Hazal & Cem — Nişan Anı Sayfası
   Quiet luxury / romantic editorial / modern digital experience.
   ============================================================ */

:root {
  --ivory: #F7F3EC;
  --ivory-deep: #F0E9DC;
  --charcoal: #2B2521;
  --taupe: #8C8275;
  --champagne: #B7A17A;
  --champagne-soft: #D9CDB4;
  --champagne-line: rgba(183, 161, 122, 0.4);
  --line: rgba(43, 37, 33, 0.1);

  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-ui: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body {
  min-height: 100svh;
  min-height: 100dvh;
  position: relative;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; display: block; }

/* ============================================================
   Shared atmospheric backdrop
   ============================================================ */

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.atmosphere__glow {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(38% 26% at 84% 10%, rgba(183, 161, 122, 0.22) 0%, rgba(183, 161, 122, 0) 68%),
    radial-gradient(46% 30% at 12% 96%, rgba(183, 161, 122, 0.12) 0%, rgba(183, 161, 122, 0) 70%);
  animation: driftGlow 15s var(--ease) infinite alternate;
}

@keyframes driftGlow {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-1.5%, 1.5%) scale(1.03); }
}

.atmosphere__grain {
  position: absolute;
  inset: 0;
  opacity: 0.045;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.atmosphere__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 85% at 50% 45%, rgba(43,37,33,0) 55%, rgba(43,37,33,0.05) 100%);
}

.botanical {
  position: absolute;
  width: 132px;
  height: 132px;
  color: var(--charcoal);
  opacity: 0.055;
}
.botanical--tr { top: 0; right: 0; }
.botanical--bl { bottom: 0; left: 0; }

.frame-corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border-color: var(--champagne-line);
  border-style: solid;
  border-width: 0;
  opacity: 0.7;
}
.frame-corner--tl {
  top: calc(var(--safe-top) + 16px);
  left: 16px;
  border-top-width: 1px;
  border-left-width: 1px;
}
.frame-corner--br {
  bottom: calc(var(--safe-bottom) + 16px);
  right: 16px;
  border-bottom-width: 1px;
  border-right-width: 1px;
}

/* ============================================================
   Screen / view shell
   ============================================================ */

.screen {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  overflow-x: hidden;
}

.view {
  display: none;
  min-height: 100svh;
  min-height: 100dvh;
}
.view.is-active { display: flex; flex-direction: column; }

/* ---------------- HERO ---------------- */

.view--hero {
  justify-content: space-between;
  align-items: stretch;
  padding: calc(var(--safe-top) + 30px) 26px calc(var(--safe-bottom) + 22px);
  text-align: center;
}

.hero-top { flex: 0 0 auto; }

.hero-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.eyebrow-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.eyebrow-line {
  width: 26px;
  height: 1px;
  background: var(--champagne-line);
  flex: none;
}

.eyebrow {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--taupe);
  white-space: nowrap;
}

.names {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.22em;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1;
  color: var(--charcoal);
}
.names__part {
  font-size: clamp(3rem, 16.5vw, 4.6rem);
  letter-spacing: 0.005em;
}
.names__amp {
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.4rem, 6.5vw, 1.9rem);
  color: var(--champagne);
  transform: translateY(-0.12em) rotate(-4deg);
  display: inline-block;
}

.event-date {
  margin: 20px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.26em;
  color: var(--champagne);
  font-variant-numeric: tabular-nums;
}
.date-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--champagne);
  opacity: 0.8;
}

.hero-message-block {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-message {
  margin: 0;
  max-width: 270px;
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 4.4vw, 1.28rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.56;
  color: var(--charcoal);
  opacity: 0.86;
}

.message-sep {
  display: block;
  width: 34px;
  height: 1px;
  margin-top: 18px;
  background: linear-gradient(90deg, transparent, var(--champagne-line), transparent);
}

.hero-name-field {
  margin-top: 26px;
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-name-field__input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 8px 4px 10px;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 4vw, 1.1rem);
  color: var(--charcoal);
  transition: border-color 0.25s var(--ease);
  border-radius: 0; /* iOS Safari'nin varsayılan input yuvarlatmasını iptal eder */
  -webkit-appearance: none;
}
.hero-name-field__input::placeholder {
  font-style: italic;
  color: var(--taupe);
  opacity: 0.7;
}
.hero-name-field__input:focus {
  outline: none;
  border-bottom-color: var(--champagne);
}

.hero-name-field__hint {
  margin: 9px 0 0;
  font-size: 11px;
  letter-spacing: 0.01em;
  color: var(--taupe);
  text-align: center;
}

.hero-cta {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.hero-hint {
  margin: 16px 0 0;
  font-size: 11.5px;
  letter-spacing: 0.015em;
  color: var(--taupe);
}

.hero-trust {
  margin: 7px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--champagne);
}

.trust-mark {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--champagne);
  flex: none;
}

.signature {
  flex: 0 0 auto;
  margin: 22px 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--taupe);
  opacity: 0.8;
}

/* ---------------- Buttons ---------------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 58px;
  padding: 0 28px;
  width: 100%;
  max-width: 340px;
  border-radius: 5px;
  font-family: var(--font-ui);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), background-color 0.25s var(--ease);
}

.btn--primary {
  background: var(--charcoal);
  color: var(--ivory);
  box-shadow:
    0 14px 26px -10px rgba(43, 37, 33, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.btn--primary:active {
  transform: scale(0.985);
  box-shadow:
    0 8px 16px -8px rgba(43, 37, 33, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.btn--ghost {
  min-height: 50px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--charcoal);
  background: transparent;
}
.btn--ghost:active { transform: scale(0.985); background: rgba(43,37,33,0.04); }

.btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0.9;
  flex: none;
}
.btn--primary .btn__icon { color: var(--champagne-soft); }
.btn--ghost .btn__icon { color: var(--champagne); width: 19px; height: 19px; }

.btn[disabled] { opacity: 0.5; pointer-events: none; }

/* ---------------- SENDING / GRID ---------------- */

.view--sending {
  padding: calc(var(--safe-top) + 22px) 20px calc(var(--safe-bottom) + 20px);
}

.sending-header {
  flex: 0 0 auto;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.sending-eyebrow {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: var(--champagne);
}

.sending-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 6vw, 1.9rem);
  font-weight: 500;
  color: var(--charcoal);
}

.sending-subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--taupe);
}

.progress-track { margin-top: 16px; }

.progress-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--champagne);
}

.progress-bar {
  height: 2px;
  width: 100%;
  background: var(--line);
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  width: 0%;
  background: var(--champagne);
  transition: width 0.4s var(--ease);
}

.grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 18px 0 10px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 3px;
  background: var(--ivory-deep);
  border: 1px solid var(--line);
  box-shadow: 0 6px 14px -10px rgba(43, 37, 33, 0.3);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb__status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ivory);
  background: linear-gradient(0deg, rgba(43,37,33,0.62) 0%, rgba(43,37,33,0) 100%);
}
.thumb__status[data-state="error"] {
  background: linear-gradient(0deg, rgba(120,40,30,0.72) 0%, rgba(120,40,30,0) 100%);
  justify-content: center;
}

.thumb__retry {
  font-size: 11px;
  font-weight: 700;
  color: var(--ivory);
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 4px;
  margin: -4px;
}

.thumb__spinner {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid rgba(247,243,236,0.4);
  border-top-color: var(--ivory);
  animation: spin 0.85s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.sending-footer {
  flex: 0 0 auto;
  padding-top: 14px;
  display: flex;
  justify-content: center;
}

/* ---------------- SUCCESS ---------------- */

.view--success {
  justify-content: center;
  align-items: center;
  padding: calc(var(--safe-top) + 30px) 30px calc(var(--safe-bottom) + 30px);
  text-align: center;
}

.success-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 380px;
}

.success-check {
  color: var(--champagne);
  margin-bottom: 20px;
}
.success-check__mark {
  stroke-dasharray: 28;
  stroke-dashoffset: 28;
  animation: draw 0.55s var(--ease) 0.15s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.success-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.7rem, 7vw, 2.2rem);
  color: var(--charcoal);
}

.success-count {
  margin: 12px 0 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--champagne);
}

.success-content .message-sep { margin: 20px 0; }

.success-message {
  margin: 0 0 30px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 4vw, 1.15rem);
  line-height: 1.55;
  color: var(--charcoal);
  opacity: 0.82;
}

/* ---------------- Reveal-on-load intro ---------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(8px);
  animation: reveal 0.55s var(--ease) forwards;
  animation-delay: var(--d, 0ms);
}

@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; animation: none; }
  .success-check__mark { stroke-dashoffset: 0; animation: none; }
  .btn, .progress-bar__fill { transition: none; }
  .atmosphere__glow { animation: none; }
}

/* ---------------- Small screens (very short viewports) ---------------- */

@media (max-height: 700px) {
  .names__part { font-size: clamp(2.5rem, 14vw, 3.6rem); }
  .hero-message-block { margin-top: 20px; }
  .hero-name-field { margin-top: 18px; }
  .hero-cta { margin-top: 22px; }
  .signature { margin-top: 14px; }
}

@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  .view--sending { max-width: 720px; margin: 0 auto; width: 100%; }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .botanical { width: 180px; height: 180px; }
}
