:root {
  --green-dark: #1f4d22;
  --green: #2e6b30;
  --grass: #5ea55a;
  --ink: #f4f8ee;
  --pin: #e04436;
  --route: #2f7de1;
  --sand: #dcc488;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--green-dark);
  color: var(--ink);
  font-family: "VT323", monospace;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 96px 0;
}

/* Pixel map background, slow drift for life */
.hero__bg {
  position: absolute;
  inset: -3%;
  background: url("assets/hero-map.png") center / cover no-repeat;
  image-rendering: pixelated;
  animation: drift 24s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: scale(1.03) translate(0, 0); }
  to   { transform: scale(1.08) translate(-1.5%, -1%); }
}

/* Green translucent wash, heavy on the left, fading right */
.hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg,
      rgba(22, 64, 26, 0.92) 0%,
      rgba(31, 84, 35, 0.82) 30%,
      rgba(46, 107, 48, 0.45) 55%,
      rgba(46, 107, 48, 0) 78%);
}

/* retrac.space logo, top left (lines up with the hero text) */
.site-logo {
  position: absolute;
  z-index: 2;
  top: clamp(16px, 3vw, 32px);
  left: clamp(16px, 6vw, 96px);
  transition: opacity 0.15s ease;
}

.site-logo img { display: block; width: clamp(130px, 14vw, 180px); height: auto; }
.site-logo:hover { opacity: 0.8; }
.site-logo:focus-visible { outline: 3px solid var(--sand); outline-offset: 6px; }

.hero__content {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  padding: 0 clamp(16px, 6vw, 96px);
}

.hero__badge {
  display: inline-block;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-dark);
  background: var(--sand);
  padding: 8px 10px;
  box-shadow: 0 4px 0 #8a6f35;
  margin-bottom: 28px;
  opacity: 0;
  animation: badgeIn 0.5s steps(5) 0.1s forwards;
}

@keyframes badgeIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero__title {
  font-family: "Press Start 2P", monospace;
  font-weight: 400;
  font-size: clamp(30px, 6vw, 64px);
  line-height: 1.1;
  margin-bottom: 28px;
  text-shadow: 4px 4px 0 var(--green-dark), 0 0 0 transparent;
}

.hero__tagline {
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.15;
}

