/* ---------- tokens ---------- */
:root{
  --bg:            #211a45;
  --bg-deep:       #17132f;
  --panel:         #2b2360;
  --ink:           #fbf7ff;
  --ink-dim:       #c6bdf0;

  --coral:         #ff6b5b;
  --orange:        #ff9f45;
  --sky:           #5b8def;
  --mint:          #4fd8bd;
  --pink:          #ff8fc7;
  --dark-blob:     #2a2740;
  --yellow:        #ffd23f;

  --radius-blob:   58% 42% 46% 54% / 52% 48% 52% 48%;
  --font-display:  'Fredoka', system-ui, sans-serif;
  --font-body:     'Nunito', system-ui, sans-serif;
}

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

html{ scroll-behavior:smooth; }

body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--font-body);
  overflow-x:hidden;
  position:relative;
}

h1,h2,h3{ font-family:var(--font-display); margin:0; line-height:1.15; }

a{ color:inherit; }

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

/* ---------- floating background doodles ---------- */
.bg-doodles{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:0;
  overflow:hidden;
}
.bg-doodles span{
  position:absolute;
  opacity:0.55;
  animation:drift linear infinite;
  will-change:transform;
}
@keyframes drift{
  from{ transform:translateY(0) rotate(0deg); }
  to{ transform:translateY(-120vh) rotate(360deg); }
}

/* ---------- nav ---------- */
.nav{
  position:relative;
  z-index:5;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:28px 6vw 0;
}
.nav-brand{
  font-family:var(--font-display);
  font-weight:600;
  font-size:1.15rem;
  display:flex;
  align-items:center;
  gap:10px;
}
.nav-dot{
  width:14px; height:14px;
  border-radius:40% 60% 55% 45% / 45% 40% 60% 55%;
  background:var(--yellow);
  display:inline-block;
}
.nav-links{ display:flex; gap:28px; font-weight:700; font-size:0.95rem; }
.nav-links a{ text-decoration:none; color:var(--ink-dim); transition:color .2s ease; }
.nav-links a:hover{ color:var(--ink); }

