/* ------------------------------------------------------------
   Solarpunk Brasil — landing concept
   Light-driven palette: the --sky-*, --sun-* and --hill-* tokens
   are rewritten by main.js as the (real or scrubbed) hour changes.
   ------------------------------------------------------------ */

:root {
  /* base palette */
  --canopy: #173d2e;      /* deep forest, used as "ink" */
  --leaf:   #3e8a5a;      /* living green */
  --moss:   #7fae7a;
  --sun:    #f6c453;      /* sunlight gold */
  --dawn:   #fff7e1;      /* paper, warm light */
  --water:  #bfe3d6;
  --earth:  #6b4b2e;

  /* light-driven tokens (defaults = midday) */
  --sky-top: #8fcbe3;
  --sky-bot: #eaf6f0;
  --sun-color: #fff1b8;
  --sun-glow: rgba(255, 236, 160, .75);
  --sun-x: 50%;
  --sun-y: 18%;
  --ray-alpha: .28;
  --hill-far-top: #7fb594;
  --hill-far-bot: #4f9170;
  --hill-near-top: #3f8c5d;
  --hill-near-bot: #23563d;
  --window-alpha: 0;
  --copy-color: var(--canopy);
  --copy-shadow: rgba(255, 255, 255, .55);
  --mote-color: 255, 240, 190;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Figtree", "Avenir Next", "Segoe UI", sans-serif;

  --measure: 36rem;
  --gutter: clamp(1rem, 4vw, 3.5rem);
  --radius-leaf: 62% 38% 55% 45% / 48% 58% 42% 52%;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--canopy);
  background: var(--dawn);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 60, "opsz" 72;
  font-weight: 400;
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.01em;
}
h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); }
h3 { font-size: clamp(1.35rem, 2.1vw, 1.75rem); line-height: 1.15; }
p { margin: 0; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--canopy); color: var(--dawn);
  padding: .6rem 1rem; border-radius: 999px; text-decoration: none;
}
.skip:focus { top: 1rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 1rem;
  padding: .85rem 1.5rem; border-radius: 999px;
  text-decoration: none; border: 2px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
  cursor: pointer;
}
.btn-sun {
  background: var(--sun); color: var(--canopy);
  box-shadow: 0 10px 30px -12px rgba(246, 196, 83, .9);
}
.btn-sun:hover { transform: translateY(-1px); box-shadow: 0 14px 34px -12px rgba(246, 196, 83, 1); }
.btn-wa {
  background: #25d366; color: #0b3b22; gap: .55rem;
  box-shadow: 0 10px 30px -12px rgba(37, 211, 102, .9);
}
.btn-wa:hover { transform: translateY(-1px); background: #1fc45b; }
.wa-mark { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; }
.btn-dark { background: var(--canopy); color: var(--dawn); box-shadow: 0 10px 30px -12px rgba(23,61,46,.8); }
.btn-dark:hover { transform: translateY(-1px); background: #1f5240; }
.menu .menu-vale { background: var(--canopy); color: var(--dawn); padding-left: 1.05rem; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem var(--gutter);
  color: var(--copy-color);
  transition: color .6s ease;
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--font-display); font-size: 1.25rem;
  font-variation-settings: "SOFT" 80, "opsz" 24; text-decoration: none;
  color: var(--canopy);
  padding: .35rem .9rem .35rem .5rem; border-radius: 999px;
  background: rgba(255, 251, 236, .7); backdrop-filter: blur(8px);
}
/* once the hero is scrolled away the bar gets a solid ground to stand on */
.topbar.is-grounded {
  background: rgba(255, 247, 225, .88);
  backdrop-filter: blur(10px);
  color: var(--canopy);
  box-shadow: 0 1px 0 rgba(23, 61, 46, .08);
}
.brand-mark { width: 30px; height: 30px; }
.mark-sun { fill: var(--sun); }
.mark-leaf { fill: var(--canopy); }
.menu { display: flex; gap: 1.5rem; align-items: center; font-weight: 500; }
.menu a { text-decoration: none; }
.menu a:not(.menu-cta):hover { text-decoration: underline; text-underline-offset: .3em; }
.menu-cta {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem 1.05rem .5rem .85rem; border-radius: 999px;
  background: #25d366; color: #0b3b22;
}
.brand span, .menu-cta { white-space: nowrap; }
@media (max-width: 640px) {
  .menu a:not(.menu-cta) { display: none; }
  .brand { font-size: 1.05rem; gap: .45rem; }
  .brand-mark { width: 24px; height: 24px; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr;
  overflow: hidden;
  isolation: isolate;
  color: var(--copy-color);
  transition: color .6s ease;
}

.sky {
  position: absolute; inset: 0; z-index: -3;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bot) 78%);
  transition: background 1.2s ease;
}
.sun {
  position: absolute;
  left: var(--sun-x); top: var(--sun-y);
  width: clamp(90px, 12vw, 160px); aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #fffbe8 0%, var(--sun-color) 45%, transparent 72%);
  box-shadow: 0 0 80px 30px var(--sun-glow), 0 0 220px 90px var(--sun-glow);
  transition: left 1.2s ease, top 1.2s ease, background 1.2s ease, box-shadow 1.2s ease;
}

