/* ART identity 1.0: Void / Ivory / Graphite, Pulse once per screen, 0 px corners, 1 px lines, 8 px grid. */
@font-face { font-family: "Archivo"; src: url("/fonts/Archivo-Variable.ttf") format("truetype"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/SpaceGrotesk-Variable.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/JetBrainsMono-Variable.ttf") format("truetype"); font-weight: 100 800; font-display: swap; }

:root {
  --void: #000000; --ivory: #F8FAED; --pulse: #9A0D1B; --pulse-hover: #7D0A16; --graphite: #161616; --white: #FFFFFF;
  --mist: #C9CABF; --ash: #9A9A9A; --line: #2A2A2A; --line-2: #444444;
  --top: env(safe-area-inset-top, 0px); --bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; border-radius: 0; }
html { background: var(--void); -webkit-text-size-adjust: 100%; }
body {
  background: var(--void); color: var(--ivory); min-height: 100dvh;
  font: 400 18px/1.5 "Space Grotesk", system-ui, sans-serif;
  padding: calc(var(--top) + 8px) 16px calc(var(--bottom) + 96px);
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }

.top { display: flex; align-items: center; justify-content: space-between; height: 48px; margin-bottom: 24px; }
.logo { height: 24px; width: auto; display: block; }

.mono, label { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ash); }
.muted { color: var(--ash); }
.display {
  font-family: "Archivo", sans-serif; font-weight: 900; font-stretch: 125%; font-variation-settings: "wdth" 125;
  text-transform: uppercase; font-size: 48px; line-height: 0.92; letter-spacing: -0.01em; margin-bottom: 24px;
}
.lead { color: var(--mist); margin-bottom: 32px; }
.note { color: var(--ash); font-size: 14px; margin-top: 24px; }
h2 { font-weight: 700; font-size: 22px; line-height: 1.2; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 24px 0 8px; }

input {
  font: inherit; color: var(--ivory); background: var(--graphite); border: 1px solid var(--line-2);
  height: 56px; padding: 0 16px; width: 100%; outline: none;
}
input:focus { border-color: var(--ivory); }

.btn {
  font: 500 18px/1 "Space Grotesk", sans-serif; color: var(--ivory); background: transparent;
  border: 1px solid var(--line-2); min-height: 56px; padding: 0 24px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; width: 100%;
}
.btn:active { background: var(--graphite); }
.btn.pulse { background: var(--pulse); border-color: var(--pulse); color: var(--ivory); }
.btn.pulse:active, .btn.pulse:hover { background: var(--pulse-hover); }
.btn.small { min-height: 40px; font-size: 14px; width: auto; padding: 0 16px; }
.btn.ghost { border-color: var(--line-2); }
.btn[disabled] { opacity: 0.4; }
.err { color: var(--ivory); min-height: 16px; }

.card { background: var(--graphite); border: 1px solid var(--line); padding: 16px; }
.card.alert { background: var(--pulse); border-color: var(--pulse); }
.card.alert .mono, .card.alert dt { color: var(--ivory); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 16px; }
.state { display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; background: var(--ivory); display: inline-block; }
.dot.off { background: transparent; border: 1px solid var(--ash); }

dl.data { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
dl.data > div { padding: 8px 0; border-bottom: 1px solid var(--line); }
dl.data > div:nth-child(odd) { padding-right: 8px; border-right: 1px solid var(--line); }
dl.data > div:nth-child(even) { padding-left: 8px; }
dt { font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ash); }
dd { font-family: "JetBrains Mono", monospace; font-size: 16px; color: var(--ivory); overflow-wrap: anywhere; }
.card .btn { margin-top: 16px; }
.problem { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }

a.link { display: flex; justify-content: space-between; align-items: center; color: var(--ivory); text-decoration: none; }
a.link h2 { font-size: 20px; }
a.link .arrow { font-family: "JetBrains Mono", monospace; color: var(--ash); }

.notes { list-style: none; border-top: 1px solid var(--line); }
.notes li { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 16px 1fr; gap: 0 8px; }
.notes li .mark { width: 8px; height: 8px; margin-top: 8px; background: var(--ivory); }
.notes li.read .mark { background: transparent; }
.notes li.read .t { color: var(--mist); font-weight: 500; }
.notes .t { font-weight: 700; line-height: 1.3; }
.notes .b { color: var(--mist); font-size: 16px; }
.notes .m { grid-column: 2; margin-top: 4px; }
.notes a { color: var(--ivory); }

#push-box h2 { margin-bottom: 8px; }
#push-box p { color: var(--mist); font-size: 16px; }
#push-box ol { margin: 8px 0 0 24px; color: var(--mist); font-size: 16px; }

.forecast { margin-top: 16px; font-size: 16px; color: var(--ivory); }
.card .btn + .btn { margin-top: 8px; }
.back { display: inline-block; text-decoration: none; margin-bottom: 16px; padding: 8px 0; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0; }
.actions:empty { display: none; }
.actions .btn { width: 100%; }
fieldset { border: 0; border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 16px; }
legend { padding-right: 8px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field .inline { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.field .help { color: var(--ash); font-size: 14px; }
select {
  font: inherit; color: var(--ivory); background: var(--graphite); border: 1px solid var(--line-2);
  height: 56px; padding: 0 16px; width: 100%; appearance: none; border-radius: 0;
}
select:focus { border-color: var(--ivory); outline: none; }
.check { appearance: none; width: 48px; height: 28px; border: 1px solid var(--line-2); background: var(--graphite); position: relative; cursor: pointer; flex: none; padding: 0; }
.check::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: var(--ash); }
.check:checked { border-color: var(--ivory); }
.check:checked::after { left: 23px; background: var(--ivory); }
.cmds { list-style: none; border-top: 1px solid var(--line); margin-top: 8px; }
.cmds li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
#device-status > div { margin-top: 16px; }
.help { color: var(--ash); font-size: 14px; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--void); border-top: 1px solid var(--line); padding-bottom: var(--bottom);
}
.tabs a {
  height: 64px; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  font-family: "JetBrains Mono", monospace; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ash);
}
.tabs a.on { color: var(--ivory); box-shadow: inset 0 1px 0 var(--ivory); }
.tabs b { font-weight: 400; color: var(--void); background: var(--ivory); padding: 0 4px; letter-spacing: 0; }
