/* One Lap launch site. Tokens come from docs/site/BRIEF.md and match the app's "warm workshop" palette. */

:root {
  color-scheme: light dark;

  --surface: #f4efe7;
  --surface-raised: #fffcf8;
  --surface-sunken: #eae3d8;
  --border: #ddd5c8;
  --border-strong: #c3b9aa;
  --ink: #231f1b;
  --ink-muted: #6a635a;
  --ink-faint: #9b9286;
  --accent: #c94d0a;
  --accent-hover: #b3440a;
  --accent-ink: #ffffff;
  --accent-soft: #fbe5d6;
  --accent-glow: rgba(201, 77, 10, 0.1);
  --success: #2b7f49;
  --success-soft: #dff1e3;
  --panel: #231f1b;
  --panel-ink: #f4eee6;
  --chalk: #c3b9aa;
  --focus: #2563eb;
  --shadow-raised:
    0 1px 2px rgba(60, 45, 30, 0.05), 0 4px 14px rgba(60, 45, 30, 0.07);
  --shadow-floating:
    0 2px 6px rgba(60, 45, 30, 0.1), 0 24px 56px rgba(60, 45, 30, 0.22);
  --mark-highlight: rgba(255, 255, 255, 0.22);
  --error: #b42318;

  --font-display:
    "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto,
    sans-serif;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease-state: cubic-bezier(0.2, 0, 0, 1);
  --ease-arrive: cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-colour: 150ms;
  --t-enter: 220ms;
  --t-progress: 360ms;
  --t-reveal: 400ms;

  --header-height: 64px;
  --radius: 12px;
  --radius-control: 8px;
  --section-pad: 96px;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #1b1816;
    --surface-raised: #262220;
    --surface-sunken: #141210;
    --border: #39332d;
    --border-strong: #4e463e;
    --ink: #f4eee6;
    --ink-muted: #a89f93;
    --ink-faint: #7b7266;
    --accent: #ff7b30;
    --accent-hover: #ff8f50;
    --accent-ink: #1b1816;
    --accent-soft: #3e2718;
    --accent-glow: rgba(255, 123, 48, 0.12);
    --success: #62c882;
    --success-soft: #1d3626;
    --panel: #110f0d;
    --panel-ink: #f4eee6;
    --chalk: #4e463e;
    --focus: #7cb6ff;
    --shadow-raised:
      0 1px 2px rgba(0, 0, 0, 0.35), 0 4px 14px rgba(0, 0, 0, 0.3);
    --shadow-floating:
      0 2px 6px rgba(0, 0, 0, 0.4), 0 24px 56px rgba(0, 0, 0, 0.6);
    --mark-highlight: rgba(255, 255, 255, 0.1);
    --error: #ff8a80;
  }
}

@media (max-width: 639px) {
  :root {
    --section-pad: 56px;
    --gutter: 16px;
  }
}

/* Base */

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

html {
  overflow-x: clip;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol,
fieldset {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

fieldset {
  padding: 0;
  border: 0;
  min-width: 0;
}

legend {
  padding: 0;
}

a {
  color: inherit;
}

svg {
  display: block;
}

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

.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-raised);
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}

/* Type */

.display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.display--headline {
  font-size: clamp(2.5rem, 1.6rem + 4.5vw, 5rem);
}

.display--section {
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.75rem);
  line-height: 1.1;
}

@media (min-width: 640px) {
  .display--headline {
    letter-spacing: -0.03em;
  }
}

h2,
h3 {
  text-wrap: balance;
}

.lead {
  font-size: 1.125rem;
}

.small {
  font-size: 0.875rem;
  line-height: 1.5;
}

.caption-small {
  font-size: 0.75rem;
  line-height: 1.3;
}

.muted {
  color: var(--ink-muted);
}

.centre {
  text-align: center;
}

.num {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
}

.eyebrow {
  margin-bottom: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Buttons and links */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font: inherit;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--t-colour) var(--ease-state),
    border-color var(--t-colour) var(--ease-state),
    transform var(--t-colour) var(--ease-state);
}

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

.button--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.button--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.button--secondary {
  background: var(--surface-raised);
  border-color: var(--border-strong);
  color: var(--ink);
}

.button--secondary:hover {
  background: var(--surface-sunken);
  border-color: var(--ink-faint);
}

.button--large {
  min-height: 52px;
  padding: 0 24px;
  font-size: 1.0625rem;
}

