/* ==========================================================================
   EarnWhile — website styles
   ==========================================================================

   Every colour, radius and spacing step below is ported directly from the iOS
   app's design system (EarnWhile/Views/Shared/DesignSystem.swift). If a token
   changes there, change it here so the two stay in step.

   The app is deliberately light-only — see docs/DARK_MODE.md — so this site
   commits to the same light palette rather than inventing a dark theme the
   product does not have. Every surface paints its own background explicitly so
   the page never borrows a host theme.
   ========================================================================== */

:root {
  /* Palette — DesignSystem.swift */
  --ew-background:     #F5F6F8;
  --ew-surface:        #FFFFFF;
  --ew-primary-text:   #111318;
  --ew-secondary-text: #5B6472;
  --ew-green:          #0C7A4E;
  --ew-money-green:    #085C3A;
  --ew-soft-green:     #E3F5EC;
  --ew-amber:          #B7700E;
  --ew-amber-bg:       #FCF1DD;
  --ew-error-red:      #C2392F;
  --ew-error-bg:       #FBE6E4;
  --ew-border:         #E4E6EA;
  --ew-neutral-bg:     #F0F1F3;

  /* Derived — used only for large decorative fills */
  --ew-deep:           #06341F;
  --ew-hairline:       rgba(17, 19, 24, 0.08);

  /* Spacing — EWSpacing */
  --sp-xxs: 4px;
  --sp-xs:  8px;
  --sp-sm:  12px;
  --sp-md:  16px;
  --sp-lg:  24px;
  --sp-xl:  32px;
  --sp-xxl: 48px;

  /* Radius — EWRadius */
  --r-card:   16px;
  --r-button: 14px;
  --r-chip:   10px;
  --r-badge:  6px;

  /* Elevation — EWCard */
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-lift: 0 8px 28px rgba(17, 19, 24, 0.08);
  --shadow-phone: 0 24px 70px rgba(17, 19, 24, 0.18);

  /* Type
     The app uses SF Pro, with SF Pro Rounded for the wordmark and money.
     `ui-rounded` resolves to the real SF Rounded on Apple platforms, so on the
     devices this app targets the site is set in literally the same face. No web
     fonts are loaded: it keeps the site dependency-free and eliminates FOUT. */
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
             "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", -apple-system,
                  BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --measure: 68ch;
  --page-max: 1120px;
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  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;
  background: var(--ew-background);
  color: var(--ew-primary-text);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ew-primary-text);
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0; }

a { color: var(--ew-green); }

a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--ew-green);
  outline-offset: 3px;
  border-radius: var(--r-badge);
}

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */

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

@media (max-width: 600px) {
  .wrap { padding-inline: var(--sp-md); }
}

.section { padding-block: clamp(56px, 9vw, 104px); }
.section--tight { padding-block: clamp(40px, 6vw, 72px); }
.section--surface { background: var(--ew-surface); }
.section--deep { background: var(--ew-deep); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ew-green);
  color: #FFFFFF;
  padding: var(--sp-sm) var(--sp-md);
  border-radius: 0 0 var(--r-chip) 0;
  z-index: 100;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
}

/* --------------------------------------------------------------------------
   Typography helpers
   -------------------------------------------------------------------------- */

.eyebrow {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ew-green);
  margin: 0 0 var(--sp-sm);
}

.eyebrow--muted { color: var(--ew-secondary-text); }
.eyebrow--onDeep { color: #7FD6AC; }

.h1 { font-size: clamp(2.15rem, 5.4vw, 3.5rem); line-height: 1.06; font-weight: 700; }
.h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.14; font-weight: 700; }
.h3 { font-size: clamp(1.12rem, 2vw, 1.35rem); line-height: 1.25; font-weight: 600; }

.lede {
  font-size: clamp(1.03rem, 1.8vw, 1.2rem);
  color: var(--ew-secondary-text);
  max-width: 56ch;
  line-height: 1.55;
}

