:root {
  color-scheme: dark;
  --bg: #070707;
  --bg-soft: #11100f;
  --text: #f4efe1;
  --muted: rgba(244, 239, 225, 0.62);
  --faint: rgba(244, 239, 225, 0.16);
  --line: rgba(244, 239, 225, 0.13);
  --glass: rgba(255, 255, 255, 0.055);
  --glow: rgba(220, 211, 159, 0.8);
  --glow-soft: rgba(220, 211, 159, 0.23);
  --accent: #ded6aa;
  --accent-two: #9bb7b2;
  --cursor-x: 0;
  --cursor-y: 0;
  --aged-text: #f4efe1;
  --grid-opacity: 0.22;
  --particle-opacity: 0.46;
  --aura-opacity: 0.64;
  --aura-breathe-opacity: 0.8;
  --breathe-duration: 16s;
  --glow-duration: 6s;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--aged-text);
  background:
    radial-gradient(
      circle at calc(50% + var(--cursor-x) * 24%) calc(20% + var(--cursor-y) * 18%),
      color-mix(in srgb, var(--accent-two) 18%, transparent),
      transparent 34rem
    ),
    linear-gradient(145deg, var(--bg), var(--bg-soft) 52%, #050505);
  overflow-x: hidden;
  transition: background 900ms ease, color 900ms ease;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
  opacity: var(--grid-opacity);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  content: "";
  opacity: 0.13;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.58'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.ambient,
#particleCanvas,
.aura {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.ambient {
  z-index: 0;
  overflow: hidden;
}

#particleCanvas {
  opacity: var(--particle-opacity);
}

.aura {
  border-radius: 999px;
  filter: blur(78px);
  opacity: var(--aura-opacity);
  transform: translate3d(calc(var(--cursor-x) * 22px), calc(var(--cursor-y) * 18px), 0);
  animation: breathe var(--breathe-duration) ease-in-out infinite alternate;
}

.aura-one {
  width: 42vw;
  height: 42vw;
  min-width: 360px;
  min-height: 360px;
  top: -16%;
  left: -12%;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.aura-two {
  width: 48vw;
  height: 48vw;
  right: -16%;
  bottom: -18%;
  background: color-mix(in srgb, var(--accent-two) 16%, transparent);
  animation-delay: -6s;
}

.aura-three {
  width: 34vw;
  height: 34vw;
  left: 42%;
  top: 38%;
  background: rgba(255, 255, 255, 0.055);
  animation-delay: -11s;
}

/* ── Language Switcher ── */
.lang-switch {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 25;
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 7, 7, 0.58);
  backdrop-filter: blur(20px);
}

.lang-btn {
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  background: transparent;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 200ms ease, background 200ms ease;
}

.lang-btn.is-active {
  color: var(--text);
  background: rgba(244, 239, 225, 0.12);
}

.shell {
  position: relative;
  z-index: 3;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.intro-view {
  display: grid;
  min-height: 100vh;
  place-content: center;
  padding: 80px 0;
  text-align: center;
  animation: pageIn 1400ms ease both;
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 930px;
  margin-bottom: 46px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.1rem, 9vw, 8.8rem);
  font-weight: 400;
  line-height: 0.95;
}

h2 {
  max-width: 780px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.3rem, 5vw, 5.7rem);
  font-weight: 400;
  line-height: 1;
}

h3 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 4.8rem);
  font-weight: 400;
  line-height: 1.02;
}

.entry-form {
  display: grid;
  grid-template-columns: 1fr 1.3fr auto;
  align-items: end;
  width: min(940px, 100%);
  gap: 12px;
  padding: 12px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.032));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(22px);
}

label {
  display: grid;
  gap: 8px;
  text-align: left;
}

label span {
  padding-left: 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

input,
select {
  width: 100%;
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: 6px;
  outline: none;
  padding: 0 14px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.24);
  transition: border-color 220ms ease, background 220ms ease;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(244, 239, 225, 0.62) 50%),
    linear-gradient(135deg, rgba(244, 239, 225, 0.62) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size:
    6px 6px,
    6px 6px;
  background-repeat: no-repeat;
}

