/* Platform Sign: pixel city at dusk. Night-sky blue, cream pixel type, one amber light. */
:root {
  color-scheme: dark;
  --tunnel: #0e1c36;      /* page and input wells */
  --deck: #172a4d;        /* cards */
  --deck-2: #1f355e;
  --steel: #2c4677;       /* lines */
  --steel-2: #4566a3;
  --ink: #f7e9c8;
  --ink-dim: #bccbe6;
  --ink-faint: #8399c2;
  --amber: #ffb347;
  --amber-ink: #ffb347;
  --amber-hot: #ffd37a;
  --amber-glow: rgba(255, 179, 71, 0.32);
  --amber-wash: #2e3040;
  --pink: #e48a8f;
  --danger: #ff6b6b;
  --ok: #7fd18b;
  --shade: #07101f;       /* hard pixel shadows */
  --shadow: 4px 4px 0 var(--shade);
  --radius: 0px;
  --display: "Pixelify Sans", "Silkscreen", ui-monospace, monospace;
  --mono: "Silkscreen", "Pixelify Sans", ui-monospace, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--tunnel); color: var(--ink); }
body {
  font: 400 17px/1.45 var(--display);
  -webkit-font-smoothing: none;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  min-height: 100vh;
  background:
    radial-gradient(circle, rgba(255,255,255,.05) 1px, transparent 1.5px) 0 0 / 8px 8px,
    var(--tunnel);
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- intro ---------- */
#intro { position: fixed; inset: 0; z-index: 50; overflow: hidden; cursor: pointer; background: var(--tunnel); }
#intro .city { position: absolute; left: 0; top: 0; width: 100%; height: clamp(40%, 31vw, 55%); opacity: 0; }
.intro-sign {
  position: absolute; left: 50%; top: max(52%, calc(min(31vw, 55%) + 2%)); transform: translate(-50%, -50%);
  width: min(92vw, 860px); aspect-ratio: 672 / 120; opacity: 0;
  padding: clamp(6px, 1.2vw, 12px); background: #050505;
  box-shadow: 0 0 0 4px var(--shade), 8px 8px 0 4px var(--shade);
}
.intro-sign canvas { width: 100%; height: 100%; display: block; }
.intro-copy { position: absolute; left: 0; right: 0; top: calc(max(52%, calc(min(31vw, 55%) + 2%)) + min(92vw, 860px) * 0.09 + 34px); text-align: center; padding-inline: 16px; }
.intro-line {
  margin: 0; font-size: clamp(28px, 7.4vw, 60px); font-weight: 700; line-height: 1.08; color: var(--ink);
  opacity: 0; transform: translateY(8px); transition: opacity .01s steps(1), transform .3s steps(3);
}
.intro-line.accent { color: var(--amber); }
.intro-line.in { opacity: 1; transform: none; }
#intro .skip {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 16px); right: 16px;
  background: var(--tunnel); border: 2px solid var(--ink); color: var(--ink); box-shadow: 3px 3px 0 var(--shade);
  padding: 6px 12px; font: 400 12px var(--mono); text-transform: uppercase;
}

/* ---------- shell ---------- */
#app { animation: appIn 0.4s steps(4) both; }
@keyframes appIn { from { opacity: 0; } }
.bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px 14px;
  background: var(--tunnel); border-bottom: 2px solid var(--steel);
}
.wordmark { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 18px var(--display); letter-spacing: 0.04em; }
.wordmark b { color: var(--amber); font-weight: 700; margin-left: 6px; }
.wordmark .dots { display: grid; grid-template-columns: repeat(3, 5px); gap: 3px; }
.wordmark .dots i { width: 5px; height: 5px; background: var(--amber); }
.wordmark .dots i:nth-child(2) { opacity: 0.55; }
.wordmark .dots i:nth-child(3) { opacity: 0.25; }
.clock { font: 400 12px var(--mono); color: var(--ink-faint); font-variant-numeric: tabular-nums; }
main { max-width: 600px; margin: 0 auto; padding: 8px 18px 140px; }
.view { display: grid; gap: 22px; animation: viewIn 0.3s steps(3) both; }
@keyframes viewIn { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- type ---------- */
.eyebrow { margin: 0; display: inline-flex; align-items: center; gap: 8px; font: 400 12px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); }
h1 { margin: 10px 0 0; font-size: clamp(38px, 10.5vw, 60px); line-height: 1.02; font-weight: 700; text-wrap: balance; text-shadow: 4px 4px 0 var(--shade); }
h1 em { font-style: normal; color: var(--amber); }
h2 { margin: 0; font-size: 21px; font-weight: 700; }
h3 { margin: 0; font: 400 12px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-dim); }
.lede { margin: 14px 0 0; color: var(--ink-dim); font-size: 17px; max-width: 46ch; }
.hint { margin: 0; color: var(--ink-faint); font-size: 14px; }
.center { text-align: center; }
.error { margin: 0; color: var(--danger); font-size: 14px; }
.section-title { font: 400 12px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 10px; }
.pulse { width: 8px; height: 8px; background: var(--amber); animation: pulse 1s steps(1) infinite; display: inline-block; }
@keyframes pulse { 50% { opacity: 0.2; } }

