:root {
  --sky-top: #6eb4d8;
  --sky-mid: #a8d4ef;
  --sky-dawn: #e8c99a;
  --sky-horizon: #d4e8c4;
  --grass: #3d7a3c;
  --grass-lit: #58a84e;
  --grass-deep: #2f5f2e;
  --dirt: #6b4a2e;
  --dirt-deep: #4a3220;
  --ink: #1c2a1c;
  --ink-soft: #3a4a3a;
  --moss: #e6ecda;
  --moss-deep: #d5dec8;
  --sun: #f0c35a;
  --water: #3a7fa0;
  --focus: #1a5c9a;
  --radius: 6px;
  --font-display: "Bungee", cursive;
  --font-body: "Lexend", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --page-pad-x: max(1.25rem, var(--safe-left), var(--safe-right));
}

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

html {
  scroll-behavior: smooth;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--moss);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--grass);
}

a:hover {
  color: var(--dirt);
}

.skip-link {
  position: absolute;
  left: max(1rem, var(--safe-left));
  top: -100%;
  z-index: 100;
  padding: 0.75rem 1.1rem;
  min-height: 44px;
  background: var(--ink);
  color: var(--moss);
  text-decoration: none;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: max(1rem, var(--safe-top));
}

/* ——— Hero: one full-bleed composition ——— */
.hero {
  position: relative;
  min-height: 100dvh;
  min-height: 100svh;
  display: grid;
  align-items: end;
  overflow: hidden;
  color: var(--ink);
  /* Bleed past body side safe padding so sky goes edge-to-edge */
  margin-left: calc(-1 * var(--safe-left));
  margin-right: calc(-1 * var(--safe-right));
  width: calc(100% + var(--safe-left) + var(--safe-right));
}

.hero-sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.sky-wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 42% at 74% 16%, rgba(240, 195, 90, 0.5), transparent 62%),
    radial-gradient(ellipse 40% 30% at 20% 30%, rgba(255, 255, 255, 0.18), transparent 70%),
    linear-gradient(
      180deg,
      var(--sky-top) 0%,
      var(--sky-mid) 38%,
      var(--sky-dawn) 68%,
      var(--sky-horizon) 100%
    );
}

.sun {
  position: absolute;
  top: max(10%, calc(var(--safe-top) + 2.5rem));
  right: max(12%, var(--safe-right));
  width: clamp(3.75rem, 11vw, 7.25rem);
  height: clamp(3.75rem, 11vw, 7.25rem);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff8d4, var(--sun) 52%, #e09a3a);
  box-shadow:
    0 0 40px 14px rgba(240, 195, 90, 0.4),
    0 0 90px 40px rgba(232, 170, 80, 0.2);
  animation: sun-breathe 8s ease-in-out infinite;
}

.haze {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28%;
  height: 35%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(212, 232, 196, 0.35) 55%,
    rgba(107, 74, 46, 0.08)
  );
  pointer-events: none;
  animation: haze-drift 14s ease-in-out infinite alternate;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.84);
  border-radius: 999px;
  filter: blur(0.4px);
  animation: cloud-drift linear infinite;
  will-change: transform;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: inherit;
}

.cloud-a {
  top: max(14%, calc(var(--safe-top) + 3rem));
  left: -12%;
  width: 150px;
  height: 38px;
  animation-duration: 72s;
}

.cloud-a::before {
  width: 58px;
  height: 58px;
  top: -30px;
  left: 26px;
}

.cloud-a::after {
  width: 46px;
  height: 46px;
  top: -22px;
  left: 74px;
}

.cloud-b {
  top: 26%;
  left: 38%;
  width: 108px;
  height: 30px;
  opacity: 0.72;
  animation-duration: 98s;
  animation-delay: -22s;
}

.cloud-b::before {
  width: 44px;
  height: 44px;
  top: -22px;
  left: 18px;
}

.cloud-b::after {
  width: 36px;
  height: 36px;
  top: -16px;
  left: 54px;
}

.cloud-c {
  top: max(11%, calc(var(--safe-top) + 2rem));
  left: 68%;
  width: 168px;
  height: 42px;
  opacity: 0.68;
  animation-duration: 115s;
  animation-delay: -48s;
}

.cloud-c::before {
  width: 62px;
  height: 62px;
  top: -32px;
  left: 30px;
}

.cloud-c::after {
  width: 50px;
  height: 50px;
  top: -24px;
  left: 84px;
}

.birds {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.bird {
  position: absolute;
  width: 10px;
  height: 4px;
  color: rgba(28, 42, 28, 0.35);
  animation: bird-fly 22s linear infinite;
}

.bird::before,
.bird::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  top: 1px;
}

.bird::before {
  left: 0;
  transform: rotate(-28deg);
  transform-origin: right center;
  animation: wing-flap 0.55s ease-in-out infinite;
}

