/* Shift — a shift checklist and handover demo.
   The whole interface is built around one rule: a block closes when the hour does. Time is the
   spine, so the layout is a vertical rail rather than a dashboard or a card grid. */

:root {
  --ink: #101318;
  --panel: #171b22;
  --panel-2: #1d222b;
  --line: #262c36;
  --chalk: #e9edf2;
  --mute: #8a94a3;
  --live: #e8a33d;
  --sealed: #4fb477;
  --missed: #d9544d;
  --rail: 3.25rem;
  /* Where the track sits inside the block grid, so the line and every node share one x. */
  --rail-x: 2.6rem;
  --font-ui: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--chalk);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--live); outline-offset: 2px; border-radius: 2px; }

.wrap { max-width: 74rem; margin: 0 auto; padding: 0 1.25rem; }

/* ---------------------------------------------------------------- masthead */
.masthead {
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  backdrop-filter: blur(10px);
}
.masthead .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 3.5rem;
}
.mark {
  font-family: var(--font-data);
  font-size: 0.9rem; letter-spacing: 0.22em; text-transform: uppercase;
  display: flex; align-items: center; gap: 0.6rem;
}
.mark b { font-weight: 600; letter-spacing: 0.22em; }
.mark .dot {
  width: 0.5rem; height: 0.5rem; border-radius: 50%;
  background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 22%, transparent);
}
.mark span { color: var(--mute); letter-spacing: 0.14em; }

.trade-picker { display: flex; align-items: center; gap: 0.55rem; }
.trade-picker > span {
  font-family: var(--font-data); font-size: 0.68rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--mute);
}
.trade-picker select {
  font-family: var(--font-data); font-size: 0.78rem; letter-spacing: 0.06em;
  background: var(--panel-2); color: var(--chalk);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 0.4rem 0.55rem; min-height: 2.25rem;
}

/* ---------------------------------------------------------------- hero */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (min-width: 62rem) { .hero-grid { grid-template-columns: 1fr 22rem; } }

.eyebrow {
  font-family: var(--font-data); font-size: 0.7rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--live); margin: 0 0 1.1rem;
}
h1 {
  font-size: clamp(2.3rem, 6.4vw, 4.1rem);
  line-height: 1.02; letter-spacing: -0.035em; font-weight: 700;
  margin: 0 0 1.25rem; text-wrap: balance; max-width: 16ch;
}
h1 em { font-style: normal; color: var(--live); }
.lede { font-size: clamp(1.02rem, 1.6vw, 1.18rem); color: var(--mute); margin: 0 0 1.5rem; max-width: 46ch; }
.lede strong { color: var(--chalk); font-weight: 600; }

.claims { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; max-width: 40ch; }
.claims li {
  font-size: 0.95rem; color: var(--mute);
  border-left: 1px solid var(--line); padding-left: 0.95rem;
}
.claims b { color: var(--chalk); font-weight: 600; }

/* ---------------------------------------------------------------- device */
/* Sticky only where there is a second column for it to sit beside. In one column it just fights
   the scroll. */
.device-col { position: static; }
@media (min-width: 62rem) { .device-col { position: sticky; top: 4.75rem; } }
.device {
  width: 100%; max-width: 22rem; margin: 0 auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 1.85rem; padding: 0.5rem;
  box-shadow: 0 2rem 4rem -1.5rem rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}
.screen {
  background: var(--ink); border-radius: 1.4rem; overflow: hidden;
  height: 40rem; display: flex; flex-direction: column;
}
.status-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.7rem 1.1rem 0.35rem;
  font-family: var(--font-data); font-size: 0.66rem; color: var(--mute); letter-spacing: 0.06em;
}
.screen-body {
  flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 0 1.5rem;
  scrollbar-width: none;
  /* Fades the last few pixels so a cut-off row reads as "there is more" rather than as broken. */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2.5rem), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 2.5rem), transparent 100%);
}
.screen-body::-webkit-scrollbar { width: 0; }