input:focus,
select:focus {
  border-color: rgba(244, 239, 225, 0.35);
  background-color: rgba(0, 0, 0, 0.38);
}

select option {
  color: #f4efe1;
  background: #1a1a18;
}

.birth-selects {
  display: grid;
  grid-template-columns: 1fr 1fr 0.8fr;
  gap: 8px;
}

.primary-action,
.ghost-action,
.text-action {
  min-height: 54px;
  border-radius: 6px;
  border: 1px solid rgba(244, 239, 225, 0.22);
  color: var(--text);
  background: rgba(244, 239, 225, 0.11);
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.primary-action {
  padding: 0 22px;
  white-space: nowrap;
}

.primary-action:hover,
.ghost-action:hover,
.text-action:hover {
  transform: translateY(-1px);
  border-color: rgba(244, 239, 225, 0.38);
  background: rgba(244, 239, 225, 0.15);
}

.form-note {
  grid-column: 1 / -1;
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.result-view {
  display: none;
  padding: 28px 0 78px;
}

.app[data-stage="result"] .intro-view {
  display: none;
}

.app[data-stage="result"] .result-view {
  display: block;
}

.result-top {
  max-width: 760px;
  padding-top: 18px;
  margin-bottom: 18px;
}

.result-top h2 {
  font-size: clamp(2rem, 4.4vw, 4.6rem);
}

.sound-dock {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  display: flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 7, 7, 0.58);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(20px);
}

.sound-dock button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  font-size: 0.72rem;
}

.sound-dock button.is-active {
  color: var(--text);
  background: rgba(244, 239, 225, 0.12);
}

.result-stage {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(440px, 460px);
  align-items: start;
  gap: clamp(32px, 3.6vw, 46px);
  min-height: calc(100vh - 132px);
  padding-bottom: 5vh;
}

.progress-hero {
  display: grid;
  align-content: center;
  gap: 18px;
  width: 100%;
  max-width: 460px;
  min-width: 0;
  padding: clamp(30px, 3vw, 38px);
  border: 1px solid rgba(244, 239, 225, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 60px rgba(255, 255, 255, 0.018);
}

.progress-copy p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.45rem);
}

.progress-copy strong {
  display: block;
  margin-bottom: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4rem, 6.1vw, 6.35rem);
  font-weight: 400;
  line-height: 0.82;
  white-space: nowrap;
}

.life-line {
  display: grid;
  gap: 10px;
  width: 100%;
}

.life-line-track {
  position: relative;
  height: 9px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(244, 239, 225, 0.17), rgba(244, 239, 225, 0.045)),
    rgba(0, 0, 0, 0.28);
  overflow: visible;
}

