/* MoneyByte look: deep violet ink, the brand purple for actions, hexagons from the logo.
   --p / --p-text are the colours of the project an element belongs to (set by /projects.css). */
@font-face {
  font-family: "Familjen Grotesk"; font-weight: 400 700; font-display: swap;
  src: url("fonts/familjen-grotesk-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Martian Mono"; font-weight: 100 800; font-display: swap;
  src: url("fonts/martian-mono-latin-wght-normal.woff2") format("woff2");
}

:root {
  --bg: #0b0912; --panel: #14111f; --panel-2: #1b172a; --line: #2a2540; --line-2: #3d3660;
  --text: #f2eefb; --muted: #9c95b3;
  --signal: #9600dc; --signal-ink: #ffffff; --signal-text: #cf8cff;
  --ok: #5fe39a; --warn: #ffb547; --bad: #ff6a5c; --wait: #78c2ff; --off: #5d665f;
  --p: var(--signal); --p-text: var(--signal-text);
  --sans: "Familjen Grotesk", "Segoe UI", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; color: var(--text); font: 17px/1.55 var(--sans);
  background-color: var(--bg);
  background-image: radial-gradient(900px 520px at 85% -120px, #9600dc47, transparent 70%),
    radial-gradient(600px 400px at -10% 30%, #9600dc1c, transparent 70%), url("hex.svg");
  background-repeat: no-repeat, no-repeat, repeat;
  min-height: 100vh;
}
a { color: var(--text); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--signal-text); }
code, pre, .mono, input.mono { font-family: var(--mono); font-size: 0.78em; letter-spacing: -0.01em; }
code { overflow-wrap: anywhere; color: #d9d2ea; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); line-height: 1.05; letter-spacing: -0.03em; margin: 0 0 0.6rem; font-weight: 700; }
h2 { font-size: 1.2rem; letter-spacing: -0.01em; margin: 0 0 0.7rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.3rem; }
p { margin: 0 0 0.8rem; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 0.9rem; display: block; margin: 0.3rem 0 0; font-weight: 400; }
.label { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.5rem; }
:focus-visible { outline: 2px solid var(--signal-text); outline-offset: 2px; }

/* Frame */
.top, main, footer { max-width: 980px; margin: 0 auto; padding-left: 1.2rem; padding-right: 1.2rem; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding-top: 1.1rem; padding-bottom: 1.1rem; }
.brand { display: flex; align-items: center; gap: 0.8rem; font-family: var(--mono); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; }
.brand img { display: block; filter: drop-shadow(0 4px 10px #9600dc88); }
.top nav { display: flex; align-items: center; gap: 1.3rem; font-size: 0.95rem; }
.top nav form { margin: 0; }
main { padding-top: 1.5rem; padding-bottom: 4rem; }
footer { padding-top: 1.3rem; padding-bottom: 2.5rem; color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--line); }
footer .label { display: inline; margin-right: 0.8rem; color: var(--signal-text); }

/* Buttons */
.btn { display: inline-block; padding: 0.7rem 1.25rem; border: 1px solid var(--signal); border-radius: 999px; background: var(--signal);
  color: var(--signal-ink); font-family: var(--mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; transition: transform 0.12s, box-shadow 0.12s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -6px #9600dc; }
.btn:active { transform: none; box-shadow: none; }
.btn.small { padding: 0.45rem 0.75rem; font-size: 0.66rem; }
.btn.ghost { background: transparent; color: var(--signal-text); border-color: var(--signal-text); }
.btn.ghost:hover { box-shadow: none; background: #9600dc33; }
.btn.bad { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn.bad:hover { background: var(--bad); color: #1a0806; box-shadow: none; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; cursor: pointer; }

/* Panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1.4rem 1.5rem; margin: 1rem 0; }
.panel.narrow { max-width: 430px; margin: 3rem auto; border-top: 3px solid var(--signal); }
.panel.empty { text-align: center; padding: 3.2rem 1rem; border-style: dashed; background: transparent; }
.panel.danger { border-color: #4a2320; background: transparent; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.2rem; flex-wrap: wrap; margin-bottom: 1.4rem;
  padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.head h1 { margin: 0; }
.tally { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.tally b { color: var(--text); font-size: 1.05rem; font-weight: 600; margin-right: 0.2rem; }
.tally .attn b { color: var(--warn); }
.back { font-size: 0.92rem; }
h2.section { margin: 2.6rem 0 0.6rem; }

/* Project chip */
.chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.15rem 0.6rem 0.15rem 0.3rem; border: 1px solid var(--line-2); border-radius: 999px; background: #9600dc1f;
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); vertical-align: middle; }
.chip img { display: block; }

/* Status */
.ok { --s: var(--ok); } .warn { --s: var(--warn); } .bad { --s: var(--bad); } .wait { --s: var(--wait); } .off { --s: var(--off); }
.status { font-family: var(--mono); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--s); white-space: nowrap; }
.status.big { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.78rem; padding: 0.55rem 0.85rem; border: 1px solid var(--s); border-radius: 8px; }
.led { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--s); box-shadow: 0 0 10px var(--s); }
.ok .led, .ok.unit > .led { animation: breathe 2.6s ease-in-out infinite; }
.wait .led, .wait.unit > .led { animation: blink 1.1s steps(2) infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 2px var(--s); opacity: 0.75; } }
@keyframes blink { 50% { opacity: 0.25; } }

/* Dashboard units: one rack unit per node */
.units { display: grid; gap: 0.7rem; }
.unit { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; padding: 1.2rem 1.4rem 1.2rem 2.6rem;
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 12px;
  animation: slot-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.unit:nth-child(2) { animation-delay: 0.06s; } .unit:nth-child(3) { animation-delay: 0.12s; } .unit:nth-child(n+4) { animation-delay: 0.18s; }
@keyframes slot-in { from { opacity: 0; transform: translateX(-14px); } }
.unit::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--s); border-radius: 12px 0 0 12px; }
.unit > .led { position: absolute; left: 1.15rem; top: 1.65rem; }
.unit-title { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.35rem; }
.unit-title h2 { margin: 0; font-size: 1.45rem; letter-spacing: -0.02em; }
.unit-title a { text-decoration: none; }
.addr { display: block; margin-bottom: 0.5rem; }
.unit-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.6rem; text-align: right; min-width: 11rem; }
.unit-side dl { margin: 0; display: grid; gap: 0.15rem; font-family: var(--mono); font-size: 0.68rem; color: var(--muted); }
.unit-side dl div { display: flex; gap: 0.6rem; justify-content: flex-end; }
.unit-side dt { text-transform: uppercase; letter-spacing: 0.08em; }
.unit-side dd { margin: 0; color: var(--text); }
.more { margin-top: auto; font-size: 0.9rem; }

/* Deletion countdown: one segment per day */
.countdown { margin: 0.9rem 0 0.2rem; padding: 0.8rem 0.95rem; border: 1px solid #5a4317; border-radius: 8px; background: #ffb5470d; --c: var(--warn); }
.countdown.critical { border-color: #6b2a24; background: #ff6a5c10; --c: var(--bad); }
.countdown p { margin: 0 0 0.5rem; }
.countdown p:last-child { margin: 0.55rem 0 0; }
.countdown strong { color: var(--c); font-family: var(--mono); font-size: 0.95rem; letter-spacing: 0.02em; }
.days { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; height: 10px; }
.days i { background: var(--line); border-radius: 1px; }
.days i.on { background: var(--c); }
main > .countdown { margin: 0 0 1rem; }

/* Collateral confirmations: one segment per confirmation */
.confirm { margin: 0 0 1rem; padding: 0.8rem 0.95rem; border: 1px solid var(--line-2); border-radius: 8px; background: #78c2ff0d; --c: var(--wait); }
.confirm p { margin: 0 0 0.5rem; }
.confirm strong { color: var(--c); font-family: var(--mono); font-size: 0.95rem; }

/* Alerts */
.alert { padding: 0.75rem 0.95rem; border-radius: 8px; margin: 0.8rem 0; border: 1px solid; border-left-width: 4px; background: var(--panel); }
.alert.ok { border-color: var(--ok); } .alert.warn { border-color: var(--warn); } .alert.bad { border-color: var(--bad); } .alert.info { border-color: var(--wait); }

/* Forms */
label { display: block; font-weight: 600; margin: 1rem 0 0; }
input { display: block; width: 100%; margin-top: 0.35rem; padding: 0.7rem 0.8rem; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit; }
input.mono { font-size: 0.8rem; padding: 0.85rem 0.8rem; }
input:focus { border-color: var(--signal-text); outline: none; box-shadow: 0 0 0 3px #9600dc55; }
input.short { max-width: 7rem; } input.medium { max-width: 18rem; }
form .btn { margin-top: 1.2rem; }
form.inline { display: flex; align-items: flex-end; gap: 0.8rem; flex-wrap: wrap; }
form.inline label { margin-top: 0; flex: 0 1 18rem; }
form.inline .btn { margin-top: 0; }

/* Landing */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 3rem; align-items: center; padding: 3rem 0 2.5rem; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: 0.95; margin-bottom: 1.2rem; }
.hero h1 em { font-style: normal; color: var(--signal-text); }
.lead { font-size: 1.15rem; color: #c5bdd8; max-width: 44ch; }
.actions { margin-top: 1.6rem; display: flex; gap: 0.7rem; flex-wrap: wrap; }
.pitch > * { animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.pitch > :nth-child(2) { animation-delay: 0.07s; } .pitch > :nth-child(3) { animation-delay: 0.14s; } .pitch > :nth-child(4) { animation-delay: 0.21s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* The rack: one bay per project */
.rack { padding: 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 30px 70px -30px #9600dc99, inset 0 1px 0 #ffffff0d; transform: rotate(1.2deg); }
.rack.wide { transform: none; margin: 1rem 0 1.6rem; }
.rack-title { margin: 0.1rem 0.3rem 0.8rem; }
.bay { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; padding: 1rem 1.1rem; margin-top: 0.5rem;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; text-decoration: none; align-items: start;
  transition: transform 0.15s, border-color 0.15s; animation: slot-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.25s backwards; }
a.bay:hover { transform: translateX(4px); border-color: var(--p); }
.bay-logo { display: block; filter: drop-shadow(0 6px 14px #9600dc77); }
.bay-hex { width: 48px; height: 48px; background: var(--line-2); clip-path: polygon(50% 2%, 93% 26%, 93% 74%, 50% 98%, 7% 74%, 7% 26%); opacity: 0.6; }
.bay.empty .bay-main { align-self: center; }
.bay-main strong { display: block; font-size: 1.3rem; letter-spacing: -0.02em; }
.bay-main span { color: var(--muted); font-size: 0.93rem; }
.bay-facts { grid-column: 2; display: flex; gap: 1.1rem; flex-wrap: wrap; margin-top: 0.5rem; font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.bay-facts b { color: var(--p-text); font-weight: 600; }
.bay.empty { border-style: dashed; border-color: var(--line-2); background: transparent; animation-delay: 0.35s; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; margin-top: 2rem; border-top: 1px solid var(--line); }
.steps > div { padding: 1.5rem 1.5rem 0.5rem 0; }
.steps .label { color: var(--signal-text); font-size: 0.8rem; }
.steps p { color: var(--muted); }

/* Setup guide */
.guide { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.guide > li { counter-increment: step; position: relative; padding: 0 0 2rem 3.6rem; }
.guide > li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 0.1rem; width: 2.3rem; height: 2.3rem;
  display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel);
  font-family: var(--mono); font-size: 0.7rem; color: var(--signal-text); }
.guide > li::after { content: ""; position: absolute; left: 1.15rem; top: 2.7rem; bottom: 0.3rem; width: 1px; background: var(--line); }
.guide > li:last-child { padding: 1.4rem 1.5rem 1.5rem 5rem; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--signal); border-radius: 12px; }
.guide > li:last-child::before { left: 1.4rem; top: 1.4rem; background: var(--signal); color: var(--signal-ink); border-color: var(--signal); font-weight: 700; }
.guide > li:last-child::after { display: none; }
.guide p { max-width: 62ch; color: #cdc6de; }
.plain { padding-left: 1.3rem; margin: 0 0 1rem; }
.plain li { margin-bottom: 1rem; }

/* Copyable terminal lines */
.term { display: flex; gap: 0.6rem; align-items: flex-start; margin-top: 0.5rem; }
.term pre { flex: 1; min-width: 0; margin: 0; padding: 0.8rem 0.9rem 0.8rem 2rem; position: relative; background: #07060c; border: 1px solid var(--line);
  border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; color: #e4dcf5; line-height: 1.7; }
.term pre::before { content: ">"; position: absolute; left: 0.8rem; color: var(--signal-text); }
details { margin-top: 0.7rem; border-top: 1px solid var(--line); padding-top: 0.7rem; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 0.6rem 0 0; color: #cdc6de; max-width: 68ch; }

.facts { margin: 0; display: grid; gap: 0.9rem; }
.facts dt { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.15rem; }
.facts dd { margin: 0; }

.bar { height: 10px; border-radius: 1px; background: var(--line); overflow: hidden; margin: 0.6rem 0 0.4rem; }
.bar span { display: block; height: 100%; width: 2%; background: repeating-linear-gradient(90deg, var(--wait) 0 6px, transparent 6px 8px); }
.bar .w5 { width: 5%; } .bar .w10 { width: 10%; } .bar .w15 { width: 15%; } .bar .w20 { width: 20%; } .bar .w25 { width: 25%; }
.bar .w30 { width: 30%; } .bar .w35 { width: 35%; } .bar .w40 { width: 40%; } .bar .w45 { width: 45%; } .bar .w50 { width: 50%; }
.bar .w55 { width: 55%; } .bar .w60 { width: 60%; } .bar .w65 { width: 65%; } .bar .w70 { width: 70%; } .bar .w75 { width: 75%; }
.bar .w80 { width: 80%; } .bar .w85 { width: 85%; } .bar .w90 { width: 90%; } .bar .w95 { width: 95%; }

.events, .history { list-style: none; padding: 0; margin: 0; }
.events li, .history li { padding: 0.5rem 0; border-top: 1px solid var(--line); }
.events li:first-child { border-top: 0; }
.events time { font-family: var(--mono); font-size: 0.66rem; color: var(--muted); margin-right: 0.8rem; }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 1.5rem; }
  .rack { transform: none; }
  .unit { grid-template-columns: 1fr; gap: 0.9rem; }
  .unit-side { align-items: flex-start; text-align: left; flex-direction: row; flex-wrap: wrap; gap: 0.6rem 1.2rem; min-width: 0; }
  .unit-side dl div { justify-content: flex-start; }
  .more { margin-top: 0; }
  .guide > li { padding-left: 3rem; }
  .guide > li:last-child { padding: 4.2rem 1.1rem 1.2rem; }
  .guide > li:last-child::before { left: 1.1rem; top: 1.1rem; }
  .term { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
