:root {
  --ink: #15233F;
  --slate: #56617A;
  --rule: #DCE1EA;
  --paper: #FFFFFF;
  --tint: #F3F5F9;
  --red: #C21F32;
  --red-soft: #F8E3E5;
  --cheese: #F4C64E;

  --font: "Schibsted Grotesk", system-ui, sans-serif;
  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ol, ul, dl, dd, figure { margin: 0; }

a { color: inherit; }
:focus-visible { outline: 3px solid var(--cheese); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* Masthead */
.masthead { border-bottom: 1px solid var(--rule); }
.masthead__row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 4rem; }
.masthead__brand { font-weight: 800; letter-spacing: -0.02em; font-size: 1.125rem; }
.masthead__nav { display: flex; gap: 1.75rem; font-size: 0.9375rem; color: var(--slate); }
.masthead__nav a { text-decoration: none; }
.masthead__nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 760px) { .masthead__nav { display: none; } }

/* Hero */
.hero { padding-block: clamp(3rem, 8vw, 6rem) 0; }
.hero__for { color: var(--slate); font-size: 0.9375rem; margin-bottom: 1.25rem; }
.hero__title {
  font-weight: 900;
  font-size: clamp(2.4rem, 5.6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 17ch;
}
.hero__lede { margin-top: 1.5rem; max-width: 58ch; font-size: 1.1875rem; color: var(--slate); }

/* Shift chart */
.shift { margin-top: clamp(2.5rem, 6vw, 4.5rem); padding-block: 2.5rem 3rem; background: var(--tint); border-block: 1px solid var(--rule); }
.shift__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.75rem 2rem; margin-bottom: 1.75rem; }
.shift__title { font-weight: 700; font-size: 1.0625rem; }
.shift__legend { display: flex; flex-wrap: wrap; gap: 1.25rem; font-size: 0.875rem; color: var(--slate); }
.shift__legend span { display: inline-flex; align-items: center; gap: 0.5rem; }
.sw { display: inline-block; width: 1.5rem; height: 0.75rem; border-radius: 3px; }
.sw--roster { border: 1.5px dashed var(--slate); }
.sw--actual { background: var(--ink); }
.sw--flag { background: var(--red); }

.shift__grid { --label: 9rem; position: relative; }
.shift__axis {
  position: relative;
  margin-left: var(--label);
  height: 1.5rem;
  font-size: 0.8125rem;
  color: var(--slate);
  font-variant-numeric: tabular-nums;
}
.shift__axis span { position: absolute; left: calc(var(--h) / 12 * 100%); transform: translateX(-50%); }
.shift__axis span:first-child { transform: none; }
.shift__axis span:last-child { transform: translateX(-100%); }

.row { display: grid; grid-template-columns: var(--label) 1fr; align-items: start; min-height: 4.75rem; border-top: 1px solid var(--rule); padding-top: 0.875rem; }
.row__who { font-weight: 500; font-size: 0.9375rem; padding-top: 0.125rem; }
.row__track {
  position: relative;
  height: 1.75rem;
  background-image: repeating-linear-gradient(to right, var(--rule) 0 1px, transparent 1px calc(100% / 12));
}

.bar {
  position: absolute;
  top: 0;
  left: calc(var(--s) / 12 * 100%);
  width: calc((var(--e) - var(--s)) / 12 * 100%);
  height: 100%;
  border-radius: 4px;
}
.bar--roster { border: 1.5px dashed var(--slate); background: var(--paper); }
.bar--actual { top: 0.3125rem; height: calc(100% - 0.625rem); background: var(--ink); border-radius: 3px; }
.bar--over { top: 0.3125rem; height: calc(100% - 0.625rem); background: var(--red); border-radius: 3px; }
.bar--gap, .bar--late {
  top: 0.3125rem; height: calc(100% - 0.625rem);
  background: repeating-linear-gradient(135deg, var(--red) 0 2px, var(--red-soft) 2px 6px);
  border-radius: 3px;
}
.bar--gap-quiet { background: transparent; }

.note {
  position: absolute;
  top: calc(100% + 0.375rem);
  left: calc(var(--at) / 12 * 100%);
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--red);
}
.note--end { transform: translateX(-100%); }
.note--start { transform: none; }

.shift__cap { margin-top: 1.75rem; max-width: 62ch; color: var(--slate); font-size: 0.9375rem; }

/* The one orchestrated moment: worked time fills in on load */
@media (prefers-reduced-motion: no-preference) {
  .js .bar--actual, .js .bar--over, .js .bar--gap, .js .bar--late {
    transform-origin: left center;
    transform: scaleX(0);
  }
  .js .note { opacity: 0; }
  .js .shift.is-playing .bar--actual,
  .js .shift.is-playing .bar--over,
  .js .shift.is-playing .bar--gap,
  .js .shift.is-playing .bar--late {
    transform: scaleX(1);
    transition: transform 0.7s var(--ease) var(--d, 0s);
  }
  .js .shift.is-playing .note { opacity: 1; transition: opacity 0.4s ease var(--d, 0s); }
}

@media (max-width: 760px) {
  .shift__grid { --label: 0rem; overflow-x: auto; }
  .shift__grid > * { min-width: 40rem; }
  .row { grid-template-columns: 1fr; min-height: 5.75rem; padding-bottom: 1.75rem; }
  .row__who { padding-bottom: 0.375rem; }
}

