:root {
  --void: #000000;
  --moss: #06120a;
  --canopy: #14351c;
  --leaf: #2f7d3a;
  --signal: #6bff5c;
  --signal-soft: rgba(107, 255, 92, 0.16);
  --mist: #e6f5de;
  --mist-dim: #a2bb9e;
  --lantern: #ffb547;

  --pixel: "Pixelify Sans", "Courier New", monospace;
  --body: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(1rem, 4vw, 3rem);
  --max: 1240px;
  --notch: 6px;
}

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

html { scroll-behavior: smooth; color-scheme: dark; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--void);
  color: var(--mist);
  font-family: var(--body);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-variant-ligatures: none;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--pixel); font-weight: 600; line-height: 1.02; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }

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

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--signal); color: var(--void); padding: .5rem 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* Pixel-notched buttons */
.btn {
  --bg: var(--signal);
  --fg: var(--void);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--pixel); font-weight: 600; font-size: 1.05rem;
  padding: .85rem 1.4rem;
  background: var(--bg); color: var(--fg);
  text-decoration: none; border: 0; cursor: pointer;
  clip-path: polygon(0 var(--notch), var(--notch) var(--notch), var(--notch) 0, calc(100% - var(--notch)) 0, calc(100% - var(--notch)) var(--notch), 100% var(--notch), 100% calc(100% - var(--notch)), calc(100% - var(--notch)) calc(100% - var(--notch)), calc(100% - var(--notch)) 100%, var(--notch) 100%, var(--notch) calc(100% - var(--notch)), 0 calc(100% - var(--notch)));
  transition: background-color .15s, transform .15s;
}
.btn:hover { background: #a4ff96; }
.btn:active { transform: translateY(2px); }
.btn--ghost { --bg: rgba(107, 255, 92, .1); --fg: var(--mist); box-shadow: inset 0 0 0 2px var(--signal); }
.btn--ghost:hover { background: rgba(107, 255, 92, .22); }
.btn--small { font-size: .95rem; padding: .6rem 1rem; }

/* Logo */
.ylogo { display: inline-block; line-height: 0; }
.ylogo svg { overflow: visible; }
.ylogo rect { fill: var(--signal); }
.ylogo .frag { opacity: .55; }

/* NAV */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 2rem;
  padding: .9rem var(--gutter);
  transition: background-color .25s, backdrop-filter .25s;
}
.nav.is-scrolled { background: rgba(0, 0, 0, .72); backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--canopy); }
.nav__logo { display: flex; padding: 4px; }
.nav__links { display: flex; gap: 1.75rem; margin-right: auto; }
.nav__links a { text-decoration: none; color: var(--mist-dim); font-size: .95rem; transition: color .15s; }
.nav__links a:hover { color: var(--mist); }
@media (max-width: 760px) { .nav__links { display: none; } .nav { justify-content: space-between; } }

/* HERO */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; }
.hero__media { position: absolute; inset: 0; z-index: -2; background: #031006 url("/media/hero.webp") center / cover no-repeat; }
.hero__video { width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.hero__shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.35) 42%, rgba(0,0,0,0) 65%),
    linear-gradient(0deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,0) 40%);
}
@media (max-width: 760px) {
  .hero__video { object-position: 72% 50%; }
  .hero__shade { background: linear-gradient(0deg, rgba(0,0,0,.92) 0%, rgba(0,0,0,.7) 45%, rgba(0,0,0,.1) 80%); }
}
.hero__content { width: 100%; max-width: var(--max); margin-inline: auto; padding: 7rem var(--gutter) clamp(3rem, 9vh, 6rem); }
.hero__kicker { display: flex; align-items: center; gap: .6rem; color: var(--mist-dim); font-size: .95rem; margin-bottom: 1.25rem; }
.dot { width: 8px; height: 8px; background: var(--signal); box-shadow: 0 0 12px var(--signal); }
.hero__title { font-size: clamp(3.4rem, 10.5vw, 9.5rem); line-height: .9; text-shadow: 0 0 40px rgba(107, 255, 92, .25); }
.hero__title .line { display: block; }
.hero__lede { max-width: 34rem; margin-top: 1.5rem; color: #cfe3c8; font-size: clamp(1.05rem, 1rem + .35vw, 1.25rem); }
.hero__actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2rem; }