.prose { max-width: var(--measure); }
.prose p + p { margin-top: var(--sp-md); }
.muted { color: var(--ew-secondary-text); }
.onDeep { color: #FFFFFF; }
.onDeep .lede, .onDeep p { color: rgba(255, 255, 255, 0.78); }

.money {
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ew-money-green);
}

/* --------------------------------------------------------------------------
   Buttons — EWPrimaryButtonStyle / EWSecondaryButtonStyle
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xs);
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  padding: 15px 26px;
  border-radius: var(--r-button);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--ew-green); color: #FFFFFF; }
.btn--primary:hover { background: var(--ew-money-green); }

.btn--secondary { background: var(--ew-soft-green); color: var(--ew-green); }
.btn--secondary:hover { background: #D3EDE0; }

.btn--ghost {
  background: transparent;
  color: var(--ew-primary-text);
  border-color: var(--ew-border);
}
.btn--ghost:hover { background: var(--ew-neutral-bg); }

.btn--onDeep { background: #FFFFFF; color: var(--ew-money-green); }
.btn--onDeep:hover { background: var(--ew-soft-green); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  align-items: center;
}

/* --------------------------------------------------------------------------
   Chips and badges
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--r-badge);
  background: var(--ew-neutral-bg);
  color: var(--ew-secondary-text);
  white-space: nowrap;
}

/* The chip foregrounds are darkened from the app's `ewAmber` (#B7700E) and
   `ewErrorRed` (#C2392F). At 12.5px semibold on their own tinted backgrounds
   those two miss WCAG AA — 3.52:1 and 4.47:1 against #FCF1DD and #FBE6E4.
   These variants keep the hue and clear AA at 4.78:1. Website-only: the iOS
   palette is not changed from here. */
.badge--trust  { background: var(--ew-soft-green); color: var(--ew-green); }
.badge--pending{ background: var(--ew-amber-bg);   color: #995D0C; }
.badge--alert  { background: var(--ew-error-bg);   color: #BA372D; }

.badge--soon {
  background: var(--ew-soft-green);
  color: var(--ew-money-green);
  border: 1px solid rgba(12, 122, 78, 0.18);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
}

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

/* --------------------------------------------------------------------------
   Cards — EWCard
   -------------------------------------------------------------------------- */

.card {
  background: var(--ew-surface);
  border-radius: var(--r-card);
  padding: var(--sp-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--ew-border);
}

.card--flat { box-shadow: none; }
.card--pad-sm { padding: var(--sp-md); }

.grid {
  display: grid;
  gap: var(--sp-md);
}

.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); }

/* --------------------------------------------------------------------------
   Site header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 246, 248, 0.88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--ew-hairline);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
  min-height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ew-primary-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.brand__mark { width: 30px; height: 30px; flex: none; }

.nav { display: flex; align-items: center; gap: var(--sp-xs); }

.nav a {
  color: var(--ew-secondary-text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--r-chip);
  transition: background-color 0.12s ease, color 0.12s ease;
}

.nav a:hover { background: var(--ew-neutral-bg); color: var(--ew-primary-text); }
.nav a[aria-current="page"] { color: var(--ew-primary-text); font-weight: 600; }

.nav__cta { margin-left: var(--sp-xs); }

.nav-toggle {
  display: none;
  background: var(--ew-surface);
  border: 1px solid var(--ew-border);
  border-radius: var(--r-chip);
  width: 42px; height: 42px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ew-primary-text);
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--ew-surface);
    border-bottom: 1px solid var(--ew-border);
    padding: var(--sp-sm) var(--sp-md) var(--sp-md);
    box-shadow: var(--shadow-lift);
  }

  .nav[hidden] { display: none; }
  .nav a { padding: 12px; font-size: 16px; }
  .nav__cta { margin-left: 0; margin-top: var(--sp-xs); }
  .nav__cta .btn { width: 100%; }
}

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

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(44px, 7vw, 84px) clamp(56px, 9vw, 96px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 70%;
  background:
    radial-gradient(60% 70% at 22% 20%, rgba(12, 122, 78, 0.10), transparent 70%),
    radial-gradient(50% 60% at 82% 8%, rgba(12, 122, 78, 0.07), transparent 70%);
  pointer-events: none;
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

@media (max-width: 940px) {
  .hero__grid { grid-template-columns: 1fr; gap: var(--sp-xl); }
}

.hero__copy > * + * { margin-top: var(--sp-md); }
.hero__title { max-width: 15ch; }
.hero__title em { font-style: normal; color: var(--ew-green); }

.hero__points {
  list-style: none;
  padding: 0;
  margin: var(--sp-lg) 0 0;
  display: grid;
  gap: var(--sp-sm);
}

.hero__points li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 15.5px;
  color: var(--ew-secondary-text);
}

.hero__points svg { width: 20px; height: 20px; color: var(--ew-green); margin-top: 2px; }

.hero__note {
  font-size: 13.5px;
  color: var(--ew-secondary-text);
  margin-top: var(--sp-md);
}

/* --------------------------------------------------------------------------
   Time selector — the product's core idea, made operable
   -------------------------------------------------------------------------- */

