* { box-sizing: border-box; }

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

body {
  min-width: 20rem;
  min-height: 100vh;
  margin: 0;
  color: var(--cream-50);
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at 17% 12%, rgb(255 245 207 / 70%) 0 1px, transparent 1.5px),
    radial-gradient(circle at 82% 8%, rgb(255 255 255 / 46%) 0 1px, transparent 1.5px),
    radial-gradient(circle at 71% 42%, rgb(255 245 207 / 40%) 0 1px, transparent 2px),
    radial-gradient(circle at 25% 70%, rgb(255 255 255 / 36%) 0 1px, transparent 1.5px),
    linear-gradient(155deg, var(--night-950), var(--night-800) 58%, #18392c);
  background-attachment: fixed;
  background-size: 17rem 19rem, 23rem 17rem, 29rem 31rem, 37rem 27rem, auto;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

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

.app-shell { width: min(100%, 68rem); margin: 0 auto; padding: 1rem clamp(1rem, 4vw, 2.5rem) 6rem; }
.topbar { min-height: 4.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; font-size: .75rem; font-weight: 800; letter-spacing: .15em; }
.brand img { width: 2.75rem; height: 2.75rem; border: 1px solid var(--line); border-radius: 50%; object-fit: cover; }
.icon-link { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; text-decoration: none; background: rgb(255 255 255 / 4%); }

.channel-banner { margin: .5rem 0 1rem; padding: .85rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: .8rem; border: 1px solid rgb(245 223 160 / 18%); border-radius: var(--radius-sm); color: var(--mist-200); background: rgb(255 245 207 / 6%); font-size: .84rem; }
.channel-banner a { flex: none; color: var(--moon-100); font-weight: 800; text-underline-offset: .2em; }

.moon-hero { position: relative; min-height: 29rem; display: grid; place-items: center; padding: 2.5rem 1rem 1.5rem; overflow: hidden; }
.moon-orbit { position: absolute; width: min(86vw, 34rem); aspect-ratio: 1; border: 1px solid rgb(255 250 240 / 10%); border-radius: 50%; transform: rotate(-16deg); }
.moon-orbit::before, .moon-orbit::after { content: ""; position: absolute; width: .42rem; aspect-ratio: 1; border-radius: 50%; background: var(--moon-100); box-shadow: 0 0 1rem var(--moon-100); }
.moon-orbit::before { top: 10%; left: 20%; }
.moon-orbit::after { right: 4%; bottom: 30%; }
.moon-disc { position: absolute; width: min(72vw, 21rem); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 32% 27%, rgb(126 97 48 / 11%) 0 7%, transparent 8%), radial-gradient(circle at 68% 66%, rgb(126 97 48 / 10%) 0 12%, transparent 13%), var(--moon-100); box-shadow: 0 0 4rem rgb(255 229 143 / 22%), 0 0 9rem rgb(255 229 143 / 10%); }
.moon-copy { z-index: 1; width: min(85%, 17rem); color: #203228; text-align: center; }
.moon-copy .kicker { margin: 0 0 .7rem; font-size: .68rem; font-weight: 900; letter-spacing: .14em; }
.moon-copy blockquote { margin: 0; font-family: var(--font-serif); font-size: clamp(1.1rem, 4vw, 1.38rem); line-height: 1.62; word-break: keep-all; }
.moon-copy time { display: block; margin-top: 1rem; color: #587063; font-size: .72rem; }

.summary-row { margin: -1rem auto 1.5rem; position: relative; width: min(100%, 40rem); display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius-md); background: rgb(6 16 15 / 72%); backdrop-filter: blur(1rem); box-shadow: var(--shadow); }
.summary-item { padding: 1rem .6rem; text-align: center; }
.summary-item + .summary-item { border-left: 1px solid var(--line); }
.summary-item strong { display: block; color: var(--moon-100); font-family: var(--font-serif); font-size: 1.45rem; }
.summary-item span { color: var(--mist-400); font-size: .72rem; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 2.25rem 0 1rem; }
.section-head h1, .section-head h2 { margin: 0; font-family: var(--font-serif); font-weight: 500; letter-spacing: -.03em; }
.section-head h1 { font-size: clamp(1.9rem, 7vw, 3rem); }
.section-head h2 { font-size: 1.45rem; }
.section-head p { margin: .45rem 0 0; color: var(--mist-400); font-size: .86rem; }

.button { min-height: 2.9rem; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .75rem 1rem; border: 1px solid transparent; border-radius: 999px; cursor: pointer; color: #13291e; background: var(--moon-100); font-weight: 850; text-decoration: none; }
.button.secondary { color: var(--cream-50); border-color: var(--line); background: rgb(255 255 255 / 5%); }
.button.danger { color: #321a17; background: #f0b8af; }
.button.small { min-height: 2.3rem; padding: .5rem .8rem; font-size: .78rem; }
.button:disabled { cursor: not-allowed; opacity: .45; }

.wish-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: .85rem; }
.wish-card { position: relative; min-height: 10.5rem; padding: 1.2rem; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--radius-md); background: linear-gradient(145deg, rgb(255 255 255 / 7%), rgb(255 255 255 / 2%)); box-shadow: 0 1rem 3rem rgb(0 0 0 / 10%); }
.wish-card::before { content: "✦"; position: absolute; top: 1rem; right: 1rem; color: var(--moon-200); font-size: .72rem; }
.wish-card p { margin: 0; padding-right: 1rem; font-family: var(--font-serif); font-size: 1.05rem; line-height: 1.65; word-break: keep-all; }
.wish-card footer { margin-top: 1rem; display: flex; justify-content: space-between; align-items: center; color: var(--mist-400); font-size: .72rem; }
.wish-card button { color: var(--moon-100); border: 0; cursor: pointer; background: transparent; font-weight: 800; }

.empty-state { padding: 3rem 1.5rem; border: 1px dashed rgb(255 250 240 / 18%); border-radius: var(--radius-md); text-align: center; color: var(--mist-200); }
.empty-state .empty-stars { color: var(--moon-200); font-size: 1.7rem; letter-spacing: .6em; }
.empty-state h2 { margin: 1rem 0 .4rem; color: var(--cream-50); font-family: var(--font-serif); font-weight: 500; }
.empty-state p { max-width: 28rem; margin: 0 auto 1.2rem; color: var(--mist-400); line-height: 1.7; }

.bottom-nav { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; min-height: 4.7rem; display: flex; justify-content: center; border-top: 1px solid var(--line); background: rgb(6 16 15 / 90%); backdrop-filter: blur(1rem); }
.bottom-nav .inner { width: min(100%, 34rem); display: grid; grid-template-columns: repeat(4, 1fr); }
.bottom-nav a { display: grid; place-items: center; align-content: center; gap: .2rem; color: var(--mist-400); font-size: .68rem; text-decoration: none; }
.bottom-nav a[aria-current="page"] { color: var(--moon-100); }
.bottom-nav b { font-size: 1rem; font-weight: 500; }

.onboarding { width: min(100%, 38rem); margin: 2rem auto; padding: clamp(1.2rem, 5vw, 2.4rem); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); box-shadow: var(--shadow); }
.onboarding h1 { margin: 0; font-family: var(--font-serif); font-size: clamp(2rem, 8vw, 3.4rem); font-weight: 500; line-height: 1.05; }
.onboarding > p { color: var(--mist-200); line-height: 1.7; }
.form-stack { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .5rem; }
.field label, .field legend { color: var(--mist-200); font-size: .82rem; font-weight: 800; }
.field input, .field textarea { width: 100%; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--cream-50); background: rgb(0 0 0 / 20%); }
.field textarea { min-height: 8rem; resize: vertical; line-height: 1.6; }
.field-meta { display: flex; justify-content: space-between; gap: 1rem; color: var(--mist-400); font-size: .72rem; line-height: 1.5; }
.consent-list { margin: 0; padding: 0; display: grid; gap: .7rem; border: 0; }
.check { display: flex; align-items: flex-start; gap: .7rem; color: var(--mist-200); font-size: .82rem; line-height: 1.5; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: .12rem; accent-color: var(--moon-200); }
.check a { text-underline-offset: .2em; }
.form-error { min-height: 1.3rem; margin: 0; color: var(--danger-300); font-size: .8rem; }