.hero__you {
  position: absolute; left: var(--you-x, -999px); top: var(--you-y, -999px);
  transform: translate(-100%, -100%); pointer-events: none;
  font-family: var(--pixel); font-size: .95rem; color: var(--lantern);
  opacity: 0; transition: opacity .6s .8s;
}
.hero__you.is-on { opacity: 1; }
.hero__you span { display: block; padding: 0 1rem .9rem 0; border-right: 2px solid var(--lantern); border-bottom: 2px solid var(--lantern); white-space: nowrap; margin: 0 14px 22px 0; }
@media (max-width: 900px) { .hero__you { display: none; } }

/* One orchestrated moment: headline builds in pixel steps */
@media (prefers-reduced-motion: no-preference) {
  .hero__title .line { animation: build 0.9s steps(8, end) both; }
  .hero__title .line:nth-child(2) { animation-delay: .25s; }
  .hero__title .line:nth-child(3) { animation-delay: .5s; }
  @keyframes build { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
}

/* Sections */
.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head h2 { font-size: clamp(2.2rem, 5vw, 4rem); }
.section-head p { margin-top: 1rem; color: var(--mist-dim); max-width: 38rem; }
.section-head--row { max-width: none; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 3rem; }
.section-head--row p { margin-top: 0; max-width: 26rem; }

/* LOOP */
.loop { padding-block: clamp(5rem, 11vw, 9rem) clamp(4rem, 8vw, 6rem); background: linear-gradient(180deg, var(--void), var(--moss)); }
.loop__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2.5vw, 2rem); }
.step:nth-child(2) { margin-top: clamp(0rem, 6vw, 5rem); }
.step:nth-child(3) { margin-top: clamp(0rem, 12vw, 10rem); }
.step__img { margin: 0; aspect-ratio: 4 / 5; overflow: hidden; background: var(--canopy); position: relative; }
.step__img img { width: 100%; height: 100%; object-fit: cover; }
.step__img::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(107,255,92,.2); pointer-events: none; }
.step__body { position: relative; padding-top: 1.25rem; }
.step__n { font-family: var(--pixel); font-size: 1rem; color: var(--void); background: var(--signal); display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; margin-bottom: .75rem; }
.step h3 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.step p { margin-top: .5rem; color: var(--mist-dim); max-width: 22rem; }
.loop__return { display: flex; align-items: center; gap: 1rem; margin-top: 3rem; font-family: var(--pixel); font-size: clamp(1.1rem, 2vw, 1.4rem); color: var(--signal); }
.loop__arc { flex: 0 0 auto; width: 64px; height: 28px; border: 2px dashed var(--signal); border-top: 0; border-right: 0; }
@media (max-width: 760px) {
  .loop__steps { grid-template-columns: 1fr; gap: 2.5rem; }
  .step:nth-child(n) { margin-top: 0; }
  .step__img { aspect-ratio: 4 / 3; }
}