.life-line-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(244, 239, 225, 0.26), var(--accent));
  box-shadow: 0 0 18px var(--glow-soft);
  transition: width 2100ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.life-line-now {
  position: absolute;
  top: 50%;
  left: var(--progress, 0%);
  width: 15px;
  height: 15px;
  border: 1px solid rgba(244, 239, 225, 0.7);
  border-radius: 999px;
  background: var(--text);
  box-shadow: 0 0 22px rgba(244, 239, 225, 0.44);
  transform: translate(-50%, -50%);
  transition: left 2100ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.life-line-labels {
  display: flex;
  justify-content: space-between;
  color: rgba(244, 239, 225, 0.42);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.progress-basis {
  max-width: 34rem;
  margin: 0;
  color: rgba(244, 239, 225, 0.62);
  font-size: clamp(0.92rem, 1.2vw, 1.02rem);
  line-height: 1.65;
}

.calendar-section {
  min-height: 0;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid rgba(244, 239, 225, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 60px rgba(255, 255, 255, 0.018);
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading .eyebrow {
  margin-bottom: 10px;
}

.ghost-action,
.text-action {
  padding: 0 16px;
}

.text-action {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.calendar-wrap {
  display: grid;
  justify-content: center;
  padding: clamp(6px, 1.2vw, 12px) 0;
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(52, clamp(3px, 0.5vw, 6px));
  gap: clamp(1px, 0.18vw, 2.2px);
  contain: layout style paint;
  width: 100%;
  max-width: 100%;
}

.week-dot {
  aspect-ratio: 1;
  border-radius: 35%;
  opacity: 0;
  background: var(--glow);
  box-shadow: 0 0 10px var(--glow-soft);
  transform: scale(0.4);
  animation: dotArrive 600ms ease forwards;
}

.week-dot.is-lived {
  background: rgba(244, 239, 225, 0.12);
  filter: blur(0.45px);
  box-shadow: none;
  animation: dotArrive 600ms ease forwards, livedFade 1700ms ease forwards;
}

.week-dot.is-current {
  background: var(--text);
  box-shadow: 0 0 18px rgba(244, 239, 225, 0.55);
  animation: dotArrive 600ms ease forwards, currentPulse 2800ms ease-in-out infinite;
}

.calendar-caption {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.calendar-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
}

.calendar-footer .ghost-action {
  min-height: 40px;
  white-space: nowrap;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 24px;
  padding: 7vh 0 8vh;
}

.metric-card {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-top: 1px solid var(--line);
}

.metric-card span {
  color: var(--muted);
  font-size: clamp(0.95rem, 1.4vw, 1.12rem);
}

.metric-card strong {
  display: block;
  margin: 8px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.2rem, 6.6vw, 6.8rem);
  font-weight: 400;
  line-height: 0.86;
}

/* ========================================
   Timeline — Apple-style card timeline
   ======================================== */

.timeline-section {
  padding: 5vh 0 8vh;
}

.tl-header {
  margin-bottom: 48px;
}

.tl-header .eyebrow {
  margin-bottom: 12px;
}

.tl-header h3 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.timeline-container {
  position: relative;
  max-width: 600px;
  padding-left: 40px;
}

/* ── Timeline rail ── */
.timeline-container::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 13px;
  width: 1px;
  background: rgba(244, 239, 225, 0.08);
}

/* ── Each event card ── */
.tl-card {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 16px;
  margin-bottom: 32px;
  animation: tlFadeIn 600ms ease both;
  animation-delay: calc(var(--i, 0) * 80ms);
}

@keyframes tlFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tl-card:last-child {
  margin-bottom: 0;
}

/* ── Timeline node (left dot) ── */
.tl-node {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(244, 239, 225, 0.20);
  background: rgba(244, 239, 225, 0.04);
  margin-top: 10px;
  flex-shrink: 0;
  z-index: 2;
}

/* Current / now node */
.tl-node.is-now {
  border-color: rgba(155, 183, 178, 0.7);
  background: rgba(155, 183, 178, 0.28);
  box-shadow: 0 0 12px rgba(155, 183, 178, 0.22);
}

/* ── Card body ── */
.tl-body {
  padding: 18px 22px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(244, 239, 225, 0.06);
}

/* ── Top row: title + age ── */
.tl-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}

.tl-title {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tl-age {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0.85;
  flex-shrink: 0;
}

/* ── Description ── */
.tl-desc {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* ── Personal context ── */
.tl-context {
  margin: 0;
  color: rgba(244, 239, 225, 0.35);
  font-size: 0.78rem;
  font-style: italic;
  line-height: 1.45;
}

/* ── Empty state ── */
.timeline-empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding-left: 40px;
}

/* ── Mobile ── */
@media (max-width: 560px) {
  .timeline-container {
    padding-left: 32px;
  }

  .tl-card {
    grid-template-columns: 24px 1fr;
    gap: 12px;
    margin-bottom: 24px;
  }

  .tl-body {
    padding: 14px 16px;
    border-radius: 8px;
  }

  .tl-title {
    font-size: 0.95rem;
  }

  .tl-age {
    font-size: 0.8rem;
  }

  .tl-desc {
    font-size: 0.82rem;
  }

  .tl-context {
    font-size: 0.72rem;
  }
}

.closing {
  display: grid;
  gap: 32px;
  min-height: 70vh;
  place-content: center;
  text-align: center;
}

blockquote {
  max-width: 880px;
  margin: 0 auto;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 7vw, 7.5rem);
  font-weight: 400;
  line-height: 0.98;
}

.footer-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.source-note {
  max-width: 720px;
  margin: 0 auto;
  color: rgba(244, 239, 225, 0.45);
  font-size: 0.86rem;
  line-height: 1.65;
}

.poster-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(18px);
}

.poster-modal[hidden] {
  display: none;
}

.poster-panel {
  display: grid;
  grid-template-columns: minmax(230px, 340px) minmax(300px, 460px);
  align-items: center;
  gap: 28px;
  width: min(940px, 100%);
  max-height: min(920px, 92vh);
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 12, 11, 0.88);
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.58);
  overflow: auto;
}