/* The closing band is dark in both schemes, so its button keeps the dark-scheme accent. */
.button--on-panel {
  background: #ff7b30;
  border-color: #ff7b30;
  color: #1b1816;
}

.button--on-panel:hover {
  background: #ff8f50;
  border-color: #ff8f50;
}

/* Ink text with an orange underline: orange type on the light surfaces misses 4.5:1. */
.text-link {
  display: inline-block;
  padding-block: 4px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition:
    color var(--t-colour) var(--ease-state),
    text-decoration-color var(--t-colour) var(--ease-state);
}

.text-link:hover {
  color: var(--accent-hover);
  text-decoration-color: var(--accent-hover);
}

.text-link:active {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: color-mix(in srgb, var(--surface-raised) 86%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  text-decoration: none;
  border-radius: var(--radius-control);
}

.brand__mark {
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: inset 0 1px 0 var(--mark-highlight);
  transition: transform var(--t-enter) var(--ease-spring);
}

.brand__mark svg {
  border-radius: 8px;
}

.brand:hover .brand__mark {
  transform: rotate(-6deg) scale(1.04);
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.site-nav {
  display: flex;
  gap: 4px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  color: var(--ink-muted);
  font-weight: 500;
  text-decoration: none;
  transition:
    color var(--t-colour) var(--ease-state),
    background-color var(--t-colour) var(--ease-state);
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--surface-sunken);
}

.site-nav a:active {
  color: var(--accent);
}

@media (max-width: 639px) {
  .site-nav {
    display: none;
  }
}

@media (max-width: 389px) {
  .site-header__cta {
    font-size: 0.875rem;
    padding-inline: 14px;
  }
}

/* Sections */

section {
  padding-block: var(--section-pad);
}

.card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.aisle-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.aisle-badge--28 {
  width: 28px;
  height: 28px;
  font-size: 0.9375rem;
}

.check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-raised);
  transition:
    background-color var(--t-enter) var(--ease-state),
    border-color var(--t-enter) var(--ease-state);
}

.check svg {
  width: 14px;
  height: 14px;
}

.check path {
  fill: none;
  stroke: var(--accent-ink);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 16;
  stroke-dashoffset: 16;
  transition: stroke-dashoffset var(--t-enter) var(--ease-spring);
}

.check.is-ticked,
.is-ticked .check {
  background: var(--accent);
  border-color: var(--accent);
}

.check.is-ticked path,
.is-ticked .check path {
  stroke-dashoffset: 0;
}

/* Scroll reveals: hidden until main.js adds is-in. The noscript block in index.html undoes this. */

[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--t-reveal) var(--ease-arrive),
    transform var(--t-reveal) var(--ease-arrive);
  transition-delay: calc(var(--i, 0) * var(--stagger, 100ms));
}

