/* Ready2Serve work-in-progress page. Mobile first; no scripts needed for any animation. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/BricolageGrotesque-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/InstrumentSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/InstrumentSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  /* Brand colours (brand/README.md) */
  --ink: #1B1F24;
  --tomato: #D9381E;
  --tomato-dark: #B42D17;
  --herb: #1F7A55;
  --cream: #FFF6E9;
  --soft: #E9B7AC;
  --muted: #5B6470;
  --paper: #FFFFFF;
  --line: #EADFD0;

  --font-head: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;

  --gutter: 1.25rem;
  --max: 64rem;
  --radius: 1rem;
  --shadow: 0 1px 0 rgba(27, 31, 36, 0.04), 0 12px 32px -12px rgba(27, 31, 36, 0.18);

  /* Timeline of the mark (seconds from page load). The steps run on one
     4.2s keyframe track each, so their percentages below follow these times. */
  --t-plate: 3.5s;
  --t-steps: 4.2s;
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: var(--font-head);
  line-height: 1.1;
  margin: 0;
}

a {
  color: inherit;
}

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

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--cream);
  border-radius: 0.5rem;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

/* ---------- Header ---------- */

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem var(--gutter);
}

.site-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-head);
  font-size: 1.1rem;
  text-decoration: none;
}

.site-nav__brand img {
  border-radius: 0.5rem;
}

.site-nav__cta {
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  transition: background-color 0.2s, color 0.2s;
}

.site-nav__cta:hover {
  background: var(--ink);
  color: var(--cream);
}

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

main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem var(--gutter) 3rem;
}

main:focus {
  outline: none;
}

.hero {
  text-align: center;
  padding-top: 1.5rem;
}

.hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.75rem 0 0.75rem;
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tomato-dark);
  background: rgba(217, 56, 30, 0.08);
  border-radius: 999px;
}

.hero__kicker::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--tomato);
  animation: pulse 1.6s ease-in-out infinite;
}

.hero__title {
  font-size: clamp(2rem, 8vw, 3.75rem);
  letter-spacing: -0.02em;
  max-width: 24ch;
  margin: 0 auto;
}

.hero__lead {
  max-width: 36rem;
  margin: 1rem auto 0;
  color: var(--muted);
}

.hero__strong {
  font-weight: 900;
}

/* ---------- The animated mark ---------- */

.mark {
  display: block;
  width: 100%;
  max-width: 40rem;
  height: auto;
  margin: 0 auto;
  overflow: visible;
}

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

.mark__outline {
  fill: var(--paper);
  stroke: var(--tomato);
  stroke-width: 4;
}

.mark__dish {
  fill: var(--tomato);
}

.mark__rim {
  fill: none;
  stroke: var(--cream);
  stroke-width: 3;
}

.mark__two {
  fill: var(--cream);
}

.icon__line {
  fill: none;
  stroke: var(--tomato);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon__fill {
  fill: var(--paper);
}

.icon__speed {
  fill: none;
  stroke: var(--soft);
  stroke-width: 4;
  stroke-linecap: round;
}

/* Scale every part around its own centre */
.mark__solo,
.mark__plate,
.mark__word {
  transform-box: fill-box;
  transform-origin: center;
}

.mark__word--ready {
  animation: word-in-left 0.7s var(--t-plate) ease-out both;
}

.mark__word--serve {
  animation: word-in-right 0.7s var(--t-plate) ease-out both;
}

/* One plate at a time, all in the same spot: phone, bike, then the 2 */
.mark__solo--order {
  animation: solo-order var(--t-steps) ease-in-out both;
}

.mark__solo--courier {
  animation: solo-courier var(--t-steps) ease-in-out both;
}

.mark__bike {
  animation: bike-ride var(--t-steps) both;
}

.mark__bike .icon__speed {
  animation: speed-lines var(--t-steps) linear both;
}

.mark__plate {
  animation: plate-in 0.9s var(--t-plate) var(--ease-pop) both;
}

/* A little steam over the plate, once, then the logo is clean again */
.mark__steam path {
  fill: none;
  stroke: var(--soft);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0;
  animation: steam 2.2s ease-out 1 both;
  animation-delay: calc(var(--t-plate) + 0.9s);
}

.mark__steam path:nth-child(2) {
  animation-delay: calc(var(--t-plate) + 1.2s);
}

.mark__steam path:nth-child(3) {
  animation-delay: calc(var(--t-plate) + 1.5s);
}

/* Percentages of 4.2s. Phone plate in 0.2–0.5s, out 1.6–1.8s.
   Bike plate in 1.9–2.2s while the bike rides in until 2.5s, out 3.3–3.5s. The 2 from 3.5s. */
@keyframes solo-order {

  0%,
  5% {
    opacity: 0;
    transform: scale(0.6);
  }

  12%,
  38% {
    opacity: 1;
    transform: scale(1);
  }

  43%,
  100% {
    opacity: 0;
    transform: scale(0.85);
  }
}

@keyframes solo-courier {

  0%,
  45% {
    opacity: 0;
    transform: scale(0.6);
  }

  52%,
  79% {
    opacity: 1;
    transform: scale(1);
  }

  83%,
  100% {
    opacity: 0;
    transform: scale(0.85);
  }
}

@keyframes bike-ride {

  0%,
  46% {
    transform: translateX(-80px);
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1);
  }

  60%,
  100% {
    transform: translateX(0);
  }
}

