/* The Long Shift — one stylesheet, no framework.
   The world: the works. Painted walls, the rota board, a hi-vis vest, a clock card. */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --ink: #22304a;        /* painted wall */
  --ink-deep: #16213a;
  --paper: #edefea;      /* stone */
  --chalk: #ffffff;
  --text: #2a2e35;
  --muted: #5f6873;
  --rule: #c9cdc6;
  --hivis: #f2b21b;      /* you are here */
  --brick: #9b3b2e;      /* separated */
  --grass: #3d6b4a;      /* a stream that is open */

  --display: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;

  --measure: 64ch;
  --gutter: clamp(16px, 4vw, 56px);
  --wall: 6px;
  --wall-thick: 12px;
  --max: 1200px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #d8dde6;
    --ink-deep: #eef1f5;
    --paper: #171c26;
    --chalk: #1f2531;
    --text: #e4e7ec;
    --muted: #9aa3b0;
    --rule: #39414e;
  }
}
:root[data-theme="dark"] {
  --ink: #d8dde6; --ink-deep: #eef1f5; --paper: #171c26; --chalk: #1f2531;
  --text: #e4e7ec; --muted: #9aa3b0; --rule: #39414e;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2.5px; }
:focus-visible { outline: 3px solid var(--hivis); outline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--display);
  font-variation-settings: 'opsz' 96;
  color: var(--ink-deep);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 0 0 0.5em;
  font-weight: 800;
}
h1 { font-size: clamp(2.8rem, 9vw, 7rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.8rem); font-weight: 800; }
h3 { font-size: 1.3rem; font-weight: 700; margin-top: 1.6em; letter-spacing: -0.01em; font-variation-settings: 'opsz' 24; }
p, li { max-width: var(--measure); }
p { margin: 0 0 1em; }
small, .small { font-size: 0.9rem; color: var(--muted); }

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

/* Header: the name on the wall, the doors */
.site-head { border-bottom: var(--wall-thick) solid var(--ink); background: var(--paper); }
.site-head .wrap {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 28px;
  padding-top: 20px; padding-bottom: 14px;
}
.brand {
  font-family: var(--display); font-variation-settings: 'opsz' 48; font-weight: 800; font-size: 1.5rem;
  color: var(--ink-deep); text-decoration: none; letter-spacing: -0.02em;
}
.doors { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-left: auto; }
.doors a {
  font-family: var(--display); font-weight: 700; font-size: 1.05rem;
  text-decoration: none; color: var(--ink); padding: 6px 0 4px;
  border-bottom: 4px solid transparent;
}
.doors a:hover { border-bottom-color: var(--rule); }
.doors a[aria-current="page"] { border-bottom-color: var(--hivis); }

