:root {
  --ink: #3c271c;
  --muted: #72594a;
  --cream: #fff6db;
  --paper: #f6dfad;
  --wood: #8c4d20;
  --wood-dark: #543019;
  --blue: #159de0;
  --blue-dark: #0873b0;
  --green: #3f862f;
  --gold: #ffb72a;
  --shadow: 0 18px 50px rgba(45, 25, 12, .22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #f8edcf;
  font-family: Inter, ui-rounded, "Trebuchet MS", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
a { color: inherit; }
img { display: block; max-width: 100%; }

.topbar {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(20px, calc((100vw - 1160px) / 2));
  background: rgba(22, 50, 58, .88);
  color: white;
  border-bottom: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 900; letter-spacing: -.02em; }
.brand img { border-radius: 11px; box-shadow: 0 3px 12px rgba(0,0,0,.24); }
.top-download {
  padding: 10px 22px;
  color: #fff;
  background: var(--blue);
  border: 2px solid rgba(255,255,255,.65);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 5px 0 #075f90;
}

.hero {
  position: relative;
  min-height: 850px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: center;
  gap: clamp(40px, 7vw, 100px);
  overflow: hidden;
  padding: 130px max(24px, calc((100vw - 1160px) / 2)) 70px;
  color: #fff;
  background: url("assets/village-restored.png") center / cover no-repeat;
}
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12,38,48,.94) 0%, rgba(12,38,48,.78) 45%, rgba(12,38,48,.18) 100%); }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 170px; background: linear-gradient(transparent, rgba(30,62,40,.64)); }
.hero-content, .phone { position: relative; z-index: 2; }
.hero-content { max-width: 630px; }
.eyebrow, .kicker { color: #efb43d; font-size: .83rem; font-weight: 950; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; padding: 8px 12px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.2); border-radius: 999px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 22px 0 20px; font-size: clamp(3.3rem, 7vw, 6rem); line-height: .94; letter-spacing: -.055em; text-wrap: balance; }
h1 em { color: #7ad7ff; font-style: normal; }
.hero-content > p { max-width: 610px; margin-bottom: 28px; color: rgba(255,255,255,.88); font-size: clamp(1.05rem, 2vw, 1.3rem); }
.play-cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 254px;
  padding: 13px 22px;
  color: white;
  background: linear-gradient(#23acf0, #0b82c4);
  border: 2px solid rgba(255,255,255,.76);
  border-radius: 16px;
  box-shadow: 0 7px 0 #075780, 0 16px 28px rgba(0,0,0,.26);
  text-decoration: none;
  transition: transform .18s ease, filter .18s ease;
}
.play-cta:hover { transform: translateY(-2px); filter: brightness(1.08); }
.play-cta:active { transform: translateY(4px); box-shadow: 0 3px 0 #075780; }
.play-mark { display: grid; place-items: center; width: 42px; height: 42px; color: var(--blue-dark); background: #fff8de; border-radius: 12px; font-size: 1.15rem; }
.play-mark img { width: 34px; height: 34px; border-radius: 8px; object-fit: contain; }
.play-cta span:last-child { display: grid; }
.play-cta small { font-size: .74rem; opacity: .88; }
.play-cta strong { font-size: 1.2rem; line-height: 1.2; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.hero-facts span { padding: 7px 11px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; background: rgba(0,0,0,.2); font-size: .84rem; font-weight: 800; }

.phone {
  width: min(100%, 360px);
  aspect-ratio: 9 / 16;
  justify-self: end;
  padding: 10px;
  border: 4px solid #f9d792;
  border-radius: 42px;
  background: #251810;
  box-shadow: 0 35px 70px rgba(0,0,0,.42), inset 0 0 0 2px #6d3d1d;
  transform: rotate(3deg);
}
.phone::before { content: ""; position: absolute; z-index: 2; top: 17px; left: 50%; width: 92px; height: 22px; transform: translateX(-50%); background: #251810; border-radius: 999px; }
.phone-screen { width: 100%; height: 100%; border-radius: 30px; background: url("assets/bg-menu.png") center top / cover no-repeat; }

.section { padding: 92px max(24px, calc((100vw - 1160px) / 2)); }
.section-heading { max-width: 720px; margin: 0 auto 50px; text-align: center; }
.section-heading h2, .story h2, .final-cta h2 { margin: 8px 0 14px; font-size: clamp(2rem, 4.5vw, 3.3rem); line-height: 1.06; letter-spacing: -.045em; text-wrap: balance; }
.section-heading p { color: var(--muted); font-size: 1.08rem; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step-card { position: relative; min-height: 300px; padding: 28px; overflow: hidden; text-align: center; background: rgba(255,250,229,.88); border: 2px solid #d9b778; border-radius: 24px; box-shadow: var(--shadow); }
.step-number { position: absolute; top: 16px; left: 18px; display: grid; place-items: center; width: 34px; height: 34px; color: white; background: var(--wood); border-radius: 50%; font-weight: 900; }
.step-card h3 { margin: 18px 0 5px; font-size: 1.28rem; }
.step-card p { color: var(--muted); }
.pipe-demo { position: relative; width: 112px; height: 112px; margin: 12px auto 0; border: 3px solid #9bb1bf; border-radius: 22px; background: #edf1e5; }
.pipe-demo::before, .pipe-demo::after { content: ""; position: absolute; background: #b9d0e2; border: solid #7896ad; }
.pipe-demo::before { top: 45px; left: -3px; width: 66px; height: 26px; border-width: 4px 0 4px 4px; }
.pipe-demo::after { left: 45px; bottom: -3px; width: 26px; height: 66px; border-width: 0 4px 4px; border-radius: 0 0 12px 0; }
.pipe-demo i { position: absolute; z-index: 2; left: 45px; top: 45px; width: 30px; height: 30px; background: #b9d0e2; }
.source-target { display: flex; align-items: center; justify-content: center; height: 124px; margin-top: 2px; }
.source-target img { position: relative; z-index: 2; width: 76px; height: 76px; object-fit: contain; }
.water-line { width: 70px; height: 14px; margin: 0 -9px; border: 3px solid #148fd3; background: repeating-linear-gradient(90deg, #35bfff 0 16px, #8cddff 16px 22px); }
.stars { margin: 28px 0 17px; color: var(--gold); font-size: 3rem; letter-spacing: 4px; text-shadow: 0 3px 0 #9b5a19; }

.story { display: grid; grid-template-columns: 1.18fr .82fr; min-height: 640px; background: #173f42; color: white; }
.story-image { min-height: 580px; background: url("assets/village-restored.png") center / cover no-repeat; }
.story-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(45px, 7vw, 90px); }
.story-copy p, .story-copy li { color: rgba(255,255,255,.83); }
.story-copy ul { display: grid; gap: 14px; padding: 0; list-style: none; }
.story-copy li { position: relative; padding-left: 30px; }
.story-copy li::before { content: "✓"; position: absolute; left: 0; color: #80e184; font-weight: 950; }

.friends { overflow: hidden; background: linear-gradient(#f8edcf, #e8c98c); }
.character-stage { display: flex; align-items: end; justify-content: center; gap: clamp(0px, 3vw, 34px); min-height: 410px; padding: 24px 20px 0; border: 2px solid #c99d58; border-radius: 34px; background: linear-gradient(rgba(255,255,255,.58), rgba(255,244,205,.52)), url("assets/village-restored.png") center 68% / cover; box-shadow: var(--shadow); }
.character-stage figure { width: min(21%, 190px); margin: 0; text-align: center; }
.character-stage figure.alfi { width: min(23%, 205px); }
.character-stage img { max-height: 310px; margin: auto; object-fit: contain; filter: drop-shadow(0 12px 8px rgba(42,25,10,.3)); }
.character-stage figcaption { position: relative; z-index: 2; width: max-content; max-width: 100%; margin: -9px auto 14px; padding: 7px 11px; color: white; background: var(--wood-dark); border: 2px solid #e7bd76; border-radius: 999px; font-size: .84rem; font-weight: 900; }

.final-cta { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 30px; padding: 62px max(24px, calc((100vw - 1060px) / 2)); color: white; background: linear-gradient(120deg, #6e381c, #a85d28); }
.final-cta > img { border-radius: 24px; box-shadow: 0 10px 26px rgba(0,0,0,.26); }
.final-cta h2 { margin-bottom: 8px; }
.final-cta p { margin: 0; color: rgba(255,255,255,.8); }

footer { display: flex; justify-content: space-between; gap: 18px; padding: 28px max(24px, calc((100vw - 1160px) / 2)); color: #d6c6b9; background: #201610; font-size: .9rem; }
footer a { color: white; }
.mobile-download { display: none; }

@media (max-width: 900px) {
  .hero { min-height: 760px; grid-template-columns: 1fr 280px; }
  .phone { transform: rotate(2deg) translateX(32px); }
  .steps { grid-template-columns: 1fr; max-width: 580px; margin: auto; }
  .step-card { min-height: 270px; }
  .story { grid-template-columns: 1fr; }
  .story-image { min-height: 430px; }
  .final-cta { grid-template-columns: auto 1fr; }
  .final-cta .play-cta { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 650px) {
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .topbar { height: 62px; padding-inline: 14px; }
  .brand img { width: 38px; height: 38px; }
  .brand span { font-size: .95rem; }
  .top-download { display: none; }
  .hero { min-height: 820px; display: block; padding: 103px 22px 58px; text-align: center; background-position: 58% center; }
  .hero-shade { background: linear-gradient(rgba(12,38,48,.9), rgba(12,38,48,.62) 68%, rgba(12,38,48,.78)); }
  h1 { font-size: clamp(3.15rem, 15vw, 4.6rem); }
  .hero-content { margin: auto; }
  .hero-content > p { font-size: 1.03rem; }
  .hero-facts { justify-content: center; }
  .phone { display: none; }
  .section { padding: 70px 18px; }
  .section-heading { margin-bottom: 34px; }
  .story-image { min-height: 310px; }
  .story-copy { padding: 52px 24px; }
  .character-stage { min-height: 335px; gap: 0; padding-inline: 2px; }
  .character-stage figure, .character-stage figure.alfi { width: 25%; }
  .character-stage img { max-height: 245px; }
  .character-stage figcaption { margin-bottom: 8px; padding: 5px 7px; font-size: .64rem; }
  .final-cta { grid-template-columns: 1fr; justify-items: center; padding: 58px 24px; text-align: center; }
  .final-cta .play-cta { justify-self: center; }
  footer { flex-direction: column; align-items: center; text-align: center; }
  .mobile-download {
    position: fixed;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    left: 10px;
    right: 10px;
    bottom: calc(9px + env(safe-area-inset-bottom));
    min-height: 55px;
    color: white;
    background: linear-gradient(#22aaf0, #0878b7);
    border: 2px solid rgba(255,255,255,.8);
    border-radius: 15px;
    box-shadow: 0 7px 22px rgba(0,0,0,.34);
    text-decoration: none;
    font-weight: 950;
  }
  .mobile-download img { width: 32px; height: 32px; border-radius: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .play-cta { transition: none; }
}
