:root {
  --night: #070b19;
  --navy: #0e1630;
  --violet: #2a214e;
  --plum: #4b2a5f;
  --rose: #ffb6c8;
  --peach: #ffd0a6;
  --gold: #ffd96f;
  --cyan: #8ff0ff;
  --mint: #a9f0c7;
  --cream: #fff8e8;
  --muted: rgba(255, 248, 232, 0.68);
  --line: rgba(255, 248, 232, 0.16);
  --panel: rgba(18, 25, 50, 0.78);
  --panel-soft: rgba(255, 248, 232, 0.055);
  --shadow: rgba(0, 0, 0, 0.36);
  color-scheme: dark;
  font-family: "Geeza Pro", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--cream);
  background:
    linear-gradient(145deg, #070b19 0%, #101321 43%, #20152e 100%);
  overflow-x: hidden;
  text-align: right;
}

button,
textarea {
  font: inherit;
}

button {
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(255, 217, 111, 0.95);
  outline-offset: 5px;
}

.site-shell {
  position: relative;
  isolation: isolate;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.framer-gradient-bg {
  position: absolute;
  inset: -16%;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 143, 177, 0.2), transparent 30rem),
    radial-gradient(circle at 80% 26%, rgba(143, 240, 255, 0.16), transparent 28rem),
    radial-gradient(circle at 48% 70%, rgba(255, 216, 107, 0.14), transparent 34rem),
    conic-gradient(from 230deg at 52% 40%, rgba(255, 182, 200, 0.13), transparent 19%, rgba(255, 217, 111, 0.12), transparent 45%, rgba(169, 240, 199, 0.1), transparent 68%, rgba(214, 179, 255, 0.13), transparent 86%);
  opacity: 0.9;
  will-change: transform;
  transform: translateZ(0);
}

.gradient-sheet {
  position: absolute;
  width: min(42rem, 74vw);
  aspect-ratio: 1;
  pointer-events: none;
  opacity: 0.34;
  border-radius: 999px;
  will-change: transform;
  transform: translateZ(0);
}

.sheet-rose {
  right: -10rem;
  top: 2rem;
  background: radial-gradient(circle, rgba(255, 143, 177, 0.26), rgba(255, 143, 177, 0.08) 48%, transparent 72%);
}

.sheet-gold {
  left: -12rem;
  top: 16rem;
  background: radial-gradient(circle, rgba(255, 216, 107, 0.23), rgba(255, 216, 107, 0.07) 50%, transparent 74%);
}

.sheet-cyan {
  left: 28%;
  bottom: -12rem;
  background: radial-gradient(circle, rgba(143, 240, 255, 0.2), rgba(214, 179, 255, 0.07) 48%, transparent 74%);
}

.floating-heart {
  position: absolute;
  left: var(--x);
  top: var(--y);
  color: var(--heart-color);
  font-size: clamp(1rem, 2vw, 1.65rem);
  text-shadow: 0 0 18px var(--heart-glow);
  will-change: transform, opacity;
}

.dust {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 0.22rem;
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.72);
  box-shadow: 0 0 10px rgba(255, 217, 111, 0.42);
}

.hero {
  min-height: 92vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(18rem, 0.72fr);
  gap: clamp(1.2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(4rem, 9vw, 7rem) 0 3rem;
}

.hero-copy {
  min-width: 0;
}

.eyebrow,
.kicker,
.tiny-label,
.progress,
.composer-footer span,
.note-meta span,
.note-meta time {
  color: var(--muted);
  font-size: clamp(0.74rem, 1.7vw, 0.86rem);
  font-weight: 800;
}

.eyebrow,
.kicker {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 0.9rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.06);
}

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

h1,
h2,
h3 {
  text-wrap: balance;
}