/* god rays: long skewed slivers of light swinging from the sun */
.rays {
  position: absolute; inset: 0;
  opacity: var(--ray-alpha);
  transition: opacity 1.2s ease;
  mix-blend-mode: screen;
  pointer-events: none;
}
.rays i {
  position: absolute;
  left: var(--sun-x); top: var(--sun-y);
  width: 14vw; height: 160vmax;
  transform-origin: 50% 0;
  translate: -50% 0;
  background: linear-gradient(180deg, rgba(255, 246, 200, .9), rgba(255, 246, 200, 0) 70%);
  filter: blur(14px);
  rotate: var(--r);
  animation: raySway 14s ease-in-out infinite alternate;
  animation-delay: var(--d, 0s);
  transition: left 1.2s ease, top 1.2s ease;
}
.rays i:nth-child(1) { --r: -34deg; --d: 0s; }
.rays i:nth-child(2) { --r: -19deg; --d: -3s; width: 8vw; }
.rays i:nth-child(3) { --r: -6deg;  --d: -6s; }
.rays i:nth-child(4) { --r: 8deg;   --d: -1.5s; width: 10vw; }
.rays i:nth-child(5) { --r: 22deg;  --d: -8s; }
.rays i:nth-child(6) { --r: 38deg;  --d: -4.5s; width: 7vw; }
@keyframes raySway {
  from { rotate: calc(var(--r) - 3deg); opacity: .55; }
  to   { rotate: calc(var(--r) + 3deg); opacity: 1; }
}

