/* gstep.fit, in the gStep design system: Paper and Night themes, with a Forest band. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/BricolageGrotesque-Variable.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/SchibstedGrotesk-Variable.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --forest: #0d3b22;
  --pine: #0e5a28;
  --canopy: #137333;
  --mint: #e6f4ea;
  --spring: #b8f05a;
  --page: #f6f8f7;
  --card: #ffffff;
  --border: #dde3e0;
  --text: #1f2421;
  --muted: #5f6b65;
  --accent-strong: #137333;
  --accent-soft: #e6f4ea;
  --action: #137333;
  --action-hover: #0e5a28;
  --on-action: #ffffff;
  --focus: #0d3b22;
  --shadow-step: 0 4px 0 #0d3b22;
  --shadow-float: 0 24px 40px rgba(19, 115, 51, 0.18), 0 2px 4px rgba(0, 0, 0, 0.08);
  --font-display: "Bricolage Grotesque", "Schibsted Grotesk", system-ui, sans-serif;
  --font-sans: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0f1713;
    --card: #18231d;
    --border: #2d3b33;
    --text: #e8ebe9;
    --muted: #a3ada7;
    --accent-strong: #a8dab5;
    --accent-soft: rgba(129, 201, 149, 0.16);
    --action: #81c995;
    --action-hover: #a8dab5;
    --on-action: #0d3b22;
    --focus: #b8f05a;
    --shadow-float: 0 24px 40px rgba(0, 0, 0, 0.45), 0 2px 4px rgba(0, 0, 0, 0.3);
  }
}

/* The Forest band */
.tip {
  --page: #0d3b22;
  --text: #f2f8f3;
  --muted: #b9d6c2;
  --action: #b8f05a;
  --action-hover: #cdf78a;
  --on-action: #0d3b22;
  --focus: #b8f05a;
  --shadow-step: 0 4px 0 #137333;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 16px/24px var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

/* Header */

.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px clamp(16px, 4vw, 48px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--accent-strong);
  font: 800 24px/30px var(--font-display);
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand img {
  transition: transform 300ms var(--ease-out);
}

.brand:hover img {
  transform: rotate(-8deg) scale(1.06);
}

/* Buttons: the primary stands on a solid step and steps down when pressed. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid transparent;
  border-radius: 999px;
  font: 700 15px/20px var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease-out, box-shadow 120ms ease-out, background-color 120ms ease-out;
}

.btn svg {
  flex: none;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.btn--primary {
  margin-bottom: 4px;
  background: var(--action);
  color: var(--on-action);
  box-shadow: var(--shadow-step);
}

.btn--primary:hover {
  background: var(--action-hover);
}

.btn--primary:active {
  transform: translateY(4px);
  box-shadow: none;
}

.btn--small {
  min-height: 40px;
  padding: 0 18px;
}

.btn--large {
  min-height: 56px;
  padding: 0 30px;
  font-size: 18px;
}

.btn--large svg {
  width: 24px;
  height: 24px;
}

/* Mission */

.mission {
  position: relative;
  display: grid;
  place-items: center;
  min-height: calc(100svh - 80px);
  padding: 32px clamp(16px, 4vw, 48px) 192px;
  overflow: hidden;
}

.mission-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 880px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 28px;
  color: var(--muted);
  font: 600 12px/16px var(--font-sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.statement {
  max-width: 21em;
  margin: 0;
  font: 500 clamp(22px, 0.9rem + 1.7vw, 36px) / 1.32 var(--font-display);
  letter-spacing: -0.015em;
  text-wrap: pretty;
}

.statement strong {
  color: var(--accent-strong);
  font-weight: 800;
}

/* The spring highlighter sweeps in behind the number everyone chases. */
.statement mark {
  padding: 0 0.12em;
  border-radius: 4px;
  background: linear-gradient(var(--spring), var(--spring)) no-repeat 0 0 / 100% 100%;
  color: var(--forest);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  animation: sweep 700ms var(--ease-out) 1050ms both;
}

.statement a {
  color: var(--accent-strong);
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}

.statement a:hover {
  border-radius: 4px;
  background: var(--accent-soft);
}

/* Demo: one route, with the label gStep adds */

.demo {
  width: min(440px, 100%);
  margin: 48px 0 0;
}

.route {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow-float);
  text-align: left;
  font-size: 15px;
  line-height: 21px;
}

.route-name b {
  display: block;
  font-weight: 600;
}

.route-name small {
  color: var(--muted);
  font-size: 13px;
}

.route-figures {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}

.route-time {
  font: 700 19px/24px var(--font-display);
  color: var(--accent-strong);
}

.route-dist {
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 2px 8px 2px 6px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font: 600 12px/16px var(--font-display);
  font-variation-settings: "wdth" 90;
  letter-spacing: 0.1px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: help;
}

.chip svg {
  flex: none;
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.chip .foot {
  transform-box: fill-box;
  transform-origin: center;
}

.chip-figures {
  display: flex;
  column-gap: 12px;
}

.chip-kcal {
  position: relative;
}

.chip-kcal::before {
  content: "·";
  position: absolute;
  right: 100%;
  width: 12px;
  text-align: center;
  opacity: 0.7;
}

.demo figcaption {
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

/* The staircase: when it scrolls into view, its blocks rise and footprints climb them. Without script it stands still. */

.stairs {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 0;
  width: 288px;
  height: 144px;
}

.block {
  transform-box: fill-box;
  transform-origin: bottom;
}

.block.mint {
  fill: var(--mint);
}

.block.spring {
  fill: var(--spring);
  animation-delay: 120ms;
}

.block.canopy {
  fill: var(--canopy);
  animation-delay: 240ms;
}

.js .stairs .block {
  transform: scaleY(0);
}

.js .stairs .print {
  opacity: 0;
}

.js .stairs.is-in .block {
  transform: none;
  animation-name: grow;
  animation-duration: 700ms;
  animation-timing-function: var(--ease-out);
  animation-fill-mode: both;
}

.js .stairs.is-in .print {
  opacity: 1;
  animation: plant 420ms ease-in-out both;
}

@media (prefers-color-scheme: dark) {
  .block.mint {
    fill: #2d3b33;
  }
}

.print {
  transform-box: fill-box;
  transform-origin: center;
}

.ink-canopy {
  fill: var(--canopy);
}

.ink-forest {
  fill: var(--forest);
}

.ink-mint {
  fill: var(--mint);
}

@media (prefers-color-scheme: dark) {
  .ink-canopy {
    fill: #81c995;
  }
}

.js .stairs.is-in .p1 { animation-delay: 800ms; }
.js .stairs.is-in .p2 { animation-delay: 1050ms; }
.js .stairs.is-in .p3 { animation-delay: 1300ms; }
.js .stairs.is-in .p4 { animation-delay: 1550ms; }
.js .stairs.is-in .p5 { animation-delay: 1800ms; }
.js .stairs.is-in .p6 { animation-delay: 2050ms; }

/* Entrances: each sentence rises in turn. */

.rise {
  animation: rise 800ms var(--ease-out) both;
}

/* Sentences are inline text, which can't be moved, so they fade in and sharpen instead. */
.statement .rise {
  animation-name: focus-in;
}

.d1 { animation-delay: 120ms; }
.d2 { animation-delay: 300ms; }
.d3 { animation-delay: 480ms; }
.d4 { animation-delay: 660ms; }
.d5 { animation-delay: 840ms; }
.d6 { animation-delay: 1100ms; }

/* Ko-fi band */

/* Reading bands: how it's calculated, and the questions.
   Told apart by colour and a 1px rule, not by cards: see the design system. */

.explain,
.faq {
  padding: 72px clamp(16px, 4vw, 48px);
  background: var(--page);
  color: var(--text);
}

.explain {
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.band-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.section-title {
  max-width: 24em;
  margin: 0 0 8px;
  font: 800 clamp(28px, 1.2rem + 2vw, 44px) / 1.1 var(--font-display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.explain h3,
.faq dt {
  margin: 32px 0 6px;
  color: var(--accent-strong);
  font: 700 18px/24px var(--font-display);
  letter-spacing: -0.015em;
}

.explain p,
.faq dd {
  max-width: 680px;
  margin: 0;
  font: 400 16px/26px var(--font-sans);
  text-wrap: pretty;
}

.explain p + p {
  margin-top: 12px;
}

.faq dl,
.faq dd {
  margin: 0;
}

.faq dd + dt {
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.tip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 96px clamp(16px, 4vw, 48px) 104px;
  background: var(--page);
  color: var(--text);
  text-align: center;
}

.tip h2 {
  margin: 0;
  font: 800 clamp(36px, 1.5rem + 3vw, 64px) / 1 var(--font-display);
  letter-spacing: -0.03em;
}

.tip p {
  max-width: 30em;
  margin: 16px 0 32px;
  color: var(--muted);
  font-size: 18px;
  line-height: 28px;
}

/* Footer */

.foot-bar {
  padding: 32px clamp(16px, 4vw, 48px) 40px;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}

.foot-bar p {
  margin: 0;
}

.foot-bar a {
  color: var(--accent-strong);
  font-weight: 700;
  text-underline-offset: 3px;
}

.foot-bar .small {
  max-width: 42em;
  margin: 8px auto 0;
  font-size: 12px;
  line-height: 17px;
}

/* Phones */

@media (max-width: 640px) {
  .top .btn--small {
    padding: 0 14px;
    font-size: 14px;
  }

  .mission {
    padding-bottom: 128px;
  }

  .stairs {
    width: 192px;
    height: 96px;
  }

  .route {
    padding: 16px;
  }
}

@media (max-width: 380px) {
  .top .btn--small svg {
    display: none;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes focus-in {
  from {
    opacity: 0;
    filter: blur(6px);
  }
}

@keyframes sweep {
  from {
    background-size: 0% 100%;
  }
}

@keyframes grow {
  from {
    transform: scaleY(0);
  }
}

@keyframes plant {
  from {
    opacity: 0;
    transform: translateY(-3px) scale(1.15);
  }
  60% {
    opacity: 0.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
