@font-face {
  font-family: "Bedstead";
  src: url("fonts/bedstead.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "Bedstead";
  src: url("fonts/bedstead-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

/* Bedstead draws every glyph on a 6x10 cell where one pixel is 0.1em, so sizes in
   multiples of 10px keep pixels on whole device pixels. */
:root {
  --black: #0B0B0C;
  --signal: #F2EAD3;
  --sun: #F6B92B;
  --land: #6CB33F;
  --water: #3DB9B0;
  --cold: #2160C4;
  --alert: #E2559F;
  --live: #E8483B;
  --dim: #A19E92;
  --off: #3A3935;
  --px: 2px;
  --cell: 20px;
  --gutter: clamp(20px, 4vw, 60px);
  color-scheme: dark;
  accent-color: var(--sun);
  scrollbar-color: var(--cold) var(--black);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding-bottom: 80px;
  background: var(--black);
  color: var(--signal);
  font-family: "Bedstead", ui-monospace, monospace;
  font-size: 20px;
  line-height: 30px;
  font-variant-ligatures: none;
}
::selection { background: var(--sun); color: var(--black); }
input { caret-color: var(--sun); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 400; }

.skip {
  position: absolute; left: 20px; top: -80px; z-index: 20;
  padding: 10px 20px; background: var(--sun); color: var(--black); text-decoration: none;
}
.skip:focus { top: 20px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }

/* Header row: page number, service, clock */
.tt-head { padding: 20px var(--gutter) 0; }
.tt-row {
  display: flex;
  align-items: baseline;
  gap: 0 1ch;
  padding-bottom: 10px;
  border-bottom: 4px solid var(--sun);
  white-space: nowrap;
}
.pg { color: var(--signal); min-width: 4ch; }
.svc { color: var(--sun); }
.tt-msg { color: var(--live); overflow: hidden; text-overflow: clip; }
.tt-date { margin-left: auto; color: var(--signal); }
.tt-time { color: var(--sun); font-variant-numeric: tabular-nums; }
.tt-msg:empty + .tt-date { margin-left: auto; }
.pg-inline { color: var(--signal); }

.page { padding: 60px var(--gutter); scroll-margin-top: 0; }

/* Block-cell display: the glyph is cut into its own pixel cells over a faint unlit grid. */
.cells {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .1em;
  font-size: 100px;
  font-size: clamp(60px, round(down, min(9.6vw, 14.5svh), 10px), 150px);
  line-height: 1;
  letter-spacing: 0;
}
.cl {
  display: block;
  padding: 0 .1em;
  margin-left: -.1em;
  background-color: rgba(242, 234, 211, .07);
  --gap: max(1px, .012em);
  -webkit-mask:
    linear-gradient(90deg, transparent 0 var(--gap), #000 var(--gap)) 0 0 / .1em .1em,
    linear-gradient(180deg, transparent 0 var(--gap), #000 var(--gap)) 0 0 / .1em .1em;
  -webkit-mask-composite: source-in;
  mask:
    linear-gradient(90deg, transparent 0 var(--gap), #000 var(--gap)) 0 0 / .1em .1em,
    linear-gradient(180deg, transparent 0 var(--gap), #000 var(--gap)) 0 0 / .1em .1em;
  mask-composite: intersect;
}
.cl-signal { color: var(--signal); }
.cl-sun { color: var(--sun); }

/* Double-height rows, as the character generator drew them */
.dh {
  display: flex;
  align-items: baseline;
  gap: 1ch;
  height: 80px;
  font-size: 40px;
  line-height: 40px;
}
.dh > span { display: inline-block; transform: scaleY(2); transform-origin: 0 0; }
.dh .pg-inline { font-size: 20px; line-height: 40px; transform: none; align-self: flex-start; }
.dh-land .dh-text { color: var(--land); }
.dh-sun .dh-text { color: var(--sun); }
.dh-water .dh-text { color: var(--water); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 56fr) minmax(0, 44fr);
  gap: 40px clamp(30px, 5vw, 80px);
  align-items: start;
  padding-top: 40px;
  min-height: calc(100svh - 160px);
}
.lede { max-width: 46ch; margin: 30px 0; color: var(--signal); }
.hero-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 30px; }

/* Panels: square, single colour border, title row in the border colour */
.panel { min-width: 0; margin: 0; padding: 20px; border: 4px solid var(--water); }
.panel-title {
  display: flex;
  gap: 1ch;
  margin-bottom: 20px;
  color: var(--water);
  font-size: 20px;
  line-height: 30px;
}
.panel-sub { margin-left: auto; color: var(--sun); }
.panel-desk { border-color: var(--land); }
.panel-desk .panel-title { color: var(--land); }
.panel-status { border-color: var(--alert); }
.panel-status .panel-title { color: var(--alert); }
.panel-water { border-color: var(--water); }
.panel-land { border-color: var(--land); }
.panel-foot { margin-top: 20px; color: var(--land); }

.mosaic { display: block; width: 100%; height: auto; shape-rendering: crispEdges; }
.mz-y { fill: var(--sun); }
.mz-c { fill: var(--signal); }
.mz-w, .mz-w-a, .mz-w-b, .mz-w-c { fill: var(--water); }
.mz-b { fill: var(--cold); }
.mz-g { fill: var(--land); }
.mz-m { fill: var(--alert); }
.mz-r { fill: var(--live); }
.mz-w-a, .mz-w-b { animation: flash 1.2s steps(1, end) infinite; }
.mz-w-c { animation: flash 1.2s steps(1, end) infinite reverse; }
@keyframes flash { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.status { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.status > div { display: flex; align-items: center; gap: 1ch; }
.status dt::after {
  content: " ....................................";
  color: var(--off);
}
.status dt { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.status dd { margin: 0; flex: none; }

.chip { display: inline-block; padding: 0 10px; line-height: 30px; }
.chip-dev { background: var(--sun); color: var(--black); }
.chip-off { background: var(--off); color: var(--signal); }
.chip-open { background: var(--land); color: var(--black); }

/* Waitlist */
.wait { max-width: 36em; }
.wait-label { display: block; margin-bottom: 10px; color: var(--sun); text-transform: uppercase; }
.wait-row { display: flex; flex-wrap: wrap; gap: 20px; }
input[type="email"] {
  flex: 1 1 14em;
  min-width: 0;
  height: 60px;
  padding: 0 20px;
  border: 4px solid var(--signal);
  border-radius: 0;
  background: var(--black);
  color: var(--signal);
  font: inherit;
}
input[type="email"]::placeholder { color: var(--dim); opacity: 1; }
input[type="email"]:focus-visible { outline: none; border-color: var(--sun); box-shadow: 0 0 0 4px var(--black), 0 0 0 7px var(--sun); }
input[aria-invalid="true"] { border-color: var(--live); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 2ch;
  height: 60px;
  padding: 0 20px;
  border: 0;
  border-radius: 0;
  background: var(--cold);
  color: var(--signal);
  font: inherit;
  text-transform: uppercase;
  cursor: pointer;
}
.btn-arrow { display: inline-flex; color: var(--sun); }
.mosaic-arrow { width: .4em; height: .7em; }
.mz-cur { fill: currentColor; }
.sub-btn .mosaic-arrow { margin: 0 auto; }
.btn:hover { background: var(--signal); color: var(--cold); }
.btn:hover .btn-arrow { color: var(--cold); }
.btn:active { background: var(--sun); color: var(--black); }
.btn[disabled] { cursor: progress; background: var(--off); }
.btn[disabled] .btn-arrow { animation: flash .6s steps(1, end) infinite; }
.wait-hint { margin-top: 10px; color: var(--dim); }
.wait-hint.is-error { color: var(--live); }

/* P401: confirmation arrives one row at a time */
.done { max-width: 36em; padding: 20px; border: 4px solid var(--land); }
.done .row + .row { margin-top: 10px; }
.done-head { color: var(--land); }
.done .mosaic-tick { width: 132px; }
.done-title { height: 60px; color: var(--land); font-size: 30px; line-height: 30px; }
.done-title span { display: inline-block; transform: scaleY(2); transform-origin: 0 0; }
.done-copy { color: var(--signal); }
.again {
  padding: 0;
  border: 0;
  background: none;
  color: var(--water);
  font: inherit;
  text-decoration: underline 2px;
  text-underline-offset: 6px;
  cursor: pointer;
}
.again:hover { color: var(--signal); }
.is-arriving .row { visibility: hidden; animation: arrive 0s linear forwards; }
.is-arriving .row:nth-child(1) { animation-delay: .05s; }
.is-arriving .row:nth-child(2) { animation-delay: .25s; }
.is-arriving .row:nth-child(3) { animation-delay: .45s; }
.is-arriving .row:nth-child(4) { animation-delay: .65s; }
.is-arriving .row:nth-child(5) { animation-delay: .85s; }
@keyframes arrive { to { visibility: visible; } }
.tt-head.is-searching .pg { color: var(--sun); }

/* P200 */
.page-lede { margin: 20px 0 40px; max-width: 46ch; }
.build { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
.build .mosaic-icon { width: 160px; margin-bottom: 20px; }
.build-name { margin-bottom: 10px; color: var(--sun); font-size: 30px; line-height: 30px; }
.panel-water .build-name { color: var(--water); }
.panel-land .build-name { color: var(--land); }
.build-meta { margin-top: 20px; color: var(--dim); }
.note { margin-top: 30px; color: var(--dim); }

/* P300: subpages cycle like a teletext carousel */
.subpages { max-width: 920px; border-top: 4px solid var(--sun); }
.sub-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 0; }
.sub-count { color: var(--sun); font-variant-numeric: tabular-nums; }
.sub-ctl { display: flex; gap: 10px; }
.sub-ctl[hidden] { display: none; }
.sub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  height: 40px;
  padding: 0 10px;
  border: 4px solid var(--sun);
  border-radius: 0;
  background: var(--black);
  color: var(--sun);
  font: inherit;
  cursor: pointer;
}
.sub-btn:hover { background: var(--sun); color: var(--black); }
.sub-hold[aria-pressed="true"] { background: var(--sun); color: var(--black); }
.subpage { padding: 20px 0 30px; border-bottom: 2px solid var(--off); }
.subpage h3 { margin-bottom: 10px; color: var(--signal); font-size: 30px; line-height: 40px; }
.subpage p { max-width: 52ch; color: var(--signal); }
.js .subpages.is-cycling .subpage { display: none; border-bottom: 0; min-height: 190px; }
.js .subpages.is-cycling .subpage.is-on { display: block; }

/* P400 */
.join-grid { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 40px clamp(30px, 5vw, 80px); align-items: start; margin-top: 30px; }
.join-copy { margin-bottom: 30px; max-width: 40ch; }

/* Footer */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 30px;
  margin: 20px var(--gutter) 0;
  padding: 20px 0 30px;
  border-top: 4px solid var(--cold);
  color: var(--dim);
}
.foot-tip { color: var(--sun); }

/* Fastext: the four colour keys */
.fastext {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 4px;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: var(--black);
  border-top: 4px solid #1A1A1C;
}
.fx {
  display: flex;
  align-items: center;
  gap: 1ch;
  height: 40px;
  padding: 0 10px;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
}
.fx-short { display: none; }
.fx-key { flex: none; width: 20px; height: 20px; background: currentColor; }
.fx-red { color: var(--live); }
.fx-green { color: var(--land); }
.fx-yellow { color: var(--sun); }
.fx-cyan { color: var(--water); }
.fx:hover, .fx.is-here { background: currentColor; }
.fx:hover, .fx.is-here { color: var(--black); }
.fx-red:hover, .fx-red.is-here { background: var(--live); }
.fx-green:hover, .fx-green.is-here { background: var(--land); }
.fx-yellow:hover, .fx-yellow.is-here { background: var(--sun); }
.fx-cyan:hover, .fx-cyan.is-here { background: var(--water); }
.fx:hover .fx-key, .fx.is-here .fx-key { background: var(--black); }

/* Responsive: the grid scales in whole cells */
@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (max-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 40px; }
  .cells { font-size: clamp(50px, round(down, 18vw, 10px), 110px); }
  .lede { margin: 30px 0; }
  .tt-date { display: none; }
  .tt-msg:empty + .tt-date + .tt-time, .tt-time { margin-left: auto; }
  .build { grid-template-columns: minmax(0, 1fr); }
  .join-grid { grid-template-columns: minmax(0, 1fr); }
  .join-grid .mosaic-envelope { width: 180px; }
  .dh { font-size: 30px; line-height: 30px; height: 60px; }
  .dh .pg-inline { line-height: 30px; }
  .foot-tip { display: none; }
}

@media (max-width: 520px) {
  body { font-size: 20px; line-height: 30px; }
  .page { padding-top: 50px; padding-bottom: 50px; }
  .wait-row { flex-direction: column; }
  input[type="email"] { flex: none; }
  .btn { width: 100%; }
  .fastext { gap: 0 2px; padding-left: 10px; padding-right: 10px; }
  .fx { flex-direction: column; justify-content: center; gap: 4px; height: 50px; padding: 0 4px; }
  .fx-key { width: 100%; height: 6px; }
  .fx-long { display: none; }
  .fx-short { display: inline; }
  .dh { font-size: 20px; line-height: 20px; height: 40px; }
  .dh .pg-inline { line-height: 20px; }
  .subpage h3 { font-size: 20px; line-height: 30px; }
  .build-name { font-size: 20px; }
  .done-title { font-size: 20px; line-height: 20px; height: 40px; }
}

@media (max-width: 360px) {
  .sec { display: none; }
  .btn { gap: 1ch; padding: 0 10px; }
}

@media (min-width: 821px) and (max-height: 800px) {
  .tt-head { padding-top: 10px; }
  .hero { padding-top: 20px; }
  .cells { font-size: clamp(60px, round(down, min(9.6vw, 12svh), 10px), 150px); }
  .lede { max-width: 50ch; margin: 20px 0; }
  .wait-label { margin-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mz-w-a, .mz-w-b, .mz-w-c, .btn[disabled] .btn-arrow { animation: none; }
  .is-arriving .row { animation-delay: 0s !important; }
}