.timepick { display: grid; gap: var(--sp-sm); }

.timepick__label {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}

.timepick__row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-xs);
}

.timepick__btn {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  padding: 13px 8px;
  border-radius: var(--r-chip);
  border: 1.5px solid var(--ew-border);
  background: var(--ew-surface);
  color: var(--ew-secondary-text);
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.timepick__btn:hover { border-color: #C9D3CE; color: var(--ew-primary-text); }

.timepick__btn[aria-pressed="true"] {
  background: var(--ew-green);
  border-color: var(--ew-green);
  color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   Phone mock — a faithful rebuild of the app's Home screen in HTML
   -------------------------------------------------------------------------- */

.phone {
  width: min(340px, 100%);
  margin-inline: auto;
  background: #111318;
  border-radius: 46px;
  padding: 10px;
  box-shadow: var(--shadow-phone);
}

.phone__screen {
  background: var(--ew-background);
  border-radius: 37px;
  overflow: hidden;
  padding: var(--sp-md) var(--sp-sm) var(--sp-md);
}

.phone__statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 600;
  padding: 2px var(--sp-xs) var(--sp-sm);
  color: var(--ew-primary-text);
}

.phone__statusbar svg { width: 15px; height: 15px; opacity: 0.8; }
.phone__statusicons { display: flex; gap: 5px; align-items: center; }

.mock { display: grid; gap: var(--sp-sm); }

.mock__greeting {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  padding-inline: var(--sp-xs);
}

.mock__balance {
  background: var(--ew-surface);
  border-radius: var(--r-card);
  padding: var(--sp-md);
  box-shadow: var(--shadow-card);
}

.mock__balance-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ew-secondary-text);
}

.mock__balance-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--ew-money-green);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  margin-top: 2px;
}

.mock__balance-meta {
  display: flex;
  gap: var(--sp-xs);
  margin-top: var(--sp-sm);
  flex-wrap: wrap;
}

.mock__question {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 600;
  padding-inline: var(--sp-xs);
  margin-top: var(--sp-xxs);
}

.mock__chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }

.mock__chip {
  text-align: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  padding: 10px 4px;
  border-radius: var(--r-chip);
  background: var(--ew-surface);
  border: 1.5px solid var(--ew-border);
  color: var(--ew-secondary-text);
}

.mock__chip.is-on {
  background: var(--ew-green);
  border-color: var(--ew-green);
  color: #FFFFFF;
}

.mock__section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ew-secondary-text);
  padding-inline: var(--sp-xs);
  margin-top: var(--sp-xxs);
}

.mock__card {
  background: var(--ew-surface);
  border-radius: var(--r-card);
  padding: var(--sp-md);
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 10px;
}

.mock__partner {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  justify-content: space-between;
}

.mock__partner-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ew-secondary-text);
}

.mock__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.mock__stats { display: flex; align-items: baseline; gap: var(--sp-sm); flex-wrap: wrap; }

.mock__reward {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--ew-money-green);
  font-variant-numeric: tabular-nums;
}

.mock__duration { font-size: 14px; color: var(--ew-secondary-text); font-weight: 500; }