.poster-copy h3 {
  font-size: clamp(2rem, 4vw, 3.9rem);
}

#posterPreview {
  width: min(100%, 420px);
  max-height: 78vh;
  justify-self: center;
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.46);
}

.poster-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---- Donation button ---- */

.donate-action {
  min-height: 54px;
  padding: 0 22px;
  border-radius: 24px;
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.08);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease, box-shadow 220ms ease;
  animation: donatePulse 3s ease-in-out infinite;
}

.donate-action:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.7);
  background: rgba(245, 158, 11, 0.15);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.12);
}

@keyframes donatePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
  50% { box-shadow: 0 0 18px 2px rgba(245, 158, 11, 0.1); }
}

/* ---- Donation modal ---- */

.donate-modal {
  position: fixed;
  inset: 0;
  z-index: 31;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(18px);
}

.donate-modal[hidden] {
  display: none;
}

.donate-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: min(400px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(12, 12, 11, 0.92);
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.58);
  text-align: center;
}

.donate-close {
  position: absolute;
  top: 12px;
  right: 16px;
  padding: 4px 8px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  transition: color 180ms ease;
}

.donate-close:hover {
  color: var(--text);
}

.donate-icon {
  font-size: 2rem;
}

.donate-header h3 {
  margin: 8px 0 4px;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
}

.donate-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.donate-amounts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.donate-amount {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 120ms ease;
}

.donate-amount:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.donate-amount.is-popular {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
}

.donate-amount.is-popular:hover {
  border-color: rgba(245, 158, 11, 0.7);
  background: rgba(245, 158, 11, 0.16);
}

.donate-amount.is-custom {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--muted);
}

.donate-amount.is-custom:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text);
}

.donate-badge {
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.donate-custom-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
}

.donate-currency {
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 500;
}

.donate-custom-input input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  -moz-appearance: textfield;
}

.donate-custom-input input::-webkit-outer-spin-button,
.donate-custom-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.donate-custom-input input:focus {
  outline: none;
  border-color: rgba(245, 158, 11, 0.5);
}

.donate-continue {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: #f59e0b;
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 180ms ease, transform 120ms ease;
}

.donate-continue:hover {
  background: #fbbf24;
  transform: translateY(-1px);
}

.donate-footer-note {
  margin: 0;
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.75rem;
}

/* ---- Donation: China (QR codes) ---- */

.donate-china[hidden] {
  display: none;
}

