:root {
  color-scheme: light;
  --ink: #2f3839;
  --muted: #727d7e;
  --accent: #647c7f;
  --accent-dark: #4e6669;
  --canvas: #dfe8e8;
  --paper: #fbfaf5;
  --line: rgba(72, 91, 94, 0.15);
  --shadow: 0 28px 72px rgba(71, 89, 91, 0.2);
  font-family:
    Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Noto Sans KR", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 14%, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(160deg, #edf2f1 0%, #dce6e7 48%, #cedbdd 100%);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  width: min(100%, 540px);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 18px
    max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.letter-frame {
  margin: 0;
}

.letter-frame > figcaption {
  margin: 0 0 13px;
  color: rgba(49, 64, 66, 0.72);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-align: center;
  white-space: nowrap;
}

.letter-card {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.envelope-visual {
  margin: 0;
  overflow: hidden;
  background: #e6eded;
  border-bottom: 1px solid rgba(87, 105, 107, 0.08);
}

.envelope-visual img {
  width: 100%;
  height: auto;
  display: block;
}

.letter-content {
  padding: 31px 28px 29px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(27px, 7.5vw, 36px);
  line-height: 1.34;
  letter-spacing: -0.05em;
}

h1 span {
  color: var(--accent-dark);
}

.description {
  margin: 15px 0 25px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: -0.025em;
}

.open-button {
  width: 100%;
  min-height: 58px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, #71898c, var(--accent-dark));
  border: 1px solid rgba(54, 74, 77, 0.12);
  border-radius: 15px;
  box-shadow: 0 12px 24px rgba(67, 88, 91, 0.24);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.open-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 28px rgba(67, 88, 91, 0.3);
}

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

.open-button:focus-visible,
.store-link:focus-visible {
  outline: 3px solid rgba(100, 124, 127, 0.34);
  outline-offset: 3px;
}

.open-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.status {
  min-height: 20px;
  margin: 11px 0 0;
  color: #7e898a;
  font-size: 12px;
  line-height: 1.5;
}

.divider {
  margin: 23px 0 15px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 11px;
  color: #899394;
}

.divider span {
  height: 1px;
  background: var(--line);
}

.divider p {
  margin: 0;
  font-size: 11px;
}

.store-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.store-link {
  min-height: 64px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  background: #f4f5f1;
  border: 1px solid var(--line);
  border-radius: 14px;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.store-link:hover {
  background: #fff;
  border-color: rgba(100, 124, 127, 0.38);
}

.store-link__icon {
  flex: 0 0 auto;
  color: var(--accent-dark);
  font-size: 16px;
}

.store-link__icon--apple {
  font-size: 17px;
}

.store-link small,
.store-link strong {
  display: block;
}

.store-link small {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
}

.store-link strong {
  font-size: 13px;
  line-height: 1.15;
}

footer {
  color: rgba(54, 69, 71, 0.54);
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.noscript-message {
  position: fixed;
  inset: auto 16px 16px;
  margin: 0;
  padding: 12px 14px;
  color: #fff;
  text-align: center;
  background: #394749;
  border-radius: 12px;
}

@media (max-width: 359px) {
  .page-shell {
    padding-inline: 11px;
  }

  .letter-card {
    border-radius: 21px;
  }

  .letter-content {
    padding: 25px 19px 23px;
  }

  .store-link {
    padding-inline: 9px;
  }
}

@media (max-height: 680px) and (orientation: landscape) {
  .page-shell {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
