/* Front page: the desktop HUD around the terminal, and the phone layout */
:root {
  --bg: #05080f;
  --panel: #0b1322;
  --panel-2: #0f1a2e;
  --line: #1d3557;
  --cyan: #5fd3ff;
  --text: #b9d6ee;
  --dim: #5b7a99;
  --red: #ff5c5c;
  --amber: #ffb84d;
  --green: #6dffa8;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.5 var(--mono);
  overflow-x: hidden;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* scanlines over everything, very faint */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 60;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px);
}

/* ---------- boot: password breaker ---------- */
#boot {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  cursor: pointer; transition: opacity .35s;
}
#boot.gone { opacity: 0; pointer-events: none; }
.boot-label { color: var(--dim); letter-spacing: .3em; font-size: 11px; text-align: center; padding: 0 16px; }
/* one row at any width: the boxes shrink to fit 12 letters + a gap on a phone */
#crack { display: flex; gap: min(4px, .8vw); justify-content: center; }
#crack span {
  width: min(28px, 6.2vw); height: min(40px, 8.8vw); display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--panel);
  font-size: min(22px, 4.8vw); color: var(--dim);
}
#crack span.locked { color: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 10px rgba(95,211,255,.35); }
#crack span.gap { border: none; background: none; width: min(14px, 3vw); }
#boot-status { color: var(--amber); font-size: 12px; min-height: 1.5em; }
.skip { color: var(--dim); font-size: 11px; }

/* ---------- layout ---------- */
/* minmax(0, 1fr): a column may shrink below its content (the terminal),
   or a phone gets a page wider than its screen */
.app { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; height: 100vh; gap: 10px; padding: 10px; }