.mock__qual {
  font-size: 13px;
  color: var(--ew-secondary-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mock__why {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ew-green);
  display: flex;
  align-items: center;
  gap: 5px;
}

.mock__cta {
  background: var(--ew-green);
  color: #FFFFFF;
  border-radius: var(--r-button);
  text-align: center;
  padding: 13px;
  font-size: 15.5px;
  font-weight: 600;
}

.mock__tabbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  border-top: 1px solid var(--ew-border);
  margin: var(--sp-sm) calc(var(--sp-sm) * -1) calc(var(--sp-md) * -1);
  padding: 10px var(--sp-sm) var(--sp-md);
  background: var(--ew-surface);
}

.mock__tab {
  display: grid;
  justify-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ew-secondary-text);
}

.mock__tab svg { width: 21px; height: 21px; }
.mock__tab.is-on { color: var(--ew-green); font-weight: 600; }

/* Fade the recommendation when it swaps */
.mock__swap { transition: opacity 0.18s ease; }
.mock__swap.is-swapping { opacity: 0.35; }

/* --------------------------------------------------------------------------
   Steps ("How it works") — numbered because the order genuinely matters
   -------------------------------------------------------------------------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--sp-md);
  counter-reset: step;
}

@media (min-width: 860px) {
  .steps { grid-template-columns: repeat(4, 1fr); }
}

.step {
  background: var(--ew-surface);
  border: 1px solid var(--ew-border);
  border-radius: var(--r-card);
  padding: var(--sp-lg);
  counter-increment: step;
  position: relative;
}

.step__n {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--ew-green);
  background: var(--ew-soft-green);
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: var(--sp-sm);
}

.step h3 { margin-bottom: 6px; }
.step p { font-size: 15px; color: var(--ew-secondary-text); }

/* --------------------------------------------------------------------------
   Factor list — the ranking signals
   -------------------------------------------------------------------------- */

.factors {
  display: grid;
  gap: var(--sp-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.factor {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-md);
  align-items: center;
  background: var(--ew-surface);
  border: 1px solid var(--ew-border);
  border-radius: var(--r-chip);
  padding: 14px var(--sp-md);
}

.factor__name { font-weight: 600; font-size: 15.5px; }
.factor__desc { font-size: 14px; color: var(--ew-secondary-text); margin-top: 2px; }

.factor__bar {
  width: clamp(70px, 16vw, 128px);
  height: 6px;
  border-radius: 3px;
  background: var(--ew-neutral-bg);
  overflow: hidden;
  flex: none;
}

/* `display:block` is load-bearing: this is a <span>, and its parent is not a
   flex or grid container, so without it the fill stays inline, ignores its
   width, and the bar renders empty. */
.factor__fill { display: block; height: 100%; background: var(--ew-green); border-radius: 3px; }

@media (max-width: 560px) {
  .factor { grid-template-columns: 1fr; gap: var(--sp-sm); }
  .factor__bar { width: 100%; }
}

/* --------------------------------------------------------------------------
   Category cards
   -------------------------------------------------------------------------- */

.cat {
  background: var(--ew-surface);
  border: 1px solid var(--ew-border);
  border-radius: var(--r-card);
  padding: var(--sp-lg);
  display: grid;
  gap: 10px;
  align-content: start;
}

.cat__icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--ew-soft-green);
  color: var(--ew-green);
  display: grid;
  place-items: center;
}

.cat__icon svg { width: 23px; height: 23px; }
.cat h3 { font-size: 17px; }
.cat p { font-size: 14.5px; color: var(--ew-secondary-text); }

/* --------------------------------------------------------------------------
   Status legend — real TransactionStatus values from the app
   -------------------------------------------------------------------------- */

.legend {
  display: grid;
  gap: var(--sp-sm);
  margin: 0;
  padding: 0;
}

.legend div {
  display: grid;
  grid-template-columns: minmax(96px, auto) 1fr;
  gap: var(--sp-md);
  align-items: baseline;
  padding-block: var(--sp-sm);
  border-bottom: 1px solid var(--ew-border);
}

