/* Animatable colour tokens: the sky crossfades when the mood changes */
@property --c1 { syntax: '<color>'; inherits: true; initial-value: #030712; }
@property --c2 { syntax: '<color>'; inherits: true; initial-value: #0b1530; }
@property --c3 { syntax: '<color>'; inherits: true; initial-value: #10233a; }
@property --accent { syntax: '<color>'; inherits: true; initial-value: #5cf2c2; }
@property --accent2 { syntax: '<color>'; inherits: true; initial-value: #a78bfa; }

:root {
  --text: #eef0ff;
  --muted: #b3b6d4;
  --glass: rgba(10, 10, 28, 0.52);
  --glass-border: rgba(255, 255, 255, 0.12);
  --radius: 22px;
  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  color-scheme: dark;
}

body[data-mood="sunny"]  { --c1: #1b0e2b; --c2: #5a2446; --c3: #b8502f; --accent: #ffd166; --accent2: #ff7a59; }
body[data-mood="rainy"]  { --c1: #050a18; --c2: #0d1d3a; --c3: #1a3350; --accent: #6cc4ff; --accent2: #7b8cff; }
body[data-mood="stormy"] { --c1: #07060d; --c2: #1a1030; --c3: #2b1638; --accent: #b388ff; --accent2: #ff4fd8; }
body[data-mood="snowy"]  { --c1: #0a1224; --c2: #1b2c4a; --c3: #3d5a7a; --accent: #bfe9ff; --accent2: #e0d4ff; }
body[data-mood="foggy"]  { --c1: #101217; --c2: #22262e; --c3: #3a3f48; --accent: #d7dee6; --accent2: #9fb4c7; }
body[data-mood="aurora"] { --c1: #030712; --c2: #0b1530; --c3: #10233a; --accent: #5cf2c2; --accent2: #a78bfa; }

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  line-height: 1.6;
  color: var(--text);
  background: var(--c1);
  min-height: 100vh;
  overflow-x: hidden;
  transition: --c1 1.4s ease, --c2 1.4s ease, --c3 1.4s ease, --accent 0.8s ease, --accent2 0.8s ease;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, var(--c1) 0%, var(--c2) 55%, var(--c3) 100%);
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

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

/* ---------- Top bar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  background: linear-gradient(180deg, rgba(3, 5, 15, 0.7), rgba(3, 5, 15, 0));
  backdrop-filter: blur(6px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.brand-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent), 0 0 28px var(--accent2);
}

nav { display: flex; align-items: center; gap: 1.6rem; }
nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.95rem; transition: color 0.2s; }
nav a:hover { color: var(--text); }
nav .nav-cta {
  color: var(--text);
  padding: 8px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: 999px;
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 25%, transparent);
}

.menu-btn {
  display: none;
  background: none;
  border: 0;
  width: 40px; height: 40px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.menu-btn span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.25s; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Layout ---------- */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

section { scroll-margin-top: 80px; }

.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ---------- Hero ---------- */
.hero {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 120px 0 60px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); }
  100% { box-shadow: 0 0 0 12px transparent; }
}

h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.glow-text {
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px color-mix(in srgb, var(--accent) 45%, transparent));
}

.lede {
  max-width: 560px;
  margin: 22px auto 34px;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.15rem);
}

.mood-form {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 560px;
  padding: 8px;
  background: var(--glass);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
  backdrop-filter: blur(14px);
  box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 18%, transparent);
  transition: box-shadow 0.3s;
}
.mood-form:focus-within { box-shadow: 0 0 60px color-mix(in srgb, var(--accent) 35%, transparent); }
.mood-form.shake { animation: shake 0.4s; }
@keyframes shake {
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-4px); }
}

.mood-form input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  padding: 10px 16px;
}
.mood-form input::placeholder { color: #8a8db0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  padding: 12px 24px;
  cursor: pointer;
  text-decoration: none;
  border: 0;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: wait; }

.btn-primary {
  color: #0a0a18;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 45%, transparent);
}
.btn-primary:hover { box-shadow: 0 0 36px color-mix(in srgb, var(--accent) 70%, transparent); }

.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  font-size: 0.92rem;
  padding: 10px 18px;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
  max-width: 620px;
}

.chip {
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.chip:hover { transform: translateY(-2px); border-color: var(--accent); background: rgba(255, 255, 255, 0.1); }

/* ---------- Forecast ---------- */
.forecast {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  padding: 40px 0 80px;
}

.result { padding: clamp(22px, 4vw, 36px); }
.result.pop { animation: pop 0.6s ease; }
@keyframes pop {
  0% { transform: translateY(12px); opacity: 0.4; }
  100% { transform: none; opacity: 1; }
}

.result-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }

.result-icon {
  font-size: 3.4rem;
  line-height: 1;
  width: 84px; height: 84px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px var(--glass-border), 0 0 40px color-mix(in srgb, var(--accent) 30%, transparent);
}

.result-label {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent);
  text-shadow: 0 0 24px color-mix(in srgb, var(--accent) 50%, transparent);
}