/* The rota: four stages across the board */
.stages { background: var(--chalk); border-bottom: var(--wall) solid var(--ink); }
.stages .wrap { padding-left: 0; padding-right: 0; }
.rota { display: grid; grid-template-columns: repeat(4, 1fr); }
.rota .lede { display: none; }
.stage-btn {
  font: inherit; cursor: pointer; text-align: left;
  background: transparent; color: var(--text);
  border: 0; border-right: 1.5px solid var(--rule); border-top: 6px solid transparent;
  padding: 12px var(--gutter) 14px; min-height: 76px;
  display: flex; flex-direction: column; justify-content: flex-start; gap: 3px;
}
.stage-btn:last-child { border-right: 0; }
.stage-btn .name { font-family: var(--display); font-weight: 700; font-size: 1.05rem; line-height: 1.1; letter-spacing: -0.01em; }
.stage-btn .sub { font-size: 0.85rem; color: var(--muted); }
.stage-btn:hover { background: var(--paper); }
.stage-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-top-color: var(--hivis); }
.stage-btn[aria-pressed="true"] .sub { color: var(--paper); opacity: .75; }
.stage-btn.separated[aria-pressed="true"] { background: var(--brick); color: #fff; }
.stage-btn.separated[aria-pressed="true"] .sub { color: #fff; }
.stages .prompt { display: block; padding: 8px var(--gutter) 0; font-size: 0.85rem; color: var(--muted); }

/* Home hero: the floor plan is the page */
.hero { padding-top: clamp(28px, 5vw, 72px); padding-bottom: clamp(28px, 5vw, 64px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.hero h1 { margin-bottom: 0.3em; font-size: clamp(2.6rem, 6.4vw, 5.6rem); }
.hero p.lead { font-size: 1.25rem; line-height: 1.4; }
.hero p.lead strong { color: var(--ink-deep); }

.plan {
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  gap: var(--wall-thick);
  background: var(--ink);
  border: var(--wall-thick) solid var(--ink);
  aspect-ratio: 1 / 1;
  width: 100%;
}
.plan a {
  background: var(--chalk); text-decoration: none; color: var(--ink-deep);
  padding: clamp(14px, 3vw, 28px); display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
}
.plan a:hover, .plan a:focus-visible { background: var(--hivis); outline-offset: -6px; }
.plan .room-name { font-family: var(--display); font-variation-settings: 'opsz' 96; font-weight: 800; font-size: clamp(1.6rem, 4.2vw, 3rem); line-height: 0.95; letter-spacing: -0.03em; }
.plan .room-what { color: var(--muted); font-size: 0.98rem; margin: 10px 0 0; max-width: 24ch; line-height: 1.35; }
.plan a:hover .room-what, .plan a:focus-visible .room-what { color: var(--ink-deep); }
.plan a::after {
  /* the doorway: a gap in the wall */
  content: ""; position: absolute; width: 36%; height: var(--wall-thick); background: var(--chalk);
}
.plan a:nth-child(1)::after { bottom: calc(-1 * var(--wall-thick)); right: 10%; }
.plan a:nth-child(2)::after { bottom: calc(-1 * var(--wall-thick)); left: 10%; }
.plan a:nth-child(3)::after { top: calc(-1 * var(--wall-thick)); right: 10%; }
.plan a:nth-child(4)::after { top: calc(-1 * var(--wall-thick)); left: 10%; }
.plan a:hover::after, .plan a:focus-visible::after { background: var(--hivis); }
.plan .room-live { font-size: 0.85rem; color: var(--muted); }
.plan .room-live b { color: var(--grass); font-weight: 700; }
.plan a:hover .room-live, .plan a:hover .room-live b { color: var(--ink-deep); }

/* Sections: headings sit on a wall */
.section { padding-top: clamp(28px, 4vw, 56px); padding-bottom: clamp(28px, 4vw, 56px); }
.section h2 { margin-bottom: 0.5em; padding-top: 14px; border-top: var(--wall) solid var(--ink); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 28px 56px; }

/* A room page: the band */
.band { background: var(--ink); color: var(--paper); }
.band .wrap { padding-top: clamp(32px, 6vw, 80px); padding-bottom: clamp(28px, 5vw, 64px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px clamp(24px, 5vw, 72px); align-items: end; }
.band h1 { color: var(--paper); margin: 0; font-size: clamp(3.4rem, 12vw, 9.5rem); }
.band .lead { font-size: 1.2rem; line-height: 1.45; margin: 0; max-width: 46ch; }
.band .lead.caution { font-size: 0.95rem; opacity: .8; margin-top: 10px; }
.band .mark { display: inline-block; width: 44px; height: 8px; background: var(--hivis); margin-bottom: 18px; }
.room-head { padding-top: clamp(28px, 5vw, 56px); padding-bottom: clamp(16px, 3vw, 32px); }

/* Streams: the noticeboard */
.stream {
  background: var(--chalk);
  border-top: var(--wall-thick) solid var(--grass);
  padding: 18px var(--gutter) 22px; margin: 0 0 32px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 32px; align-items: center;
}
.stream h3 { margin: 0; grid-column: 1; }
.stream .who { color: var(--muted); font-size: 0.95rem; margin: 0; grid-column: 1; }
.stream .empty { margin: 0; grid-column: 1; }
.stream .join {
  grid-column: 2; grid-row: 1 / span 3; align-self: center;
  display: inline-block; padding: 14px 22px;
  background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 700;
  font-family: var(--display); font-size: 1.05rem; white-space: nowrap;
}
.stream .join:hover { background: var(--hivis); color: var(--ink-deep); }
.stream .join.secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.stream .join.secondary:hover { background: var(--ink); color: var(--paper); }
.stream.not-open { border-top-color: var(--rule); }

/* Guidance: walls, not cards */
.guide { margin: 0 0 36px; }
.guide h3 { margin: 0 0 10px; padding-top: 12px; border-top: var(--wall) solid var(--ink); }
.guide ul, .guide ol { padding-left: 0; list-style: none; margin: 0; }
.guide li { margin: 0 0 10px; padding-left: 22px; position: relative; }
.guide li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 10px; height: 10px; background: var(--hivis); }
.guide.brick h3 { border-top-color: var(--brick); }
.guide.brick li::before { background: var(--brick); }
.separated-note { border-left: var(--wall) solid var(--brick); padding: 8px 16px; margin: 20px 0; }

/* Calculator: the clock card */
.calc {
  background: var(--chalk);
  border-top: var(--wall-thick) solid var(--ink);
  padding: clamp(18px, 3vw, 32px) var(--gutter);
  margin: 0 calc(-1 * var(--gutter)) 36px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px clamp(28px, 5vw, 64px);
}
.calc h2 { grid-column: 1 / -1; margin-bottom: 0; }
.calc .note { grid-column: 1 / -1; margin: 0 0 8px; }
.calc form { display: grid; gap: 16px; }
.field label { display: block; font-weight: 700; margin-bottom: 5px; }
.field .help { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.field input[type="number"], .field select {
  font: inherit; width: 100%; max-width: 340px;
  padding: 10px 12px; border: 2px solid var(--ink); border-radius: 0;
  background: var(--paper); color: var(--text);
}
.field input:focus, .field select:focus { outline: 3px solid var(--hivis); outline-offset: 0; }
.inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline input[type="number"] { max-width: 180px; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--ink); }

.result { background: var(--paper); border: 2px solid var(--ink); padding: 18px 22px 20px; align-self: start; position: relative; }
.result::before { content: ""; position: absolute; top: -2px; left: -2px; right: -2px; height: 10px; background: var(--hivis); }
.result .per { color: var(--muted); margin: 10px 0 0; }
.result .headline { font-family: var(--display); font-variation-settings: 'opsz' 96; font-weight: 800; font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1; color: var(--ink-deep); margin: 2px 0 2px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.result dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 16px 0 14px; padding-top: 12px; border-top: 2px solid var(--ink); }
.result dt { color: var(--muted); }
.result dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.result .steps { margin: 0; padding-left: 1.1em; color: var(--muted); font-size: 0.95rem; }
.result .steps li { margin-bottom: 4px; }
.result .warn { color: var(--brick); font-weight: 700; }

/* Planner */
.planner table { width: 100%; border-collapse: collapse; max-width: 640px; }
.planner th, .planner td { text-align: left; padding: 8px 6px; border-bottom: 1.5px solid var(--rule); }
.planner td:last-child, .planner th:last-child { text-align: right; }
.planner input { font: inherit; width: 110px; padding: 6px 8px; border: 2px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--text); text-align: right; }
.planner tfoot td { font-weight: 700; border-bottom: none; border-top: var(--wall) solid var(--ink); font-family: var(--display); font-size: 1.3rem; font-variant-numeric: tabular-nums; }

/* Urgent */
.urgent { background: var(--chalk); border-left: var(--wall-thick) solid var(--brick); padding: 14px 20px; }
.urgent p { margin: 0; }

/* Footer: the base of the wall */
.site-foot { background: var(--ink); color: var(--paper); margin-top: 48px; }
.site-foot .wrap { padding-top: 36px; padding-bottom: 44px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px 48px; }
.site-foot p { margin: 0 0 6px; font-size: 0.95rem; }
.site-foot .small { color: var(--paper); opacity: .7; }
.site-foot .brand { color: var(--paper); display: inline-block; margin-bottom: 10px; }
.site-foot a { color: var(--paper); }

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .band .wrap { grid-template-columns: 1fr; }
  .calc { grid-template-columns: 1fr; }
  .doors { margin-left: 0; width: 100%; gap: 2px 16px; }
  .doors a { font-size: 1rem; }
  .rota { grid-template-columns: 1fr 1fr; }
  .stage-btn { border-bottom: 1.5px solid var(--rule); min-height: 64px; padding: 10px 16px; }
  .stage-btn:nth-child(2n) { border-right: 0; }
  .stage-btn:nth-last-child(-n+2) { border-bottom: 0; }
  .stream { grid-template-columns: 1fr; }
  .stream .join { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  .stage-btn, .doors a, .plan a, .plan a::after, .stream .join { transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
}