[data-reveal="left"] {
  transform: translateX(-16px);
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* 1. Hero */

.hero {
  padding-top: var(--section-pad);
  padding-bottom: 48px;
}

.hero__inner {
  display: grid;
  gap: 40px;
  align-items: center;
}

.hero__text {
  display: grid;
  gap: 24px;
  max-width: 36rem;
}

.hero__text > * {
  animation: rise-in var(--t-reveal) var(--ease-arrive) both;
}

.hero__text > :nth-child(2) {
  animation-delay: 80ms;
}

.hero__text > :nth-child(3) {
  animation-delay: 160ms;
}

.hero__text > :nth-child(4) {
  animation-delay: 240ms;
}

.hero__visual {
  animation: rise-in var(--t-reveal) var(--ease-arrive) 200ms both;
}

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

  to {
    opacity: 1;
    transform: none;
  }
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__text .small {
  margin-top: -8px;
}

@media (min-width: 900px) {
  .hero__inner {
    grid-template-columns: 5fr 6fr;
    gap: 48px;
  }
}

.hero__visual {
  position: relative;
  height: 320px;
  overflow: hidden;
}

@media (min-width: 900px) {
  .hero__visual {
    height: 540px;
    overflow: visible;
  }
}

.plane {
  --px: 0px;
  --py: 0px;
  transition: transform 120ms linear;
}

.aisle-plan {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0.6;
  transform-origin: top left;
  transform: translate(var(--px), var(--py)) rotate(-4deg) scale(0.75);
}

@media (min-width: 900px) {
  .aisle-plan {
    transform-origin: center;
    transform: translate(var(--px), var(--py)) rotate(-4deg) scale(0.96);
  }
}

.aisle-plan__shelves rect {
  fill: none;
  stroke: var(--chalk);
  stroke-width: 1.5;
}

.aisle-plan__labels text {
  fill: var(--ink-faint);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
}

.aisle-plan__badges circle {
  fill: var(--accent);
}

.aisle-plan__badges text {
  fill: #ffffff;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  text-anchor: middle;
}

.aisle-plan__badges .aisle-plan__yard-badge {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}

.aisle-plan__badges .aisle-plan__yard-label {
  fill: var(--accent);
}

.aisle-plan__route path {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.aisle-plan__reveal {
  fill: none;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: walk-the-lap 2400ms linear 300ms forwards;
}

.aisle-plan__arrow {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  animation: fade-in var(--t-enter) var(--ease-arrive) 2500ms forwards;
}

@keyframes walk-the-lap {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes fade-in {
  to {
    opacity: 1;
  }
}

/* On phones the card sits inside the clipped stage, so its right border and radius stay visible. */
.hero-card {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(300px, 100%);
  padding: 14px 16px;
  box-shadow: var(--shadow-floating);
  transform: translate(var(--px), var(--py));
}

@media (min-width: 900px) {
  .hero-card {
    right: 0;
    bottom: 24px;
    width: 360px;
    padding: 20px;
  }
}

.hero-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.hero-card__aisle {
  font-weight: 600;
  line-height: 1.3;
}

.hero-card__done {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity var(--t-enter) var(--ease-arrive),
    transform var(--t-enter) var(--ease-arrive);
}

.hero-card.is-complete .hero-card__done {
  opacity: 1;
  transform: none;
}

.hero-card__rows {
  display: grid;
}

.hero-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-block: 7px;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 900px) {
  .hero-row {
    gap: 12px;
    padding-block: 10px;
  }
}

.hero-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.hero-row__text {
  display: grid;
  min-width: 0;
  flex: 1;
}

.hero-row__name {
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  transition: color var(--t-colour) var(--ease-state);
}

.hero-row__detail {
  white-space: nowrap;
}

@media (max-width: 899px) {
  .hero-row__detail {
    font-size: 0.75rem;
  }

  .hero-row__qty {
    font-size: 0.8125rem;
  }

  .hero-card__header {
    padding-bottom: 10px;
  }
}

.hero-row.is-ticked .hero-row__name {
  color: var(--ink-muted);
  text-decoration: line-through;
  text-decoration-color: var(--ink-muted);
}

.hero-row__qty {
  flex: none;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: right;
}

.progress-chip {
  position: absolute;
  top: -18px;
  left: -16px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  transform: translate(var(--px), var(--py));
}

@media (min-width: 900px) {
  .progress-chip {
    top: -20px;
    left: -24px;
  }
}

.progress-track {
  display: block;
  width: 72px;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-sunken);
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--t-progress) var(--ease-state);
}

/* 2. The cost of guessing */

.guessing__list,
.guessing__inner > p {
  max-width: 36rem;
}

.guessing__row {
  padding-block: 20px;
  border-top: 1px solid var(--border);
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
}

.guessing__row:last-child {
  border-bottom: 1px solid var(--border);
}

.guessing [data-reveal] {
  --stagger: 120ms;
}

.guessing__inner > p {
  margin-top: 32px;
}

/* 3. How it works */

.how__cards {
  display: grid;
  gap: 24px;
  margin-top: 48px;
}

@media (min-width: 800px) {
  .how__cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.how-card {
  display: grid;
  gap: 12px;
  padding: 24px;
  --stagger: 100ms;
}

.how-card__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 4px;
}

.illo {
  margin-top: 12px;
  padding: 16px;
  border-radius: var(--radius-control);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  line-height: 1.3;
}

.illo--projects {
  display: grid;
  gap: 6px;
}

.illo-project {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--ink-muted);
}

.illo-project--lifted {
  border-color: var(--accent);
  color: var(--ink);
  box-shadow: var(--shadow-raised);
  transform: translateY(-2px);
}

.illo-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
}

.illo--inputs {
  display: grid;
  gap: 10px;
}

.illo-field {
  display: grid;
  gap: 4px;
}

.illo-field__label {
  color: var(--ink-muted);
}

.illo-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  font-size: 0.9375rem;
  font-weight: 500;
}

.illo-segments {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-control);
  background: var(--surface-sunken);
}

.illo-segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  border-radius: 6px;
  color: var(--ink-muted);
  font-weight: 500;
}