/* WORLD */
.world { padding-block: clamp(4rem, 9vw, 8rem); background: var(--moss); }
.world__grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: clamp(1.25rem, 3vw, 2.5rem); align-items: stretch; }
@media (max-width: 960px) { .world__grid { grid-template-columns: 1fr; } }
.map { position: relative; align-self: start; width: 100%; aspect-ratio: 16 / 9; background: #000 url("/media/map.webp") center / cover; overflow: hidden; box-shadow: 0 0 0 1px var(--canopy), 0 30px 80px -30px rgba(107, 255, 92, .25); }
.map__video { width: 100%; height: 100%; object-fit: cover; }
.pin {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: .5rem;
  background: rgba(0, 0, 0, .72); color: var(--mist);
  border: 2px solid rgba(107, 255, 92, .55); padding: .35rem .7rem;
  font-family: var(--pixel); font-size: clamp(.72rem, 1.4vw, 1rem); cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.pin::before { content: ""; width: 8px; height: 8px; background: var(--signal); flex: none; }
.pin:hover { border-color: var(--signal); background: rgba(6, 30, 12, .9); }
.pin[aria-pressed="true"] { background: var(--signal); color: var(--void); border-color: var(--signal); }
.pin[aria-pressed="true"]::before { background: var(--void); }
@media (max-width: 520px) { .pin { padding: .2rem .4rem; } .pin::before { display: none; } }

.zone { display: flex; flex-direction: column; background: var(--void); padding: clamp(1.5rem, 3vw, 2.25rem); box-shadow: inset 0 0 0 1px var(--canopy); }
.zone__layer { color: var(--signal); font-size: .95rem; }
.zone__name { font-size: clamp(2rem, 3.5vw, 3rem); margin-top: .35rem; }
.zone__text { margin-top: 1rem; color: #cfe3c8; }
.zone__do { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px dashed var(--canopy); color: var(--mist-dim); }
.zone__do-label { font-family: var(--pixel); color: var(--mist); margin-bottom: .25rem; }
.zone__nav { margin-top: auto; padding-top: 1.75rem; display: flex; gap: .6rem; flex-wrap: wrap; }
.zone.is-swapping .zone__name, .zone.is-swapping .zone__text, .zone.is-swapping .zone__do { opacity: 0; }
.zone__name, .zone__text, .zone__do { transition: opacity .18s; }

/* MANIFESTO */
.manifesto { position: relative; isolation: isolate; overflow: hidden; padding-block: clamp(6rem, 14vw, 11rem); }
.manifesto__media { position: absolute; inset: 0; z-index: -2; background: url("/media/greenworld.webp") center / cover; }
.manifesto__media video { width: 100%; height: 100%; object-fit: cover; }
.manifesto__shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(0,0,0,.88) 0%, rgba(0,0,0,.55) 55%, rgba(0,0,0,.25) 100%), linear-gradient(180deg, var(--moss) 0%, transparent 18%, transparent 82%, var(--void) 100%); }
.manifesto__lines { list-style: none; margin: 0; padding: 0; font-family: var(--pixel); font-size: clamp(2rem, 6vw, 5rem); line-height: 1.08; }
.manifesto__lines li { color: rgba(230, 245, 222, .28); transition: color .5s; }
.manifesto__lines li b { font-weight: 600; }
.manifesto__lines li.is-lit { color: var(--mist); }
.manifesto__lines li.is-lit b { color: var(--signal); text-shadow: 0 0 30px rgba(107, 255, 92, .45); }
@media (prefers-reduced-motion: reduce) { .manifesto__lines li { color: var(--mist); } .manifesto__lines li b { color: var(--signal); } }

/* PIXEL */
.pixel { padding-block: clamp(5rem, 10vw, 8rem); background: var(--void); }
.pixel__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
@media (max-width: 860px) { .pixel__grid { grid-template-columns: 1fr; } }
.pixel__copy h2 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
.pixel__copy p { margin-top: 1rem; color: var(--mist-dim); max-width: 30rem; }
.pixel__count { font-family: var(--pixel); color: var(--signal) !important; font-size: 1.2rem; }
.pixel__note { font-size: .9rem; }
.pixel__copy .btn { margin-top: 1.25rem; }
.pixel__board {
  display: grid; grid-template-columns: repeat(var(--cols, 24), 1fr);
  gap: 3px; width: 100%; max-width: 560px; margin-inline: auto;
  padding: 12px; background: var(--moss); box-shadow: inset 0 0 0 1px var(--canopy);
}
.cell { aspect-ratio: 1; border: 0; padding: 0; background: #0b1d10; cursor: pointer; transition: background-color .2s, box-shadow .2s; }
.cell.y { background: #173d20; }
.cell:hover { background: #2b6a35; }
.cell.on { background: var(--signal); box-shadow: 0 0 10px rgba(107, 255, 92, .6); }
.cell.on.mine-last { animation: pop .35s steps(3, end); }
@keyframes pop { 0% { transform: scale(.4); } 100% { transform: scale(1); } }
.cell:focus-visible { outline-offset: 0; }

/* ROADMAP */
.roadmap { padding-block: clamp(5rem, 10vw, 8rem); background: linear-gradient(180deg, var(--void), var(--moss)); }
.phases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.phases::before { content: ""; position: absolute; left: 0; right: 0; top: 27px; border-top: 2px dashed var(--canopy); }
.phase { position: relative; padding-right: 1.5rem; }
.phase__icon { display: grid; place-items: center; width: 56px; height: 56px; background: var(--moss); box-shadow: inset 0 0 0 2px var(--canopy); position: relative; }
.phase__icon svg { width: 32px; height: 32px; }
.phase__icon rect { fill: var(--leaf); }
.is-now .phase__icon { background: var(--signal-soft); box-shadow: inset 0 0 0 2px var(--signal); }
.is-now .phase__icon rect { fill: var(--signal); }
.phase__when { margin-top: 1.25rem; color: var(--mist-dim); font-size: .95rem; display: flex; gap: .6rem; align-items: center; }
.phase__when em { font-style: normal; font-family: var(--pixel); color: var(--void); background: var(--lantern); padding: 0 .45rem; font-size: .85rem; }
.phase h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); margin-top: .3rem; }
.phase p:last-child { margin-top: .5rem; color: var(--mist-dim); max-width: 17rem; }
@media (max-width: 860px) {
  .phases { grid-template-columns: 1fr 1fr; gap: 2.5rem 1rem; }
  .phases::before { display: none; }
}
@media (max-width: 480px) { .phases { grid-template-columns: 1fr; } }

/* CTA */
.cta { position: relative; isolation: isolate; overflow: hidden; min-height: min(90vh, 760px); display: flex; align-items: flex-start; }
.cta__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; z-index: -2; }
.cta__shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--moss) 0%, rgba(0,0,0,.35) 30%, rgba(0,0,0,0) 55%, rgba(0,0,0,.6) 100%), linear-gradient(90deg, rgba(0,0,0,.6), rgba(0,0,0,0) 55%); }
.cta__inner { padding-block: clamp(5rem, 10vw, 8rem); }
.cta h2 { font-size: clamp(2.6rem, 7vw, 5.5rem); max-width: 12ch; }
.cta p { margin-top: 1rem; max-width: 26rem; color: #d7e9d0; }
.cta__links { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 2rem; }
.social { display: grid; place-items: center; width: 48px; height: 48px; background: rgba(0,0,0,.55); box-shadow: inset 0 0 0 2px rgba(107,255,92,.45); transition: box-shadow .15s, background-color .15s; }
.social:hover { box-shadow: inset 0 0 0 2px var(--signal); background: rgba(0,0,0,.8); }
.social svg { width: 20px; height: 20px; fill: var(--mist); }
@media (max-width: 760px) { .cta { align-items: flex-end; } .cta__shade { background: linear-gradient(0deg, rgba(0,0,0,.95) 0%, rgba(0,0,0,.75) 50%, rgba(0,0,0,.2) 80%, var(--moss) 100%); } }

/* FOOTER */
.footer { background: var(--void); border-top: 1px solid var(--canopy); padding-block: 2rem; }
.footer__inner { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; color: var(--mist-dim); }
.footer__inner p:first-of-type { font-family: var(--pixel); color: var(--mist); }
.footer__legal { margin-left: auto !important; font-size: .9rem; }