/* ---------- LED housing ---------- */
.housing {
  position: relative; padding: 10px;
  background: #070708;
  box-shadow: 0 0 0 3px var(--shade), 7px 7px 0 3px var(--shade);
}
.housing::before { /* mounting screws */
  content: ""; position: absolute; inset: 6px; pointer-events: none;
  background: radial-gradient(circle at 0 0, #3a3d44 1.5px, transparent 2px) 0 0 / 100% 100% no-repeat,
              radial-gradient(circle at 100% 0, #3a3d44 1.5px, transparent 2px) 0 0 / 100% 100% no-repeat,
              radial-gradient(circle at 0 100%, #3a3d44 1.5px, transparent 2px) 0 0 / 100% 100% no-repeat,
              radial-gradient(circle at 100% 100%, #3a3d44 1.5px, transparent 2px) 0 0 / 100% 100% no-repeat;
}
.screen { position: relative; aspect-ratio: 672 / 120; overflow: hidden; background: #030303; }
.screen canvas { width: 100%; height: 100%; display: block; }
.screen img { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.screen img.glow { filter: blur(7px) brightness(1.6) saturate(1.3); opacity: 0.75; transform: scale(1.02); }
.screen:has(img)::after { /* turn square pixels into round LEDs */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle, transparent 0 34%, rgba(3,3,3,.92) 44%) 0 0 / calc(100% / 96) calc(100% / 16);
}
.tag {
  position: absolute; top: -11px; left: 18px; display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 8px; background: var(--tunnel); border: 2px solid var(--ink-faint);
  font: 400 10px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-dim);
}
.tag.live { color: var(--amber); border-color: var(--amber); }
.preview-dock { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 58px); z-index: 5; display: grid; gap: 8px; padding-top: 10px; background: var(--tunnel); padding-bottom: 14px; }

/* ---------- controls ---------- */
.card { background: var(--deck); border: 3px solid var(--steel-2); padding: 18px; box-shadow: var(--shadow); }
.stack { display: grid; gap: 14px; margin: 0; padding-left: 0; list-style: none; }
label, .field { display: grid; gap: 8px; }
.field > span, label > span { font: 400 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
input, select {
  font: 500 16px var(--display); color: var(--ink); background: var(--tunnel);
  border: 2px solid var(--steel-2); border-radius: 0; padding: 12px 14px; width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
select option { background: var(--deck); color: var(--ink); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-dim) 50%), linear-gradient(135deg, var(--ink-dim) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 15px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
input:focus, select:focus { outline: none; border-color: var(--amber); box-shadow: 3px 3px 0 var(--shade); background: var(--deck-2); }
input::placeholder { color: var(--ink-faint); }
button { font: 500 16px var(--display); color: var(--ink); background: var(--deck-2); border: 2px solid var(--steel-2); border-radius: 0; padding: 10px 16px; cursor: pointer; box-shadow: 3px 3px 0 var(--shade); }
button:active { transform: translate(3px, 3px); box-shadow: none; }
button:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
button:disabled { opacity: .5; cursor: default; }
button.wide { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px; }
button.wide svg { width: 20px; height: 20px; stroke: var(--amber); stroke-width: 2.2; fill: var(--amber); shape-rendering: crispEdges; }
button.wide svg path, button.wide svg circle[fill="none"] { fill: none; }
button.primary {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--amber); color: var(--tunnel); border: 0; font: 700 19px var(--display); letter-spacing: 0.04em;
  padding: 15px 20px; box-shadow: 5px 5px 0 var(--ink);
}
button.primary:active { box-shadow: none; transform: translate(5px, 5px); }
button.primary .arrow { font-size: 14px; animation: pulse 1s steps(1) infinite; }

button.primary.small { padding: 11px 18px; font-size: 16px; }
button.ghost { background: transparent; border: 2px dashed var(--steel-2); color: var(--ink-dim); padding: 15px; box-shadow: none; }
button.link { background: none; border: 0; box-shadow: none; padding: 6px 0; color: var(--ink-faint); font-weight: 500; text-decoration: underline; text-underline-offset: 4px; justify-self: start; }
button.danger { color: var(--danger); }
.icon-btn { width: 44px; height: 44px; padding: 0; font-size: 20px; flex: none; }

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { padding: 8px 13px; font-size: 15px; background: var(--tunnel); }
.seg button[aria-pressed="true"] { background: var(--amber); color: var(--tunnel); border-color: var(--amber); }

.bullets { display: flex; gap: 10px; flex-wrap: wrap; }
.bullets button {
  width: 46px; height: 46px; border-radius: 50%; padding: 0; border: 0; font: 700 22px var(--display);
  opacity: 0.35; filter: saturate(0.35); box-shadow: none;
}
.bullets button[aria-pressed="true"] { opacity: 1; filter: none; box-shadow: 0 0 0 3px var(--tunnel), 0 0 0 6px var(--ink); }
.b { width: 24px; height: 24px; border-radius: 50%; color: #fff; display: inline-grid; place-items: center; font: 700 14px var(--display); flex: none; }

.dirs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dirs button { text-align: left; display: grid; gap: 3px; padding: 12px 14px; background: var(--tunnel); }
.dirs button > span { font-weight: 700; }
.dirs small { color: var(--ink-faint); font-size: 14px; line-height: 1.25; }
.dirs button[aria-pressed="true"] { border-color: var(--amber); background: var(--amber-wash); }
.dirs button[aria-pressed="true"] small { color: var(--amber); }

.swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.swatches button { width: 38px; height: 38px; padding: 0; border: 2px solid var(--shade); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--tunnel), 0 0 0 6px var(--ink); }

.autocomplete { position: relative; }
.menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; list-style: none; margin: 0; padding: 4px; background: var(--deck); border: 3px solid var(--steel-2); box-shadow: 5px 5px 0 var(--shade); max-height: 280px; overflow-y: auto; }
.menu li { padding: 10px 12px; cursor: pointer; display: flex; gap: 6px; align-items: center; }
.menu li:hover { background: var(--amber); color: var(--tunnel); }

/* ---------- connect ---------- */
.city-wrap { margin: 0 -18px; border-bottom: 3px solid var(--steel); overflow: hidden; }
.city-wrap canvas { display: block; width: 100%; height: 140px; user-select: none; -webkit-user-select: none; }
.hero { padding-top: 4px; }
.demo { margin-top: 6px; }
.code-form { display: grid; gap: 16px; }
.code-boxes { position: relative; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.code-boxes .box {
  flex: 1; aspect-ratio: 0.82; display: grid; place-items: center;
  font: 700 clamp(26px, 8vw, 38px) var(--display); color: var(--ink);
  background: var(--deck); border: 3px solid var(--steel-2); box-shadow: var(--shadow);
}
.code-boxes .box.filled { border-color: var(--ink-dim); }
.code-boxes .box.active { border-color: var(--amber); }
.code-boxes .box.active:empty::after { content: ""; width: 40%; height: 4px; align-self: end; margin-bottom: 22%; background: var(--amber); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.code-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; font-size: 16px; color: transparent; caret-color: transparent; z-index: 2; }
.code-input:focus { box-shadow: none; }
.code-boxes .dash { width: 12px; height: 4px; background: var(--steel-2); flex: none; }
.code-form.shake .code-boxes { animation: shake .4s; }
@keyframes shake { 0%, 40%, 80% { transform: translateX(-8px); } 20%, 60% { transform: translateX(8px); } 100% { transform: none; } }
.code-form.shake .code-boxes { animation-timing-function: steps(1); }

.sign-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sign-item { display: grid; gap: 14px; padding: 16px; cursor: pointer; }
.sign-item:hover { border-color: var(--amber); }
.sign-item .meta { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sign-item strong { font-size: 19px; }
.sign-item small { color: var(--ink-faint); font: 400 11px var(--mono); }
.sign-item .housing { padding: 7px; }
.status { display: inline-flex; align-items: center; gap: 6px; }
.status .dot { width: 8px; height: 8px; background: var(--ink-faint); }
.status .dot.on { background: var(--ok); }

/* ---------- settings ---------- */
.edit-head { display: flex; align-items: center; gap: 12px; }
.title-input { font: 700 28px var(--display); background: transparent; border: 2px solid transparent; padding: 4px 8px; }
.title-input:hover { border-color: var(--steel-2); }
.step { display: grid; gap: 12px; }
.step > header { display: flex; align-items: baseline; gap: 12px; }
.step .num { font: 400 13px var(--mono); color: var(--tunnel); background: var(--amber); padding: 2px 6px; }
.row-head { display: flex; justify-content: space-between; align-items: center; }
.row-card { animation: rise .3s steps(3) both; }
.hero, .demo, .code-form, .step { animation: rise .3s steps(3) both; }
.demo { animation-delay: .08s; } .code-form { animation-delay: .16s; }

.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 18px calc(env(safe-area-inset-bottom, 0px) + 12px);
  background: var(--tunnel); border-top: 3px solid var(--steel-2);
}
.savebar { padding-inline: max(18px, calc((100vw - 600px) / 2)); }
.savebar .error { flex-basis: 100%; }
.dirty { font: 400 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }
.dirty.on { color: var(--amber); }

.toast {
  position: fixed; left: 18px; right: 18px; bottom: calc(env(safe-area-inset-bottom, 0px) + 90px); max-width: 560px; margin: 0 auto; z-index: 60;
  padding: 14px 16px; background: var(--ink); color: var(--tunnel); font-weight: 600; box-shadow: 5px 5px 0 var(--shade);
  animation: toastIn .2s steps(2);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ---------- settings: same palette, clean type. Pixel font only for the title and step numbers ---------- */
#view-edit, #view-edit input, #view-edit select, #view-edit button, .savebar, .savebar button, .toast, .menu {
  font-family: "Inter", system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased;
}
#view-edit { --soft: 0 1px 0 rgba(0,0,0,.25); }
#view-edit .title-input { font: 700 26px var(--display); border-color: transparent; background: transparent; padding-left: 4px; }
#view-edit .title-input:hover { border-color: var(--steel); }
#view-edit .title-input:focus { border-color: var(--amber); background: var(--tunnel); }
#view-edit .step > header h2 { font: 600 18px "Inter", sans-serif; letter-spacing: -0.01em; }
#view-edit .step .num { font: 400 11px var(--mono); }
#view-edit .card { border: 1px solid var(--steel); box-shadow: none; border-radius: 6px; }
.card.stack { padding: 18px; } /* .stack zeroes padding-left for lists; cards keep theirs */
#view-edit .field > span, #view-edit label > span, #view-edit h3 {
  font: 600 11px "Inter", sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint);
}
#view-edit input, #view-edit select { font-size: 16px; font-weight: 500; border-width: 1px; border-color: var(--steel-2); border-radius: 6px; background: var(--tunnel); }
#view-edit input:focus, #view-edit select:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255,179,71,.18); }
#view-edit button { font-size: 15px; font-weight: 500; border-width: 1px; border-radius: 6px; box-shadow: none; }
#view-edit button:active { transform: scale(0.98); }
#view-edit button.wide { font-weight: 600; }
#view-edit .seg button { font-size: 14px; padding: 8px 14px; background: transparent; border-color: var(--steel-2); }
#view-edit .seg button[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--tunnel); font-weight: 600; }
#view-edit .dirs button { border-radius: 6px; border-color: var(--steel-2); }
#view-edit .dirs button > span { font-weight: 600; }
#view-edit .dirs small { font-size: 13px; }
#view-edit .bullets button { font: 700 20px "Helvetica Neue", Helvetica, Arial, sans-serif; border-radius: 50%; }
#view-edit .swatches button { border-radius: 50%; border: 1px solid rgba(255,255,255,.15); }
#view-edit .hint { font-size: 14px; color: var(--ink-faint); }
#view-edit button.ghost { border: 1px dashed var(--steel-2); }
#view-edit button.link { font-weight: 500; }
.menu { border-width: 1px; border-radius: 8px; box-shadow: 0 12px 30px rgba(0,0,0,.35); font-size: 15px; }
.menu li { border-radius: 4px; }
.savebar { border-top-width: 1px; }
.savebar .dirty { font: 500 12px "Inter", sans-serif; letter-spacing: 0.02em; text-transform: none; }
.savebar button.primary { font: 600 15px "Inter", sans-serif; letter-spacing: 0; border-radius: 6px; box-shadow: none; }
.toast { font-weight: 600; border-radius: 8px; box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.b { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }

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

/* schedule */
.hours .day { display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 6px 8px; }
.hours .day > span:first-child { grid-column: 1 / -1; font-size: 14px; color: var(--ink-dim); }
.hours .day small { color: var(--ink-faint); font-size: 13px; }
.hours .day input[type="time"] { padding: 8px 8px; min-width: 0; }
.hours .day .dark-note { grid-column: 1 / 4; font-size: 14px; color: var(--ink-faint); }
#view-edit .hours .day button { padding: 8px 10px; font-size: 13px; background: transparent; border-color: var(--steel-2); }
#view-edit .hours .day button[aria-pressed="true"] { background: var(--steel-2); color: var(--ink); }
.hours .day input[type="time"]::-webkit-calendar-picker-indicator { display: none; }

/* priority docks */
.bike-pick { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.bike-pick .num-tag { font: 600 13px var(--mono); color: var(--ink-faint); width: 16px; text-align: center; }
.bike-pick + small.hint { margin: -4px 0 4px 24px; font-size: 13px; }