/* view switch */
.views { display: flex; gap: 0.4rem; margin: 1.4rem auto 0; max-width: 22rem; }
.views button {
  flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 5px;
  padding: 0.6rem 0.3rem; min-height: 2.6rem; cursor: pointer;
  font-family: var(--font-data); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mute); transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.views button:hover { color: var(--chalk); }
.views button[aria-pressed="true"] { color: var(--ink); background: var(--live); border-color: var(--live); font-weight: 600; }

/* ---------------------------------------------------------------- pin */
.pin { padding: 2.2rem 1.4rem 1.4rem; text-align: center; }
.pin h2 { font-size: 1.05rem; margin: 0 0 0.3rem; letter-spacing: -0.01em; }
.pin p { color: var(--mute); font-size: 0.82rem; margin: 0 0 1.6rem; }
.pin-dots { display: flex; gap: 0.7rem; justify-content: center; margin-bottom: 1.8rem; }
.pin-dots i {
  width: 0.85rem; height: 0.85rem; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; transition: background 0.12s, border-color 0.12s;
}
.pin-dots i.on { background: var(--live); border-color: var(--live); }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.keys button {
  aspect-ratio: 1.5; border: 1px solid var(--line); background: var(--panel);
  border-radius: 6px; cursor: pointer; font-family: var(--font-data); font-size: 1.15rem;
  transition: background 0.12s;
}
.keys button:hover { background: var(--panel-2); }
.keys button.ghost { border-color: transparent; background: transparent; color: var(--mute); font-size: 0.72rem; letter-spacing: 0.1em; }
.pin-hint { margin-top: 1.2rem; font-family: var(--font-data); font-size: 0.68rem; color: var(--mute); letter-spacing: 0.06em; }

/* ---------------------------------------------------------------- the rail */
.who {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem;
  padding: 0.9rem 1.15rem 0.85rem; border-bottom: 1px solid var(--line);
}
.who b { font-size: 0.95rem; font-weight: 600; }
.who span { font-family: var(--font-data); font-size: 0.66rem; color: var(--mute); letter-spacing: 0.1em; text-transform: uppercase; }

.rail { padding: 0.4rem 1.15rem 0; }
.block { display: grid; grid-template-columns: var(--rail) 1fr; column-gap: 0.7rem; position: relative; }
/* the track itself, drawn once per block so the line is continuous down the shift */
/* The track. Drawn once per block so it runs unbroken down the whole shift, and stopped short on
   the last one so the line ends at the final node rather than trailing into nothing. */
.block::before {
  content: ""; position: absolute; left: var(--rail-x); top: 0; bottom: 0;
  width: 1px; background: var(--line); transform: translateX(-0.5px);
}
.block:last-child::before { bottom: auto; height: 1.35rem; }

.tick { padding-top: 0.95rem; }
.tick time {
  font-family: var(--font-data); font-size: 0.72rem; color: var(--mute);
  letter-spacing: 0.02em; display: block; text-align: right; padding-right: 1.15rem;
}
.node {
  position: absolute; left: var(--rail-x); top: 1.02rem;
  width: 0.62rem; height: 0.62rem; border-radius: 50%; transform: translateX(-50%);
  background: var(--ink); border: 1px solid var(--mute); z-index: 1;
}
.block[data-state="sealed"] .node { background: var(--sealed); border-color: var(--sealed); }
.block[data-state="missed"] .node { background: var(--missed); border-color: var(--missed); }
.block[data-state="live"] .node {
  background: var(--live); border-color: var(--live);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--live) 20%, transparent);
}
.block[data-state="sealed"] time, .block[data-state="missed"] time { color: var(--mute); }
.block[data-state="live"] time { color: var(--live); }

.block-body { padding: 0.85rem 0 1.1rem; min-width: 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.5rem; }
.state {
  font-family: var(--font-data); font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 0.14rem 0.4rem; border-radius: 3px; border: 1px solid currentColor; flex: none;
}
.block[data-state="sealed"] .state { color: var(--sealed); }
.block[data-state="missed"] .state { color: var(--missed); }
.block[data-state="live"] .state { color: var(--live); }
.block[data-state="locked"] .state { color: var(--mute); }
.count { font-family: var(--font-data); font-size: 0.7rem; color: var(--mute); }

.jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.job { display: flex; align-items: flex-start; gap: 0.6rem; }
.job button {
  display: flex; align-items: flex-start; gap: 0.6rem; width: 100%; text-align: left;
  background: transparent; border: 0; padding: 0.42rem 0.1rem; cursor: pointer; min-height: 2.25rem;
  border-radius: 4px;
}
.job button:disabled { cursor: default; }
.box {
  flex: none; width: 1.1rem; height: 1.1rem; border-radius: 3px;
  border: 1px solid var(--line); margin-top: 0.1rem;
  display: grid; place-items: center; font-size: 0.7rem; color: var(--ink);
  transition: background 0.14s, border-color 0.14s;
}
.job[data-done="true"] .box { background: var(--sealed); border-color: var(--sealed); }
.job[data-missed="true"] .box { border-color: var(--missed); border-style: dashed; }
.job-text { font-size: 0.87rem; line-height: 1.35; min-width: 0; }
.job[data-done="true"] .job-text { color: var(--mute); }
.block[data-state="locked"] .job-text { color: color-mix(in srgb, var(--mute) 62%, transparent); }
.needs-photo {
  font-family: var(--font-data); font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--live); border: 1px solid color-mix(in srgb, var(--live) 40%, transparent);
  border-radius: 3px; padding: 0.05rem 0.3rem; margin-left: 0.4rem; white-space: nowrap;
}
.job[data-done="true"] .needs-photo { color: var(--sealed); border-color: color-mix(in srgb, var(--sealed) 40%, transparent); }
.proof {
  margin: 0.15rem 0 0.5rem 1.7rem; border: 1px solid var(--line); border-radius: 5px;
  overflow: hidden; max-width: 9rem;
}
.proof-img { aspect-ratio: 4 / 3; display: grid; place-items: center; font-size: 1.4rem; }
.proof span {
  display: block; font-family: var(--font-data); font-size: 0.56rem; color: var(--mute);
  padding: 0.24rem 0.4rem; border-top: 1px solid var(--line); letter-spacing: 0.04em;
}
.sealed-note {
  font-family: var(--font-data); font-size: 0.63rem; color: var(--mute);
  letter-spacing: 0.04em; margin-top: 0.5rem;
}
.sealed-note.bad { color: var(--missed); }

