:root {
  --paper: #fdf3e8;
  --paper-dark: #e2c7a5;
  --ink: #442118;
  --muted: #755248;
  --accent: #8b4c3a;
  --accent-soft: #d7af84;
  --line: rgba(68, 33, 24, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Instrument Sans", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 248, 238, 0.75), rgba(255, 245, 233, 0.92)),
    url("assets/bg.jpg") center/cover no-repeat,
    linear-gradient(135deg, #f4e7d9, #f6efe6);
}

.page {
  width: min(1080px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 48px;
  display: grid;
  gap: 20px;
}

.intro-card,
.response-wrap,
.letter {
  border-radius: 28px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(78, 47, 31, 0.12);
}

.intro-card,
.response-wrap {
  padding: 26px;
  background: rgba(253, 243, 232, 0.88);
  backdrop-filter: blur(10px);
}

.intro-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.intro-visual {
  flex: 0 0 200px;
  display: flex;
  justify-content: center;
}

.intro-image {
  width: 100%;
  max-width: 200px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 12px 30px rgba(78, 47, 31, 0.15);
  border: 4px solid #fff;
}

.intro-content {
  flex: 1;
  min-width: 300px;
}

.mini-label,
.letter-tag {
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 0.74rem;
  color: var(--muted);
}

.quote,
h1,
h2 {
  font-family: "Fraunces", serif;
}

.quote {
  margin: 0 0 14px;
  max-width: 760px;
  font-size: clamp(1.25rem, 2.8vw, 2.1rem);
  line-height: 1.35;
}

h1 {
  margin: 0;
  max-width: 840px;
  font-size: clamp(2.8rem, 7vw, 5.4rem);
  line-height: 0.95;
}

.intro-actions,
.letter-controls,
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.outline-button,
.filled-button,
.choice-button {
  border-radius: 999px;
  padding: 13px 18px;
  border: 1px solid var(--line);
  font: inherit;
  cursor: pointer;
}

.outline-button,
.choice-button {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
}

.filled-button {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  color: #fff8f1;
  border-color: transparent;
}

.letters-grid {
  position: relative;
  min-height: 320px;
}

.letter {
  display: none;
  padding: 28px;
  background: linear-gradient(180deg, rgba(255, 251, 246, 0.96), rgba(247, 233, 219, 0.96));
  transform-origin: top center;
}

.letter.active {
  display: block;
  animation: unfold 0.45s ease;
}

.letter h2,
.response-heading h2 {
  margin: 12px 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.02;
}

.letter p,
.reply-form span,
.form-status {
  color: var(--muted);
}

.letter p {
  margin: 0;
  line-height: 1.9;
  max-width: 760px;
}

.response-wrap {
  display: grid;
  gap: 20px;
}

.choice-button.active {
  background: rgba(139, 76, 58, 0.12);
  border-color: rgba(139, 76, 58, 0.3);
}

.reply-form {
  display: grid;
  gap: 16px;
}

.reply-form label {
  display: grid;
  gap: 8px;
}

.reply-form input,
.reply-form textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
}

.form-status {
  min-height: 24px;
  margin: 0;
}

@keyframes unfold {
  from {
    opacity: 0;
    transform: rotateX(-10deg) translateY(18px);
  }
  to {
    opacity: 1;
    transform: rotateX(0) translateY(0);
  }
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 18px, 1080px);
    padding: 18px 0 24px;
  }

  .intro-card,
  .response-wrap,
  .letter {
    padding: 20px;
    border-radius: 24px;
  }
}
