/* Base reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  text-size-adjust: none;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  line-height: 1.6;
  background: radial-gradient(circle at top left, rgba(176, 116, 255, 0.24), transparent 40%),
              radial-gradient(circle at bottom right, rgba(255, 180, 247, 0.25), transparent 45%),
              #1b0f30;
  color: #fdf0ff;
}

/* Light/dark (we default to dark-ish, but allow switching) */
:root,
[data-theme="light"] {
  --color-bg: #fdf5ff;
  --color-surface: #ffffff;
  --color-surface-soft: #f3e5ff;
  --color-border-subtle: rgba(116, 65, 172, 0.12);
  --color-accent: #c76bff;
  --color-accent-soft: #f0d5ff;
  --color-text: #261337;
  --color-text-muted: #7b5a9e;
  --color-text-faint: #b19cd5;
}

[data-theme="dark"] {
  --color-bg: #1b0f30;
  --color-surface: #27153f;
  --color-surface-soft: #331b55;
  --color-border-subtle: rgba(239, 202, 255, 0.18);
  --color-accent: #f8a4ff;
  --color-accent-soft: #402064;
  --color-text: #ffeefe;
  --color-text-muted: #d7bdf4;
  --color-text-faint: #a98dd3;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
}

/* Utilities */
.shell {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.section-grid {
  padding-block: 2.75rem;
}

.section-grid.two-up {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
}

@media (min-width: 800px) {
  .section-grid.two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

p {
  max-width: 72ch;
  text-wrap: pretty;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: linear-gradient(
      to bottom,
      rgba(10, 6, 20, 0.9),
      rgba(10, 6, 20, 0.7),
      transparent
    );
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.75rem;
}

.brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 0%, #ffe9ff, #c684ff);
  color: #2c103e;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.brand-title {
  font-weight: 650;
  letter-spacing: 0.03em;
  font-size: 0.98rem;
}

.brand-tagline {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.theme-toggle {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 0.35rem 0.5rem;
  background: radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.18), transparent);
  color: var(--color-text);
  cursor: pointer;
}

/* Hero */
.hero {
  padding-block: 2.75rem 2.25rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.25rem;
  align-items: center;
}

@media (min-width: 920px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  }
}

.hero-copy h1 {
  font-size: clamp(2rem, 1.4rem + 2vw, 2.75rem);
  margin-bottom: 0.75rem;
}

.hero-copy p {
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--color-text-faint);
  margin-bottom: 0.3rem;
}

.hero-photo-wrap {
  position: relative;
}

.hero-photo {
  border-radius: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
  box-shadow:
    0 18px 60px rgba(10, 0, 30, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

.hero-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.photo-badge {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: color-mix(in srgb, var(--color-surface) 90%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-muted);
}

/* Prompt pills */
.prompt-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
  background: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.12), transparent);
  color: var(--color-text-muted);
  cursor: pointer;
}

/* Cards */
.card {
  position: relative;
  border-radius: 1.25rem;
  padding: 1.5rem 1.4rem 1.6rem;
  background: radial-gradient(circle at top left, var(--color-accent-soft), transparent 60%),
              var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.card-header {
  margin-bottom: 0.85rem;
}

.card-header h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.card-header p {
  color: var(--color-text-muted);
}

/* Weather */
.weather-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem 1.75rem;
  margin-top: 1rem;
}

.weather-grid dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
}

.weather-grid dd {
  font-size: 0.95rem;
  color: var(--color-text);
}

.weather-footnote {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--color-text-faint);
}

/* Facts/story */
.fact-list {
  margin-top: 0.6rem;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.fact-list li + li {
  margin-top: 0.25rem;
}

.hint {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.story-card p + p {
  margin-top: 0.75rem;
}

.story-outro {
  margin-top: 1rem;
  font-weight: 500;
  color: var(--color-accent);
}

/* Wand cursor + sparkles */
.wand-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
}

.wand-cursor {
  position: fixed;
  width: 52px;
  height: 52px;
  pointer-events: none;
  z-index: 90;
  transform: translate(-9999px, -9999px);
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
  opacity: 0.98;
}

.wand-cursor svg {
  width: 100%;
  height: 100%;
  display: block;
}

.wand-sparkle {
  position: fixed;
  font-size: 1.1rem;
  line-height: 1;
  pointer-events: none;
  z-index: 85;
  color: #ffe9ff;
  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.9),
    0 0 14px rgba(255, 170, 255, 0.9);
  animation: sparkleFall 1100ms ease-out forwards;
}

@keyframes sparkleFall {
  0% {
    transform: translate(-50%, -10px) scale(0.9);
    opacity: 1;
  }
  60% {
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--sparkle-drift, 0px)), 40px) scale(1.15);
    opacity: 0;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .wand-cursor,
  .wand-sparkle {
    display: none !important;
  }
}
