:root {
  --ink: #2f4858;
  --teal: #0fa3b1;
  --sky-top: #4d80e6;
  --sky-bottom: #99ccff;
  --sun: #ffffe6;
  --cloud: #ffffff;
  --cloud-shadow: #b3bfcc;
  --mist: rgba(253, 254, 255, 0.46);
  --mist-strong: rgba(255, 246, 235, 0.7);
  --line: rgba(47, 72, 88, 0.22);
  --line-soft: rgba(47, 72, 88, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: "Quicksand", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #b5e2fa 0%, #ebfdff 52%, #fff6eb 100%);
}

button,
input,
textarea {
  font: inherit;
}

.letter-app {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 28px 18px 36px;
  display: grid;
  place-items: center;
}

.letter-app__sky,
.letter-app__veil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.letter-app__sky {
  display: block;
}

.letter-app__veil {
  background:
    radial-gradient(circle at 18% 18%, rgba(253, 254, 255, 0.32) 0%, transparent 24%),
    radial-gradient(circle at 82% 78%, rgba(255, 246, 235, 0.36) 0%, transparent 24%),
    linear-gradient(180deg, rgba(253, 254, 255, 0.04) 0%, rgba(255, 246, 235, 0.18) 100%);
  pointer-events: none;
}

.letter-flow {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 360ms ease,
    transform 360ms ease;
}

.letter-flow.is-transitioning {
  opacity: 0;
  transform: translateY(18px);
}

.letter-flow__inner {
  min-height: min(72vh, 760px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0;
  padding: clamp(18px, 3vw, 28px) clamp(12px, 2vw, 18px);
  text-align: left;
}

.letter-flow__eyebrow {
  margin: 0 0 16px;
  color: rgba(47, 72, 88, 0.76);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.letter-flow__title {
  margin: 0;
  width: 100%;
  max-width: 72rem;
  color: var(--ink);
  font-family: "Poppins", "Segoe UI", sans-serif;
  font-size: clamp(1.45rem, 3.3vw, 2.55rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.letter-flow__title--welcome {
  max-width: 72rem;
  font-size: clamp(1.65rem, 3.6vw, 2.7rem);
}

.letter-flow__subtitle {
  margin: 18px 0 0;
  width: 100%;
  max-width: 72rem;
  color: rgba(47, 72, 88, 0.82);
  font-size: clamp(0.98rem, 1.65vw, 1.08rem);
  line-height: 1.72;
}

.letter-flow__subtitle--welcome {
  max-width: 72rem;
  font-size: clamp(1rem, 1.7vw, 1.1rem);
}

.letter-flow__subtitle--same-size {
  max-width: 72rem;
  margin-top: 10px;
  font-size: clamp(1.45rem, 3.3vw, 2.55rem);
  font-family: "Poppins", "Segoe UI", sans-serif;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.letter-flow__title--long {
  max-width: 72rem;
  text-wrap: pretty;
}

.letter-flow__field {
  margin-top: 28px;
  width: 100%;
  max-width: 72rem;
}

.field-stack {
  display: grid;
  gap: 22px;
}

.answer-input {
  width: 100%;
  min-height: 2.7em;
  height: 2.7em;
  padding: 0;
  border: 0;
  border-bottom: 2px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: clamp(1.08rem, 2.6vw, 1.32rem);
  line-height: 1.35;
  resize: none;
  overflow: hidden;
  outline: none;
  transition:
    border-color 180ms ease,
    opacity 180ms ease;
}

.answer-input--email {
  min-height: 2.7em;
  height: 2.7em;
  line-height: 1.4;
}

.answer-input::placeholder {
  color: rgba(47, 72, 88, 0.5);
}

.answer-input:focus {
  border-bottom-color: var(--teal);
}

.field-note {
  margin: 12px 0 0;
  color: rgba(47, 72, 88, 0.62);
  font-size: 0.96rem;
  line-height: 1.6;
}

.letter-flow__actions {
  margin-top: 30px;
  display: flex;
  justify-content: flex-start;
}

.button {
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    opacity 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

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

.button--primary {
  background: rgba(15, 163, 177, 0.92);
  color: #fdfeff;
}

.button--primary:hover {
  background: #1096a2;
}

@media (max-width: 760px) {
  .letter-app {
    padding: 18px 16px 28px;
  }

  .letter-flow {
    width: 100%;
  }

  .letter-flow__inner {
    min-height: 76vh;
    padding: 12px 4px;
  }

  .letter-flow__eyebrow {
    margin-bottom: 14px;
  }

  .letter-flow__title {
    max-width: 100%;
    font-size: clamp(1.4rem, 5.8vw, 2rem);
  }

  .letter-flow__title--welcome {
    max-width: 100%;
    font-size: clamp(1.55rem, 6.1vw, 2.15rem);
  }

  .letter-flow__subtitle {
    font-size: 1rem;
    max-width: 100%;
  }

  .letter-flow__subtitle--welcome {
    max-width: 100%;
    font-size: 1.05rem;
  }

  .letter-flow__subtitle--same-size {
    max-width: 100%;
    font-size: clamp(1.4rem, 5.8vw, 2rem);
  }

  .letter-flow__title--long {
    max-width: 100%;
  }

  .letter-flow__field {
    margin-top: 24px;
    max-width: 100%;
  }

  .answer-input {
    min-height: 2.7em;
    height: 2.7em;
    font-size: 1.04rem;
  }

  .answer-input--email {
    min-height: 56px;
  }
}

/* Quiet Letter — calm editorial treatment */
body {
  background: #f5f0e9;
}

.letter-app__veil {
  background:
    linear-gradient(90deg, rgba(245,240,233,.5), rgba(255,255,255,.08) 62%),
    radial-gradient(circle at 76% 22%, rgba(255,255,255,.36), transparent 28%);
}

.letter-flow {
  width: min(1080px, 100%);
}

.letter-flow__inner {
  min-height: min(78vh, 820px);
  padding-left: clamp(8px, 7vw, 90px);
}

.letter-flow__title,
.letter-flow__title--welcome,
.letter-flow__subtitle--same-size {
  max-width: 18ch;
  font-family: "Quicksand", "Segoe UI", sans-serif;
  font-size: clamp(2.1rem, 5vw, 4.7rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -.045em;
}

.letter-flow__subtitle,
.letter-flow__subtitle--welcome {
  max-width: 620px;
  font-size: clamp(1rem, 1.45vw, 1.15rem);
  line-height: 1.85;
}

.letter-flow__field {
  max-width: 760px;
  margin-top: 42px;
}

.answer-input {
  border-bottom-width: 1px;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
}

.button {
  min-height: 54px;
  padding-inline: 32px;
  border-radius: 999px;
  letter-spacing: .08em;
}

.button--primary {
  background: #2f4858;
}

.button--primary:hover {
  background: #263f4d;
}

@media (max-width: 760px) {
  .letter-flow__inner {
    padding-left: 4px;
  }

  .letter-flow__title,
  .letter-flow__title--welcome,
  .letter-flow__subtitle--same-size {
    max-width: 100%;
    font-size: clamp(2rem, 9vw, 3.2rem);
  }
}

.choice-list {
  display: grid;
  gap: 10px;
}

.choice {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  line-height: 1.45;
}

.choice:hover,
.choice:focus-visible {
  border-color: var(--ink);
}

.choice.is-selected {
  border-color: var(--ink);
  background: rgba(47, 72, 88, 0.12);
}

.contact-field {
  display: grid;
  gap: 8px;
}

.letter-flow--result {
  width: min(820px, 100%);
}

.letter-flow--result .letter-flow__inner {
  min-height: auto;
  padding: 36px 16px 80px;
}

.letter-flow--result .letter-flow__field {
  max-width: 100%;
  margin-top: 0;
}

.delivery-status {
  margin: 0 0 24px;
  font-size: 0.95rem;
}

.personal-letter {
  padding: clamp(24px, 5vw, 58px);
  background: #fffdfb;
  box-shadow: 0 6px 32px rgba(47, 72, 88, 0.12);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.06rem, 2vw, 1.22rem);
  line-height: 1.7;
}

.personal-letter p {
  margin: 0 0 1.1em;
}

.personal-letter p:last-child {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .letter-app {
    display: block;
    overflow: visible;
  }

  .letter-app__sky,
  .letter-app__veil {
    position: fixed;
  }

  .letter-flow__inner {
    min-height: calc(100svh - 46px);
    justify-content: center;
  }

  .letter-flow__title {
    font-size: clamp(1.9rem, 7vw, 2.6rem);
  }

  .choice {
    min-height: 48px;
  }

  .letter-flow--result .letter-flow__inner {
    padding: 20px 0 60px;
  }
}
