/* Malume web. Tokens follow DESIGN.md at the repo root. */

@font-face {
  /* Arial metrics adjusted to Poppins so the swap doesn't shift layout */
  font-family: "Poppins Fallback";
  src: local("Arial");
  ascent-override: 93.62%;
  descent-override: 31.21%;
  line-gap-override: 8.92%;
  size-adjust: 112.16%;
}

:root {
  /* Color (DESIGN.md) */
  --green: #11C66F;
  --green-hover: #0FB264;
  --white: #FFFFFF;
  --surface: #EBF3F9;
  --ink: #000000;
  --border: #D9D9D9;
  --muted: #767676;          /* on white only: 4.54:1 */
  --muted-on-surface: #5C6166; /* #767676 is 4.05:1 on surface; this is 5.58:1 */
  --ink-on-green: #063D22;   /* secondary copy on green: 5.49:1 */
  --field-border: #8A8A8A;   /* 3.45:1 so inputs meet non-text contrast */
  --error: #B42318;
  --ring: rgba(17, 198, 111, 0.12);

  /* Type */
  --font: "Poppins", "Poppins Fallback", system-ui, sans-serif;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --text-2xl: clamp(1.75rem, 1.35rem + 1.8vw, 2.75rem);
  --text-display: clamp(2.5rem, 1.6rem + 4.4vw, 5rem);

  /* Space: 8px base */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --section: clamp(72px, 10vw, 136px);
  --gutter: clamp(16px, 5vw, 64px);
  --max: 1200px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Elevation: gentle, diffused */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 24px 60px rgba(0, 40, 20, 0.28), 0 8px 20px rgba(0, 40, 20, 0.16);

  /* Layers */
  --z-base: 0;
  --z-raised: 1;
  --z-skip: 100;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.15; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: var(--space-md);
  top: -100px;
  z-index: var(--z-skip);
  padding: var(--space-sm) var(--space-md);
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: var(--space-md); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px var(--space-lg);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font: 600 var(--text-base)/1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }
.btn-sm { min-height: 44px; padding: 10px var(--space-md); font-size: var(--text-sm); }

/* Primary: green fill with ink text (white on #11C66F is only 2.25:1) */
.btn-green { background: var(--green); color: var(--ink); }
.btn-green:hover { background: var(--green-hover); }
.btn-green:focus-visible { box-shadow: 0 0 0 3px var(--ring); }

/* On green surfaces the primary action flips to ink */
.btn-ink { background: var(--ink); color: var(--white); }
.btn-ink:hover { background: #1c1c1c; }

.btn-line { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-line:hover { background: rgba(0, 0, 0, 0.06); }

/* ---------- Header + hero (green) ---------- */

.hero-wrap {
  background: var(--green);
  overflow: hidden;
}

.site-header {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--space-lg) var(--gutter) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  margin-right: auto;
}
.brand-mark { width: 44px; height: 36px; fill: var(--white); }
.brand-word { font-weight: 700; font-size: 1.5rem; letter-spacing: -0.02em; line-height: 1; }

.nav-links { display: flex; gap: var(--space-xs); }
.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-md);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  transition: background-color 160ms var(--ease-out);
}
.nav-links a:hover { background: rgba(0, 0, 0, 0.07); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: var(--space-2xl);
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 104px) var(--gutter) clamp(64px, 9vw, 120px);
}

.hero-title {
  font-size: var(--text-display);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
  max-width: 13ch;
}

.hero-lede {
  margin-top: var(--space-lg);
  max-width: 46ch;
  font-size: var(--text-lg);
  color: var(--ink-on-green);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}
.store {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-sm);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.08);
  font-size: var(--text-sm);
}
.store-name { font-weight: 600; }
.store-note { color: var(--ink-on-green); }

/* Hero visual: route + phone */

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 560px;
}

.hero-route {
  position: absolute;
  inset: -40px -120px -80px -80px;
  width: calc(100% + 200px);
  height: calc(100% + 120px);
  z-index: var(--z-base);
}

.route-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: route-draw 1.8s var(--ease-out) 0.3s both;
}
@keyframes route-draw { from { stroke-dashoffset: 1; } }

.phone {
  position: relative;
  z-index: var(--z-raised);
  margin: 0;
  width: min(300px, 78vw);
  aspect-ratio: 9 / 18.5;
  padding: 10px;
  border-radius: 44px;
  background: #0d0d0d;
  box-shadow: var(--shadow-lg);
  transform: rotate(-3deg);
  animation: phone-in 900ms var(--ease-out) 0.1s both;
}
@keyframes phone-in {
  from { transform: translateY(40px) rotate(2deg); opacity: 0; }
}