.legend div:last-child { border-bottom: 0; }
.legend dt { margin: 0; }
.legend dd { margin: 0; font-size: 15px; color: var(--ew-secondary-text); }

@media (max-width: 560px) {
  .legend div { grid-template-columns: 1fr; gap: 6px; }
}

/* --------------------------------------------------------------------------
   Callout / CTA band
   -------------------------------------------------------------------------- */

.band {
  background: var(--ew-deep);
  border-radius: var(--r-card);
  padding: clamp(28px, 5vw, 52px);
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
}

.band::after {
  content: "";
  position: absolute;
  right: -60px; top: -80px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(127, 214, 172, 0.10);
  pointer-events: none;
}

.band h2 { color: #FFFFFF; position: relative; }
.band p { color: rgba(255, 255, 255, 0.78); position: relative; }
.band .btn-row { position: relative; margin-top: var(--sp-lg); }

.note {
  background: var(--ew-soft-green);
  border-left: 3px solid var(--ew-green);
  border-radius: var(--r-badge);
  padding: var(--sp-md);
  font-size: 15px;
  color: var(--ew-money-green);
}

.note--amber {
  background: var(--ew-amber-bg);
  border-left-color: var(--ew-amber);
  color: #6E4508;
}

/* --------------------------------------------------------------------------
   Legal / long-form document pages
   -------------------------------------------------------------------------- */

.doc {
  background: var(--ew-surface);
  border: 1px solid var(--ew-border);
  border-radius: var(--r-card);
  padding: clamp(24px, 4vw, 52px);
  max-width: 800px;
  margin-inline: auto;
}

.doc h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  margin-top: var(--sp-xl);
  padding-top: var(--sp-lg);
  border-top: 1px solid var(--ew-border);
}

.doc > h2:first-of-type { margin-top: var(--sp-lg); }

.doc h3 { font-size: 1.05rem; margin-top: var(--sp-lg); }
.doc p, .doc li { color: #2C333B; font-size: 16.5px; }
.doc p { margin-top: var(--sp-sm); }
.doc ul, .doc ol { margin: var(--sp-sm) 0 0; padding-left: 1.3em; }
.doc li { margin-bottom: var(--sp-xs); }
.doc li::marker { color: var(--ew-secondary-text); }

.doc__meta {
  font-size: 14px;
  color: var(--ew-secondary-text);
  padding-bottom: var(--sp-md);
  border-bottom: 1px solid var(--ew-border);
}

.toc {
  background: var(--ew-neutral-bg);
  border-radius: var(--r-chip);
  padding: var(--sp-md) var(--sp-lg);
  margin-top: var(--sp-lg);
}

.toc p { font-weight: 600; font-size: 14px; margin-bottom: var(--sp-xs); }
.toc ol { margin: 0; padding-left: 1.2em; }
.toc li { font-size: 15px; margin-bottom: 4px; }

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */

.notfound {
  min-height: 62vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: var(--sp-xxl);
}

.notfound__code {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 16vw, 8rem);
  font-weight: 700;
  line-height: 1;
  color: var(--ew-soft-green);
  letter-spacing: -0.04em;
}

.notfound__inner > * + * { margin-top: var(--sp-md); }
.notfound .lede { margin-inline: auto; }
.notfound .btn-row { justify-content: center; }

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

.site-footer {
  background: var(--ew-surface);
  border-top: 1px solid var(--ew-border);
  padding-block: var(--sp-xxl) var(--sp-xl);
  margin-top: var(--sp-xxl);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: var(--sp-xl);
}

@media (max-width: 820px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: var(--sp-lg); }
  .site-footer__brand { grid-column: 1 / -1; }
}

.site-footer__brand p {
  font-size: 14.5px;
  color: var(--ew-secondary-text);
  margin-top: var(--sp-sm);
  max-width: 38ch;
}

.site-footer h2 {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ew-secondary-text);
  margin-bottom: var(--sp-sm);
}

.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }

.site-footer a {
  color: var(--ew-primary-text);
  text-decoration: none;
  font-size: 15px;
}