.illo-segment--selected {
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: var(--shadow-raised);
}

.illo--aisles {
  display: grid;
  gap: 14px;
}

.illo-aisle {
  display: grid;
  gap: 8px;
}

.illo-aisle__head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.illo-aisle__head .aisle-badge {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  font-size: 0.6875rem;
}

.illo-stub {
  display: flex;
  align-items: center;
  gap: 10px;
}

.illo-stub__bar {
  position: relative;
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: var(--surface-sunken);
}

.illo-stub--checked .illo-stub__bar {
  background: var(--border);
}

.illo-stub--checked .illo-stub__bar::after {
  content: "";
  position: absolute;
  inset: 50% 4px auto 4px;
  height: 1.5px;
  background: var(--ink-muted);
}

/* 4. Try it */

.try {
  background: var(--surface-sunken);
  border-block: 1px solid var(--border);
}

@media (min-width: 900px) {
  .try {
    min-height: 80vh;
  }
}

.try__intro {
  max-width: 40rem;
}

.try__intro .lead {
  margin-top: 16px;
}

.try__grid {
  display: grid;
  gap: 32px;
  margin-top: 48px;
}

@media (min-width: 900px) {
  .try__grid {
    grid-template-columns: 5fr 7fr;
    gap: 48px;
    align-items: start;
  }
}

.try__form {
  display: grid;
  gap: 20px;
  padding: 24px;
}

@media (max-width: 899px) {
  .try__form {
    order: 2;
  }
}

.field {
  display: grid;
  gap: 6px;
}

.field__label {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}

.field__control {
  position: relative;
  display: block;
}

.field input[type="number"] {
  width: 100%;
  height: 52px;
  padding: 0 64px 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--ink);
  font: inherit;
  font-size: 1.125rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--t-colour) var(--ease-state);
  appearance: textfield;
  -moz-appearance: textfield;
}

.field input[type="number"]::-webkit-inner-spin-button,
.field input[type="number"]::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

.field input[type="number"]:hover {
  border-color: var(--ink-faint);
}

.field input[type="number"]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 0;
  border-color: var(--focus);
}

.field input[aria-invalid="true"] {
  border-color: var(--error);
}

.field__unit {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: var(--ink-muted);
  font-size: 0.875rem;
  font-weight: 500;
  pointer-events: none;
}

.field__error {
  display: none;
  color: var(--error);
}

.field__error:not(:empty) {
  display: block;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-control);
  background: var(--surface-sunken);
}

.segmented input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.segmented label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 6px;
  color: var(--ink-muted);
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color var(--t-colour) var(--ease-state),
    color var(--t-colour) var(--ease-state);
}

.segmented label:hover {
  color: var(--ink);
}

.segmented label:active {
  background: var(--border);
}

.segmented input:checked + label {
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: var(--shadow-raised);
}

.segmented input:focus-visible + label {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.try__results {
  display: grid;
  gap: 20px;
}

.try__results.is-dimmed {
  opacity: 0.5;
}

.tiles {
  display: grid;
  gap: 16px;
}

@media (min-width: 480px) {
  .tiles {
    grid-template-columns: 1fr 1fr;
  }
}

.tile {
  display: grid;
  gap: 8px;
  padding: 20px;
  min-width: 0;
  transition:
    border-color var(--t-enter) var(--ease-state),
    opacity var(--t-colour) var(--ease-state);
}

.tile.is-changed {
  border-color: var(--accent);
}

.tile__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.tile__figure {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 10px;
  line-height: 1;
}

.tile__count {
  font-size: clamp(2.5rem, 1.5rem + 3vw, 3.5rem);
  letter-spacing: -0.03em;
  color: var(--ink);
}

.tile__unit {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.3;
}

.tile__empty {
  display: none;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-faint);
}

.tile.is-empty {
  opacity: 0.6;
}

.tile.is-empty .tile__count,
.tile.is-empty .tile__unit,
.tile.is-empty .tile__note {
  display: none;
}

.tile.is-empty .tile__empty {
  display: inline;
}

.try__sundries {
  max-width: 44rem;
}

/* 5. Features */

.features__grid {
  display: grid;
  gap: 20px;
  margin-top: 48px;
}