h1 {
  max-width: 9.5ch;
  margin-bottom: 1.1rem;
  font-family: "Geeza Pro", "Noto Naskh Arabic", serif;
  font-size: clamp(4rem, 14vw, 9.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.lede {
  max-width: 44rem;
  color: rgba(255, 248, 232, 0.78);
  font-size: clamp(1.08rem, 2.6vw, 1.45rem);
  line-height: 1.75;
}

.start-link,
.save-button,
.ghost-button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  font-weight: 900;
}

.start-link,
.save-button {
  padding: 0.9rem 1.25rem;
  color: #20172d;
  background: linear-gradient(135deg, var(--gold), var(--rose));
  box-shadow: 0 18px 42px rgba(255, 182, 200, 0.18);
}

.ghost-button {
  padding: 0.8rem 1rem;
  color: var(--cream);
  border: 1px solid var(--line);
  background: rgba(255, 248, 232, 0.075);
}

.keepsake,
.note-panel,
.letter-card,
.onboarding-card {
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: linear-gradient(145deg, rgba(255, 248, 232, 0.09), rgba(255, 248, 232, 0.035));
  box-shadow: 0 24px 60px var(--shadow);
}

.keepsake {
  position: relative;
  overflow: hidden;
  padding: clamp(1.2rem, 4vw, 1.7rem);
}

.keepsake::before {
  content: "";
  position: absolute;
  inset: auto -3rem -4rem auto;
  width: 12rem;
  aspect-ratio: 1;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 217, 111, 0.18), transparent 68%);
}

.keepsake p {
  position: relative;
  color: rgba(255, 248, 232, 0.76);
  line-height: 1.7;
}

.name-lock {
  position: relative;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 217, 111, 0.24);
  border-radius: 1.1rem;
  color: rgba(255, 248, 232, 0.82);
  background: rgba(255, 217, 111, 0.08);
}

.keepsake-notes {
  position: relative;
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.keepsake-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  padding: 0.72rem 0.78rem;
  border: 1px solid color-mix(in srgb, var(--heart-tone) 30%, rgba(255, 248, 232, 0.14));
  border-radius: 1rem;
  background: color-mix(in srgb, var(--heart-tone) 9%, rgba(255, 248, 232, 0.05));
  box-shadow: 0 0 26px var(--heart-glow);
}

.keepsake-note span {
  display: grid;
  place-items: center;
  width: 1.9rem;
  aspect-ratio: 1;
  border-radius: 999px;
  color: var(--heart-tone);
  background: color-mix(in srgb, var(--heart-tone) 12%, rgba(7, 11, 25, 0.5));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--heart-tone) 38%, transparent);
}

.keepsake-note p {
  margin: 0;
  color: rgba(255, 248, 232, 0.78);
  font-size: 0.9rem;
  line-height: 1.65;
}

.onboarding {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(5, 8, 18, 0.84);
}

.onboarding-card {
  width: min(680px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: clamp(1.25rem, 4vw, 2rem);
}

.onboarding-card h2 {
  margin-bottom: 0.6rem;
  font-family: "Geeza Pro", "Noto Naskh Arabic", serif;
  font-size: clamp(2.5rem, 8vw, 4.2rem);
  line-height: 1;
}

.soft {
  margin-bottom: 1.25rem;
  color: rgba(255, 248, 232, 0.75);
  line-height: 1.7;
}

.family-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.family-choice {
  min-height: 4.35rem;
  border: 1px solid rgba(255, 248, 232, 0.14);
  border-radius: 1.2rem;
  color: var(--cream);
  background: rgba(255, 248, 232, 0.06);
  cursor: pointer;
  text-align: right;
}

.family-choice strong,
.family-choice span {
  display: block;
}

.family-choice strong {
  margin-bottom: 0.25rem;
  font-size: 1.08rem;
}

.family-choice span {
  color: rgba(255, 248, 232, 0.6);
  font-size: 0.85rem;
}

.sister-waiting {
  position: relative;
  z-index: 1;
  min-height: 70vh;
  display: grid;
  place-items: center;
  padding: 4.5rem 1rem;
  text-align: center;
}

.waiting-card {
  width: min(560px, 100%);
  padding: clamp(1.5rem, 5vw, 2.6rem);
  border-radius: 1.6rem;
  border: 1px solid rgba(255, 242, 173, 0.16);
  background: rgba(12, 16, 32, 0.55);
  backdrop-filter: blur(10px);
}

.waiting-moon {
  font-size: clamp(2.6rem, 9vw, 3.8rem);
  color: var(--cream, #fff8e8);
  text-shadow: 0 0 28px rgba(255, 242, 173, 0.5);
  margin-bottom: 0.6rem;
}

.waiting-card h2 {
  margin: 0.2rem 0 0.8rem;
  font-family: "Geeza Pro", "Noto Naskh Arabic", serif;
  font-size: clamp(1.9rem, 6vw, 2.8rem);
  line-height: 1.1;
}

.waiting-lede {
  color: rgba(255, 248, 232, 0.82);
  line-height: 1.9;
  margin-bottom: 1.6rem;
}

.waiting-progress {
  margin: 0 auto 1.2rem;
  max-width: 22rem;
}

.waiting-bar {
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.12);
  overflow: hidden;
}

.waiting-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 216, 107, 0.95), rgba(255, 242, 173, 0.95));
  box-shadow: 0 0 16px rgba(255, 216, 107, 0.55);
}