.result-temp { color: var(--muted); }
.result-temp span { color: var(--text); font-weight: 600; }

.result-forecast { font-size: 1.1rem; margin-bottom: 18px; }

.result-quote {
  border-left: 3px solid var(--accent2);
  padding: 4px 0 4px 16px;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 26px;
}

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

.week { padding: clamp(22px, 4vw, 30px); display: flex; flex-direction: column; }
.week h2 { font-family: var(--display); font-size: 1.2rem; margin-bottom: 18px; }

.week-strip {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.week-strip:empty { display: none; }
.week-strip li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 2px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.72rem;
  color: var(--muted);
}
.week-strip li:last-child { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text); }
.week-strip .ic { font-size: 1.4rem; line-height: 1.2; }

.week-empty { color: var(--muted); font-size: 0.95rem; }

/* ---------- How it works ---------- */
.how { padding: 20px 0 80px; }

.section-title {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  text-align: center;
  margin-bottom: 32px;
  letter-spacing: -0.02em;
}

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { padding: 28px; transition: transform 0.25s, border-color 0.25s; }
.step:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.step-num { font-family: var(--display); font-weight: 700; color: var(--accent); font-size: 0.95rem; }
.step h3 { font-family: var(--display); font-size: 1.3rem; margin: 8px 0 6px; }
.step p { color: var(--muted); }

/* ---------- Join ---------- */
.join {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: center;
  padding: clamp(26px, 5vw, 48px);
  margin-bottom: 60px;
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  box-shadow: 0 0 80px color-mix(in srgb, var(--accent) 12%, transparent);
}
.join h2 { font-family: var(--display); font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; margin-bottom: 12px; }
.join-copy p:not(.eyebrow) { color: var(--muted); }

.signup { display: flex; flex-wrap: wrap; gap: 10px; }
.signup input[type="email"] {
  flex: 1 1 220px;
  min-width: 0;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 12px 20px;
  outline: none;
}
.signup input[type="email"]:focus { border-color: var(--accent); }
.signup .btn { flex: 0 0 auto; }
.signup-msg { flex-basis: 100%; min-height: 1.6em; font-size: 0.92rem; }
.signup-msg.ok { color: var(--accent); }
.signup-msg.err { color: #ff8a8a; }

/* ---------- Footer & toast ---------- */
.footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 0 16px 40px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  max-width: calc(100% - 32px);
  background: rgba(10, 10, 28, 0.9);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  overflow-wrap: anywhere;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .forecast, .join { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .menu-btn { display: flex; }
  nav {
    display: none;
    position: absolute;
    top: 64px;
    right: 16px;
    left: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px;
    background: rgba(8, 8, 24, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
  }
  nav.open { display: flex; }
  nav a { padding: 10px 12px; }
  nav .nav-cta { text-align: center; margin-top: 6px; }
}

@media (max-width: 480px) {
  .mood-form { flex-direction: column; border-radius: 24px; }
  .mood-form .btn { width: 100%; }
  .week-strip .lb { display: none; }
  .result-icon { width: 68px; height: 68px; font-size: 2.6rem; }
}

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