.hero__tagline .hl { color: #ffd84a; }

/* Lines fade and slide up into place, one after another */
.rise {
  display: block;
  opacity: 0;
  transform: translateY(24px);
  filter: blur(4px);
  animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: var(--d, 0s);
}

@keyframes rise {
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* ---------- How it works ---------- */
.steps {
  background: var(--green);
  padding: clamp(64px, 10vw, 120px) clamp(16px, 6vw, 96px);
  border-top: 8px solid var(--green-dark);
}

.steps__inner {
  max-width: 1120px;
  margin: 0 auto;
}

.section-title {
  font-family: "Press Start 2P", monospace;
  font-weight: 400;
  font-size: clamp(20px, 3.2vw, 32px);
  line-height: 1.3;
  margin-bottom: clamp(32px, 5vw, 56px);
  text-shadow: 3px 3px 0 var(--green-dark);
}

.steps__grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}

.steps__grid--two {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

/* Alternate section: darker green so it separates from the one above */
.steps--alt {
  background: var(--green-dark);
  border-top-color: #163a18;
}

.steps--alt .card {
  background: var(--green);
}

.card {
  position: relative;
  background: var(--green-dark);
  border: 4px solid #163a18;
  box-shadow: 6px 6px 0 #163a18;
  padding: 28px 24px 30px;
}

.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.card__num {
  font-family: "Press Start 2P", monospace;
  font-size: 14px;
  color: var(--green-dark);
  background: var(--sand);
  box-shadow: 0 4px 0 #8a6f35;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}

.card__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: var(--grass);
  box-shadow: 0 4px 0 #3c7a39;
  color: var(--ink);
}

.card__icon svg { width: 28px; height: 28px; stroke-width: 2.25; }

.card__title {
  font-family: "Press Start 2P", monospace;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 14px;
}

.card__text {
  font-size: 22px;
  line-height: 1.2;
  color: #d9e8d2;
}

/* ---------- Ready to get started ---------- */
.cta {
  background: var(--green);
  border-top: 8px solid #163a18;
  padding: clamp(72px, 11vw, 140px) clamp(16px, 6vw, 96px);
  text-align: center;
}

.cta__inner {
  max-width: 760px;
  margin: 0 auto;
}

.cta .section-title { margin-bottom: 20px; }

.cta__text {
  font-size: clamp(24px, 2.6vw, 30px);
  line-height: 1.2;
  color: #d9e8d2;
  margin-bottom: 40px;
}

.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 16px 26px 16px 20px;
  font: inherit;
  color: #0f2e12;
  background: #1bd96a;
  border: 4px solid #0f2e12;
  box-shadow: 0 6px 0 #0f2e12;
  cursor: pointer;
  text-align: left;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.dl-btn:hover { background: #3be583; transform: translateY(-2px); box-shadow: 0 8px 0 #0f2e12; }
.dl-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #0f2e12; }
.dl-btn:focus-visible { outline: 4px solid var(--sand); outline-offset: 4px; }

.dl-btn__logo { width: 40px; height: 40px; flex: none; }

.dl-btn__label { display: flex; flex-direction: column; gap: 8px; }

.dl-btn__main {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(11px, 1.6vw, 14px);
  line-height: 1.3;
}

.dl-btn__sub {
  font-size: 20px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.75;
}

/* ---------- Coming soon popup ---------- */
.modal {
  margin: auto;
  width: min(440px, calc(100% - 32px));
  padding: 36px 28px 28px;
  text-align: center;
  color: var(--ink);
  background: var(--green-dark);
  border: 4px solid #163a18;
  box-shadow: 8px 8px 0 #0f2e12;
}

.modal[open] { animation: modalIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
.modal[open]::backdrop { animation: fadeIn 0.3s ease; }
.modal.is-closing { animation: modalOut 0.2s ease forwards; }
.modal.is-closing::backdrop { animation: fadeOut 0.2s ease forwards; }

.modal::backdrop { background: rgba(8, 24, 10, 0.7); }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(30px) scale(0.85); }
  to   { opacity: 1; transform: none; }
}
@keyframes modalOut {
  to { opacity: 0; transform: translateY(16px) scale(0.95); }
}
@keyframes fadeIn  { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }

.modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.modal__close:hover { background: rgba(255, 255, 255, 0.1); }
.modal__close svg { width: 22px; height: 22px; }

.modal__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  color: var(--green-dark);
  background: var(--sand);
  box-shadow: 0 5px 0 #8a6f35;
}
.modal__icon svg { width: 32px; height: 32px; stroke-width: 2.25; animation: tilt 2.4s ease-in-out infinite; }

@keyframes tilt {
  0%, 40%   { transform: rotate(0); }
  50%, 90%  { transform: rotate(180deg); }
  100%      { transform: rotate(180deg); }
}

.modal__title {
  font-family: "Press Start 2P", monospace;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 14px;
}

.modal__text {
  font-size: 24px;
  line-height: 1.2;
  color: #d9e8d2;
  margin-bottom: 26px;
}

.modal__ok {
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  color: var(--green-dark);
  background: var(--sand);
  border: 0;
  box-shadow: 0 4px 0 #8a6f35;
  padding: 14px 22px;
  cursor: pointer;
}
.modal__ok:active { transform: translateY(3px); box-shadow: 0 1px 0 #8a6f35; }

/* Scroll reveal (only active once script.js has run) */
.js .reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--d, 0s);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 640px) {
  .hero__shade {
    background: linear-gradient(90deg,
      rgba(22, 64, 26, 0.9) 0%,
      rgba(31, 84, 35, 0.78) 70%,
      rgba(46, 107, 48, 0.4) 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__bg, .hero__badge, .rise { animation: none; }
  .hero__badge, .rise { opacity: 1; transform: none; filter: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .modal[open], .modal[open]::backdrop, .modal.is-closing, .modal.is-closing::backdrop,
  .modal__icon svg { animation: none; }
}