.site-footer a:hover { color: var(--ew-green); text-decoration: underline; }

.site-footer__base {
  margin-top: var(--sp-xl);
  padding-top: var(--sp-lg);
  border-top: 1px solid var(--ew-border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm) var(--sp-lg);
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--ew-secondary-text);
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

.stack-sm > * + * { margin-top: var(--sp-sm); }
.stack-md > * + * { margin-top: var(--sp-md); }
.stack-lg > * + * { margin-top: var(--sp-lg); }
.stack-xl > * + * { margin-top: var(--sp-xl); }

.center { text-align: center; }
.center .lede { margin-inline: auto; }

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

.section-head { max-width: 62ch; margin-bottom: var(--sp-xl); }
.section-head.center { margin-inline: auto; }

/* --------------------------------------------------------------------------
   Motion and micro-interactions
   --------------------------------------------------------------------------

   Rules this layer follows:

   • Only `transform`, `opacity` and `box-shadow` are animated. Nothing here
     touches width, height, margin or padding, so nothing can shift layout.
   • Hover effects are decorative only. Every one of them is additive to a
     state that already reads correctly without it, and none is needed to
     understand or operate the page.
   • Hover lifts sit behind `@media (hover: hover)` so touch devices do not
     get stuck in a hover state after a tap.
   • Scroll-reveal and the bar growth are opt-IN, applied by JavaScript. The
     default stylesheet renders everything in its final state, so with JS off
     or broken the page is complete and nothing is invisible.
   • The reduced-motion block at the end switches all of it off, not merely
     shortens it.
   -------------------------------------------------------------------------- */

:root {
  /* One easing curve for the whole site — a soft decelerate. */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast: 0.16s;
  --dur-mid: 0.22s;
  --dur-slow: 0.62s;
}

/* ---------- Cards: lift on hover, and on keyboard focus within ---------- */

.card,
.cat,
.step {
  transition:
    transform var(--dur-mid) var(--ease),
    box-shadow var(--dur-mid) var(--ease),
    border-color var(--dur-mid) var(--ease);
}

/* `.cat` and `.step` carry no resting shadow, so give them one to grow from
   rather than having a shadow appear out of nothing. */
.cat,
.step {
  box-shadow: 0 1px 2px rgba(17, 19, 24, 0.02);
}

@media (hover: hover) {
  .card:hover,
  .cat:hover,
  .step:hover {
    transform: translate3d(0, -3px, 0) scale(1.004);
    box-shadow: 0 10px 30px rgba(17, 19, 24, 0.07);
    border-color: #D8DEE3;
  }
}

/* Keyboard parity: a card containing a focused link lifts the same way. */
.card:focus-within,
.cat:focus-within,
.step:focus-within {
  transform: translate3d(0, -3px, 0) scale(1.004);
  box-shadow: 0 10px 30px rgba(17, 19, 24, 0.07);
}

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

.btn {
  transition:
    background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-mid) var(--ease),
    transform var(--dur-fast) var(--ease);
}

@media (hover: hover) {
  .btn--primary:hover { transform: translate3d(0, -1px, 0); box-shadow: 0 6px 18px rgba(12, 122, 78, 0.24); }
  .btn--secondary:hover { transform: translate3d(0, -1px, 0); }
  .btn--ghost:hover { transform: translate3d(0, -1px, 0); border-color: #CFD6DB; }
  .btn--onDeep:hover { transform: translate3d(0, -1px, 0); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22); }
}

/* Press returns the button to the surface — the lift collapses rather than
   inverting, which reads as a real press rather than a bounce. */
.btn:active { transform: translate3d(0, 1px, 0); box-shadow: none; }

/* ---------- Navigation ---------- */

.nav a {
  transition:
    background-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease);
  position: relative;
}

/* A hairline under the current page. This is the only nav treatment that
   carries meaning rather than decoration, so it is the only one that persists.

   Desktop only: below 861px the nav becomes a stacked drawer of full-width
   rows, where a rule spanning the whole row reads as a divider rather than an
   indicator. The bold weight from `aria-current` already marks it there. */