header.hud {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px;
  border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: 10px 14px;
}
.who h1 { font-size: 20px; color: #fff; letter-spacing: .08em; }
.who p { color: var(--cyan); }
.links { display: flex; flex-wrap: wrap; gap: 6px; }
.btn {
  border: 1px solid var(--line); padding: 4px 10px; color: var(--text); background: var(--panel);
  font: inherit; cursor: pointer;
}
.btn:hover { border-color: var(--cyan); color: var(--cyan); text-decoration: none; }
.btn.primary { border-color: var(--cyan); color: var(--cyan); }
.clock { margin-left: auto; text-align: right; color: var(--dim); font-size: 12px; }
.clock b { color: var(--text); font-size: 15px; display: block; }

main { display: grid; grid-template-columns: 250px minmax(0, 1fr) 270px; gap: 10px; min-height: 0; }

.panel { border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.panel h2 {
  font-size: 11px; letter-spacing: .25em; color: var(--dim); font-weight: 400;
  padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--panel-2);
  display: flex; justify-content: space-between; gap: 8px;
}
.panel .body { padding: 10px; overflow: auto; }

/* remote systems = projects */
.sys { padding: 8px; border: 1px solid transparent; cursor: pointer; margin-bottom: 4px; }
.sys:hover, .sys.active { border-color: var(--cyan); background: rgba(95,211,255,.06); }
.sys .name { color: #fff; }
.sys .meta { display: flex; gap: 10px; font-size: 11px; }
.sys .meta span { color: var(--green); }
.hint { color: var(--dim); font-size: 11px; margin-top: 8px; }

/* center: map over terminal */
/* the map's height is capped: on a tall window (a phone in desktop mode)
   a share of the height would make it a poster */
.center { display: grid; grid-template-rows: minmax(180px, min(38%, 340px)) 1fr; gap: 10px; min-height: 0; }
.map-wrap { position: relative; flex: 1; min-height: 0; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; }
.route-line { fill: none; stroke: var(--cyan); stroke-width: 1.5; stroke-dasharray: 6 5; animation: flow 1s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -11; } }
.node circle { fill: var(--bg); stroke: var(--cyan); stroke-width: 1.5; }
.node.you circle { stroke: var(--amber); }
.node circle.ping { fill: none; transform-box: fill-box; transform-origin: center; animation: ping 2.4s ease-out infinite; }
@keyframes ping { from { transform: scale(1); opacity: .9; } to { transform: scale(3.2); opacity: 0; } }
.packet { stroke: none; }
.packet.out { fill: var(--amber); }
.packet.in { fill: var(--green); }
.node text { fill: var(--text); font: 10px var(--mono); paint-order: stroke; stroke: var(--panel); stroke-width: 3px; }

/* terminal */
.console { background: #03060b; }
.term-wrap { flex: 1; min-height: 0; padding: 6px 0 0 8px; }
#terminal { width: 100%; height: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); }

/* status */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin-bottom: 14px; }
.kv dt { color: var(--dim); }
.kv dd { color: #fff; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route { list-style: none; margin-bottom: 14px; }
.route li { position: relative; padding: 0 0 8px 16px; }
.route li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 7px; height: 7px; border: 1px solid var(--cyan); border-radius: 50%; }
.route li:first-child::before { border-color: var(--amber); }
.route li:not(:last-child)::after { content: ""; position: absolute; left: 6px; top: 14px; bottom: 0; border-left: 1px dashed var(--cyan); }
.route b { color: #fff; font-weight: 400; }
.route small { color: var(--dim); display: block; font-size: 11px; }
.sub { font-size: 11px; letter-spacing: .25em; color: var(--dim); margin-bottom: 6px; }
.contract { border: 1px dashed var(--amber); padding: 8px; color: var(--amber); font-size: 12px; margin-bottom: 10px; }
.contract b { display: block; color: #fff; margin-bottom: 4px; }
.seats { color: var(--green); }
.live { color: var(--green); }
.stale { color: var(--dim); }

/* responsive: stack on narrow screens, page scrolls */
@media (max-width: 980px) {
  .app { height: auto; min-height: 100vh; }
  main { grid-template-columns: minmax(0, 1fr); }
  .center { order: -1; grid-template-rows: 220px min(70vh, 620px); }
  .clock { margin-left: 0; text-align: left; }
}
/* ---------- phone: its own layout, no terminal ----------
   A phone gets a readable page (name, CV, projects as text, live status and
   the route map); the HUD and the terminal are for a screen and a keyboard */
.phone { display: none; padding: 14px 16px 28px; }
.phone section, .phone details { border: 1px solid var(--line); background: var(--panel); margin-bottom: 12px; }
.phone .head h1 { font-size: 22px; color: #fff; letter-spacing: .08em; }
.phone .head p { color: var(--cyan); margin-bottom: 12px; }
.phone .head .links { margin-bottom: 14px; }
.phone .btn { padding: 8px 14px; }
.phone h2 {
  font-size: 11px; letter-spacing: .25em; color: var(--dim); font-weight: 400;
  padding: 8px 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between;
}
.phone .strip { padding: 10px 12px; font-size: 12px; line-height: 1.7; }
.phone .strip b { color: #fff; font-weight: 400; }
.phone .p-map { height: 190px; position: relative; }
.phone .p-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.phone .p-route { padding: 8px 12px 10px; font-size: 12px; color: var(--text); border-top: 1px solid var(--line); }
.phone details summary { list-style: none; cursor: pointer; padding: 12px; }
.phone details summary::-webkit-details-marker { display: none; }
.phone details summary .name { color: #fff; display: flex; justify-content: space-between; gap: 8px; }
.phone details summary .name::after { content: "+"; color: var(--cyan); }
.phone details[open] summary .name::after { content: "−"; }
.phone details summary .gist { color: var(--dim); font-size: 12px; margin-top: 4px; }
.phone details[open] summary .gist { display: none; }
.phone details .text { padding: 0 12px 14px; font-size: 13px; line-height: 1.6; }
.phone .text h4 { color: var(--amber); font-weight: 400; letter-spacing: .15em; font-size: 11px; margin: 14px 0 6px; }
.phone .text p { margin-bottom: 8px; }
.phone .text ul { padding-left: 16px; margin-bottom: 8px; }
.phone .text li { margin-bottom: 4px; }
.phone .text .stack { color: var(--dim); font-size: 12px; }
.phone .text a, .phone .strip a { word-break: break-all; }
.phone .contract { margin-bottom: 12px; }
.phone h2.bare { border: 0; padding: 6px 0; }
.phone .foot { color: var(--dim); font-size: 12px; text-align: center; margin-top: 18px; }
@media (max-width: 700px), (max-height: 500px) and (pointer: coarse) {
  .app { display: none; }
  .phone { display: block; }
}