/* ---------------------------------------------------------------- handover */
.pane { padding: 1.15rem; }
.pane h2 { font-size: 1rem; margin: 0 0 0.3rem; letter-spacing: -0.01em; }
.pane .sub { color: var(--mute); font-size: 0.82rem; margin: 0 0 1.15rem; }
.chain { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.leg { padding: 0.95rem 1rem; }
.leg + .leg { border-top: 1px solid var(--line); }
.leg-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.55rem;
}
.leg-who { font-family: var(--font-data); font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); }
.leg b { font-size: 0.92rem; }
.sig {
  border: 1px dashed var(--line); border-radius: 5px; padding: 0.8rem;
  display: grid; place-items: center; min-height: 4rem; text-align: center;
}
.sig.signed { border-style: solid; border-color: color-mix(in srgb, var(--sealed) 45%, transparent); }
.sig-name {
  font-family: "Segoe Script", "Bradley Hand", cursive; font-size: 1.35rem; color: var(--chalk);
}
.sig-meta { font-family: var(--font-data); font-size: 0.58rem; color: var(--mute); margin-top: 0.25rem; letter-spacing: 0.06em; }
.btn {
  width: 100%; min-height: 2.75rem; border-radius: 5px; cursor: pointer;
  font-family: var(--font-data); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--chalk);
  transition: background 0.14s, border-color 0.14s;
}
.btn:hover { background: var(--panel); }
.btn.primary { background: var(--live); border-color: var(--live); color: var(--ink); font-weight: 600; }
.btn.primary:hover { background: color-mix(in srgb, var(--live) 88%, #fff); }
.btn.danger { color: var(--missed); border-color: color-mix(in srgb, var(--missed) 45%, transparent); }
.btn-row { display: grid; gap: 0.5rem; margin-top: 0.7rem; }
@media (min-width: 24rem) { .btn-row.two { grid-template-columns: 1fr 1fr; } }
.reject-note {
  margin-top: 0.7rem; border-left: 2px solid var(--missed); padding: 0.55rem 0 0.55rem 0.7rem;
  font-size: 0.83rem; color: var(--chalk);
}
.reject-note span { display: block; font-family: var(--font-data); font-size: 0.58rem; color: var(--missed); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.2rem; }

/* ---------------------------------------------------------------- owner */
.owner-head { padding: 1.15rem 1.15rem 0.9rem; }
.owner-head .big {
  font-family: var(--font-data); font-size: 2.5rem; line-height: 1; letter-spacing: -0.03em;
}
.owner-head .big.ok { color: var(--sealed); }
.owner-head .big.warn { color: var(--live); }
.owner-head .big.bad { color: var(--missed); }
.owner-head p { margin: 0.35rem 0 0; color: var(--mute); font-size: 0.85rem; }
.strip { display: flex; gap: 2px; padding: 0 1.15rem 1rem; }
.strip i { flex: 1; height: 2.1rem; border-radius: 2px; position: relative; }
.strip i[data-s="sealed"] { background: color-mix(in srgb, var(--sealed) 78%, transparent); }
.strip i[data-s="missed"] { background: color-mix(in srgb, var(--missed) 78%, transparent); }
.strip i[data-s="live"] { background: color-mix(in srgb, var(--live) 78%, transparent); }
.strip i[data-s="locked"] { background: var(--panel-2); }
.owner-sec { padding: 0 1.15rem 1.2rem; }
.owner-sec h3 {
  font-family: var(--font-data); font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--mute); margin: 0 0 0.65rem; font-weight: 400;
}
.row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.7rem; padding: 0.48rem 0; border-top: 1px solid var(--line); font-size: 0.87rem; }
.row .v { font-family: var(--font-data); font-size: 0.8rem; color: var(--mute); flex: none; }
.row .v.bad { color: var(--missed); }
.row .v.ok { color: var(--sealed); }
.alert {
  border: 1px solid color-mix(in srgb, var(--missed) 40%, transparent);
  background: color-mix(in srgb, var(--missed) 9%, transparent);
  border-radius: 6px; padding: 0.75rem 0.85rem; margin: 0 1.15rem 1.2rem;
}
.alert b { display: block; font-size: 0.87rem; margin-bottom: 0.15rem; }
.alert p { margin: 0; font-size: 0.8rem; color: var(--mute); }
.alert .when { font-family: var(--font-data); font-size: 0.58rem; color: var(--missed); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.35rem; }

/* ---------------------------------------------------------------- prose sections */
.section { border-top: 1px solid var(--line); padding: clamp(2.75rem, 6vw, 4.5rem) 0; }
.section h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.025em; margin: 0 0 0.9rem; max-width: 28ch; text-wrap: balance; }
.section p { color: var(--mute); max-width: 54ch; margin: 0 0 1rem; }
.two-col { display: grid; gap: clamp(1.5rem, 4vw, 3rem); }
@media (min-width: 52rem) { .two-col { grid-template-columns: 1fr 1fr; } }
.trade-note {
  border: 1px solid var(--line); border-radius: 8px; padding: 1.15rem 1.25rem; background: var(--panel);
}
.trade-note h3 { margin: 0 0 0.4rem; font-size: 0.95rem; }
.trade-note p { font-size: 0.88rem; margin: 0; }
footer { border-top: 1px solid var(--line); padding: 2rem 0 3rem; }
footer p { color: var(--mute); font-size: 0.8rem; margin: 0; }
footer a { color: var(--chalk); }

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