.bird::after {
  right: 0;
  transform: rotate(28deg);
  transform-origin: left center;
  animation: wing-flap-r 0.55s ease-in-out infinite;
}

.bird-1 {
  top: 22%;
  left: -8%;
  animation-duration: 26s;
}

.bird-2 {
  top: 18%;
  left: -8%;
  animation-duration: 32s;
  animation-delay: -8s;
  transform: scale(0.85);
}

.bird-3 {
  top: 28%;
  left: -8%;
  animation-duration: 38s;
  animation-delay: -14s;
  transform: scale(0.7);
  opacity: 0.7;
}

.terrain {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  pointer-events: none;
}

.terrain-far {
  height: min(48dvh, 460px);
  opacity: 0.92;
}

.terrain-near {
  height: min(44dvh, 420px);
  filter: drop-shadow(0 -10px 28px rgba(28, 42, 28, 0.14));
}

.hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(28, 42, 28, 0.08) 0%, transparent 18%),
    linear-gradient(0deg, rgba(74, 50, 32, 0.28) 0%, transparent 28%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 2 * var(--page-pad-x)));
  margin: 0 auto;
  margin-bottom: max(10dvh, calc(var(--safe-bottom) + 5rem));
  padding: max(1.5rem, var(--safe-top)) 0.35rem 0;
  text-align: center;
  animation: rise-in 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Soft sky scrim so type stays readable over terrain — not a card */
.hero-content::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 8%;
  bottom: -8%;
  width: min(100%, 34rem);
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(168, 212, 239, 0.55), transparent 72%),
    radial-gradient(ellipse 80% 50% at 50% 70%, rgba(232, 201, 154, 0.28), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.brand {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 13vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-shadow:
    3px 3px 0 rgba(255, 255, 255, 0.55),
    0 3px 0 rgba(107, 74, 46, 0.22),
    0 10px 28px rgba(28, 42, 28, 0.12);
}

.headline {
  margin: 0 0 0.75rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(1.12rem, 3.4vw, 1.55rem);
  line-height: 1.25;
  color: var(--ink);
  text-wrap: balance;
}

.lede {
  margin: 0 auto 1.75rem;
  max-width: 34rem;
  font-size: clamp(0.98rem, 2.4vw, 1.1rem);
  font-weight: 300;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: stretch;
}

.btn-primary,
.btn-secondary {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius);
  padding: 0.95rem 1.35rem;
  min-height: 48px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-primary {
  position: relative;
  background: var(--grass);
  color: #fff;
  min-width: min(100%, 16rem);
  box-shadow: 0 4px 0 var(--grass-deep), 0 8px 20px rgba(47, 95, 46, 0.25);
}

.btn-primary:hover {
  background: var(--grass-deep);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--grass-deep), 0 2px 8px rgba(47, 95, 46, 0.2);
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-chip:focus-visible,
.linkish:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.btn-primary.is-copied {
  background: #2a6b3a;
}

.btn-feedback {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, max-height 0.2s ease;
}

.btn-primary.is-copied .btn-feedback {
  opacity: 1;
  max-height: 1.5rem;
  margin-top: 0.2rem;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  border: 2px solid rgba(28, 42, 28, 0.16);
  backdrop-filter: blur(6px);
}

.btn-secondary:hover {
  background: #fff;
  transform: translateY(-1px);
}

/* ——— Sections ——— */
.section {
  padding:
    clamp(3.25rem, 8vw, 5.5rem)
    var(--page-pad-x)
    clamp(3.25rem, 8vw, 5.5rem);
}

.section-inner {
  width: min(640px, 100%);
  margin: 0 auto;
}

.section h2 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 5vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.section-lede {
  margin: 0 0 2rem;
  color: var(--ink-soft);
  font-weight: 300;
  font-size: clamp(1rem, 2.4vw, 1.08rem);
}

.how {
  background: var(--moss);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.75rem;
}

.steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
}

.step-num {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-top: 0.1rem;
  background: var(--grass-lit);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1rem;
  border-radius: 4px;
  box-shadow: 0 2px 0 var(--grass-deep);
}

.steps h3 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.steps p {
  margin: 0;
  color: var(--ink-soft);
}

/* Interaction card — only where copy needs a clear target */
.join-chip {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid rgba(61, 122, 60, 0.22);
  border-radius: var(--radius);
  max-width: 100%;
}

.join-chip code {
  flex: 1 1 auto;
  font-size: clamp(0.92rem, 3.2vw, 1.05rem);
  background: transparent;
  padding: 0.15rem 0.1rem;
  word-break: break-all;
}