@keyframes speed-lines {

  0%,
  58% {
    opacity: 1;
  }

  66%,
  100% {
    opacity: 0;
  }
}

@keyframes plate-in {
  0% {
    opacity: 0;
    transform: scale(0.3) rotate(-90deg);
  }

  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes word-in-left {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes word-in-right {
  from {
    opacity: 0;
    transform: translateX(24px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes steam {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }

  35% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.35;
    transform: scale(0.75);
  }
}

@keyframes cooking {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(250%);
  }
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Kitchen ticket ---------- */

.ticket-wrap {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

.ticket {
  width: 100%;
  max-width: 22rem;
  padding: 1.25rem 1.25rem 1.5rem;
  background: var(--paper);
  border-radius: var(--radius) var(--radius) 0.25rem 0.25rem;
  box-shadow: var(--shadow);
  transform: rotate(-1.5deg);
  animation: rise 0.6s 0.3s ease-out both;
  /* Torn bottom edge, like a receipt */
  -webkit-mask: radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) 0 0 / 16px 100% repeat-x;
  mask: radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) 0 0 / 16px 100% repeat-x;
}

.ticket__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 0.75rem;
  border-bottom: 2px dashed var(--line);
}

.ticket__title {
  font-size: 1.35rem;
}

.ticket__station {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--herb);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ticket__items {
  list-style: none;
  margin: 0.75rem 0 1rem;
  padding: 0;
}

.ticket__items li {
  padding: 0.2rem 0;
}

.ticket__qty {
  display: inline-block;
  min-width: 1.75rem;
  font-weight: 700;
}

.ticket__status {
  display: flex;
  gap: 0.4rem;
  list-style: none;
  margin: 0 0 0.9rem;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 700;
}

.ticket__status li {
  flex: 1;
  text-align: center;
  padding: 0.35rem 0.25rem;
  border-radius: 0.5rem;
  background: #F4EFE7;
  color: var(--muted);
}

.ticket__status .is-done {
  background: rgba(31, 122, 85, 0.12);
  color: var(--herb);
}

.ticket__status .is-done::before {
  content: "✓ ";
}

.ticket__status .is-active {
  background: var(--tomato);
  color: var(--cream);
  animation: pulse-bg 1.6s ease-in-out infinite;
}

@keyframes pulse-bg {

  0%,
  100% {
    background: var(--tomato);
  }

  50% {
    background: var(--tomato-dark);
  }
}

.ticket__bar {
  position: relative;
  height: 0.4rem;
  overflow: hidden;
  border-radius: 999px;
  background: #F4EFE7;
}

.ticket__bar span {
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: inherit;
  background: var(--tomato);
  animation: cooking 1.8s ease-in-out infinite;
}

/* ---------- 1 2 3 ---------- */

.steps__list {
  display: grid;
  gap: 1rem;
  list-style: none;
  margin: 3rem 0 0;
  padding: 0;
}

.step {
  position: relative;
  padding: 1.25rem 1.25rem 1.25rem 4.25rem;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: rise 0.6s ease-out both;
}

.step:nth-child(1) {
  animation-delay: 0.5s;
}

.step:nth-child(2) {
  animation-delay: 0.65s;
}

.step:nth-child(3) {
  animation-delay: 0.8s;
}

.step__num {
  position: absolute;
  left: 1.1rem;
  top: 1.15rem;
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border: 3px solid var(--soft);
  border-radius: 50%;
  font-family: var(--font-head);
  color: var(--soft);
}

.step--main .step__num {
  background: var(--tomato);
  border-color: var(--tomato);
  color: var(--cream);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--tomato);
}

.step__title {
  font-size: 1.2rem;
}

.step p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

/* ---------- Join ---------- */

.join {
  margin-top: 3rem;
  padding: 2rem 1.25rem;
  text-align: center;
  background: var(--ink);
  color: var(--cream);
  border-radius: calc(var(--radius) * 1.5);
}

.join__title {
  font-size: clamp(1.5rem, 5vw, 2.25rem);
}

.join p {
  margin: 0.5rem auto 1.5rem;
  max-width: 30rem;
  color: rgba(255, 246, 233, 0.8);
}

.button {
  display: inline-block;
  padding: 0.85rem 1.4rem;
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
  color: var(--cream);
  background: var(--tomato);
  border-radius: 999px;
  transition: transform 0.2s var(--ease-pop), background-color 0.2s;
}

.button:hover {
  background: var(--tomato-dark);
  transform: translateY(-2px) rotate(-1deg);
}

.join .button:focus-visible {
  outline-color: var(--cream);
}

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

.site-footer {
  padding: 1.5rem var(--gutter) 2rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

/* ---------- Larger screens ---------- */

@media (min-width: 48rem) {
  :root {
    --gutter: 2rem;
  }

  .hero {
    padding-top: 3rem;
  }

  .steps__list {
    grid-template-columns: repeat(3, 1fr);
  }

  .step {
    padding: 4.5rem 1.5rem 1.5rem;
    text-align: center;
  }

  .step__num {
    left: 50%;
    top: 1.25rem;
    transform: translateX(-50%);
  }

  .join {
    padding: 3rem 2rem;
  }
}

/* ---------- Less motion: show the end state straight away ---------- */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }

  .ticket__bar span {
    width: 60%;
    transform: none;
  }
}