@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk.ttf?v=acad6de1fc93436f5c0f1f4137751ef04f1aea3063e7036535970ffcfbd79f72") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: "Space Grotesk", sans-serif;
  background: #0c0d10;
  color: #eeeeef;
}

* { box-sizing: border-box; }

body {
  min-height: 100svh;
  margin: 0;
  padding: 1.5rem;
  display: grid;
  place-items: center;
}

.panel {
  width: min(100%, 20rem);
  text-align: center;
}

.logo { display: block; margin: 0 auto 1.25rem; }

body[data-page="login"] .logo { width: 128px; height: 128px; margin-bottom: .25rem; }
body[data-page="login"] .intro { margin-bottom: 3rem; }

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: 1.15;
}

.intro {
  margin: .75rem 0 2rem;
  color: #a1a2ad;
  line-height: 1.5;
}

button {
  width: 100%;
  min-height: 3rem;
  padding: .7rem 1rem;
  border: 1px solid #eeeeef;
  border-radius: .65rem;
  background: #eeeeef;
  color: #0c0d10;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover:not(:disabled) { background: #d7d7db; border-color: #d7d7db; }
button:focus-visible { outline: 2px solid #eeeeef; outline-offset: 4px; }
button:disabled { opacity: .55; cursor: wait; }

.status {
  min-height: 1.5em;
  margin: 1rem 0 0;
  color: #a1a2ad;
  font-size: .9rem;
  line-height: 1.5;
}

.device-note {
  margin: .75rem 0 1rem;
  color: #a1a2ad;
  font-size: .9rem;
  line-height: 1.5;
}

#device-controls:not([hidden]) + #logout-button { margin-top: .75rem; }

#invite-qr {
  display: block;
  width: min(100%, 220px);
  height: auto;
  margin: 1.5rem auto 0;
  padding: .5rem;
  border-radius: .5rem;
  background: #eeeeef;
}

#copy-link-button {
  border-color: #303138;
  background: transparent;
  color: #eeeeef;
}

#copy-link-button:hover:not(:disabled) { background: #17181d; border-color: #a1a2ad; }