@media (min-width: 600px) {
  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .features__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* The list item only reveals ([data-reveal] owns that transition); the body inside it carries the card and the hover lift. */
.feature {
  display: grid;
  --stagger: 60ms;
}

.feature__body {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 24px;
  transition:
    transform var(--t-enter) var(--ease-state),
    border-color var(--t-enter) var(--ease-state);
}

/* The floating shadow lives on a pseudo-element and fades in, so no shadow is ever animated directly. */
.feature__body::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: var(--radius);
  box-shadow: var(--shadow-floating);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-enter) var(--ease-state);
}

@media (hover: hover) and (pointer: fine) {
  .feature__body:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
  }

  .feature__body:hover::after {
    opacity: 1;
  }
}

.glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 4px;
}

.glyph svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature__title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* 6. The real app */

.real-app__lead {
  max-width: 40ch;
  margin: 16px auto 0;
}

.browser-frame {
  max-width: 1040px;
  margin: 48px auto 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-floating);
  overflow: hidden;
}

.browser-frame__bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
}

.browser-frame__dots {
  position: absolute;
  left: 16px;
  top: 50%;
  display: flex;
  gap: 6px;
  transform: translateY(-50%);
}

.browser-frame__dots i {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
}

.browser-frame__url {
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.browser-frame iframe {
  display: block;
  width: 100%;
  height: 640px;
  border: 0;
  background: var(--surface);
}

@media (min-width: 640px) {
  .browser-frame iframe {
    height: 720px;
  }
}

.real-app__actions {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 32px;
  text-align: center;
}

/* 7. For staff */

.staff__inner {
  display: grid;
  gap: 40px;
  align-items: center;
}

@media (min-width: 900px) {
  .staff__inner {
    grid-template-columns: 6fr 5fr;
    gap: 48px;
  }
}

@media (max-width: 899px) {
  .staff__text {
    order: -1;
  }
}

.staff__visual {
  display: grid;
  gap: 20px;
}

.staff__visual [data-reveal] {
  --stagger: 120ms;
}

.staff-panel {
  display: grid;
  gap: 10px;
  padding: 20px;
  box-shadow: var(--shadow-raised);
}

.formula {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-sunken);
  font-size: 0.875rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.formula__valid {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-weight: 500;
}

.aisle-map {
  padding: 8px;
}

.aisle-map__row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 6px 12px;
  border-radius: var(--radius-control);
  transition: background-color var(--t-colour) var(--ease-state);
}

@media (hover: hover) and (pointer: fine) {
  .aisle-map__row:hover {
    background: var(--surface-sunken);
  }
}

.drag-handle {
  display: inline-flex;
  color: var(--ink-faint);
}

.drag-handle svg {
  fill: currentColor;
}

.aisle-map__name {
  font-weight: 600;
  min-width: 56px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
  justify-content: flex-end;
}

.chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
}

.staff__text {
  display: grid;
  gap: 16px;
}

.staff__text .text-link {
  justify-self: start;
}

/* 8. Closing band and footer */

.closing {
  padding-block: 64px;
  background:
    radial-gradient(120% 120% at 50% 0%, var(--accent-glow), transparent 60%),
    var(--panel);
  color: var(--panel-ink);
  text-align: center;
}

@media (min-width: 640px) {
  .closing {
    padding-block: 120px;
  }
}

.closing__inner {
  display: grid;
  justify-items: center;
  gap: 24px;
  max-width: 48rem;
}

.closing__inner .lead {
  max-width: 36rem;
  color: var(--panel-ink);
  opacity: 0.85;
}

.closing__note {
  color: var(--ink-faint);
}

.closing :focus-visible {
  outline-color: #7cb6ff;
}

.site-footer {
  padding-block: 28px;
  background: var(--panel);
  color: var(--panel-ink);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}

.site-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  color: var(--ink-faint);
}

.site-footer__links nav {
  display: flex;
  gap: 16px;
}

.site-footer__links a {
  color: var(--panel-ink);
  text-decoration: none;
  padding-block: 8px;
  transition: color var(--t-colour) var(--ease-state);
}

.site-footer__links a:hover {
  color: #ff7b30;
}

.site-footer__links a:active {
  color: #ff8f50;
}

.site-footer :focus-visible {
  outline-color: #7cb6ff;
}

@media (max-width: 599px) {
  .site-footer__inner,
  .site-footer__links {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Reduced motion: no durations, every element in its final state. main.js checks the same query. */

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

  [data-reveal] {
    opacity: 1;
    transform: none;
  }

  [data-reveal="left"] {
    transform: none;
  }

  .aisle-plan__reveal {
    stroke-dashoffset: 0;
  }

  .aisle-plan__arrow {
    opacity: 1;
  }
}
