:root {
  --ink: #172033;
  --ink-soft: #334158;
  --paper: #f4f6f5;
  --surface: #ffffff;
  --muted: #667085;
  --line: #d9dee5;
  --line-strong: #bcc5cf;
  --coral: #d44b57;
  --coral-dark: #a93342;
  --rose-soft: #fff0f2;
  --jade: #16796f;
  --mint: #eaf6f2;
  --lemon: #f3c84b;
  --blue: #426ca8;
  --sky: #edf3fb;
  --focus: #f3c84b;
  --danger: #b42318;
  --shadow-soft: 0 10px 26px rgba(23, 32, 51, 0.08);
  --radius: 8px;
  --rail-height: 64px;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0;
}

body.page-mode {
  min-height: 100dvh;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

h1[tabindex="-1"]:focus-visible,
h2[tabindex="-1"]:focus-visible,
h3[tabindex="-1"]:focus-visible,
legend[tabindex="-1"]:focus-visible {
  outline: none;
}

[hidden] {
  display: none !important;
}

/* Persistent mobile reading context */
.chapter-rail {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: grid;
  min-height: var(--rail-height);
  grid-template-columns: 44px minmax(0, 1fr) 74px;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(23, 32, 51, 0.1);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  backdrop-filter: blur(12px);
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.chapter-rail.is-hero {
  grid-template-columns: minmax(0, 1fr) 74px;
  border-bottom-color: rgba(255, 255, 255, 0.16);
  background: rgba(13, 20, 33, 0.84);
  color: #ffffff;
}

.rail-back {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: currentColor;
  font-size: 22px;
}

.rail-back:hover {
  background: rgba(66, 108, 168, 0.1);
}

.rail-title {
  min-width: 0;
  line-height: 1.25;
}

.rail-title strong,
.rail-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-title strong {
  font-size: 14px;
}

.rail-title span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.is-hero .rail-title span {
  color: #c4cbd6;
}

.rail-progress {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.rail-progress i {
  display: block;
  height: 4px;
  background: var(--line);
  transition: background-color 180ms ease;
}

.rail-progress i.is-active {
  background: var(--coral);
}

.is-hero .rail-progress i {
  background: #465064;
}

.is-hero .rail-progress i.is-active {
  background: var(--lemon);
}

/* Page flow */
[data-page] {
  min-height: 100dvh;
}

.page-enter-forward {
  animation: page-in-forward 260ms ease-out both;
}

.page-enter-back {
  animation: page-in-back 260ms ease-out both;
}

@keyframes page-in-forward {
  from { opacity: 0; transform: translateX(22px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes page-in-back {
  from { opacity: 0; transform: translateX(-22px); }
  to { opacity: 1; transform: translateX(0); }
}

.section-inner {
  width: min(100% - 32px, 1080px);
  margin: 0 auto;
}

.chapter-count {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--coral-dark);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
h2,
h3,
legend,
.signature,
.confession-thesis {
  font-family: "Songti SC", "STSong", serif;
}

h2 {
  max-width: 800px;
  margin: 0;
  font-size: 33px;
  line-height: 1.28;
}

.section-lead {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
}

/* Buttons */
.primary-action,
.secondary-action,
.back-action,
.page-back-link,
.footer-link {
  min-height: 48px;
  border-radius: var(--radius);
  font-weight: 750;
  touch-action: manipulation;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.primary-action,
.secondary-action {
  border: 0;
}

.primary-action {
  padding: 12px 18px;
  background: var(--coral);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(212, 75, 87, 0.22);
}

.primary-action:hover {
  background: var(--coral-dark);
}

.secondary-action {
  padding: 12px 18px;
  background: var(--ink);
  color: #ffffff;
}

.primary-action:active,
.secondary-action:active,
.back-action:active,
.page-back-link:active {
  transform: translateY(1px);
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.56;
}

.page-back-link,
.footer-link {
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
}

.page-back-link:hover,
.footer-link:hover {
  border-color: var(--jade);
  background: var(--mint);
}

.page-nav {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(104px, auto) minmax(0, 1fr);
  gap: 10px;
  margin: 48px -16px -56px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(244, 246, 245, 0.96);
  backdrop-filter: blur(12px);
}

.page-nav .primary-action,
.page-nav .page-back-link {
  width: 100%;
}

.page-top-nav {
  display: none;
}

/* Opening */
.hero {
  position: relative;
  display: grid;
  min-height: 100dvh;
  place-items: end stretch;
  overflow: hidden;
  padding-top: var(--rail-height);
  background: var(--ink);
  color: #ffffff;
  isolation: isolate;
}

.bead-scene,
.hero-noise {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bead-scene {
  z-index: -2;
}

.hero-noise {
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
  opacity: 0.22;
  pointer-events: none;
}

.hero-content {
  width: min(100% - 32px, 1080px);
  margin: 0 auto;
  padding: 52vh 0 76px;
  text-align: left;
}

.hero .chapter-count {
  margin-bottom: 8px;
  color: #aeb8c7;
}

.hero .eyebrow {
  color: var(--lemon);
}

h1 {
  margin: 0;
  font-size: 58px;
  line-height: 1.05;
}

.hero-line {
  max-width: 620px;
  margin: 18px 0 24px;
  color: #e6e9ee;
  font-size: 17px;
  line-height: 1.75;
}

.hero .primary-action {
  width: 100%;
}

.hero-caption {
  display: none;
}

/* Story */
.story-section,
.future-section,
.memory-section,
.answer-section,
.date-lab {
  padding: 96px 0 112px;
}

.story-section {
  background: var(--paper);
}

.like-list {
  display: grid;
  gap: 0;
  max-width: 880px;
  margin: 38px 0 0;
  padding: 0;
  border-top: 2px solid var(--ink);
  list-style: none;
}

.like-list li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.like-list span {
  color: var(--coral-dark);
  font-size: 12px;
  font-weight: 850;
}

.like-list p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
}

.page-quote {
  max-width: 760px;
  margin: 32px 0 0;
  padding: 18px 0 18px 18px;
  border-left: 4px solid var(--coral);
  color: var(--coral-dark);
  font-family: "Songti SC", "STSong", serif;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.65;
}

.memory-line {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-width: 900px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}

.memory-line li {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  padding: 20px 18px 20px 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.memory-line li::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--jade);
  content: "";
}

.memory-index {
  position: absolute;
  top: 10px;
  right: 14px;
  color: #e4e9ed;
  font-size: 26px;
  font-weight: 850;
  line-height: 1;
}

.memory-line time {
  color: var(--jade);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.memory-line strong,
.memory-line span {
  display: block;
}

.memory-line strong {
  position: relative;
  padding-right: 22px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.55;
}

.memory-line div > span:last-child {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.memory-line .memory-status {
  margin: 0 0 6px;
  color: var(--jade);
  font-size: 11px;
  font-weight: 850;
}

/* Shared future list */
.future-section {
  background: var(--mint);
}

.future-section .page-nav {
  background: rgba(234, 246, 242, 0.96);
}

.growth-points {
  max-width: 860px;
  margin-top: 38px;
  border-top: 1px solid #cbded8;
}

.growth-points section {
  display: grid;
  gap: 8px;
  padding: 22px 0;
  border-bottom: 1px solid #cbded8;
}

.growth-points span {
  color: var(--jade);
  font-size: 12px;
  font-weight: 850;
}

.growth-points p {
  margin: 0;
  color: #405a57;
  font-size: 16px;
}

.growth-section .page-quote {
  border-left-color: var(--jade);
  color: #12665e;
}

/* Memories that matter */
.memory-section {
  background: var(--surface);
}

.memory-section .page-nav {
  background: rgba(255, 255, 255, 0.96);
}

.memory-notes {
  display: grid;
  gap: 12px;
  max-width: 920px;
  margin-top: 38px;
}

.memory-notes article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.memory-notes span {
  display: block;
  margin-bottom: 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.memory-notes p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.intimacy-note {
  max-width: 820px;
  margin: 28px 0 0;
  padding: 20px;
  border: 1px solid #efc3c7;
  border-radius: var(--radius);
  background: var(--rose-soft);
  color: #7f3440;
  font-size: 16px;
}

.future-glance {
  max-width: 920px;
  margin-top: 34px;
  padding-top: 28px;
  border-top: 2px solid var(--ink);
}

.future-glance > p {
  margin: 0;
  color: var(--ink);
  font-family: "Songti SC", "STSong", serif;
  font-size: 22px;
  font-weight: 700;
}

.future-glance ul {
  display: grid;
  gap: 0;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.future-glance li {
  position: relative;
  padding: 13px 0 13px 24px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.future-glance li::before {
  position: absolute;
  top: 20px;
  left: 2px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--jade);
  content: "";
}

.future-list {
  max-width: 920px;
  margin-top: 40px;
  border-top: 2px solid var(--ink);
}

.future-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: wish;
}

.future-list li {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  padding: 20px 0 20px;
  border-bottom: 1px solid #cbded8;
  counter-increment: wish;
}

.future-list li::before {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--jade);
  border-radius: var(--radius);
  color: var(--jade);
  content: counter(wish, decimal-leading-zero);
  font-size: 11px;
  font-weight: 850;
}

.future-list li::after {
  position: absolute;
  top: 20px;
  right: 0;
  padding: 3px 7px;
  border: 1px solid #b8d6cf;
  border-radius: 4px;
  color: var(--jade);
  content: attr(data-horizon);
  font-size: 10px;
  font-weight: 800;
}

.future-list strong,
.future-list span {
  display: block;
}

.future-list strong {
  padding-right: 64px;
  color: var(--ink);
  font-size: 17px;
}

.future-list li > span {
  grid-column: 2;
  margin-top: 5px;
  color: #536b68;
  font-size: 14px;
}

/* The letter */
.confession-section {
  padding: 96px 0 112px;
  background: var(--surface);
  color: var(--ink);
}

.confession-section .section-kicker {
  color: var(--coral-dark);
}

.confession-copy h2 {
  max-width: 850px;
  font-size: 35px;
}

.confession-thesis {
  max-width: 760px;
  margin: 28px 0 0;
  padding: 20px 0 20px 20px;
  border-left: 5px solid var(--coral);
  color: var(--coral-dark);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.6;
}

.letter-sections {
  max-width: 820px;
  margin-top: 42px;
  border-top: 1px solid var(--line);
}

.letter-sections section {
  display: grid;
  gap: 10px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.letter-sections section > span {
  color: var(--jade);
  font-size: 12px;
  font-weight: 850;
}

.letter-sections p,
.letter-promise {
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.85;
}

.letter-promise {
  max-width: 780px;
  margin-top: 28px;
}

.signature {
  max-width: 780px;
  margin: 36px 0 0;
  padding: 22px 20px;
  border: 1px solid #f0c1c6;
  border-radius: var(--radius);
  background: var(--rose-soft);
  color: var(--coral-dark);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.55;
}

.confession-section .page-nav {
  background: rgba(255, 255, 255, 0.96);
}

.heart-statement {
  display: grid;
  gap: 10px;
  max-width: 820px;
  margin-top: 36px;
  padding: 24px 20px;
  border: 1px solid #efc3c7;
  border-radius: var(--radius);
  background: var(--rose-soft);
}

.heart-statement strong {
  color: var(--coral-dark);
  font-family: "Songti SC", "STSong", serif;
  font-size: 21px;
  line-height: 1.5;
}

.final-copy {
  margin-top: 28px;
}

.response-panel {
  max-width: 820px;
  margin-top: 38px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.response-panel .text-field {
  margin-top: 0;
}

.response-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.response-actions button {
  width: 100%;
}

.final-page-nav {
  position: static;
  grid-template-columns: auto;
  margin-bottom: 0;
  padding-bottom: 0;
  background: transparent;
  backdrop-filter: none;
}

/* Answers */
.answer-section {
  background: var(--paper);
}

.answer-heading {
  display: grid;
  gap: 18px;
}

.answer-heading .chapter-count {
  margin-bottom: 8px;
}

.answer-intro {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.progress {
  width: 100%;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 6px;
  margin-top: 7px;
  overflow: hidden;
  background: var(--line);
}

.progress-track i {
  display: block;
  width: 25%;
  height: 100%;
  background: var(--jade);
  transition: width 220ms ease;
}

#confessionForm {
  max-width: 900px;
  margin-top: 36px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  max-width: 100%;
  padding: 0;
  color: var(--ink);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.4;
}

.step-note {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 14px;
}

.form-step.is-active {
  animation: step-in 240ms ease-out both;
}

@keyframes step-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.choice-card {
  position: relative;
  min-height: 86px;
  cursor: pointer;
}

.choice-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.choice-card > span {
  position: relative;
  display: grid;
  min-height: 86px;
  height: 100%;
  align-content: center;
  padding: 15px 50px 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.choice-card > span::after {
  position: absolute;
  top: 50%;
  right: 16px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: transparent;
  content: "✓";
  font-size: 14px;
  font-weight: 900;
  transform: translateY(-50%);
}

.choice-card:hover > span {
  border-color: var(--jade);
}

.choice-card input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.choice-card input:checked + span {
  border-color: var(--jade);
  background: var(--mint);
  box-shadow: inset 4px 0 0 var(--jade);
}

.choice-card input:checked + span::after {
  border-color: var(--jade);
  background: var(--jade);
  color: #ffffff;
}

.choice-card strong,
.choice-card small {
  display: block;
}

.choice-card strong {
  color: var(--ink);
  font-size: 16px;
}

.choice-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.text-field {
  display: block;
  margin-top: 22px;
}

.text-field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 750;
}

.text-field input,
.text-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.text-field textarea {
  min-height: 110px;
  resize: vertical;
}

.text-field input:focus,
.text-field textarea:focus {
  border-color: var(--jade);
}

.privacy-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.form-error {
  min-height: 26px;
  margin: 16px 0 0;
  color: var(--danger);
  font-size: 14px;
  font-weight: 750;
}

.form-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px -16px 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(244, 246, 245, 0.96);
  backdrop-filter: blur(12px);
}

.form-next,
.form-submit {
  flex: 1;
}

.back-action {
  display: grid;
  width: 48px;
  min-width: 48px;
  height: 48px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 22px;
}

.success-state {
  max-width: 680px;
  padding: 40px 0 12px;
}

.success-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: var(--jade);
  color: #ffffff;
  font-size: 26px;
}

.success-state h3 {
  margin: 22px 0 8px;
  font-size: 32px;
}

.success-state p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 17px;
}

/* Reusable date signal */
.date-lab {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--ink);
  color: #ffffff;
}

.date-lab .chapter-count {
  color: #aeb8c7;
}

.date-lab .section-kicker {
  color: var(--lemon);
}

.date-lab .section-lead,
.date-lab .privacy-note {
  color: #bdc6d3;
}

.date-layout {
  display: grid;
  gap: 36px;
}

.date-form {
  min-width: 0;
  padding-top: 28px;
  border-top: 1px solid #48546a;
}

.date-form legend,
.date-form .text-field > span {
  color: #ffffff;
}

.date-form legend {
  font-family: inherit;
  font-size: 17px;
}

.compact-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.compact-options label {
  position: relative;
  cursor: pointer;
}

.compact-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.compact-options span {
  display: grid;
  min-height: 48px;
  place-items: center;
  padding: 8px 10px;
  border: 1px solid #58667d;
  border-radius: var(--radius);
  color: #e9edf2;
  font-size: 14px;
  text-align: center;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.compact-options input:checked + span {
  border-color: var(--lemon);
  background: #344057;
  color: #ffffff;
  box-shadow: inset 0 -3px 0 var(--lemon);
}

.compact-options input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.date-form .text-field input,
.date-form .text-field textarea {
  border-color: #536077;
  background: #202b40;
  color: #ffffff;
}

.date-form .text-field input::placeholder,
.date-form .text-field textarea::placeholder {
  color: #9faabc;
}

.date-form .form-error {
  color: #ffb4ab;
}

.date-form > .primary-action {
  width: 100%;
}

footer {
  display: grid;
  gap: 14px;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid #354158;
  background: #11192a;
  color: #aeb8c7;
  font-size: 12px;
}

footer p {
  margin: 0;
}

.footer-link {
  width: max-content;
  border-color: #526078;
  color: #e5eaf0;
}

@media (min-width: 700px) {
  :root {
    --rail-height: 72px;
  }

  .chapter-rail {
    grid-template-columns: 48px minmax(0, 1fr) 140px;
    padding-inline: max(24px, calc((100% - 1120px) / 2));
  }

  .chapter-rail.is-hero {
    grid-template-columns: minmax(0, 1fr) 140px;
  }

  .rail-title strong {
    font-size: 15px;
  }

  .rail-title span {
    font-size: 12px;
  }

  .section-inner {
    width: min(100% - 64px, 1080px);
  }

  h1 {
    font-size: 78px;
  }

  h2 {
    font-size: 42px;
  }

  .hero-content {
    width: min(100% - 64px, 1080px);
    padding: 120px 0 110px;
  }

  .hero-line {
    margin: 24px 0 32px;
    font-size: 20px;
  }

  .hero .primary-action {
    width: auto;
  }

  .story-section,
  .future-section,
  .memory-section,
  .answer-section,
  .date-lab,
  .confession-section {
    padding: 120px 0;
  }

  .memory-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 52px;
  }

  .like-list li {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 18px;
    padding: 21px 0;
  }

  .like-list p {
    font-size: 17px;
  }

  .page-quote {
    padding-left: 24px;
    font-size: 25px;
  }

  .growth-points section {
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 24px;
    padding: 26px 0;
  }

  .growth-points p {
    font-size: 17px;
  }

  .memory-notes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .memory-notes article {
    padding: 22px;
  }

  .future-glance ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 28px;
  }

  .memory-line li {
    grid-template-columns: 58px minmax(0, 1fr);
    padding: 24px;
  }

  .future-list li {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 18px;
    padding: 24px 0;
  }

  .future-list li::after {
    top: 24px;
  }

  .future-list li > span {
    max-width: 720px;
  }

  .confession-copy h2 {
    font-size: 48px;
  }

  .confession-thesis {
    margin-top: 36px;
    padding: 24px 0 24px 28px;
    font-size: 27px;
  }

  .heart-statement {
    padding: 28px;
  }

  .heart-statement strong {
    font-size: 25px;
  }

  .response-panel {
    padding: 28px;
  }

  .response-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .letter-sections section {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 24px;
    padding: 28px 0;
  }

  .letter-sections p,
  .letter-promise {
    font-size: 17px;
  }

  .answer-heading {
    grid-template-columns: minmax(0, 1fr) 190px;
    align-items: end;
    gap: 40px;
  }

  .choice-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .activity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .choice-card,
  .choice-card > span {
    min-height: 108px;
  }

  .form-actions,
  .page-nav {
    position: static;
    margin: 48px 0 0;
    padding: 24px 0 0;
    background: transparent;
    backdrop-filter: none;
  }

  .page-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .page-nav .primary-action,
  .page-nav .page-back-link {
    width: auto;
  }

  .date-layout {
    gap: 56px;
  }

  .compact-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .date-form > .primary-action {
    width: auto;
  }

  footer {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding-inline: max(32px, calc((100% - 1080px) / 2));
  }
}

@media (min-width: 1000px) {
  h1 {
    font-size: 96px;
  }

  h2 {
    font-size: 46px;
  }

  .hero-content {
    text-align: left;
  }

  .date-layout {
    grid-template-columns: minmax(0, 0.78fr) minmax(460px, 1.22fr);
    gap: 80px;
  }

  .date-form {
    padding: 0 0 0 48px;
    border-top: 0;
    border-left: 1px solid #48546a;
  }

  .activity-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