.waiting-count {
  margin-top: 0.55rem;
  font-size: 0.95rem;
  color: rgba(255, 242, 173, 0.85);
}

.waiting-hint {
  font-size: 1.02rem;
  color: var(--cream, #fff8e8);
  margin-bottom: 0.5rem;
}

.waiting-soft {
  font-size: 0.85rem;
  color: rgba(255, 248, 232, 0.55);
  line-height: 1.7;
}

.sky-section,
.comment-preview,
.letter-section {
  padding: 4.5rem 0;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(18rem, 1fr);
  gap: 2rem;
  align-items: end;
  margin-bottom: 1.3rem;
}

.comment-preview {
  padding-top: 1rem;
}

.comment-preview-head {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(18rem, 1fr);
  gap: 2rem;
  align-items: end;
  margin-bottom: 1rem;
}

.comment-preview-head h2 {
  margin-bottom: 0;
  font-family: "Geeza Pro", "Noto Naskh Arabic", serif;
  font-size: clamp(2.45rem, 7vw, 5.1rem);
  line-height: 1;
}

.comment-preview-head p:not(.kicker) {
  max-width: 42rem;
  margin-bottom: 0.35rem;
  color: rgba(255, 248, 232, 0.74);
  line-height: 1.75;
}

.section-heading h2,
.letter-card h2 {
  margin-bottom: 0;
  font-family: "Geeza Pro", "Noto Naskh Arabic", serif;
  font-size: clamp(2.6rem, 8vw, 5.8rem);
  line-height: 1.02;
}

.section-heading p:not(.kicker) {
  max-width: 40rem;
  margin-bottom: 0.4rem;
  color: rgba(255, 248, 232, 0.74);
  line-height: 1.75;
}

.sky-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(18rem, 0.78fr);
  gap: 1rem;
  align-items: stretch;
}

.sky-board {
  position: relative;
  min-height: 34rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 217, 111, 0.08), transparent 12rem),
    linear-gradient(145deg, rgba(7, 12, 28, 0.95), rgba(12, 21, 44, 0.9));
  box-shadow: inset 0 0 0 1px rgba(255, 248, 232, 0.025), 0 20px 52px var(--shadow);
}

.star-field {
  position: absolute;
  inset: 0;
}

.star-field i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 2px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.42);
}

.sky-lines {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sky-line-base,
.sky-line-lit {
  fill: none;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
}

.sky-line-base {
  stroke: rgba(255, 248, 232, 0.12);
  stroke-width: 1.6;
}

.sky-line-lit {
  stroke: rgba(255, 217, 111, 0.95);
  stroke-width: 2.6;
}

.star-button {
  position: absolute;
  z-index: 4;
  width: clamp(2.7rem, 7vw, 3.4rem);
  aspect-ratio: 1;
  translate: -50% -50%;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.star-button:disabled {
  cursor: default;
}

.star-button span {
  position: absolute;
  inset: 50%;
  translate: -50% -50%;
  width: 0.72rem;
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.78);
  box-shadow: 0 0 18px rgba(255, 217, 111, 0.34);
}

.star-button.is-lit span {
  width: 0.86rem;
  background: linear-gradient(135deg, var(--gold), var(--rose));
  box-shadow: 0 0 26px rgba(255, 217, 111, 0.62);
}

.star-button.is-next span {
  width: 0.92rem;
  background: var(--gold);
}

.star-button.is-next::after {
  content: "";
  position: absolute;
  inset: 0.35rem;
  border: 1px solid rgba(255, 217, 111, 0.55);
  border-radius: 999px;
}

.heart-burst {
  position: absolute;
  z-index: 8;
  translate: -50% -50%;
  pointer-events: none;
}

.heart-burst span {
  position: absolute;
  left: 0;
  top: 0;
  color: var(--tone);
  font-size: 1.1rem;
  text-shadow: 0 0 16px color-mix(in srgb, var(--tone) 55%, transparent);
}

.completion-orbit {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 50%;
  width: 9rem;
  aspect-ratio: 1;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 217, 111, 0.25);
  border-radius: 999px;
  color: var(--gold);
  font-size: 2rem;
}