/* Sections */
.section { padding-block: clamp(3.5rem, 9vw, 6.5rem); }
.section--tint { background: var(--tint); }
.section__title {
  font-weight: 800;
  font-size: clamp(1.75rem, 3.4vw, 2.625rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  max-width: 24ch;
}
.section__lede { margin-top: 1rem; max-width: 62ch; color: var(--slate); font-size: 1.125rem; }

/* Today's flow: a real sequence, so numbered */
.flow {
  list-style: none;
  padding: 0;
  margin-top: 2.75rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  counter-reset: step;
}
.flow li {
  counter-increment: step;
  position: relative;
  padding: 3rem 1.5rem 0 0;
  border-top: 3px solid var(--ink);
  color: var(--slate);
  font-size: 0.9875rem;
}
.flow li::before {
  content: counter(step);
  position: absolute;
  top: -1.0625rem;
  left: 0;
  width: 2rem; height: 2rem;
  display: grid; place-items: center;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.875rem;
  color: var(--ink);
}
.flow li:last-child { border-top-color: var(--red); }
.flow li:last-child::before { border-color: var(--red); color: var(--red); }
.flow strong { display: block; color: var(--ink); font-weight: 700; margin-bottom: 0.375rem; }
@media (max-width: 860px) {
  .flow { grid-template-columns: 1fr; gap: 2rem; }
  .flow li { border-top: 0; border-left: 3px solid var(--ink); padding: 0 0 0 2rem; }
  .flow li:last-child { border-left-color: var(--red); }
  .flow li::before { top: -0.25rem; left: -1.1875rem; }
}

.costs {
  margin-top: 4rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}
.cost__figure { font-weight: 900; font-size: clamp(1.875rem, 3.2vw, 2.5rem); letter-spacing: -0.03em; line-height: 1.1; }
.cost__text { margin-top: 0.5rem; color: var(--slate); max-width: 30ch; }
@media (max-width: 760px) { .costs { grid-template-columns: 1fr; gap: 1.75rem; } }

/* Program */
.system {
  margin-top: 3.5rem;
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) 2.6fr;
  gap: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}
.system__name { font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; line-height: 1.15; }
.system__intro p { margin-top: 0.625rem; color: var(--slate); }
.system__intro .system__rank { margin: 0 0 0.375rem; color: var(--ink); font-weight: 700; font-size: 0.9375rem; }
.system__intro .system__proof { margin-top: 1rem; padding-top: 0.75rem; border-top: 2px solid var(--cheese); color: var(--ink); font-size: 0.9375rem; max-width: 26ch; }
.phases { list-style: none; padding: 0; display: grid; gap: 0; }
.phases li { padding: 1.25rem 0 1.5rem 1.5rem; border-left: 2px solid var(--rule); position: relative; }
.phases li::before {
  content: "";
  position: absolute; left: -7px; top: 1.6rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--tint); border: 2px solid var(--slate);
}
.phases li:first-child { border-left-color: var(--ink); }
.phases li:first-child::before { background: var(--cheese); border-color: var(--ink); }
.phases__when { font-size: 0.875rem; color: var(--slate); font-weight: 500; }
.phases li:first-child .phases__when { color: var(--ink); font-weight: 700; }
.phases h4 { margin-top: 0.25rem; font-size: 1.1875rem; font-weight: 700; letter-spacing: -0.01em; }
.phases li p:last-child { margin-top: 0.5rem; color: var(--slate); max-width: 62ch; }
@media (max-width: 860px) { .system { grid-template-columns: 1fr; gap: 1.25rem; } }

/* Camera demo */
.demo {
  margin-top: 2.75rem;
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 2rem;
  align-items: start;
}
.demo__video { width: 100%; aspect-ratio: 4 / 3; background: var(--ink); border-radius: 6px; display: block; }
.demo__stats { display: grid; gap: 1.5rem; }
.demo__stats div { border-top: 1px solid var(--rule); padding-top: 0.875rem; }
.demo__stats dt { font-size: 0.875rem; color: var(--slate); }
.demo__stats dd { font-weight: 800; font-size: 1.875rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.demo__note { margin-top: 2rem; max-width: 62ch; color: var(--slate); }
@media (max-width: 860px) { .demo { grid-template-columns: 1fr; } .demo__stats { grid-template-columns: 1fr 1fr; } }

/* Working demos */
.try { margin-top: 2.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.try__item {
  display: block; text-decoration: none;
  padding: 1.75rem 1.75rem 1.5rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--ink);
  border-radius: 0 0 6px 6px;
}
.try__item h3 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.try__item p { margin-top: 0.5rem; color: var(--slate); max-width: 44ch; }
.try__go { display: inline-block; margin-top: 1.25rem; font-weight: 700; border-bottom: 2px solid var(--cheese); padding-bottom: 2px; }
.try__item:hover { border-top-color: var(--cheese); }
.try__item:hover .try__go { border-bottom-color: var(--ink); }
@media (max-width: 760px) { .try { grid-template-columns: 1fr; } }

/* Pilot */
.steps { list-style: none; padding: 0; margin-top: 2.75rem; display: grid; gap: 0; }
.steps li {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1.5rem;
  padding-block: 1.125rem;
  border-top: 1px solid var(--rule);
}
.steps li:last-child { border-bottom: 1px solid var(--rule); }
.steps__when { font-weight: 700; }
.steps li p { color: var(--slate); max-width: 62ch; }
@media (max-width: 560px) { .steps li { grid-template-columns: 1fr; gap: 0.25rem; } }

.needs { margin-top: 3.5rem; padding: 2rem; background: var(--tint); border-left: 6px solid var(--cheese); border-radius: 0 6px 6px 0; }
.needs__title { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.015em; }
.needs__list { margin-top: 1rem; padding-left: 1.25rem; display: grid; gap: 0.5rem; max-width: 70ch; }
.needs__list li::marker { color: var(--slate); }

/* Close */
.section--close { background: var(--ink); color: var(--paper); }
.section--close .section__lede { color: #C5CCDA; }
.close__sign { margin-top: 3rem; font-weight: 700; }
