@charset "UTF-8";

* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button, a, input { touch-action: manipulation; }
button:not(:disabled) { cursor: pointer; }
[hidden] { display: none !important; }
button:disabled { cursor: default; opacity: .4; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 5px;
}
h1:focus, #wrapped-content:focus { outline: none; }
h1, h2, p, blockquote, figure { margin: 0; }
h1, h2 { font-weight: 400; }
button, p, h1, h2, span, blockquote { overflow-wrap: anywhere; }
.wrapped-root { min-height: 100svh; }
.app-shell { width: min(1120px, calc(100% - 96px)); margin-inline: auto; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 108px; border-bottom: 1px solid var(--line); }
.brand { font-size: 21px; line-height: 1.3; font-weight: 500; letter-spacing: -.045em; }
.brand-top, .brand-bottom { display: inline; }
.brand-bottom { margin-left: .3em; color: var(--sage); }
.header-note, .eyebrow { font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.header-note { color: var(--muted); }
.wrapped-content { padding-block: 48px 44px; }
.story-card { min-height: min(580px, calc(100svh - 310px)); animation: arrive 180ms ease-out both; }
.eyebrow { color: var(--sage); margin-bottom: 28px; line-height: 1.7; }
.hero-title { max-width: 900px; font-size: clamp(46px, 6.2vw, 78px); font-weight: 400; line-height: 1.08; letter-spacing: -.055em; white-space: pre-line; }
.hero-title em { font-weight: 400; font-style: normal; color: var(--sage); }
.hero-title span, .hero-title em { display: block; }
.hero-name { margin-bottom: 12px; }
.lead { max-width: 37rem; color: var(--muted); font-size: 18px; line-height: 1.8; margin-top: 28px; }
.opening-card { display: grid; grid-template-columns: minmax(0, 1fr) 180px; align-items: center; gap: 48px; padding-block: 44px 64px; }
.birthday-art-opening { width: 180px; height: 141px; justify-self: end; }
.birthday-art-access { width: 112px; height: 88px; margin-bottom: 26px; }
.birthday-art-closing { width: 128px; height: 100px; margin-bottom: 30px; }
.birthday-art-state { width: 112px; height: 88px; margin: 0 auto 28px; }
.hero-copy { min-width: 0; width: 100%; }
.hero-lead { max-width: 30rem; }
.age-pill { display: inline-block; padding: 0 0 10px; border-bottom: 1px solid var(--line); margin: -4px 0 26px; color: var(--muted); font-size: 13px; }
.story-navigation { padding-bottom: max(30px, env(safe-area-inset-bottom)); }
.progress-row { display: flex; justify-content: space-between; align-items: center; min-height: 48px; gap: 16px; }
.progress-counter { font-size: 12px; font-weight: 400; color: var(--muted); }
.progress-track { height: 1px; background: var(--line); overflow: hidden; margin-bottom: 22px; }
.progress-bar { height: 100%; background: var(--sage); transition: width 150ms ease; }
.navigation-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.navigation-hint { color: var(--muted); font-size: 13px; text-align: center; }
.button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 14px; padding: 14px 26px; border: 1px solid transparent; border-radius: 2px; font-size: 14px; font-weight: 500; line-height: 1.4; transition: background 150ms ease, border-color 150ms ease; }
.button-primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.button-primary:hover:not(:disabled) { background: #3a4d42; border-color: #3a4d42; }
.button-primary[data-action='next']::after { content: '→'; font-size: 21px; font-weight: 400; }
.button-secondary { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.button-secondary:hover:not(:disabled) { background: var(--soft); border-color: var(--sage); }
.button-previous::before { content: '←'; font-size: 20px; font-weight: 400; }
.button-text { padding: 10px 0 10px 18px; background: transparent; color: var(--muted); min-height: 48px; font-size: 12px; font-weight: 400; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 5px; }
.button-text:hover:not(:disabled) { color: var(--ink); }
.intro-card { padding-block: 28px; }
.intro-card > .hero-title { max-width: 800px; font-size: clamp(46px, 6vw, 72px); }
.stats-grid { display: flex; flex-wrap: wrap; gap: 0; margin-top: 48px; border-top: 1px solid var(--line); max-width: 720px; }
.stat { display: flex; flex-direction: column; padding: 30px 40px 24px 0; min-width: 230px; flex: 1 1 230px; }
.stat + .stat { border-left: 1px solid var(--line); padding-left: 40px; }
.stat-number { color: var(--ink); font-size: clamp(64px, 8vw, 96px); font-weight: 400; line-height: 1.05; letter-spacing: -.065em; }
.stat-label { margin-top: 14px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.memory-card { display: grid; align-items: center; gap: 64px; padding-block: 20px; }
.memory-card.has-image { grid-template-columns: 1fr 1fr; }
.memory-body { min-width: 0; }
.memory-body .eyebrow { margin-bottom: 18px; }
.memory-title { font-size: clamp(30px, 3.3vw, 44px); font-weight: 400; line-height: 1.2; letter-spacing: -.045em; }
.date-precision { margin-top: 14px; max-width: 30rem; font-size: 12px; line-height: 1.7; color: var(--muted); }
.preserve-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.memory-quote { margin-top: 32px; font-size: clamp(21px, 2.2vw, 26px); line-height: 1.7; letter-spacing: -.025em; }
.memory-signature { margin-top: 30px; display: flex; align-items: center; gap: 14px; color: var(--sage); font-size: 13px; font-weight: 500; }
.signature-line { display: inline-block; width: 24px; height: 1px; flex: 0 0 24px; background: var(--line-strong); }
.memory-figure { position: relative; min-width: 0; min-height: 340px; background: var(--soft); display: flex; align-items: center; justify-content: center; align-self: start; }
.memory-image { display: block; max-width: 100%; width: 100%; max-height: 68svh; object-fit: contain; }
.image-status { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: var(--muted); font-size: 14px; }
.image-fallback { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 35px 15px; text-align: center; color: var(--muted); }
.text-only { max-width: 800px; margin-inline: auto; grid-template-columns: 1fr; padding: 48px 56px; border-top: 2px solid var(--birthday-accent); background: var(--surface); }
.text-only .memory-quote { font-size: clamp(24px, 2.7vw, 32px); line-height: 1.65; }
.words-card { padding: 25px 0; }
.word-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; padding: 0; margin: 42px 0 10px; }
.word-item { min-width: 0; max-width: 100%; padding: 25px 0; border-top: 1px solid var(--line); }
.word-text { display: block; color: var(--ink); font-size: clamp(26px, 3vw, 36px); font-weight: 400; line-height: 1.25; letter-spacing: -.045em; }
.word-sender { display: block; color: var(--muted); margin-top: 14px; font-size: 12px; line-height: 1.7; }
.closing-card { max-width: 800px; margin-inline: auto; padding-block: 40px; }
.closing-card .hero-title { font-size: clamp(46px, 6vw, 72px); }
.closing-card .lead { max-width: 35rem; }
.closing-message { margin-top: 36px; font-size: clamp(21px, 2.3vw, 27px); line-height: 1.75; letter-spacing: -.025em; }
.closing-restart { margin-top: 40px; }
.access-layout { min-height: calc(100svh - 220px); display: grid; grid-template-columns: 1.2fr .85fr; align-items: center; gap: 80px; padding-block: 24px 56px; }
.access-title { font-size: clamp(46px, 5.8vw, 72px); }
.access-intro .lead { max-width: 29rem; }
.access-panel { padding: 40px 36px; background: var(--surface); border: 1px solid var(--line); }
.panel-title { font-size: 28px; font-weight: 400; line-height: 1.3; letter-spacing: -.04em; }
.access-form { margin-top: 30px; }
.field-label { font-size: 13px; display: block; font-weight: 500; margin-bottom: 12px; color: var(--ink); }
.code-input { width: 100%; min-width: 0; min-height: 54px; padding: 12px 15px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 2px; background: var(--surface); font-size: 20px; letter-spacing: .1em; caret-color: var(--sage); }
.code-input:hover { border-color: var(--sage); }
.field-help { margin-top: 12px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.form-error { margin-top: 16px; font-size: 14px; color: var(--error); line-height: 1.6; }
.access-form .button { width: 100%; margin-top: 24px; }
.panel-footnote { font-size: 11px; line-height: 1.8; color: var(--muted); margin-top: 26px; }
.section-title { font-size: clamp(36px, 4.8vw, 60px); font-weight: 400; line-height: 1.2; letter-spacing: -.045em; }
.state-card { min-height: calc(100svh - 260px); max-width: 720px; margin-inline: auto; padding-block: 70px; text-align: center; }
.state-card .lead { margin-inline: auto; }
.state-card > .button { margin-top: 32px; }
.empty-letter { margin-top: 50px; border-top: 1px solid var(--line); padding-top: 30px; text-align: left; }
.empty-letter .preserve-text { margin-top: 22px; font-size: 23px; line-height: 1.75; letter-spacing: -.025em; }
.loading-mark { display: block; width: 36px; height: 36px; border: 1px solid var(--line); border-top: 2px solid var(--sage); border-radius: 50%; margin: 0 auto 36px; animation: spin 1.2s linear infinite; }
.initial-loading, .noscript-message { padding: 40px 24px; text-align: center; font-size: 18px; }
.skip-link { position: fixed; top: -100px; left: 16px; padding: 15px 20px; background: var(--ink); color: var(--surface); z-index: 20; }
.skip-link:focus { top: 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@keyframes arrive { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 1400px) {
  .app-header { min-height: 120px; }
  .wrapped-content { padding-top: 56px; }
}

@media (max-width: 850px) {
  .app-shell { width: calc(100% - 48px); }
  .access-layout { gap: 35px; grid-template-columns: 1fr 1fr; }
  .access-panel { padding: 32px 24px; }
  .memory-card { gap: 30px; }
  .memory-figure { min-height: 260px; }
}

@media (max-width: 620px) {
  .app-shell { width: calc(100% - 40px); }
  .app-header { min-height: 86px; gap: 16px; }
  .brand { font-size: 18px; }
  .header-note { font-size: 9px; letter-spacing: .06em; max-width: 92px; text-align: right; line-height: 1.7; }
  .wrapped-content { padding-block: 36px 28px; }
  .story-card { min-height: auto; }
  .eyebrow { font-size: 10px; margin-bottom: 24px; letter-spacing: .1em; }
  .hero-title { font-size: clamp(41px, 10.8vw, 60px); }
  .lead { font-size: 17px; margin-top: 24px; line-height: 1.75; }
  .opening-card { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 26px; padding-block: 12px 40px; }
  .birthday-art-opening { width: 112px; height: 88px; }
  .navigation-controls { gap: 12px; }
  .navigation-hint { display: none; }
  .navigation-controls .button { padding-inline: 18px; }
  .progress-track { margin-bottom: 18px; }
  .story-navigation { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .intro-card { padding-top: 0; }
  .intro-card > .hero-title { font-size: clamp(41px, 10.8vw, 60px); }
  .stats-grid { margin-top: 34px; }
  .stat { min-width: 0; flex-basis: 120px; padding: 24px 16px 20px 0; }
  .stat + .stat { padding-left: 20px; }
  .stat-number { font-size: 64px; }
  .stat-label { font-size: 12px; }
  .memory-card.has-image { display: flex; flex-direction: column; align-items: stretch; padding-top: 0; gap: 30px; }
  .memory-figure { width: 100%; min-height: 260px; align-self: stretch; }
  .memory-image { max-height: 64svh; }
  .memory-title { font-size: 32px; }
  .memory-quote { font-size: 22px; margin-top: 24px; }
  .memory-signature { margin-top: 26px; }
  .text-only { padding: 32px 24px; }
  .text-only .memory-title { font-size: 30px; }
  .text-only .memory-quote { font-size: 24px; }
  .words-card { padding-top: 0; }
  .word-list { grid-template-columns: minmax(0, 1fr); margin-top: 32px; }
  .word-item { padding: 22px 0; }
  .word-text { font-size: 30px; }
  .closing-card { padding-block: 28px 36px; }
  .closing-card .hero-title { font-size: clamp(41px, 10.8vw, 60px); }
  .closing-message { font-size: 23px; }
  .access-layout { display: flex; flex-direction: column; gap: 38px; align-items: stretch; padding: 5px 0 30px; }
  .access-title { font-size: clamp(41px, 10.8vw, 60px); }
  .access-panel { width: 100%; max-width: 420px; margin-inline: auto; padding: 32px 28px; }
  .panel-title { font-size: 27px; }
  .state-card { min-height: calc(100svh - 190px); padding-block: 45px; }
  .section-title { font-size: 40px; }
}

@media (max-width: 350px) {
  .app-shell { width: calc(100% - 32px); }
  .hero-title, .access-title, .intro-card > .hero-title, .closing-card .hero-title { font-size: 38px; }
  .access-panel { padding: 28px 20px; }
  .navigation-controls .button { padding-inline: 14px; }
  .text-only { padding-inline: 20px; }
}

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