/* ============================================================
   lunau.xyz — canonical cypherpunk stylesheet (single source of truth)
   Phosphor green #00ff41 on #0d1117, Consolas mono, CRT + matrix rain.
   Linked by every page: <link rel="stylesheet" href="/cypherpunk.css">
   Data-semantic accents kept minimal: --up / --down / --warn.
   ============================================================ */
:root {
  --bg:        #0d1117;   /* base */
  --panel:     #0b120c;   /* raised phosphor surface */
  --surf:      #0b120c;   /* legacy alias */
  --border:    #124a24;   /* phosphor border */
  --green:     #00ff41;   /* primary phosphor */
  --green-dim: #00aa2a;   /* dim phosphor */
  --green-hi:  #7dff9a;   /* hover / bright */
  --text:      #00ff41;   /* body text = phosphor */
  --head:      #7dff9a;   /* headings brighter phosphor */
  --muted:     rgba(0,170,42,0.75);
  --ink:       #00cc44;
  /* legacy palette aliases collapsed onto phosphor so old class names conform */
  --blue: #00ff41; --teal: #00ff41; --gold: #7dff9a; --dim: var(--green-dim);
  /* minimal data-semantic accents (kept desaturated to fit phosphor CRT) */
  --up:   #00ff41;   /* gains / yes / up  */
  --down: #ff4d5e;   /* losses / down     */
  --warn: #d8ff3e;   /* highlight / watch */
  --info: #00e0d0;   /* neutral metric (temp etc.) */
  --mono: 'Consolas','Courier New',monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  text-shadow: 0 0 6px rgba(0,255,65,0.18);
  text-transform: lowercase;
}
/* keep the raw data in tables/tickers case-exact — lowercase is chrome only */
th, td, .tickerBtn, .tickerPlain, .ticker, code, pre, input, select,
.ks-table, [data-nocase], .nocase { text-transform: none; }

a { color: var(--green); text-decoration: none; }
a:hover, a:focus-visible { color: var(--green-hi); text-shadow: 0 0 10px rgba(0,255,65,0.45); }

/* ---- matrix rain + CRT scaffold (shared with landing) ---- */
#rain, .cp-rain {
  position: fixed; inset: 0; z-index: 0;
  opacity: 0.06; pointer-events: none;
}
.crt, .cp-crt {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px, rgba(0,0,0,0.12) 3px),
    radial-gradient(ellipse 90% 75% at 50% 45%, transparent 30%, rgba(0,0,0,0.45) 100%);
  mix-blend-mode: multiply; opacity: 0.5;
}
.crt::after, .cp-crt::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,255,65,0.03), transparent 30%, transparent 70%, rgba(0,255,65,0.025));
  animation: cp-flicker 4.5s ease-in-out infinite;
}
@keyframes cp-flicker { 0%,100%{opacity:.7} 48%{opacity:.95} 52%{opacity:.55} 56%{opacity:.9} }

/* content sits above the rain */
.wrap, .container, main, header, footer, section, .page { position: relative; z-index: 1; }

/* ---- headings ---- */
h1 { color: var(--head); font-weight: 700; font-size: 20px; letter-spacing: .02em;
     text-shadow: 0 0 10px rgba(0,255,65,0.35); }
h2 { color: var(--green); font-weight: 700; margin: 32px 0 12px;
     border-bottom: 1px solid var(--border); padding-bottom: 6px; }
h3 { color: var(--head); font-weight: 700; font-size: 18px; }
h4 { color: var(--green); font-weight: 700; margin: 0 0 8px;
     text-transform: uppercase; letter-spacing: .04em; }