.note-panel {
  min-height: 28rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.2rem, 4vw, 2.1rem);
}

.progress {
  color: var(--gold);
}

.note-panel h3 {
  margin-bottom: 0.7rem;
  font-family: "Geeza Pro", "Noto Naskh Arabic", serif;
  font-size: clamp(2rem, 5vw, 3.15rem);
  line-height: 1.06;
}

.note-panel p:not(.progress) {
  color: rgba(255, 248, 232, 0.78);
  font-size: 1.08rem;
  line-height: 1.75;
}

.hint-row {
  margin: 1.1rem 0;
  color: rgba(255, 248, 232, 0.58);
}

.letter-card {
  position: relative;
  overflow: hidden;
  width: min(860px, 100%);
  margin: 0 auto 5rem;
  padding: clamp(1.35rem, 5vw, 3rem);
}

.letter-card::before {
  content: "";
  position: absolute;
  inset: -8rem auto auto -7rem;
  width: 18rem;
  aspect-ratio: 1;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 182, 200, 0.2), transparent 68%);
}

.letter-card > * {
  position: relative;
}

.letter-card p {
  color: rgba(255, 248, 232, 0.78);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.85;
}

.signature {
  color: var(--cream) !important;
  font-family: "Geeza Pro", "Noto Naskh Arabic", serif;
  font-size: 1.45rem !important;
}

.composer,
.sister-note,
.family-notes {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  background: rgba(255, 248, 232, 0.045);
}

.family-notes.is-preview {
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.composer label {
  display: block;
  margin-bottom: 0.6rem;
  font-weight: 900;
}

textarea {
  width: 100%;
  min-height: 8rem;
  resize: vertical;
  border: 1px solid rgba(255, 248, 232, 0.16);
  border-radius: 1rem;
  padding: 0.95rem;
  color: var(--cream);
  background: rgba(7, 11, 25, 0.52);
  line-height: 1.7;
}

textarea::placeholder {
  color: rgba(255, 248, 232, 0.44);
}

.composer-footer,
.composer-actions,
.note-meta,
.notes-title {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.composer-footer,
.notes-title {
  justify-content: space-between;
  margin-top: 0.85rem;
}

.notes-title {
  margin-top: 0;
  margin-bottom: 1rem;
  align-items: end;
}

.notes-title h3 {
  margin: 0;
  font-family: "Geeza Pro", "Noto Naskh Arabic", serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.notes-list {
  display: grid;
  gap: 0.85rem;
}

.family-notes.is-preview .notes-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.family-note {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--heart-tone) 36%, rgba(255, 248, 232, 0.16));
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at 12% 12%, var(--heart-glow), transparent 42%),
    rgba(255, 248, 232, 0.055);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.family-notes.is-preview .family-note {
  min-height: 9.5rem;
  align-content: start;
}

.family-note::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(120deg, transparent, color-mix(in srgb, var(--heart-tone) 14%, transparent), transparent);
  opacity: 0.65;
}

.heart-badge {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.75rem;
  aspect-ratio: 1;
  border-radius: 999px;
  color: var(--heart-tone);
  background: color-mix(in srgb, var(--heart-tone) 12%, rgba(255, 248, 232, 0.06));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--heart-tone) 40%, transparent), 0 0 30px var(--heart-glow);
  font-size: 1.2rem;
  will-change: transform;
}

.comment-copy {
  position: relative;
  z-index: 1;
}

.note-meta {
  margin-bottom: 0.45rem;
}

.note-meta strong {
  color: var(--cream);
}

.family-note p,
.empty {
  margin-bottom: 0;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  z-index: 30;
  right: 50%;
  bottom: 1rem;
  max-width: calc(100% - 2rem);
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--cream);
  background: rgba(7, 11, 25, 0.94);
  box-shadow: 0 16px 40px var(--shadow);
}

noscript {
  display: block;
  padding: 2rem;
  color: var(--cream);
}

@media (max-width: 900px) {
  .hero,
  .sky-grid,
  .section-heading,
  .comment-preview-head {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .keepsake {
    order: -1;
  }

  .family-notes.is-preview .notes-list {
    grid-template-columns: 1fr;
  }
}

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

  .family-grid {
    grid-template-columns: 1fr;
  }

  .sky-board {
    min-height: 25rem;
  }

  .note-panel {
    min-height: auto;
  }

  .composer-footer,
  .composer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .composer-actions button,
  .save-button,
  .ghost-button,
  .start-link {
    width: 100%;
  }
}

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