/* ============================================================
   BinEasy — landing page styles
   Mobile-first. Palette:
   forest #1B4332 · mid #2D6A4F · fresh #52B788 · mint #EAF5EF
   ink #1F2421 · white #FFFFFF
   ============================================================ */

:root {
  --forest: #1B4332;
  --mid: #2D6A4F;
  --fresh: #52B788;
  --mint: #EAF5EF;
  --ink: #1F2421;
  --muted: #5A6660;
  --white: #FFFFFF;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(27, 67, 50, 0.10);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-brand: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --header-h: 68px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  width: min(100% - 2.5rem, 1080px);
  margin-inline: auto;
}

.narrow {
  max-width: 680px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Type ---------- */

h1, h2, h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--forest);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 8vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

h1 em {
  font-style: normal;
  color: var(--fresh);
}

h2 {
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  font-weight: 700;
}

.eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mid);
  background: var(--mint);
  border: 1px solid rgba(82, 183, 136, 0.35);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  margin-bottom: 1.25rem;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  color: var(--white);
  background: var(--forest);
  border: none;
  border-radius: 999px;
  padding: 0.8rem 1.7rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s ease, transform 0.25s ease;
}

.btn:hover {
  background: var(--mid);
  transform: translateY(-2px);
}

.btn-small {
  padding: 0.5rem 1.2rem;
  font-size: 0.9rem;
}

.btn-light {
  background: var(--white);
  color: var(--forest);
}

.btn-light:hover {
  background: var(--mint);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(27, 67, 50, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
}

.wordmark {
  font-family: var(--font-brand);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--forest);
  text-decoration: none;
}

/* Header CTA stays hidden until the truck pulls in (JS adds .is-visible) */
@media (prefers-reduced-motion: no-preference) {
  html.js .header-cta {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
  }

  html.js .header-cta.is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  html.js .header-cta.is-visible:hover {
    transform: translateY(-2px);
  }
}

.wordmark span {
  color: var(--fresh);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  text-align: center;
  background:
    radial-gradient(48rem 30rem at 85% -10%, rgba(82, 183, 136, 0.16), transparent 65%),
    radial-gradient(40rem 26rem at 5% 110%, rgba(45, 106, 79, 0.10), transparent 60%),
    var(--white);
}

.hero-inner {
  max-width: 760px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: clamp(1.5rem, 4vh, 3.5rem) 1rem;
}

.hero-sub {
  font-size: clamp(1.05rem, 2.5vw, 1.2rem);
  color: var(--muted);
  max-width: 560px;
  margin: 1.25rem auto 2rem;
}

/* ---------- Store badges ---------- */

.store-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.store-badge {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--ink);
  color: var(--white);
  text-decoration: none;
  border-radius: 12px;
  padding: 0.6rem 1.2rem;
  min-width: 175px;
  opacity: 0.92;
  cursor: default;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.store-badge:hover {
  transform: translateY(-2px);
  opacity: 1;
}

.store-badge svg {
  width: 1.7rem;
  height: 1.7rem;
  flex-shrink: 0;
}

.store-badge span {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.25;
}

.store-badge small {
  font-size: 0.68rem;
  opacity: 0.75;
  letter-spacing: 0.02em;
}

.store-badge strong {
  font-size: 1.05rem;
  font-weight: 600;
}

/* ---------- Notify form ---------- */

.notify-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  max-width: 460px;
  margin-inline: auto;
}

.notify-form input {
  flex: 1 1 220px;
  font: inherit;
  padding: 0.75rem 1.1rem;
  border: 1.5px solid rgba(27, 67, 50, 0.25);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.notify-form input:focus {
  outline: none;
  border-color: var(--fresh);
  box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.25);
}

