:root {
  color-scheme: light;
  --ivory: #fffaf2;
  --cream: #f7efe5;
  --blush: #f1cdd2;
  --rose: #c77c88;
  --mauve: #8f667b;
  --lavender: #cfc3e6;
  --champagne: #ead8af;
  --gold: #b9975b;
  --ink: #302733;
  --muted: #766979;
  --glass: rgba(255, 252, 247, 0.68);
  --glass-strong: rgba(255, 252, 247, 0.9);
  --line: rgba(103, 78, 91, 0.16);
  --shadow: 0 28px 90px rgba(104, 73, 83, 0.18);
  --soft-shadow: 0 18px 50px rgba(104, 73, 83, 0.14);
  --focus: #6d4262;
  --font-display: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --font-body: "Inter", "Poppins", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 18%, rgba(241, 205, 210, 0.55), transparent 32rem),
    radial-gradient(circle at 92% 12%, rgba(207, 195, 230, 0.48), transparent 30rem),
    linear-gradient(135deg, #fffaf2 0%, #f8ece9 42%, #f3e8df 100%);
  transition: background 700ms ease;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(109, 66, 98, 0.5);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 10;
  transform: translateY(-150%);
  border-radius: 999px;
  background: var(--ink);
  color: white;
  padding: 0.7rem 1rem;
  text-decoration: none;
  transition: transform 180ms ease;
}

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

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.grain {
  position: absolute;
  inset: -20%;
  opacity: 0.09;
  background-image:
    linear-gradient(rgba(48, 39, 51, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(48, 39, 51, 0.04) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(circle at center, black, transparent 82%);
}

.blob {
  position: absolute;
  width: 42vmax;
  aspect-ratio: 1;
  border-radius: 44% 56% 58% 42%;
  filter: blur(34px);
  opacity: 0.4;
  animation: floatBlob 18s ease-in-out infinite alternate;
}

.blob-one {
  left: -16vmax;
  top: -10vmax;
  background: rgba(241, 205, 210, 0.82);
}

.blob-two {
  right: -18vmax;
  top: 10vh;
  background: rgba(207, 195, 230, 0.72);
  animation-delay: -6s;
}

.blob-three {
  left: 35vw;
  bottom: -22vmax;
  background: rgba(234, 216, 175, 0.56);
  animation-delay: -11s;
}

@keyframes floatBlob {
  from {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
  to {
    transform: translate3d(6vw, -3vh, 0) rotate(22deg) scale(1.08);
  }
}

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

.particle {
  position: absolute;
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 50%;
  background: rgba(185, 151, 91, 0.62);
  box-shadow: 0 0 20px rgba(255, 250, 242, 0.72);
  animation: drift var(--duration, 16s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  opacity: var(--opacity, 0.6);
}

.particle::after {
  content: "";
  position: absolute;
  inset: -0.22rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: inherit;
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(var(--x, 2rem), var(--y, -3rem), 0) scale(1.45);
  }
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  padding: clamp(1rem, 3vw, 2.25rem);
  place-items: center;
}

.view {
  display: none;
  width: min(100%, 1120px);
  animation: viewIn 560ms ease both;
}

.view.is-active {
  display: block;
}

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

.hero {
  min-height: calc(100vh - clamp(2rem, 6vw, 4.5rem));
  display: none;
  place-items: center;
  text-align: center;
}

.hero.is-active {
  display: grid;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--mauve);
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0;
}

h1 {
  max-width: 12ch;
  margin-inline: auto;
  font-size: clamp(4.4rem, 12vw, 10.8rem);
  line-height: 0.86;
}

.hero-copy {
  max-width: 36rem;
  margin: 1.5rem auto 2.2rem;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.primary-action,
.secondary-action,
.ghost-action,
.choice-button {
  cursor: pointer;
  touch-action: manipulation;
}

.primary-action {
  display: inline-flex;
  min-height: 3.65rem;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #4f3149, #9a6075 55%, #caa566);
  color: #fffaf2;
  padding: 0.95rem 1.35rem 0.95rem 1.65rem;
  font-weight: 700;
  box-shadow: 0 20px 50px rgba(103, 64, 83, 0.28);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

.primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 70px rgba(103, 64, 83, 0.34);
}

.primary-action:active {
  transform: translateY(0);
}

.primary-action.compact {
  min-height: 3.1rem;
  padding-inline: 1.35rem;
}

.action-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  font-size: 1.05rem;
}

.question-view {
  max-width: 920px;
}

.progress-wrap {
  margin: 0 auto 1.5rem;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
  color: var(--mauve);
  font-size: 0.83rem;
  font-weight: 700;
}

.progress-track {
  overflow: hidden;
  height: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: inset 0 1px 8px rgba(91, 64, 72, 0.08);
}

.progress-fill {
  display: block;
  width: 33.333%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9a6075, #d5af71);
  transition: width 460ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.question-panel,
.reflection-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 2rem;
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px);
}

.question-panel {
  padding: clamp(1.2rem, 4vw, 3rem);
}

.question-panel h2 {
  max-width: 760px;
  font-size: clamp(2.55rem, 7vw, 5.7rem);
  line-height: 0.92;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: clamp(1.5rem, 4vw, 2.4rem);
}

.choice-button {
  position: relative;
  min-height: 4rem;
  overflow: hidden;
  border: 1px solid rgba(154, 96, 117, 0.16);
  border-radius: 1.15rem;
  background: rgba(255, 252, 247, 0.72);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(104, 73, 83, 0.08);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.choice-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(234, 216, 175, 0.28));
  opacity: 0;
  transition: opacity 160ms ease;
}

