/* ==========================================================================
   NRTCCA booth entry page
   Palette lifted from the vis|ability logo assets:
     #FFB71B  brand amber (the pipe in vis|ability)
     #F9B83D  secondary amber
     #293341  slate (dark wordmark variant)
   Amber stays the brand voice; red and green are reserved for lamp state, so
   they never compete with it.
   ========================================================================== */

:root {
  --bg:        #10161F;
  --bg-2:      #151E29;
  --panel:     #1A2431;
  --slate:     #293341;
  --line:      #2C3949;

  --amber:     #FFB71B;
  --amber-2:   #F9B83D;

  --alarm:     #E8433F;
  --alarm-dim: #7E1F1E;
  --go:        #35C46B;
  --go-dim:    #1B5E36;

  --text:      #EEF3F9;
  --muted:     #8A99AC;

  --font:      'Sora', system-ui, -apple-system, sans-serif;
  --mono:      'IBM Plex Mono', ui-monospace, monospace;

  --pulse:     1500ms;   /* keep in step with the lamp `rate` value */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background:
    radial-gradient(120% 80% at 50% -10%, var(--bg-2) 0%, var(--bg) 60%);
}

/* ---------- brand bar ---------- */

.brand {
  padding: 22px 20px 0;
  display: flex;
  justify-content: center;
}

.brand img {
  height: 34px;
  width: auto;
}

/* ---------- stage ---------- */

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 28px 22px 34px;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- annunciator (the signature element) ---------- */

.annunciator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.lamp {
  width: clamp(96px, 30vw, 132px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  position: relative;
}

.lamp-core {
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--go);
  box-shadow: 0 0 34px 4px color-mix(in srgb, var(--go) 55%, transparent);
  transition: background 240ms ease, box-shadow 240ms ease;
}

/* state colouring */
[data-state="emergency"] .lamp-core {
  background: var(--alarm);
  box-shadow: 0 0 42px 6px color-mix(in srgb, var(--alarm) 60%, transparent);
}

[data-state="working"] .lamp-core {
  background: var(--amber);
  box-shadow: 0 0 38px 5px color-mix(in srgb, var(--amber) 55%, transparent);
  animation: breathe var(--pulse) ease-in-out infinite;
}

[data-state="fault"] .lamp-core {
  background: var(--slate);
  box-shadow: none;
}

/* the page breathes only while the system is genuinely in motion.
   set BREATHE_WHEN_ACTIVE in config.js once the lamps run in breathe mode. */
.breathe-active[data-state="emergency"] .lamp-core {
  animation: breathe var(--pulse) ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.42; transform: scale(0.94); }
  50%      { opacity: 1;    transform: scale(1); }
}

.state {
  margin: 0;
  font-size: clamp(26px, 8vw, 36px);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.05;
}

.state-sub {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 34ch;
}

/* ---------- panels ---------- */

.panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel[hidden] { display: none; }

/* ---------- buttons ---------- */

.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 22px 20px;
  font-family: var(--font);
  font-size: clamp(17px, 4.6vw, 21px);
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, filter 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.985); }

.btn:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

.btn-alarm {
  background: var(--alarm);
  color: #fff;
  padding-block: 30px;
  box-shadow: 0 10px 30px -12px var(--alarm);
}

.btn-alarm:hover { filter: brightness(1.07); }

.btn-portal {
  background: var(--amber);
  color: #17202B;
}

.btn-portal:hover { filter: brightness(1.06); }

.btn-quiet {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 16px;
  padding: 16px 20px;
}

.btn-quiet:hover { color: var(--text); border-color: var(--slate); }

.btn[disabled] { opacity: 0.45; pointer-events: none; }

/* ---------- checklist ---------- */

.checklist {
  list-style: none;
  margin: 0;
  padding: 18px 18px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checklist li {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  font-size: 15px;
  color: var(--muted);
  transition: color 200ms ease;
}

.checklist li + li { border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }

.tick {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line);
  justify-self: center;
  position: relative;
}

.at {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--slate);
}

li[data-done="1"] { color: var(--text); }

li[data-done="1"] .tick {
  border-color: var(--go);
  background: var(--go);
}

li[data-done="1"] .tick::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 4px;
  height: 8px;
  border: solid #0F1720;
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}

li[data-done="1"] .at { color: var(--muted); }

li[data-running="1"] { color: var(--text); }

li[data-running="1"] .tick {
  border-color: var(--amber);
  animation: breathe var(--pulse) ease-in-out infinite;
}

.slow {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

/* ---------- error ---------- */

.err {
  margin: 0;
  padding: 16px 18px;
  background: color-mix(in srgb, var(--alarm) 12%, var(--panel));
  border: 1px solid var(--alarm-dim);
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- footer ---------- */

.foot {
  padding: 0 20px 22px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
}

/* ---------- accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-state="working"] .lamp-core,
  li[data-running="1"] .tick { opacity: 1; }
}
