/* ============================================
   MOMENTORI LETTER BOX
   Cinematic Anonymous Feedback Experience
   ============================================ */

:root {
  --gold: #D4AF37;
  --gold-soft: #E8C76B;
  --gold-dim: #8B7028;
  --cream: #F8EFD8;
  --paper: #F4E8C8;
  --paper-shadow: #C8B98A;
  --ink: #2A1F0F;
  --ink-soft: #4A3A24;
  --night: #1A1108;
  --warm-glow: #FFD27A;
  --error: #C25450;

  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'DM Sans', sans-serif;
  --font-hand: 'Caveat', cursive;
  --font-script: 'Kalam', cursive;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--ink);
  background: #0A0510;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  border: none;
  outline: none;
}

/* ============================================
   PRELOADER
   ============================================ */
.preloader {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #1F140D 0%, #0A0510 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.8s var(--ease);
}

.preloader.fade-out { opacity: 0; pointer-events: none; }
.preloader-content { text-align: center; }

.preloader-symbol {
  margin-bottom: 1.5rem;
  animation: gentle-pulse 2s ease-in-out infinite;
}

.preloader-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.7;
}

@keyframes gentle-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* ============================================
   SCENES
   ============================================ */
.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s var(--ease);
  overflow: hidden;
}

.scene.active {
  opacity: 1;
  pointer-events: auto;
}

.scene-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  animation: bg-drift 30s ease-in-out infinite alternate;
}

/* On Scene 4 (flight), shift the postbox-scene image to keep the postbox visible on narrow screens */
.scene-flight .bg-image,
.scene-success .bg-image {
  object-position: 30% center;
}

/* Disable drift on flight/success scenes — keep postbox fixed for plane animation */
.scene-flight .bg-image,
.scene-success .bg-image {
  animation: none;
}

@keyframes bg-drift {
  0% { transform: scale(1.02) translateX(-0.5%); }
  100% { transform: scale(1.05) translateX(0.5%); }
}

.scene-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.scene-overlay-day {
  background: linear-gradient(180deg,
    rgba(255, 220, 150, 0.08) 0%,
    rgba(0, 0, 0, 0.15) 50%,
    rgba(0, 0, 0, 0.35) 100%);
}

.scene-overlay-warm {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255, 210, 122, 0.18) 0%, transparent 50%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.25) 100%);
}

.scene-overlay-dusk {
  background: linear-gradient(180deg,
    rgba(80, 30, 60, 0.15) 0%,
    rgba(120, 60, 40, 0.1) 50%,
    rgba(20, 10, 25, 0.4) 100%);
}

.scene-overlay-night {
  background: linear-gradient(180deg,
    rgba(10, 5, 20, 0.65) 0%,
    rgba(20, 10, 30, 0.75) 100%);
}