.choice-button span {
  position: relative;
  z-index: 1;
}

.choice-button:hover {
  transform: translateY(-2px);
  border-color: rgba(154, 96, 117, 0.32);
  box-shadow: 0 16px 36px rgba(104, 73, 83, 0.13);
}

.choice-button:hover::before {
  opacity: 1;
}

.choice-button.is-selected {
  border-color: rgba(185, 151, 91, 0.7);
  background: rgba(255, 247, 234, 0.92);
}

.reveal-view {
  max-width: 960px;
  padding-block: clamp(1.5rem, 4vw, 3rem);
}

.reveal-heading {
  margin-bottom: 1.2rem;
  text-align: center;
}

.reveal-heading h2 {
  max-width: 14ch;
  margin-inline: auto;
  font-size: clamp(2.8rem, 7vw, 6rem);
  line-height: 0.9;
}

#revealTitle:focus {
  outline: none;
}

.reflection-card {
  overflow: hidden;
  padding: clamp(1.25rem, 4vw, 3.2rem);
  transform-origin: 50% 100%;
  animation: riseCard 780ms 160ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes riseCard {
  from {
    opacity: 0;
    transform: translateY(34px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-orbit {
  position: absolute;
  inset: -25% -12% auto auto;
  width: 22rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(234, 216, 175, 0.55), transparent 66%);
  animation: shimmer 5.4s ease-in-out infinite;
}

@keyframes shimmer {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translate3d(-1.4rem, 1rem, 0) scale(1.08);
    opacity: 0.85;
  }
}

.card-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--line);
}

.reflection-icon {
  display: grid;
  flex: 0 0 auto;
  width: 4.2rem;
  height: 4.2rem;
  border-radius: 50%;
  place-items: center;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.92), transparent 34%),
    linear-gradient(135deg, rgba(241, 205, 210, 0.9), rgba(234, 216, 175, 0.86));
  color: #6b4057;
  font-family: var(--font-display);
  font-size: 2rem;
  box-shadow: 0 14px 32px rgba(151, 93, 112, 0.18);
}

.card-kicker {
  margin: 0 0 0.18rem;
  color: var(--mauve);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card-header h3 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
}

.letter-section {
  position: relative;
  z-index: 1;
  padding: clamp(1.15rem, 3vw, 1.85rem) 0;
  border-bottom: 1px solid var(--line);
}

.letter-section p:last-child,
.curiosity p {
  margin-bottom: 0;
}

.section-label {
  margin: 0 0 0.55rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.message-section p:last-child {
  color: #3c303f;
  font-family: var(--font-display);
  font-size: clamp(1.42rem, 3vw, 2.05rem);
  line-height: 1.18;
}

.letter-section:not(.message-section) p:last-child,
.curiosity p {
  color: var(--muted);
  font-size: 1rem;
}

.prompt-section p:last-child {
  color: #4c394d;
  font-weight: 700;
}

.curiosity {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.25rem;
  margin-top: 1.2rem;
  border: 1px solid rgba(185, 151, 91, 0.22);
  border-radius: 1.2rem;
  background: rgba(255, 247, 234, 0.54);
  padding: 1rem;
}

.curiosity span {
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.action-dock {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.secondary-action,
.ghost-action {
  min-height: 3.1rem;
  border-radius: 999px;
  padding: 0.75rem 1.1rem;
  font-weight: 800;
  transition:
    transform 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.secondary-action {
  border: 1px solid rgba(154, 96, 117, 0.18);
  background: rgba(255, 252, 247, 0.78);
  color: var(--ink);
  box-shadow: var(--soft-shadow);
}

.ghost-action {
  background: rgba(255, 255, 255, 0.35);
  color: var(--mauve);
}

.secondary-action:hover,
.ghost-action:hover {
  transform: translateY(-2px);
}

.save-note {
  min-height: 1.4rem;
  margin: 0.85rem 0 0;
  color: var(--mauve);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
}

body[data-palette="healing"] {
  --blush: #f2cbd0;
  --rose: #bd7f8d;
  --mauve: #825e72;
  --lavender: #dccbe7;
  --champagne: #ead7bd;
}

body[data-palette="purpose"] {
  --blush: #ecd1c3;
  --rose: #b97970;
  --mauve: #74596d;
  --lavender: #c8c8e3;
  --champagne: #ead6a5;
}

body[data-palette="rest"] {
  --blush: #ead5d9;
  --rose: #a97986;
  --mauve: #6f697c;
  --lavender: #cfd4ea;
  --champagne: #eadfc7;
}

body[data-palette="hope"] {
  --blush: #f0d2c7;
  --rose: #bc7682;
  --mauve: #796174;
  --lavender: #d6caec;
  --champagne: #efd694;
}

@media (max-width: 820px) {
  .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-header {
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .shell {
    padding: 0.9rem;
  }

  h1 {
    font-size: clamp(4rem, 19vw, 6.4rem);
  }

  .hero {
    min-height: calc(100vh - 1.8rem);
  }

  .question-panel,
  .reflection-card {
    border-radius: 1.35rem;
  }

  .choice-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .choice-button {
    min-height: 3.4rem;
  }

  .card-header {
    gap: 0.75rem;
  }

  .reflection-icon {
    width: 3.2rem;
    height: 3.2rem;
    font-size: 1.55rem;
  }

  .action-dock {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-action,
  .secondary-action,
  .ghost-action {
    width: 100%;
  }
}

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