body[data-page="app"] {
  display: block;
  padding: 2.25rem 2rem 4rem;
  background: radial-gradient(ellipse at 50% 0, #17191e 0, transparent 520px), #0c0d10;
}

.site-header { margin: 0 auto 2.75rem; text-align: center; }
.home-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  color: inherit;
  text-decoration: none;
  border-radius: .5rem;
}
.home-link img { display: block; filter: drop-shadow(0 4px 14px #ffffff0b); }
.site-title { font-size: 2rem; font-weight: 500; letter-spacing: -.045em; }
.workspace { width: min(100%, 1160px); margin: 0 auto; }

.factory-floor {
  --turn-space: 24px;
  position: relative;
  isolation: isolate;
  padding: 20px 36px 28px;
}
.factory-floor::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: -12px 0;
  background-image: radial-gradient(#737c8b20 .7px, transparent .7px);
  background-size: 20px 20px;
  mask-image: linear-gradient(transparent, #000 60px, #000 calc(100% - 60px), transparent);
  pointer-events: none;
}
.conveyor { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; z-index: -1; pointer-events: none; }
.conveyor path { fill: none; stroke-linejoin: round; }
.belt-shadow { stroke: #07080b; stroke-width: 25px; }
.belt-rail { stroke: #434750; stroke-width: 20px; }
.belt-surface { stroke: #1b1e24; stroke-width: 16px; }
.belt-rollers { stroke: #555b67; stroke-width: 11px; stroke-dasharray: 1 7; }
.step-path {
  --gap-x: 2.75rem;
  --gap-y: 3.25rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(160px, auto);
  gap: var(--gap-y) var(--gap-x);
  margin: 0;
  padding: 0;
  list-style: none;
}
.step-node { position: relative; grid-row: var(--row); grid-column: var(--column); min-width: 0; }
/* A simple connecting line remains available until the belt is drawn. */
.step-node:not(:last-child)::after { content: ""; position: absolute; background: #494b55; pointer-events: none; }
.step-node[data-direction="right"]::after { top: calc(50% - 1px); left: 100%; width: var(--gap-x); height: 2px; }
.step-node[data-direction="left"]::after { top: calc(50% - 1px); right: 100%; width: var(--gap-x); height: 2px; }
.step-node[data-direction="down"]::after { top: 100%; left: calc(50% - 1px); width: 2px; height: var(--gap-y); }
.belt-ready .step-node::after { display: none; }
.step-button {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  width: 100%;
  height: 100%;
  padding: 1.2rem 1.25rem 1.5rem;
  border: 1px solid #393d45;
  border-radius: .85rem;
  background: linear-gradient(145deg, #22252c, #191b21 65%);
  color: #e9eaee;
  text-align: left;
  text-decoration: none;
  transition: border-color .18s, background .18s;
}
.station-tools { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.station-icon { width: 30px; height: 30px; color: #b7bdc8; flex: 0 0 auto; transition: color .18s; }
.step-number {
  color: #a3aab7;
  background: #101217;
  border: 1px solid #343944;
  border-radius: .3rem;
  padding: .25rem .4rem;
  font-size: .6875rem;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.step-name { font-size: .96875rem; line-height: 1.45; font-weight: 500; overflow-wrap: anywhere; }
.step-button:hover, .step-button:focus-visible {
  border-color: #a4aab5;
  background: linear-gradient(145deg, #2b2e35, #202228 65%);
}
.step-button:hover .station-icon, .step-button:focus-visible .station-icon { color: #f2f3f5; }
.step-button:hover .step-number, .step-button:focus-visible .step-number { color: #f2f3f5; border-color: #767e8c; }
.step-button:focus-visible, .home-link:focus-visible { outline: 2px solid #eeeeef; outline-offset: 5px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.step-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  width: min(100%, 1160px);
  margin: 0 auto 2.5rem;
  padding: .25rem 0 1rem;
  border-bottom: 1px solid #25282f;
}
.step-heading { display: flex; align-items: stretch; gap: 1rem; min-width: 0; color: inherit; text-decoration: none; border-radius: .5rem; }
.step-heading:focus-visible { outline: 2px solid #eeeeef; outline-offset: 5px; }
.step-heading:hover .step-heading-icon, .step-heading:focus-visible .step-heading-icon { color: #f2f3f5; border-color: #a4aab5; background: #292d35; }
.step-heading-icon {
  display: grid;
  place-items: center;
  flex: 0 0 64px;
  width: 64px;
  height: auto;
  border: 1px solid #363a43;
  border-radius: .7rem;
  background: #1b1e24;
  color: #b7bdc8;
  transition: color .18s, border-color .18s, background .18s;
}
.step-heading-icon svg { width: 36px; height: 36px; }
.step-heading-text { min-width: 0; }
.step-heading-number { display: block; margin-bottom: .5rem; color: #a1a8b5; font-size: .75rem; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.step-heading h1 { font-size: clamp(1.3rem, 2.5vw, 1.9rem); line-height: 1.3; letter-spacing: -.025em; overflow-wrap: anywhere; }

.station-result { max-width: 680px; }
.station-result h2 { margin: 0 0 .75rem; font-size: .75rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: #a1a8b5; }
.station-result p { margin: 0; font-size: 1.0625rem; line-height: 1.7; color: #d8dbe2; }

@media (max-width: 800px) {
  body[data-page="app"] { padding: 1.75rem .75rem 3rem; }
  .site-header { margin-bottom: 1.75rem; }
  .factory-floor { --turn-space: 14px; padding: 16px 20px 24px; }
  .step-path { --gap-x: 1.5rem; --gap-y: 2.5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(168px, auto); }
  .step-node { grid-row: var(--mobile-row); grid-column: var(--mobile-column); }
  .step-node:not(:last-child)::after { top: auto; right: auto; bottom: auto; left: auto; }
  .step-node[data-mobile-direction="right"]::after { top: calc(50% - 1px); left: 100%; width: var(--gap-x); height: 2px; }
  .step-node[data-mobile-direction="left"]::after { top: calc(50% - 1px); right: 100%; width: var(--gap-x); height: 2px; }
  .step-node[data-mobile-direction="down"]::after { top: 100%; left: calc(50% - 1px); width: 2px; height: var(--gap-y); }
  .step-button { padding: 1rem .85rem 1.4rem; gap: 1rem; }
  .station-icon { width: 27px; height: 27px; }
  .step-name { font-size: .875rem; line-height: 1.4; }
  .belt-shadow { stroke-width: 21px; }
  .belt-rail { stroke-width: 16px; }
  .belt-surface { stroke-width: 12px; }
  .belt-rollers { stroke-width: 8px; stroke-dasharray: 1 6; }
  body[data-view="step"] { padding: 1.5rem 1rem 3rem; }
  .step-header { gap: 1rem; padding-bottom: .75rem; }
  .step-heading { gap: .65rem; }
  .step-heading-icon { flex-basis: 48px; width: 48px; border-radius: .5rem; }
  .step-heading-icon svg { width: 29px; height: 29px; }
  .step-heading-number { font-size: .6875rem; margin-bottom: .45rem; }
  .step-heading h1 { font-size: 1.1875rem; line-height: 1.35; }
}

@media (prefers-reduced-motion: reduce) {
  .step-button, .station-icon, .step-heading-icon { transition: none; }
}