@media (min-width: 861px) {
  .nav a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 3px;
    height: 2px;
    border-radius: 1px;
    background: var(--ew-green);
  }
}

.nav a:active { background: #E7EAEC; }

/* ---------- Time selector ---------- */

.timepick__btn {
  transition:
    background-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-mid) var(--ease);
}

@media (hover: hover) {
  .timepick__btn:hover { transform: translate3d(0, -1px, 0); }
}

.timepick__btn:active { transform: translate3d(0, 1px, 0); }

.timepick__btn[aria-pressed="true"] {
  box-shadow: 0 4px 14px rgba(12, 122, 78, 0.22);
}

/* The chips inside the phone follow the selector, so they need the same
   easing or the two halves of the interaction feel disconnected. */
.mock__chip {
  transition:
    background-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

/* ---------- Phone mock ---------- */

.phone {
  /* Only ever set by the pointer-tracking script, which writes translate
     values into these two custom properties. Defaults keep it centred. */
  --phone-x: 0px;
  --phone-y: 0px;
  transform: translate3d(var(--phone-x), var(--phone-y), 0);
}

/* ---------- Dark CTA band ---------- */

.band {
  box-shadow: 0 18px 46px rgba(6, 52, 31, 0.18);
  transition: box-shadow var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}

@media (hover: hover) {
  .band:hover {
    box-shadow: 0 24px 60px rgba(6, 52, 31, 0.26);
    transform: translate3d(0, -2px, 0);
  }
}

/* ---------- Scroll reveal (JS opt-in) ----------

   `.ew-reveal` is added by site.js. Without it these elements render normally,
   which is what a no-JS visitor gets. The transform is a 14px rise, small
   enough that a reader who scrolls fast never sees an empty screen. */

.ew-reveal {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition:
    opacity var(--dur-slow) var(--ease),
    transform var(--dur-slow) var(--ease);
}

.ew-reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Ranking bars (JS opt-in) ----------

   Grown with scaleX rather than width so the animation stays on the
   compositor and the track never reflows. The fill keeps its inline
   percentage width throughout; only its horizontal scale is animated. */

.factor__fill {
  transform-origin: left center;
}

.ew-bar {
  transform: scaleX(0);
  transition: transform 0.85s var(--ease);
}

.ew-bar.is-in {
  transform: scaleX(1);
}

/* ---------- Reduced motion ----------

   The global block near the top of this file collapses durations, which stops
   things moving but still lets a hover jump the element by 3px. These rules
   remove the displacement itself. The scroll-reveal and bar rules also reset
   to their final state, so if JS armed them before the preference was read,
   nothing can be left stuck invisible or at zero width. */

@media (prefers-reduced-motion: reduce) {
  .card:hover, .cat:hover, .step:hover,
  .card:focus-within, .cat:focus-within, .step:focus-within,
  .btn:hover, .btn:active,
  .timepick__btn:hover, .timepick__btn:active,
  .band:hover {
    transform: none;
  }

  .phone { transform: none; }

  .ew-reveal,
  .ew-reveal.is-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .ew-bar,
  .ew-bar.is-in {
    transform: scaleX(1);
    transition: none;
  }
}

/* Large desktops.
   At 1120px the column holds 78% of a 1440px screen, which is right — but only
   58% of 1920px and 44% of 2560px, where the page starts reading as a narrow
   strip marooned in grey. These steps widen the column and nudge the base size
   up so it stays comfortable, without letting line length run away: the reading
   measures are capped in `ch`, so they grow with the type rather than with the
   viewport. 1440px is deliberately left alone.

   This block lives at the END of the stylesheet on purpose. `.phone` is defined
   further down than the layout primitives, so an equal-specificity override
   placed up there would lose to it on source order. */

@media (min-width: 1600px) {
  :root { --page-max: 1240px; }
  body { font-size: 17.5px; }
  .phone { width: min(360px, 100%); }
}

@media (min-width: 1920px) {
  :root { --page-max: 1340px; }
  body { font-size: 18px; }
  .phone { width: min(376px, 100%); }
}