.motes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* landscape */
.land {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: -2;
  width: 100%; height: min(46vh, 420px);
  display: block;
}
.turbine { transform: translate(var(--tx), var(--ty)) scale(var(--s)); stroke: #e8f1e9; stroke-width: 2.5; stroke-linecap: round; }
.blades { animation: spin 9s linear infinite; animation-delay: var(--d, 0s); transform-origin: 0 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.town rect { fill: var(--hill-far-bot); }
.town .panels rect { fill: #243a4a; stroke: #cfe6f0; stroke-width: .8; }
.town .roofgreen path { fill: var(--leaf); }
.town .windows rect { fill: var(--sun); opacity: var(--window-alpha); transition: opacity 1.2s ease; }
.trees circle { fill: var(--hill-near-bot); }
.trees rect { fill: var(--earth); }

/* foreground foliage and dapples */
.foliage { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.leaf { position: absolute; width: clamp(140px, 22vw, 320px); fill: #10291f; opacity: .92; filter: drop-shadow(0 14px 22px rgba(0,0,0,.22)); }
.leaf .blade { stroke: #1d4a36; stroke-width: 2; stroke-linejoin: round; }
.leaf .veins { fill: none; stroke: #2c6a4a; stroke-width: 2.5; stroke-linecap: round; opacity: .9; }
.leaf-a { left: -6%; top: -8%;  rotate: -140deg; animation: leafSway 11s ease-in-out infinite alternate; }
.leaf-b { left: 6%;  top: -14%; rotate: -112deg; width: clamp(100px, 16vw, 240px); animation: leafSway 13s ease-in-out -4s infinite alternate-reverse; }
.leaf-c { right: -8%; bottom: 8%; rotate: 48deg; width: clamp(180px, 26vw, 380px); animation: leafSway 15s ease-in-out -7s infinite alternate; }
@keyframes leafSway {
  from { translate: 0 0; }
  to   { translate: 6px 10px; }
}
.dapple {
  position: absolute; width: 38vw; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 196, .55), rgba(255, 244, 196, 0) 60%);
  mix-blend-mode: soft-light; filter: blur(30px);
  animation: dappleDrift 18s ease-in-out infinite alternate;
}
.d1 { left: 4%; top: 30%; }
.d2 { right: 10%; top: 10%; animation-delay: -6s; width: 30vw; }
.d3 { left: 40%; bottom: 4%; animation-delay: -12s; width: 46vw; }
@keyframes dappleDrift {
  from { translate: 0 0; scale: 1; }
  to   { translate: 4vw -2vw; scale: 1.12; }
}

.hero-copy {
  position: relative; z-index: 1;
  align-self: center;
  padding: clamp(7rem, 20vh, 11rem) var(--gutter) 2rem;
  max-width: 44rem;
  text-shadow: 0 1px 0 var(--copy-shadow), 0 0 28px var(--copy-shadow);
}
.hero-copy h1 {
  font-size: clamp(2.75rem, 7.2vw, 6rem);
  font-variation-settings: "SOFT" 90, "opsz" 144;
  max-width: 11ch;
  animation: riseIn 1.1s cubic-bezier(.2,.7,.2,1) both;
}
.hero-copy p {
  margin-top: 1.4rem;
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  max-width: var(--measure);
  animation: riseIn 1.1s .15s cubic-bezier(.2,.7,.2,1) both;
}
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; animation: riseIn 1.1s .3s cubic-bezier(.2,.7,.2,1) both; }
@keyframes riseIn {
  from { opacity: 0; translate: 0 18px; }
  to   { opacity: 1; translate: 0 0; }
}

/* ============================================================
   RAIZ: movimento e princípios
   ============================================================ */
.movement { max-width: 72rem; margin: 0 auto; padding: clamp(4rem, 10vh, 7rem) var(--gutter) 0; }
.movement h2 { max-width: 14ch; }
.movement p { margin-top: 1rem; max-width: var(--measure); font-size: clamp(1.1rem, 1.6vw, 1.3rem); }
.principles { max-width: 72rem; margin: 0 auto; padding: clamp(3rem, 8vh, 5rem) var(--gutter) 0; }
.principle-grid { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.principle {
  display: grid; gap: .5rem; align-content: start; padding: 1.5rem;
  border-radius: 2rem; background: var(--c); color: var(--ink);
}
.principle svg { width: 84px; height: 84px; margin-bottom: .5rem; }
.principle h3 { font-size: 1.5rem; max-width: 14ch; }
.principle p { font-size: .98rem; max-width: 30ch; opacity: .9; }
.vale-cta { padding: clamp(4rem, 10vh, 7rem) var(--gutter); }
.vale-inner {
  max-width: 72rem; margin: 0 auto; padding: clamp(2rem, 5vw, 3.5rem);
  border-radius: 2.5rem; background: var(--canopy); color: var(--dawn);
  display: grid; gap: 1rem; justify-items: start;
}
.vale-inner h2 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
.vale-inner p { max-width: var(--measure); opacity: .9; }
.kicker { font-weight: 600; font-size: .95rem; opacity: .8; }
.vale-head .kicker { color: var(--leaf); opacity: 1; }
.vale-head .actions { margin-top: 1.5rem; }
.vale-head h1 { font-size: clamp(2.8rem, 7vw, 5rem); }

/* ---------- popup Vale Resiste (raiz) ---------- */
.vale-popup {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 60;
  width: min(22rem, calc(100vw - 2rem));
  display: grid; gap: .5rem; justify-items: start;
  padding: 1.4rem 1.4rem 1.5rem;
  border-radius: 1.75rem; background: var(--canopy); color: var(--dawn);
  box-shadow: 0 24px 50px -20px rgba(23,61,46,.6);
  animation: popIn .5s cubic-bezier(.2,.7,.2,1) both;
}
.vale-popup[hidden] { display: none; }
.vale-popup h2 { font-size: 1.5rem; max-width: 14ch; }
.vale-popup p { font-size: .95rem; opacity: .9; }
.vale-popup .btn { margin-top: .5rem; }
.vale-popup .kicker { color: var(--sun); opacity: 1; }
.vale-popup-close {
  position: absolute; top: .7rem; right: .8rem;
  width: 2rem; height: 2rem; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,247,225,.14); color: var(--dawn); font-size: 1.25rem; line-height: 1;
}
.vale-popup-close:hover { background: rgba(255,247,225,.26); }
@keyframes popIn { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }
@media (max-width: 30rem) { .vale-popup { right: .75rem; left: .75rem; bottom: .75rem; width: auto; } }
@media (prefers-reduced-motion: reduce) { .vale-popup { animation: none; } }

/* ---------- footer ---------- */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  padding: 1.5rem var(--gutter);
  background: #10291f; color: rgba(255,247,225,.8); font-size: .9rem;
}
.foot p { font-family: var(--font-display); font-variation-settings: "SOFT" 80, "opsz" 24; font-size: 1.05rem; }
.foot nav { display: flex; gap: 1.25rem; }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; text-underline-offset: .3em; }

/* ---------- motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
  .rays i, .leaf, .dapple, .blades { animation: none !important; }
  .hero-copy h1, .hero-copy p, .actions { animation: none; opacity: 1; translate: none; }
  .motes { display: none; }
  .sun, .sky, .rays, .rays i { transition: none; }
}