.btn-chip {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  background: var(--grass);
  border-radius: 4px;
  padding: 0.65rem 1.1rem;
  min-height: 44px;
  min-width: 4.5rem;
  flex: 0 0 auto;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn-chip:hover {
  background: var(--grass-deep);
}

.btn-chip:active {
  transform: scale(0.98);
}

.btn-chip.is-copied {
  background: #2a6b3a;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.95em;
  background: rgba(61, 122, 60, 0.12);
  padding: 0.2em 0.45em;
  border-radius: 4px;
  color: var(--ink);
}

.world {
  background:
    linear-gradient(180deg, rgba(61, 122, 60, 0.1), transparent 36%),
    var(--moss-deep);
}

.world-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1.35rem;
}

.world-list li {
  padding-left: 1.15rem;
  border-left: 4px solid var(--grass-lit);
  color: var(--ink-soft);
}

.world-list strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.pack {
  background: var(--moss);
}

.pack-body {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 300;
  font-size: clamp(1rem, 2.4vw, 1.08rem);
  max-width: 36rem;
}

.note {
  background: var(--dirt);
  color: var(--moss);
}

.note h2 {
  color: var(--moss);
}

.note p {
  margin: 0;
  max-width: 36rem;
  font-weight: 300;
  color: rgba(230, 236, 218, 0.92);
  font-size: clamp(1rem, 2.4vw, 1.08rem);
}

.footer {
  padding:
    2rem
    var(--page-pad-x)
    max(2.5rem, calc(var(--safe-bottom) + 1.5rem));
  text-align: center;
  background: var(--dirt-deep);
  color: rgba(230, 236, 218, 0.75);
  font-size: 0.92rem;
  /* Bleed like hero so footer is edge-to-edge */
  margin-left: calc(-1 * var(--safe-left));
  margin-right: calc(-1 * var(--safe-right));
  width: calc(100% + var(--safe-left) + var(--safe-right));
}

.footer p {
  margin: 0 0 0.4rem;
}

.brand-sm {
  font-family: var(--font-display);
  color: var(--moss);
  letter-spacing: 0.02em;
}

.footer code {
  background: rgba(0, 0, 0, 0.25);
  color: var(--moss);
}

.footer-fine {
  font-size: 0.78rem;
  opacity: 0.7;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cloud-drift {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(125vw);
  }
}

@keyframes sun-breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.045);
    opacity: 0.93;
  }
}

@keyframes haze-drift {
  from {
    opacity: 0.75;
    transform: translateY(0);
  }
  to {
    opacity: 1;
    transform: translateY(-6px);
  }
}

@keyframes bird-fly {
  0% {
    transform: translateX(0) translateY(0);
  }
  50% {
    transform: translateX(55vw) translateY(-12px);
  }
  100% {
    transform: translateX(110vw) translateY(4px);
  }
}

@keyframes wing-flap {
  0%,
  100% {
    transform: rotate(-28deg);
  }
  50% {
    transform: rotate(-8deg);
  }
}

@keyframes wing-flap-r {
  0%,
  100% {
    transform: rotate(28deg);
  }
  50% {
    transform: rotate(8deg);
  }
}

/* Phone */
@media (max-width: 560px) {
  .hero {
    align-items: center;
  }

  .hero-content {
    margin-bottom: 0;
    /* Extra top room for Dynamic Island / notch when viewport-fit=cover */
    margin-top: max(2.75rem, calc(var(--safe-top) + 0.85rem));
    padding-bottom: max(5dvh, calc(var(--safe-bottom) + 1.25rem));
  }

  .brand {
    font-size: clamp(2.85rem, 15vw, 3.6rem);
  }

  .cta-group {
    flex-direction: column;
    width: 100%;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    text-align: center;
  }

  .terrain-far {
    height: min(40dvh, 300px);
  }

  .terrain-near {
    height: min(36dvh, 270px);
  }

  .steps li {
    gap: 0.75rem;
  }

  .join-chip {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-chip {
    width: 100%;
  }

  .cloud-a,
  .cloud-b,
  .cloud-c {
    transform: scale(0.85);
  }
}

/* Large phone / small tablet */
@media (min-width: 561px) and (max-width: 900px) {
  .hero-content {
    margin-bottom: max(9dvh, calc(var(--safe-bottom) + 4rem));
  }
}

/* Desktop breathing room */
@media (min-width: 901px) {
  .hero-content {
    margin-bottom: max(12dvh, 5rem);
  }

  .terrain-far {
    height: min(58dvh, 520px);
  }

  .terrain-near {
    height: min(52dvh, 480px);
  }
}

/* Short landscape phones (notch side insets matter) */
@media (max-height: 480px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding-bottom: 2rem;
  }

  .hero-content {
    margin-bottom: max(1.5rem, var(--safe-bottom));
    padding-top: max(1rem, var(--safe-top));
  }

  .brand {
    font-size: clamp(2.2rem, 10vw, 3rem);
  }

  .lede {
    margin-bottom: 1rem;
  }

  .terrain-far,
  .terrain-near {
    height: min(70vh, 280px);
  }
}