.phone-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 34px;
  background: var(--white);
}

.phone-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 22px 6px;
  font-size: 11px;
  font-weight: 600;
}
.phone-dots { display: flex; gap: 3px; }
.phone-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }

.phone-map { width: 100%; height: 36%; flex: none; }

.phone-title {
  padding: 12px 14px 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--muted);
}

.phone-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 12px;
  flex: 1;
  align-content: start;
}
.phone-mode {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 74px;
  padding: 8px 9px;
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
.phone-mode img { position: absolute; top: 0; right: -4px; width: 52px; height: auto; }
.phone-mode b { position: relative; font-size: 11.5px; font-weight: 600; line-height: 1.2; }
.phone-mode small { position: relative; font-size: 8px; font-weight: 600; line-height: 1.3; color: var(--muted-on-surface); }

.phone-tabs {
  display: flex;
  justify-content: space-around;
  padding: 8px 6px 14px;
  border-top: 1px solid var(--border);
}
.phone-tabs span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 8px;
  font-weight: 600;
  color: var(--muted);
}
.phone-tabs svg { width: 16px; height: 16px; fill: currentColor; }
/* Active tab: green icon (decorative) with ink label for contrast */
.phone-tabs .is-active { color: var(--ink); }
.phone-tabs .is-active svg { fill: var(--green); }

/* ---------- Shared section type ---------- */

.section-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.025em;
}
.section-lede {
  margin-top: var(--space-md);
  max-width: 52ch;
  font-size: var(--text-lg);
  color: var(--muted);
}

/* ---------- Ways to ride ---------- */

.ways {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--space-2xl) var(--space-3xl);
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--section) var(--gutter);
}
.ways-head { align-self: start; position: sticky; top: var(--space-xl); }

.ways-list { counter-reset: way; }
.way {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  grid-template-areas: "name body" "sub body";
  column-gap: var(--space-xl);
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border);
}
.way:last-child { border-bottom: 1px solid var(--border); }
.way-name { grid-area: name; font-size: var(--text-xl); font-weight: 600; letter-spacing: -0.015em; }
.way-sub { grid-area: sub; margin-top: var(--space-xs); font-size: var(--text-sm); color: var(--muted); }
.way-body { grid-area: body; align-self: center; }
.way-name::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 12px;
  border-radius: 50%;
  background: var(--green);
  vertical-align: 0.12em;
}

/* ---------- Lift club road ---------- */

.clubs {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--section);
}

.road {
  --road-h: 36px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
  padding-top: calc(var(--road-h) + var(--space-xl));
}
.road::before {
  /* The road: ink tarmac with a dashed white centre line */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--road-h);
  border-radius: var(--radius-full);
  background:
    repeating-linear-gradient(90deg, var(--white) 0 20px, transparent 20px 40px) center / 100% 3px no-repeat,
    var(--ink);
}

.stop { position: relative; }
.stop-pin {
  position: absolute;
  top: calc(-1 * (var(--road-h) + var(--space-xl)) - 10px);
  left: 0;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--green);
  font-weight: 700;
  font-size: var(--text-xl);
  line-height: 1;
}
.stop-title { margin-top: var(--space-md); font-size: var(--text-xl); font-weight: 600; letter-spacing: -0.015em; }
.stop p { margin-top: var(--space-sm); max-width: 34ch; color: var(--muted); }

/* ---------- Schools & business ---------- */

.schools {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--section);
}
.schools-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-2xl);
  padding: clamp(24px, 5vw, 64px);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.schools-panel .section-lede { color: var(--muted-on-surface); }

.checks { display: grid; gap: var(--space-md); margin-top: var(--space-xl); }
.checks li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
}
.checks li::before {
  content: "";
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 12.5l3.2 3.2L17 8.8' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
}

/* ---------- Forms ---------- */

.form {
  display: grid;
  gap: var(--space-md);
  align-content: start;
  padding: clamp(20px, 3vw, 32px);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow);
}
.form-title { font-size: var(--text-lg); font-weight: 600; }

.field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.field label, .field legend { font-size: var(--text-sm); font-weight: 600; padding: 0; }