/* ---------- hero ---------- */
.hero{
  position:relative;
  z-index:2;
  display:grid;
  grid-template-columns:1.05fr 1fr;
  gap:24px;
  align-items:center;
  max-width:1180px;
  margin:0 auto;
  padding:64px 6vw 40px;
  min-height:78vh;
}
.eyebrow{
  color:var(--ink-dim);
  font-weight:700;
  margin:0 0 10px;
  font-size:1rem;
}
.hero h1{
  font-size:clamp(2.1rem, 4.6vw, 3.4rem);
  font-weight:600;
  color:var(--ink);
}
.hero .sub{
  margin-top:18px;
  max-width:46ch;
  color:var(--ink-dim);
  font-size:1.05rem;
  line-height:1.6;
}
.cta{
  display:inline-block;
  margin-top:28px;
  background:var(--yellow);
  color:var(--bg-deep);
  font-family:var(--font-display);
  font-weight:600;
  padding:14px 26px;
  border-radius:16px;
  text-decoration:none;
  box-shadow:0 6px 0 #c99e1f;
  transition:transform .15s ease, box-shadow .15s ease;
}
.cta:hover{ transform:translateY(2px); box-shadow:0 4px 0 #c99e1f; }

.hero-stage{
  position:relative;
  height:440px;
}

/* ---------- doodle blobs (hero characters) ---------- */
.blob{
  position:absolute;
  display:flex;
  gap:10%;
  align-items:center;
  justify-content:center;
  border-radius:var(--radius-blob);
  animation:bob 5s ease-in-out infinite;
}
@keyframes bob{
  0%,100%{ transform:translateY(0) rotate(var(--tilt,0deg)); }
  50%{ transform:translateY(-14px) rotate(var(--tilt,0deg)); }
}
.eye{
  position:relative;
  background:#fff;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:inset 0 0 0 2px rgba(0,0,0,.06);
}
.pupil{
  background:#20202a;
  border-radius:50%;
  position:relative;
}
.pupil::after{
  content:"";
  position:absolute;
  top:14%;
  right:16%;
  width:22%;
  height:22%;
  background:#fff;
  border-radius:50%;
}
.mouth{
  position:absolute;
  bottom:16%;
  left:50%;
  transform:translateX(-50%);
  border:0 solid transparent;
  border-bottom:4px solid #20202a;
  border-radius:0 0 50% 50%;
}
.cheek{
  position:absolute;
  width:14%;
  height:9%;
  background:rgba(255,255,255,.35);
  border-radius:50%;
  bottom:22%;
}

/* ---------- weather section ---------- */
.weather{
  position:relative;
  z-index:2;
  max-width:1180px;
  margin:40px auto 0;
  padding:60px 6vw 20px;
}
.weather-intro{ text-align:left; max-width:60ch; margin-bottom:34px; }
.weather-intro h2{ font-size:clamp(1.8rem,3.4vw,2.4rem); font-weight:600; margin-bottom:10px; }
.weather-intro p{ color:var(--ink-dim); font-size:1.05rem; }

.weather-card{
  background:var(--panel);
  border-radius:28px;
  padding:38px;
  display:grid;
  grid-template-columns:220px 1fr;
  gap:36px;
  align-items:center;
  box-shadow:0 20px 50px rgba(0,0,0,.25);
}

.weather-face{ display:flex; justify-content:center; }
.w-blob{
  position:relative;
  width:190px;
  height:190px;
  background:var(--mint);
  border-radius:var(--radius-blob);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14%;
  transition:background .4s ease;
  animation:bob 4s ease-in-out infinite;
}
.w-eye{
  width:30%;
  aspect-ratio:1;
  background:#fff;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
}
.w-pupil{
  width:46%;
  aspect-ratio:1;
  background:#20202a;
  border-radius:50%;
}
.w-mouth{
  position:absolute;
  bottom:26%;
  left:50%;
  width:34%;
  height:14%;
  transform:translateX(-50%);
  border-bottom:5px solid #20202a;
  border-radius:0 0 50% 50%;
  transition:all .3s ease;
}

.weather-body{ display:flex; flex-direction:column; gap:14px; }
.search-row{ display:flex; gap:10px; }
.search-row input{
  flex:1;
  padding:13px 16px;
  border-radius:14px;
  border:2px solid rgba(255,255,255,.12);
  background:var(--bg-deep);
  color:var(--ink);
  font-family:var(--font-body);
  font-size:1rem;
  outline:none;
}
.search-row input:focus{ border-color:var(--mint); }
.search-row button{
  padding:13px 20px;
  border-radius:14px;
  border:none;
  background:var(--coral);
  color:#fff;
  font-family:var(--font-display);
  font-weight:600;
  cursor:pointer;
  transition:transform .15s ease;
}
.search-row button:hover{ transform:translateY(-2px); }
.search-row button:focus-visible,
.loc-btn:focus-visible,
.cta:focus-visible,
.nav-links a:focus-visible{
  outline:3px solid var(--yellow);
  outline-offset:2px;
}

.loc-btn{
  align-self:flex-start;
  background:none;
  border:2px dashed rgba(255,255,255,.25);
  color:var(--ink-dim);
  padding:10px 16px;
  border-radius:14px;
  font-family:var(--font-body);
  font-weight:700;
  cursor:pointer;
  transition:border-color .2s ease, color .2s ease;
}
.loc-btn:hover{ border-color:var(--mint); color:var(--ink); }

.weather-result{ min-height:70px; }
.weather-result .hint{ color:var(--ink-dim); margin:6px 0 0; }
.weather-result .temp-row{
  display:flex;
  align-items:baseline;
  gap:14px;
  flex-wrap:wrap;
}
.weather-result .temp{
  font-family:var(--font-display);
  font-size:2.6rem;
  font-weight:600;
}
.weather-result .place{ font-weight:800; font-size:1.05rem; }
.weather-result .desc{ color:var(--ink-dim); margin-top:4px; }
.weather-result .err{ color:var(--pink); font-weight:700; }

/* ---------- about ---------- */
.about{
  position:relative;
  z-index:2;
  max-width:1180px;
  margin:70px auto 0;
  padding:0 6vw 30px;
}
.about h2{ font-size:clamp(1.6rem,3vw,2.1rem); font-weight:600; margin-bottom:26px; }

/* each word of the heading pops up in sequence when scrolled into view */
.split-words .word{
  display:inline-block;
  opacity:0;
  transform:translateY(26px) rotate(-6deg);
}
.split-words.in-view .word{
  animation:wordPop .55s cubic-bezier(.34,1.56,.64,1) forwards;
  animation-delay:var(--d, 0s);
}
@keyframes wordPop{
  0%{   opacity:0; transform:translateY(26px) rotate(-6deg); }
  60%{  opacity:1; transform:translateY(-5px) rotate(2deg); }
  100%{ opacity:1; transform:translateY(0) rotate(0deg); }
}
/* the heading's words cycle through the doodle palette as they land */
.split-words .word:nth-child(4n+1){ color:var(--yellow); }
.split-words .word:nth-child(4n+2){ color:var(--mint); }
.split-words .word:nth-child(4n+3){ color:var(--pink); }
.split-words .word:nth-child(4n+4){ color:var(--sky); }

.about-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:20px;
}
.about-card{
  background:var(--panel);
  border-radius:20px;
  padding:24px;
  transition:transform .3s ease;
}
.about-card:hover{ transform:translateY(-6px) rotate(-1deg); }
.about-card h3{ font-size:1.15rem; font-weight:600; margin-bottom:10px; color:var(--yellow); }
.about-card p{ color:var(--ink-dim); line-height:1.6; margin:0; font-size:.98rem; }

/* cards drift up and settle, one after another */
.reveal{
  opacity:0;
  transform:translateY(38px) scale(.94);
}
.reveal.in-view{
  animation:cardIn .6s cubic-bezier(.34,1.4,.64,1) forwards;
  animation-delay:var(--d, 0s);
}
@keyframes cardIn{
  0%{   opacity:0; transform:translateY(38px) scale(.94); }
  100%{ opacity:1; transform:translateY(0) scale(1); }
}

/* if motion is reduced, show everything immediately instead of animating */
@media (prefers-reduced-motion: reduce){
  .split-words .word,
  .reveal{ opacity:1; transform:none; }
}

.footer{
  position:relative;
  z-index:2;
  text-align:center;
  padding:50px 6vw 40px;
  color:var(--ink-dim);
  font-weight:700;
}

/* ---------- responsive ---------- */
@media (max-width:900px){
  .hero{ grid-template-columns:1fr; padding-top:40px; }
  .hero-stage{ height:300px; order:-1; }
  .weather-card{ grid-template-columns:1fr; text-align:center; }
  .weather-body{ align-items:center; }
  .loc-btn{ align-self:center; }
  .about-grid{ grid-template-columns:1fr; }
  .nav-links{ gap:16px; font-size:.85rem; }
}