.scene-content {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* ============================================
   FOREGROUND ELEMENTS
   ============================================ */
.fg-tree {
  position: absolute;
  z-index: 2;
  bottom: -5%;
  width: auto;
  height: 110%;
  max-height: 110vh;
  pointer-events: none;
  transform-origin: bottom center;
  animation: tree-sway 8s ease-in-out infinite;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.fg-tree-left {
  left: -10%;
}

.fg-tree-right {
  right: -10%;
  transform: scaleX(-1);
  animation: tree-sway-r 8s ease-in-out infinite;
}

@keyframes tree-sway {
  0%, 100% { transform: rotate(-1.5deg); }
  50% { transform: rotate(1.5deg); }
}

@keyframes tree-sway-r {
  0%, 100% { transform: scaleX(-1) rotate(-1.5deg); }
  50% { transform: scaleX(-1) rotate(1.5deg); }
}

.lottie-leaves {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.7;
}

.lottie-birds {
  position: absolute;
  top: 5%;
  left: 10%;
  width: 40%;
  height: 30%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.8;
}

@media (max-width: 800px) {
  .fg-tree { display: none; }
}

/* ============================================
   SCENE 1 & 2 & 6: GATE PLAQUE
   ============================================ */
.village-gate {
  position: relative;
  max-width: 560px;
  width: 100%;
  z-index: 5;
  animation: gate-rise 1.4s var(--ease-out) 0.3s backwards;
}

@keyframes gate-rise {
  0% { opacity: 0; transform: translateY(40px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.gate-plaque {
  background:
    url('../assets/objects/parchment.jpg') center/cover,
    linear-gradient(180deg, rgba(244, 232, 200, 0.97) 0%, rgba(232, 215, 175, 0.97) 100%);
  background-blend-mode: multiply;
  padding: 3.5rem 3rem 3rem;
  border-radius: 4px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 10px 30px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(212, 175, 55, 0.4),
    inset 0 0 80px rgba(139, 112, 40, 0.15);
  position: relative;
}

.gate-plaque::before,
.gate-plaque::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  border: 1px solid var(--gold-dim);
  opacity: 0.7;
}

.gate-plaque::before {
  top: 12px; left: 12px;
  border-right: none;
  border-bottom: none;
}

.gate-plaque::after {
  bottom: 12px; right: 12px;
  border-left: none;
  border-top: none;
}

.gate-ornament {
  text-align: center;
  font-size: 1.4rem;
  color: var(--gold-dim);
  margin-bottom: 0.5rem;
  letter-spacing: 0.3em;
}

.gate-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  text-align: center;
  color: var(--ink);
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.gate-subtitle {
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.gate-divider {
  width: 60px;
  height: 1px;
  background: var(--gold-dim);
  margin: 0 auto 1.75rem;
  position: relative;
}

.gate-divider::before,
.gate-divider::after {
  content: '◆';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 6px;
  color: var(--gold-dim);
}

.gate-divider::before { left: -16px; }
.gate-divider::after { right: -16px; }

.trust-statement {
  text-align: center;
  margin-bottom: 1.75rem;
  padding: 0.5rem 0.25rem;
}

.trust-statement p {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.trust-statement p:first-child {
  font-size: 1.08rem;
  color: var(--ink);
  font-weight: 500;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.gate-label {
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  text-transform: uppercase;
  text-align: center;
}

.gate-input {
  background: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid var(--gold-dim);
  padding: 0.9rem 1rem;
  font-size: 1.1rem;
  font-family: var(--font-body);
  letter-spacing: 0.15em;
  text-align: center;
  color: var(--ink);
  transition: all 0.3s var(--ease);
}

.gate-input:focus {
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: var(--gold);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.gate-hint {
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-align: center;
  font-style: italic;
  margin-top: 0.25rem;
  opacity: 0.8;
  line-height: 1.5;
}

.gate-button {
  margin-top: 0.5rem;
  padding: 0.95rem 2rem;
  background: var(--ink);
  color: var(--cream);
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}

.gate-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s var(--ease);
}

.gate-button:hover {
  background: var(--ink-soft);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

.gate-button:hover::before { transform: translateX(100%); }

.gate-error {
  color: var(--error);
  font-size: 0.85rem;
  text-align: center;
  min-height: 1.2em;
  font-style: italic;
}

.check-reply-link {
  display: block;
  text-align: center;
  margin-top: 1.5rem;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 0.92rem;
  text-decoration: none;
  font-style: italic;
  transition: color 0.3s var(--ease);
}

.check-reply-link:hover { color: var(--gold-dim); }

/* ============================================
   SCENE 2: MODE TOGGLE (New vs Returning)
   ============================================ */
.code-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 3px;
  padding: 4px;
  margin-bottom: 1.5rem;
  gap: 2px;
}

.mode-btn {
  padding: 0.65rem 0.5rem;
  font-family: var(--font-display);
  font-size: 0.92rem;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  background: transparent;
  border-radius: 2px;
  transition: all 0.3s var(--ease);
}

.mode-btn.active {
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.mode-btn:not(.active):hover { color: var(--ink); }

.code-flow {
  animation: fade-in 0.5s var(--ease);
}

@keyframes fade-in {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ============================================
   SCENE 3: WRITING ROOM
   ============================================ */
.writing-desk {
  position: relative;
  width: 100%;
  max-width: 680px;
  perspective: 2000px;
}

.letter-paper {
  position: relative;
  background:
    url('../assets/objects/parchment.jpg') center/cover,
    linear-gradient(135deg, #F8EFD8 0%, #F0E4C2 50%, #E8D8B0 100%);
  background-blend-mode: multiply;
  padding: 3rem 3rem 2rem;
  border-radius: 2px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 10px 30px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(139, 112, 40, 0.3),
    inset 0 0 100px rgba(139, 112, 40, 0.12);
  transform-origin: center center;
  transition: all 0.4s var(--ease);
  animation: paper-arrive 1.2s var(--ease-out) 0.3s backwards;
}

@keyframes paper-arrive {
  0% { opacity: 0; transform: rotateX(-15deg) translateY(40px) scale(0.95); }
  100% { opacity: 1; transform: rotateX(0) translateY(0) scale(1); }
}

.letter-paper::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  background: linear-gradient(225deg, rgba(212, 175, 55, 0.2) 0%, transparent 60%);
  border-radius: 0 2px 0 0;
  pointer-events: none;
}

.letter-paper-inner {
  position: relative;
  z-index: 2;
}

.letter-ornament-top,
.letter-ornament-bottom {
  text-align: center;
  font-family: var(--font-display);
  color: var(--gold-dim);
  letter-spacing: 0.5em;
  font-size: 0.95rem;
  opacity: 0.7;
}

.letter-ornament-top { margin-bottom: 1.25rem; }
.letter-ornament-bottom { margin-top: 1.5rem; margin-bottom: 1.5rem; }

.letter-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
}

.letter-date {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.letter-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-bottom: 0.3rem;
  opacity: 0.7;
}

.letter-value {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  color: var(--ink);
}

.letter-greeting {
  font-family: var(--font-hand);
  font-size: 1.5rem;
  color: var(--ink);
  margin-bottom: 0.85rem;
  letter-spacing: 0.01em;
}

.letter-textarea {
  width: 100%;
  min-height: 220px;
  padding: 0.5rem 0;
  background: transparent;
  font-family: var(--font-hand);
  font-size: 1.3rem;
  line-height: 1.8;
  color: var(--ink);
  resize: vertical;
  background-image: repeating-linear-gradient(
    transparent,
    transparent calc(1.8em - 1px),
    rgba(139, 112, 40, 0.2) calc(1.8em - 1px),
    rgba(139, 112, 40, 0.2) 1.8em
  );
  background-attachment: local;
}

.letter-textarea::placeholder {
  color: var(--ink-soft);
  opacity: 0.45;
  font-style: italic;
}

.letter-counter {
  text-align: right;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.3rem;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  opacity: 0.6;
}

.letter-signature {
  margin-top: 1.5rem;
  text-align: right;
}

.letter-signature p {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  color: var(--ink);
  line-height: 1.4;
}

.signature-name {
  color: var(--ink-soft);
  font-style: italic;
}

.send-button {
  margin: 0.5rem auto 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 2.4rem;
  background: var(--ink);
  color: var(--gold-soft);
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: all 0.3s var(--ease);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.send-button:hover {
  background: var(--ink-soft);
  color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.send-button:active { transform: translateY(0); }

.send-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.letter-error {
  color: var(--error);
  font-size: 0.85rem;
  text-align: center;
  min-height: 1.2em;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Letter fold animation */
.letter-paper.folding {
  animation: letter-fold 1.8s var(--ease-in) forwards;
}

@keyframes letter-fold {
  0% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
  25% {
    transform: scale(0.92) rotateX(0);
  }
  50% {
    transform: scale(0.7) rotateX(-50deg) rotateZ(-5deg);
    border-radius: 12px;
  }
  75% {
    transform: scale(0.35) rotateX(-75deg) rotateZ(-12deg);
    border-radius: 50% 10% 50% 10%;
    opacity: 0.6;
  }
  100% {
    transform: scale(0.05) rotateX(-90deg) rotateZ(-25deg);
    opacity: 0;
  }
}

/* ============================================
   SCENE 4: FLIGHT
   ============================================ */
.paper-plane {
  position: absolute;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  width: 120px;
  height: 120px;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.5));
}

.paper-plane.flying { opacity: 1; }

.paper-plane #paperPlaneLottie {
  width: 100%;
  height: 100%;
}

/* Postbox target — positioned over the postbox in the bg image */
.postbox-target {
  position: absolute;
  /* Default (desktop): postbox is at ~22% from left, top 35%, in postbox-scene.jpg */
  left: 22%;
  top: 35%;
  width: 18%;
  height: 50%;
  z-index: 4;
  pointer-events: none;
}

.postbox-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at center, rgba(255, 210, 122, 0.55) 0%, rgba(255, 180, 80, 0.3) 30%, transparent 65%);
  opacity: 0;
  pointer-events: none;
}

.postbox-target.glowing .postbox-glow {
  animation: glow-pulse 1.8s ease-in-out;
}

@keyframes glow-pulse {
  0% { opacity: 0; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0; transform: scale(1.3); }
}

/* Tablet: postbox shifts because image object-position changes */
@media (max-width: 1024px) {
  .scene-flight .bg-image,
  .scene-success .bg-image {
    object-position: 28% center;
  }
  .postbox-target {
    left: 24%;
    top: 33%;
    width: 22%;
    height: 52%;
  }
}

/* Mobile landscape / small tablet */
@media (max-width: 800px) {
  .scene-flight .bg-image,
  .scene-success .bg-image {
    object-position: 26% center;
  }
  .postbox-target {
    left: 26%;
    top: 32%;
    width: 26%;
    height: 54%;
  }
}

/* Mobile portrait */
@media (max-width: 600px) {
  .scene-flight .bg-image,
  .scene-success .bg-image {
    object-position: 22% center;
  }
  .postbox-target {
    left: 28%;
    top: 30%;
    width: 32%;
    height: 56%;
  }
}

/* Small phones */
@media (max-width: 430px) {
  .scene-flight .bg-image,
  .scene-success .bg-image {
    object-position: 20% center;
  }
  .postbox-target {
    left: 30%;
    top: 28%;
    width: 36%;
    height: 58%;
  }
}

/* ============================================
   SCENE 5: SUCCESS
   ============================================ */
.success-card {
  max-width: 520px;
  width: 100%;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(244, 232, 200, 0.08) 0%, rgba(244, 232, 200, 0.03) 100%);
  padding: 3.5rem 3rem;
  border-radius: 4px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  animation: success-rise 1s var(--ease-out) 0.2s backwards;
  position: relative;
}

@keyframes success-rise {
  0% { opacity: 0; transform: translateY(40px); }
  100% { opacity: 1; transform: translateY(0); }
}

.success-symbol {
  margin: 0 auto 1.5rem;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: var(--gold-soft);
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
}

.success-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--cream);
  opacity: 0.85;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.success-id-box {
  background: rgba(212, 175, 55, 0.1);
  border: 1px dashed rgba(212, 175, 55, 0.5);
  padding: 1.5rem;
  border-radius: 4px;
  margin-bottom: 2rem;
}

.success-id-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--gold-soft);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 0.75rem;
}

.success-id {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--gold);
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
}

.success-id-note {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-style: italic;
  color: var(--cream);
  opacity: 0.75;
  margin-top: 0.5rem;
  line-height: 1.5;
}

.copy-btn {
  padding: 0.4rem 1rem;
  background: rgba(212, 175, 55, 0.18);
  color: var(--gold-soft);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 2px;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.3s var(--ease);
  font-family: var(--font-body);
}

.copy-btn:hover {
  background: rgba(212, 175, 55, 0.3);
  border-color: var(--gold);
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.success-btn {
  padding: 0.9rem 2rem;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: all 0.3s var(--ease);
}

.success-btn.primary {
  background: var(--gold);
  color: var(--ink);
}

.success-btn.primary:hover {
  background: var(--gold-soft);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
}

.success-btn.ghost {
  background: transparent;
  color: var(--gold-soft);
  border: 1px solid rgba(212, 175, 55, 0.4);
}

.success-btn.ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ============================================
   SCENE 6: REPLY CHECK
   ============================================ */
.reply-card {
  max-width: 560px;
  width: 100%;
  background:
    url('../assets/objects/parchment.jpg') center/cover,
    linear-gradient(180deg, rgba(244, 232, 200, 0.97) 0%, rgba(232, 215, 175, 0.97) 100%);
  background-blend-mode: multiply;
  padding: 3rem;
  border-radius: 4px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.5),
    0 10px 30px rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px rgba(212, 175, 55, 0.4);
  animation: gate-rise 1.4s var(--ease-out) 0.3s backwards;
}

.reply-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 2rem;
  text-align: center;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.reply-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-soft);
  text-align: center;
  margin-bottom: 2rem;
}