.form-note {
  flex-basis: 100%;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.form-note.success {
  color: var(--mid);
  font-weight: 600;
}

.form-note.error {
  color: #B4462F;
  font-weight: 600;
}

/* ---------- Story animation (pixel-art pickup loop, hero ground) ---------- */

/* The scene strip flexes to fill whatever viewport space the copy doesn't use.
   The SVG is absolutely positioned so it contributes zero intrinsic height —
   otherwise its aspect ratio sets a flex min-size and forces the page past the fold. */
.hero-scene {
  position: relative;
  width: 100%;
  flex: 2 1 0%;
  min-height: 150px;
  max-height: 44vh;
  overflow: hidden;
}

.story-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.story-caption {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

/* One shared 14s clock keeps every actor in sync.
   steps() on the walking segments gives the chunky video-game motion. */

.story-resident {
  animation: be-resident 14s linear infinite;
}

.story-bin {
  animation: be-bin 14s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.story-worker {
  animation: be-worker 14s linear infinite;
}

.story-truck {
  animation: be-truck 14s linear infinite;
}

.story-wheel {
  animation: be-wheel 14s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.story-bob {
  animation: be-bob 0.45s steps(1, end) infinite alternate;
}

.story-cloud--one {
  animation: be-drift 26s ease-in-out infinite alternate;
}

.story-cloud--two {
  animation: be-drift 34s ease-in-out infinite alternate-reverse;
}

.story-puff {
  animation: be-puff 2.4s linear infinite;
}

.story-puff--b {
  animation-delay: 1.2s;
}

.story-trash {
  animation: be-trash 14s linear infinite;
}

.story-trash--b {
  animation-delay: 0.25s;
}

@keyframes be-resident {
  0% { opacity: 0; transform: translateX(0); }
  1.5% { opacity: 1; transform: translateX(0); animation-timing-function: steps(16); }
  15%, 17% { opacity: 1; transform: translateX(150px); animation-timing-function: steps(16); }
  27% { opacity: 1; transform: translateX(0); }
  28.5%, 78% { opacity: 0; transform: translateX(0); }
  80% { opacity: 1; transform: translateX(0); animation-timing-function: steps(16); }
  86%, 88% { opacity: 1; transform: translateX(150px); animation-timing-function: steps(16); }
  94% { opacity: 1; transform: translateX(0); }
  95.5%, 100% { opacity: 0; transform: translateX(0); }
}

@keyframes be-bin {
  0%, 2% { transform: translate(0, 0) rotate(0deg); animation-timing-function: steps(16); }
  15%, 46% { transform: translate(134px, 0) rotate(0deg); animation-timing-function: ease-in-out; }
  49% { transform: translate(256px, -58px) rotate(0deg); animation-timing-function: ease-in-out; }
  50.5%, 52% { transform: translate(256px, -58px) rotate(-105deg); animation-timing-function: ease-in-out; }
  53.5% { transform: translate(256px, -58px) rotate(0deg); animation-timing-function: ease-in-out; }
  56%, 88% { transform: translate(134px, 0) rotate(0deg); animation-timing-function: steps(16); }
  94%, 100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes be-worker {
  0%, 37% { opacity: 0; transform: translate(0, -12px); }
  38% { opacity: 1; transform: translate(0, -12px); }
  39% { opacity: 1; transform: translate(0, 0); animation-timing-function: steps(12); }
  44%, 46% { opacity: 1; transform: translateX(-52px); animation-timing-function: ease-in-out; }
  49%, 53.5% { opacity: 1; transform: translateX(22px); animation-timing-function: ease-in-out; }
  56.5%, 58% { opacity: 1; transform: translateX(-52px); animation-timing-function: steps(12); }
  62.5% { opacity: 1; transform: translateX(0); }
  63.5% { opacity: 1; transform: translate(0, -12px); }
  64.5%, 100% { opacity: 0; transform: translate(0, -12px); }
}

@keyframes be-truck {
  /* long travel distances so the truck starts/ends off-screen even on wide monitors */
  0%, 23% { transform: translateX(1500px); animation-timing-function: cubic-bezier(0.25, 0.6, 0.3, 1); }
  34%, 66% { transform: translateX(0); animation-timing-function: cubic-bezier(0.55, 0, 0.85, 0.45); }
  78%, 100% { transform: translateX(-2400px); }
}

@keyframes be-wheel {
  0%, 23% { transform: rotate(0deg); animation-timing-function: steps(30); }
  34%, 66% { transform: rotate(-1080deg); animation-timing-function: steps(30); }
  78%, 100% { transform: rotate(-2160deg); }
}

@keyframes be-bob {
  from { transform: translateY(0); }
  to { transform: translateY(-3px); }
}

@keyframes be-drift {
  from { transform: translateX(-14px); }
  to { transform: translateX(26px); }
}

@keyframes be-puff {
  0% { opacity: 0; transform: translateY(0); }
  15% { opacity: 0.9; }
  70% { opacity: 0.4; }
  100% { opacity: 0; transform: translateY(-30px); }
}

@keyframes be-trash {
  0%, 48.5% { opacity: 0; transform: translateY(-42px); }
  49.5% { opacity: 1; transform: translateY(-42px); }
  52.5% { opacity: 0; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(0); }
}

/* Compact hero on phones so headline, badges, and the scene share the first screen.
   JS also crops the scene's viewBox to the action zone (house → curb → truck). */
@media (max-width: 719px) {
  .hero .eyebrow { display: none; }
  .hero h1 { font-size: clamp(2rem, 9vw, 2.6rem); }
  .hero-sub { font-size: 0.95rem; margin: 1rem auto 1.5rem; }
  .store-badge { min-width: 150px; padding: 0.5rem 0.9rem; }
  .store-badge strong { font-size: 0.95rem; }
  .story-caption { display: none; }
}

/* Short laptop screens: trim the fat so nothing gets pushed below the fold */
@media (min-width: 720px) and (max-height: 760px) {
  .hero h1 { font-size: clamp(2.2rem, 6vw, 3rem); }
  .hero-inner { padding-block: 1.25rem 0.5rem; }
  .story-caption { display: none; }
}

/* ---------- Problem ---------- */

.problem {
  padding-block: clamp(3.5rem, 9vw, 6rem);
  background: var(--mint);
  text-align: center;
}

.problem h2 {
  margin-bottom: 1rem;
}

.problem p {
  color: var(--muted);
  font-size: 1.05rem;
}

/* ---------- How it works ---------- */

.how {
  padding-block: clamp(3.5rem, 10vw, 6.5rem);
}

.section-title {
  text-align: center;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.steps {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
  }
}

.step {
  position: relative;
  background: var(--white);
  border: 1px solid rgba(27, 67, 50, 0.10);
  border-radius: var(--radius);
  padding: 2rem 1.6rem 1.8rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.step-icon {
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  background: var(--mint);
  color: var(--mid);
  border-radius: 12px;
  margin-bottom: 1.25rem;
}

.step-icon svg {
  width: 1.6rem;
  height: 1.6rem;
}

.step-number {
  position: absolute;
  top: 1.4rem;
  right: 1.5rem;
  font-size: 2.2rem;
  font-weight: 800;
  color: rgba(82, 183, 136, 0.25);
  line-height: 1;
}

.step h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.step p {
  font-size: 0.95rem;
  color: var(--muted);
}

/* ---------- Impact ---------- */

.impact {
  padding-block: clamp(3.5rem, 10vw, 6.5rem);
  background:
    radial-gradient(42rem 26rem at 90% 0%, rgba(82, 183, 136, 0.18), transparent 60%),
    var(--forest);
  color: var(--white);
  text-align: center;
}

.impact h2 {
  color: var(--white);
  margin-bottom: 1.1rem;
}

.impact p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
}

.impact-points {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.75rem;
}

.impact-points li {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
}

/* ---------- Final CTA ---------- */

.cta {
  padding-block: clamp(3.5rem, 10vw, 6.5rem);
  background: var(--mint);
  text-align: center;
}

.cta h2 {
  margin-bottom: 0.9rem;
}

.cta > .container > p {
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 2rem;
}

.cta .notify-form input {
  background: var(--white);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--forest);
  color: rgba(255, 255, 255, 0.75);
  padding-block: 2.75rem;
  text-align: center;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.site-footer .wordmark {
  color: var(--white);
}

.site-footer .wordmark span {
  color: var(--fresh);
}

.footer-tag {
  font-size: 0.9rem;
}

.footer-tag a {
  color: var(--fresh);
  text-decoration: none;
}

.footer-tag a:hover {
  text-decoration: underline;
}

.socials {
  display: flex;
  gap: 1rem;
}

.socials a {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  color: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 50%;
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.socials a:hover {
  color: var(--white);
  border-color: var(--fresh);
  transform: translateY(-2px);
}

.socials svg {
  width: 1.1rem;
  height: 1.1rem;
}

.copyright {
  font-size: 0.8rem;
  opacity: 0.6;
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

.steps .step:nth-child(2) { transition-delay: 0.1s; }
.steps .step:nth-child(3) { transition-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn, .step, .store-badge, .socials a {
    transition: none;
  }

  /* Story scene: freeze into a static tableau — truck at the curb,
     worker beside the bin, resident watching from the door. */
  .story-svg * {
    animation: none !important;
  }
  .story-bin { transform: translateX(134px); }
  .story-resident { opacity: 1; }
  .story-worker { opacity: 1; transform: translateX(-52px); }
}