.kicker { color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.meta, .sub { color: var(--muted); }

/* ---- surfaces ---- */
.panel, .kpi, .card, .box, .ksBox, .priceChart, .eqChart {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0;
}
.kpi .label, .kpi .value { color: var(--green); }
.kpi .value { color: var(--head); font-weight: 700; }

/* ---- tables ---- */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
thead th {
  background: var(--panel); color: var(--green); text-align: left;
  border-bottom: 2px solid var(--border); font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
td { border-bottom: 1px solid var(--border); color: var(--green); }
tr:hover td { background: #003300; }

/* ---- buttons / inputs ---- */
button, .btn, .toolbar button {
  background: transparent; color: var(--green);
  border: 1px solid var(--border); border-radius: 0;
  padding: 8px 12px; cursor: pointer; font-family: var(--mono); font-weight: 700;
}
button:hover, .btn:hover, button:focus-visible, .btn:focus-visible {
  background: var(--green); color: #041006; border-color: var(--green); text-shadow: none;
}
input, select, .toolbar input, .toolbar select {
  background: var(--bg); color: var(--green);
  border: 1px solid var(--border); border-radius: 0;
  padding: 8px 12px; font-family: var(--mono); outline: none;
}
input:focus, select:focus { border-color: var(--green); }

/* ---- tickers ---- */
a.tickerBtn, .tickerBtn { color: var(--green); font-weight: 700; }
a.tickerBtn:hover { color: var(--green-hi); }
a.tickerBtn:not(:has(b))::before { content: "$"; }

/* ---- data-semantic helpers (opt-in classes) ---- */
.up, .pos, .gain { color: var(--up); }
.down, .neg, .loss { color: var(--down); }
.warn, .hl { color: var(--warn); }
.info { color: var(--info); }

/* ---- pills / badges ---- */
.badge, .pill {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border); border-radius: 0;
  padding: 2px 8px; font-weight: 600; color: var(--green);
  background: transparent;
}
.pill.warn, .pill.watch { color: var(--warn); border-color: #d8ff3e55; background: #1a1a0033; }
.pill.down { color: var(--down); border-color: #ff4d5e55; background: #2a0d0d33; }

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .crt::after, .cp-crt::after { animation: none; }
}

/* ---- shared home-link (top-right) ---- */
.lunau-home, .cp-home {
  position: fixed; top: 12px; right: 16px; z-index: 10000;
  color: var(--green); text-decoration: none;
  font: 12px var(--mono); letter-spacing: .04em;
  text-shadow: 0 0 8px rgba(0,255,65,0.35);
  text-transform: lowercase;
}
.lunau-home:hover, .cp-home:hover { color: var(--green-hi); text-shadow: 0 0 12px rgba(0,255,65,0.55); }

/* ---- shared top-header local clock (date + time w/ seconds) ----
   Sits top-right, just left of .lunau-home, so left brand/headers stay clear. */
.cp-clock {
  position: fixed;
  top: 12px;
  right: 118px;
  left: auto;
  z-index: 10000;
  color: var(--green-dim, #00aa2a);
  font: 12px/1.2 var(--mono, Consolas, 'Courier New', monospace);
  letter-spacing: .05em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(0,255,65,0.2);
  text-transform: none; /* keep ISO date / time casing exact */
  pointer-events: none;
  opacity: 0.92;
  white-space: nowrap;
  user-select: none;
}
.cp-clock .cp-clock-date { color: var(--green-dim, #00aa2a); }
.cp-clock .cp-clock-sep { color: rgba(0,170,42,0.45); margin: 0 0.35em; }
.cp-clock .cp-clock-time { color: var(--green, #00ff41); text-shadow: 0 0 8px rgba(0,255,65,0.28); }
.cp-clock .cp-clock-tz { color: var(--green-dim, #00aa2a); margin-left: 0.4em; opacity: 0.85; letter-spacing: .08em; }
@media (max-width: 720px) {
  .cp-clock {
    top: 36px; /* drop under home link on narrow screens */
    right: 16px;
    font-size: 11px;
  }
}

/* ---- shared footer strip ---- */
.cp-footer {
  position: relative; z-index: 1;
  margin-top: 40px; padding: 14px 20px;
  border-top: 1px solid var(--border);
  color: var(--green-dim);
  font: 11px var(--mono); letter-spacing: .08em;
  text-transform: lowercase;
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  justify-content: space-between; align-items: baseline;
}
.cp-footer .cp-f-mark { color: var(--green); text-shadow: 0 0 8px rgba(0,255,65,0.3); }
.cp-footer a { color: var(--green-dim); border-bottom: 1px solid #00aa2a44; }
.cp-footer a:hover { color: var(--green-hi); }

/* ---- terminal outline chrome (landings + hubs) ---- */
.term-shell {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 14px 28px;
}
.term-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.term-head .prompt {
  color: var(--head);
  letter-spacing: .08em;
  font-weight: 700;
}
.term-head .prompt .dim { color: var(--green-dim); font-weight: 400; letter-spacing: .12em; font-size: 11px; margin-left: 8px; }
.term-head .clock {
  color: var(--green-dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-transform: none;
}
.term-head .cursor {
  display: inline-block; width: 8px; height: 1em; margin-left: 4px;
  background: var(--green); vertical-align: text-bottom;
  animation: cp-caret 1.1s steps(1) infinite;
}
@keyframes cp-caret { 50% { opacity: 0; } }
.term-list {
  display: flex;
  flex-direction: column;
  counter-reset: curses;
}
.term-list a {
  display: grid;
  grid-template-columns: 3.2ch minmax(0, 1fr) minmax(0, 16ch);
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 10px;
  color: var(--green);
  letter-spacing: .06em;
  counter-increment: curses;
}
.term-list a .idx,
.term-list a::before {
  color: var(--green-dim);
  font-variant-numeric: tabular-nums;
}
.term-list a:not(:has(.idx))::before { content: counter(curses); }
.term-list a .n { color: var(--head); font-weight: 700; letter-spacing: .06em; }
.term-list a .path {
  color: var(--green-dim);
  font-size: 11px;
  letter-spacing: .04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}
.term-list a:hover, .term-list a:focus-visible, .term-list a.on {
  background: var(--green);
  color: #041006;
  text-shadow: none;
  outline: none;
}
.term-list a:hover .idx, .term-list a:focus-visible .idx, .term-list a.on .idx,
.term-list a:hover .n, .term-list a:focus-visible .n, .term-list a.on .n,
.term-list a:hover .path, .term-list a:focus-visible .path, .term-list a.on .path,
.term-list a:hover::before, .term-list a:focus-visible::before, .term-list a.on::before {
  color: #041006;
}
.term-tape {
  margin-top: 8px;
  border: 1px solid var(--border);
  padding: 10px 12px;
}
.term-tape .tape { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.term-tape .sym { font-size: 10px; color: var(--green-dim); letter-spacing: .08em; }
.term-tape .px { font-size: 15px; color: var(--green); font-weight: 700; text-transform: none; }
.term-tape .ch { font-size: 11px; text-transform: none; }
.term-tape .ch.up { color: var(--up); }
.term-tape .ch.dn { color: var(--down); }
@media (prefers-reduced-motion: reduce) {
  .term-head .cursor { animation: none; }
}
@media (max-width: 520px) {
  .term-list a .path { display: none; }
  .term-list a, .curses-menu a { grid-template-columns: 3.2ch 1fr; }
}

/* ---- one-surface home (programs + tape in one table) ---- */
.term-frame {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  border: 1px solid var(--border);
}
.term-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--green-dim);
  font-size: 11px;
  letter-spacing: .08em;
}
.term-bar b, .term-bar #clock { color: var(--head); font-weight: 700; text-transform: none; }
.term-bar #statusStrip { letter-spacing: .06em; }
.term-prompt {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.term-prompt label { color: var(--green-dim); }
.term-prompt input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--green);
  font: inherit;
  outline: none;
  padding: 0;
  text-transform: lowercase;
}
.term-prompt .cur {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--green);
  animation: cp-caret 1.1s steps(1) infinite;
}
.term-table { width: 100%; border-collapse: collapse; }
.term-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #0f2a16;
  color: var(--green);
}
.term-table td.n { width: 3.2ch; color: var(--green-dim); font-variant-numeric: tabular-nums; }
.term-table td.name { color: var(--head); font-weight: 700; letter-spacing: .06em; }
.term-table td.name a { color: inherit; }
.term-table td.path { color: var(--green-dim); font-size: 11px; text-align: right; }
.term-table td.px { color: var(--green); font-weight: 700; text-align: right; text-transform: none; }
.term-table td.ch { width: 7ch; text-align: right; text-transform: none; font-size: 11px; }
.term-table td.ch.up { color: var(--up); }
.term-table td.ch.dn { color: var(--down); }
.term-table tr.prog { cursor: pointer; }
.term-table tr.prog:hover td,
.term-table tr.prog.on td {
  background: var(--green);
  color: #041006;
  text-shadow: none;
}
.term-table tr.prog:hover td.n,
.term-table tr.prog.on td.n,
.term-table tr.prog:hover td.name,
.term-table tr.prog.on td.name,
.term-table tr.prog:hover td.path,
.term-table tr.prog.on td.path,
.term-table tr.prog:hover td.name a,
.term-table tr.prog.on td.name a { color: #041006; }
.term-table tr.dim { opacity: .28; }
.term-table tr.sec td {
  color: var(--green-dim);
  letter-spacing: .12em;
  font-size: 10px;
  padding: 6px 10px;
}
.term-table tr.sec:hover td { background: transparent; color: var(--green-dim); }
.term-table tr.tape-row:hover td { background: transparent; }
.term-echo {
  padding: 8px 10px;
  color: var(--green-dim);
  font-size: 11px;
  min-height: 2.4em;
}
.term-echo b { color: var(--green); }
@media (prefers-reduced-motion: reduce) {
  .term-prompt .cur { animation: none; }
}

/* ---- phone-deck home (globe-v49) ---- */
body.phone-deck {
  padding: 10px 10px calc(72px + env(safe-area-inset-bottom, 0px));
}
body.phone-deck .cp-clock,
body.phone-deck .cp-footer { display: none !important; }
.deck-wrap {
  position: relative;
  z-index: 1;
  max-width: 430px;
  margin: 0 auto;
}
.deck-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 6px 4px 10px;
  color: var(--green-dim);
  font-size: 11px;
  letter-spacing: .1em;
}
.deck-head b { color: var(--head); font-weight: 700; text-transform: none; }
.deck-head #statusStrip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.deck-tape {
  display: flex;
  border: 1px solid var(--border);
  margin-bottom: 10px;
  overflow: hidden;
}
.deck-tape .t {
  flex: 1;
  min-width: 0;
  padding: 8px 8px 9px;
  border-right: 1px solid var(--border);
}
.deck-tape .t:last-child { border-right: 0; }
.deck-tape .sym { color: var(--green-dim); font-size: 9px; letter-spacing: .12em; }
.deck-tape .px {
  color: var(--green);
  font-weight: 700;
  font-size: 15px;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.deck-tape .ch { font-size: 10px; text-transform: none; }
.deck-tape .ch.up { color: var(--up); }
.deck-tape .ch.dn { color: var(--down); }
.deck-find {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  padding: 8px 10px;
  margin-bottom: 10px;
}
.deck-find label { color: var(--green-dim); }
.deck-find input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--green);
  font: inherit;
  outline: none;
  padding: 0;
  text-transform: lowercase;
}
.deck-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.deck-grid .tile {
  border: 1px solid var(--border);
  background: var(--panel);
  min-height: 92px;
  padding: 10px 10px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: inherit;
  text-shadow: inherit;
}
.deck-grid .tile .idx { color: var(--green-dim); font-size: 10px; }
.deck-grid .tile .nm {
  color: var(--head);
  font-weight: 700;
  letter-spacing: .04em;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.deck-grid .tile .sub {
  color: var(--green-dim);
  font-size: 9px;
  letter-spacing: .04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deck-grid .tile:hover,
.deck-grid .tile:focus-visible,
.deck-grid .tile.on {
  background: var(--green);
  color: #041006;
  text-shadow: none;
  outline: none;
  border-color: var(--green);
}
.deck-grid .tile:hover .idx,
.deck-grid .tile.on .idx,
.deck-grid .tile:focus-visible .idx,
.deck-grid .tile:hover .nm,
.deck-grid .tile.on .nm,
.deck-grid .tile:focus-visible .nm,
.deck-grid .tile:hover .sub,
.deck-grid .tile.on .sub,
.deck-grid .tile:focus-visible .sub { color: #041006; }
.deck-grid .tile.dim { opacity: .22; pointer-events: none; }
.deck-echo { margin-top: 10px; color: var(--green-dim); font-size: 11px; min-height: 1.6em; }
.deck-echo b { color: var(--green); }
body.phone-deck #lunauDock a {
  flex: 1 1 0;
  min-width: 0;
  border-right: 0;
  font-size: 9px;
}
.term-table td.px,
.term-table td.ch { white-space: nowrap; }
@media (max-width: 520px) {
  .term-table td.path { display: none; }
  .term-table td.px,
  .term-table td.ch { font-size: 11px; padding-left: 6px; }
  .term-bar #statusStrip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
}

/* ---- curses-select chrome (/app + full-bleed operate) ---- */
.curses-shell {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}
@media (min-width: 720px) {
  .curses-shell {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}
.curses-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.curses-head .brand {
  color: var(--head);
  font-weight: 700;
  letter-spacing: .12em;
}
.curses-head .clock {
  color: var(--green-dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-transform: none;
}
.curses-menu {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 6px 12px;
}
.curses-tape {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
}
.curses-tape > div {
  padding: 10px 8px;
  border-right: 1px solid var(--border);
  min-width: 0;
}
.curses-tape > div:last-child { border-right: 0; }
.curses-tape .sym { font-size: 10px; color: var(--green-dim); letter-spacing: .1em; }
.curses-tape .px {
  font-size: 12px;
  color: var(--green);
  font-weight: 700;
  text-transform: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.curses-tape .ch { font-size: 10px; text-transform: none; }
.curses-tape .ch.up { color: var(--up); }
.curses-tape .ch.dn { color: var(--down); }

/* lunau-skin-radius — square generator/fork chrome after cypherpunk.css */
.badge, .pill, .stage,
.kpi, .card, .panel, .hero, .nav a, .metrics div, .status {
  border-radius: 0;
}