.reply-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.reply-input {
  background: rgba(255, 255, 255, 0.65);
  border-bottom: 1px solid var(--gold-dim);
  padding: 0.9rem 1rem;
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  text-align: center;
  color: var(--ink);
  text-transform: uppercase;
  transition: all 0.3s var(--ease);
}

.reply-input:focus {
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: var(--gold);
}

.reply-button {
  margin-top: 0.5rem;
  padding: 0.9rem 2rem;
  background: var(--ink);
  color: var(--cream);
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: all 0.3s var(--ease);
}

.reply-button:hover {
  background: var(--ink-soft);
  transform: translateY(-1px);
}

.reply-error {
  color: var(--error);
  font-size: 0.85rem;
  text-align: center;
  min-height: 1.2em;
  font-style: italic;
}

.reply-result { margin-top: 2rem; }

.reply-letter {
  background: rgba(255, 255, 255, 0.5);
  padding: 2rem;
  border-radius: 2px;
  border: 1px solid rgba(139, 112, 40, 0.25);
}

.reply-status {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin: 0.75rem 0;
  font-style: italic;
}

.reply-content {
  font-family: var(--font-hand);
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--ink);
  padding: 1rem 0;
}

.back-btn {
  display: block;
  margin: 1.5rem auto 0;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  transition: color 0.3s var(--ease);
}

.back-btn:hover { color: var(--gold-dim); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 600px) {
  .gate-plaque, .reply-card { padding: 2.5rem 1.5rem; }
  .letter-paper { padding: 2rem 1.5rem 1.5rem; }
  .success-card { padding: 2.5rem 1.5rem; }
  .letter-textarea { font-size: 1.15rem; min-height: 200px; }
  .success-id { font-size: 1.3rem; }
}

.letter-textarea::-webkit-scrollbar { width: 6px; }
.letter-textarea::-webkit-scrollbar-track { background: rgba(139, 112, 40, 0.1); }
.letter-textarea::-webkit-scrollbar-thumb { background: rgba(139, 112, 40, 0.45); border-radius: 3px; }