.donate-qr-tabs {
  display: flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.donate-qr-tab {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.donate-qr-tab + .donate-qr-tab {
  border-left: 1px solid var(--line);
}

.donate-qr-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.donate-qr-tab.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.donate-qr-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0;
  max-width: 220px;
  margin: 0 auto;
}

.donate-qr {
  display: block;
  width: 200px;
  height: 200px;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  object-fit: contain;
  background: #fff;
  flex-shrink: 0;
}

.donate-qr[hidden] {
  display: none;
}

.donate-qr-tip {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.donate-qr-suggested {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
}

/* Hide PayPal section when not needed */
.donate-paypal[hidden] {
  display: none;
}

.app[data-stage="result"] .result-top,
.app[data-stage="result"] .result-stage,
.app[data-stage="result"] .metrics,
.app[data-stage="result"] .timeline-section,
.app[data-stage="result"] .closing {
  opacity: 0;
  transform: translateY(24px);
}

.app[data-stage="result"][data-revealed="true"] .result-top {
  animation: reveal 1000ms ease forwards;
}

.app[data-stage="result"][data-revealed="true"] .result-stage {
  animation: reveal 1200ms ease 300ms forwards;
}

.app[data-stage="result"][data-revealed="true"] .metrics {
  animation: reveal 1200ms ease 1000ms forwards;
}

.app[data-stage="result"][data-revealed="true"] .timeline-section {
  animation: reveal 1200ms ease 1250ms forwards;
}

.app[data-stage="result"][data-revealed="true"] .closing {
  animation: reveal 1200ms ease 1500ms forwards;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes breathe {
  to {
    opacity: var(--aura-breathe-opacity);
    transform: translate3d(calc(var(--cursor-x) * -18px), calc(var(--cursor-y) * -14px), 0)
      scale(1.08);
  }
}

@keyframes dotArrive {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes livedFade {
  to {
    opacity: 0.19;
    transform: scale(0.92);
  }
}

@keyframes remainGlow {
  from {
    opacity: 0.54;
  }

  to {
    opacity: 0.92;
  }
}

@keyframes currentPulse {
  50% {
    opacity: 0.55;
    transform: scale(0.82);
  }
}

@media (max-width: 1120px) {
  .shell {
    width: min(100% - 28px, 720px);
  }

  .entry-form,
  .result-stage,
  .progress-hero,
  .section-heading {
    grid-template-columns: 1fr;
  }

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

  .result-top {
    padding-top: 26px;
    margin-bottom: 20px;
  }

  .result-stage {
    min-height: auto;
  }

  .progress-hero {
    width: 100%;
    max-width: none;
    padding: 28px;
  }

  .metric-card {
    min-height: 185px;
  }

  .poster-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 22px, 520px);
  }

  .intro-view {
    padding: 44px 0;
  }

  h1 {
    margin-bottom: 30px;
  }

  .entry-form {
    padding: 10px;
  }

  .primary-action,
  input,
  select {
    min-height: 50px;
  }

  .birth-selects {
    grid-template-columns: 1fr;
  }

  .result-view {
    padding-top: 26px;
  }

  .result-top {
    padding-top: 44px;
  }

  .result-top h2 {
    font-size: clamp(2rem, 10vw, 3.1rem);
  }

  .section-heading h3 {
    font-size: clamp(1.7rem, 8vw, 2.8rem);
  }

  .progress-hero {
    gap: 14px;
    padding: 22px;
  }

  .progress-copy p {
    margin-bottom: 8px;
    font-size: 0.95rem;
  }

  .progress-copy strong {
    margin-bottom: 10px;
    font-size: clamp(3.2rem, 16vw, 5rem);
  }

  .progress-basis {
    font-size: 0.88rem;
    line-height: 1.55;
  }

  .life-line-track {
    height: 7px;
  }

  .life-line-now {
    width: 13px;
    height: 13px;
  }

  .sound-dock {
    top: 10px;
    right: 10px;
    max-width: calc(100% - 20px);
  }

  .sound-dock button {
    min-height: 28px;
    padding: 0 8px;
    font-size: 0.68rem;
  }

  .calendar-wrap {
    padding: 6px 0;
  }

  .calendar-footer {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .calendar-footer .ghost-action {
    justify-self: start;
  }

  .week-grid {
    grid-template-columns: repeat(52, clamp(2.6px, 1.15vw, 4.5px));
    gap: 1.25px;
  }

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

  .metric-card {
    min-height: 138px;
  }

  .metric-card strong {
    font-size: clamp(2.65rem, 14vw, 4.1rem);
  }

  .footer-actions {
    display: grid;
  }
}

/* ── Chinese language overrides ── */
html[data-lang="zh"] body {
  font-family:
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
}

html[data-lang="zh"] h1 {
  font-size: clamp(2.8rem, 8vw, 7.5rem);
  line-height: 1.08;
}

html[data-lang="zh"] h2 {
  font-size: clamp(2rem, 4.4vw, 4.8rem);
}

html[data-lang="zh"] h3 {
  font-size: clamp(1.7rem, 3.4vw, 4rem);
}

html[data-lang="zh"] .timeline-phase {
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
}

html[data-lang="zh"] .tl-title {
  font-weight: 500;
}

html[data-lang="zh"] .tl-context {
  font-style: normal;
  opacity: 0.45;
}

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