dialog { width: min(calc(100% - 2rem), 34rem); padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--cream-50); background: var(--night-800); box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(0 0 0 / 68%); backdrop-filter: blur(.25rem); }
.dialog-body { padding: 1.4rem; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.dialog-head h2 { margin: 0; font-family: var(--font-serif); font-weight: 500; }
.dialog-close { width: 2.5rem; height: 2.5rem; border: 1px solid var(--line); border-radius: 50%; color: var(--cream-50); cursor: pointer; background: transparent; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }

.undo-toast { position: fixed; z-index: 20; right: 1rem; bottom: 5.6rem; left: 1rem; width: min(calc(100% - 2rem), 30rem); margin-left: auto; padding: .85rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border: 1px solid rgb(245 223 160 / 25%); border-radius: var(--radius-sm); color: var(--night-950); background: var(--moon-100); box-shadow: var(--shadow); font-size: .82rem; font-weight: 750; }
.undo-toast button { padding: .35rem .6rem; border: 1px solid rgb(6 16 15 / 25%); border-radius: 999px; color: var(--night-950); cursor: pointer; background: transparent; font-weight: 900; }

.page-card { padding: 1.2rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); }
.page-card + .page-card { margin-top: .85rem; }
.page-card h2 { margin: 0 0 .5rem; font-family: var(--font-serif); font-weight: 500; }
.page-card p { color: var(--mist-200); line-height: 1.7; }
.action-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.muted { color: var(--mist-400); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (min-width: 760px) {
  .bottom-nav { right: 1rem; bottom: 1rem; left: auto; width: 22rem; border: 1px solid var(--line); border-radius: 999px; }
  .app-shell { padding-bottom: 2rem; }
  .undo-toast { bottom: 6.4rem; }
}

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