.field input:not([type="radio"]), .field select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--field-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font: 400 var(--text-base)/1.4 var(--font);
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.field select {
  appearance: none;
  padding-right: 40px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") right 12px center / 18px no-repeat;
}
.field input::placeholder { color: var(--muted-on-surface); }
.field input:not([type="radio"]):hover, .field select:hover { border-color: #6E6E6E; }
.field input:not([type="radio"]):focus-visible, .field select:focus-visible {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--ring), 0 0 0 1px var(--ink);
}
.field input[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12); }
.field-error { font-size: var(--text-sm); color: var(--error); font-weight: 600; }

.field-choice { grid-template-columns: auto auto 1fr; column-gap: var(--space-lg); align-items: center; }
.field-choice legend { grid-column: 1 / -1; margin-bottom: 6px; }
.choice {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 44px;
  font-weight: 400 !important;
  font-size: var(--text-base) !important;
  cursor: pointer;
}
.choice input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }

.form .btn { margin-top: var(--space-sm); width: 100%; }
.form-note { font-size: var(--text-sm); color: var(--muted); }

.form-done {
  display: grid;
  gap: var(--space-sm);
  align-content: start;
}
.form-done h3 { font-size: var(--text-xl); font-weight: 600; }
.form-done p { color: var(--muted); }
.form-done a { font-weight: 600; }
.form-done .btn { justify-self: start; margin-top: var(--space-sm); }

/* ---------- Trust ---------- */

.trust {
  max-width: 880px;
  margin: 0 auto;
  /* Schools above already leaves a full section gap */
  padding: calc(var(--section) * 0.25) var(--gutter) var(--section);
  text-align: center;
}
.trust-mark { width: 72px; height: 60px; margin: 0 auto var(--space-lg); fill: var(--green); }
.trust-title {
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.trust-body {
  max-width: 58ch;
  margin: var(--space-lg) auto 0;
  font-size: var(--text-lg);
  color: var(--muted);
}

/* ---------- Waitlist (green) ---------- */

.waitlist {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-2xl);
  align-items: start;
  max-width: calc(var(--max) - 2 * var(--gutter));
  margin: 0 var(--gutter) var(--section);
  margin-inline: max(var(--gutter), (100% - var(--max)) / 2 + var(--gutter));
  padding: clamp(28px, 6vw, 72px);
  border-radius: var(--radius-lg);
  background: var(--green);
}
.waitlist .section-title { font-size: clamp(2.25rem, 1.5rem + 3.4vw, 4rem); letter-spacing: -0.035em; }
.waitlist .section-lede { color: var(--ink-on-green); }

.form-on-green { box-shadow: none; }

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

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md) var(--space-xl);
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--space-xl) var(--gutter) var(--space-2xl);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--text-sm);
}
.site-footer .brand { color: var(--ink); margin-right: 0; }
.site-footer .brand-mark { fill: var(--green); width: 36px; height: 30px; }
.site-footer .brand-word { font-size: 1.25rem; }
.footer-small { margin-left: auto; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .nav-links { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-visual { min-height: 520px; }
  .hero-route { inset: -40px -40px -60px; width: calc(100% + 80px); }
  .ways { grid-template-columns: 1fr; }
  .ways-head { position: static; }
  .schools-panel, .waitlist { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .way { grid-template-columns: 1fr; grid-template-areas: "name" "sub" "body"; }
  .way-body { margin-top: var(--space-sm); }

  /* Road runs down the left side */
  .road {
    --road-h: 28px;
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
    padding-top: 0;
    padding-left: calc(var(--road-h) + var(--space-xl));
  }
  .road::before {
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: var(--road-h);
    height: auto;
    background:
      repeating-linear-gradient(180deg, var(--white) 0 16px, transparent 16px 32px) center / 3px 100% no-repeat,
      var(--ink);
  }
  .stop-pin {
    top: -4px;
    left: calc(-1 * (var(--road-h) + var(--space-xl)) - 10px);
    width: 48px;
    height: 48px;
  }
  .stop-title { margin-top: 6px; }
}

@media (max-width: 520px) {
  .site-header .btn-sm { padding: 10px 12px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .field-row { grid-template-columns: 1fr; }
  .footer-small { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .route-draw, .phone { animation: none; }
  .btn { transition: none; }
}

/* Phone map: the green route draws while the car drives it (timed with main.js) */
.map-route {
  stroke-dasharray: 1;
  animation: route-draw 3s cubic-bezier(0.45, 0, 0.2, 1) 0.5s both;
}
@media (prefers-reduced-motion: reduce) {
  .map-route { animation: none; }
}
