/* aivoice.tech — phosphor terminal.
   Layout: one left-aligned column like a terminal session, ~78 characters wide.
   A deliberate single dark look (a CRT screen), so there is no light theme. */
@font-face { font-family: "VT323"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/vt323-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }

:root {
  --crt:   #040805;  /* the glass */
  --panel: #07110a;  /* code blocks, tables */
  --line:  #173a22;  /* rules, borders */
  --text:  #b4e6be;  /* body copy: soft phosphor */
  --phos:  #74f79a;  /* headings, links: lit phosphor */
  --dim:   #5e8f69;  /* comments, metadata */
  --amber: #ffb547;  /* the one warm accent: downloads, warnings */
  --display: "VT323", "Courier New", monospace;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --measure: 78ch;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--crt); }
body {
  margin: 0; min-height: 100vh;
  background: var(--crt); color: var(--text);
  font: 400 15px/1.65 var(--mono);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* scanlines + vignette, painted over everything, never catching clicks */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.22) 2px 3px),
    radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,.55) 100%);
}
::selection { background: var(--phos); color: var(--crt); }

.wrap {
  max-width: calc(var(--measure) + 2 * 24px); margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

a { color: var(--phos); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--phos); }
:focus-visible { outline: 2px dashed var(--phos); outline-offset: 3px; }

/* ---------- top bar: a shell prompt */
.bar { border-bottom: 1px solid var(--line); }
.bar .wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; padding-block: 14px; }
.host { font-family: var(--display); font-size: 26px; line-height: 1; color: var(--phos); text-decoration: none; letter-spacing: .02em; text-shadow: 0 0 10px rgba(116,247,154,.35); }
.host span { color: var(--dim); }
.nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.nav a { text-decoration: none; color: var(--text); padding: 1px 4px; }
.nav a::before { content: "./"; color: var(--dim); }
.nav a:hover, .nav a[aria-current="page"] { background: var(--phos); color: var(--crt); }
.nav a:hover::before, .nav a[aria-current="page"]::before { color: var(--crt); }

/* ---------- hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .8;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 100%); mask-image: linear-gradient(to bottom, #000 30%, transparent 100%); }
.hero .wrap { position: relative; padding-block: 40px 52px; }
.boot { margin: 0 0 30px; padding: 0; list-style: none; font-size: 13px; color: var(--dim); }
.boot li { white-space: pre-wrap; }
.boot b { color: var(--phos); font-weight: 500; }
h1 {
  font: 400 clamp(46px, 9vw, 84px)/.95 var(--display); margin: 0 0 20px; color: var(--phos);
  letter-spacing: .01em; text-wrap: balance; text-shadow: 0 0 18px rgba(116,247,154,.35);
}
.lede { max-width: 60ch; margin: 0 0 26px; font-size: 16px; }
.cursor { display: inline-block; width: .55em; height: 1em; background: var(--phos); vertical-align: -0.12em; margin-left: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .cursor { animation: blink 1.1s steps(1) infinite; }
  .boot li { animation: line-in .01s steps(1) backwards; }
  .boot li:nth-child(1) { animation-delay: .05s } .boot li:nth-child(2) { animation-delay: .22s }
  .boot li:nth-child(3) { animation-delay: .39s } .boot li:nth-child(4) { animation-delay: .56s }
  .boot li:nth-child(5) { animation-delay: .73s }
}
@keyframes blink { 50% { opacity: 0 } }
@keyframes line-in { from { visibility: hidden } }

/* ---------- buttons: bracketed commands */
.actions { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: .5ch; padding: 7px 14px; font: 500 14px/1.2 var(--mono);
  color: var(--phos); background: transparent; border: 1px solid var(--phos); text-decoration: none; cursor: pointer;
}
.btn::before { content: "["; color: var(--dim); } .btn::after { content: "]"; color: var(--dim); }
.btn:hover { background: var(--phos); color: var(--crt); }
.btn:hover::before, .btn:hover::after { color: var(--crt); }
.btn.hot { color: var(--amber); border-color: var(--amber); }
.btn.hot:hover { background: var(--amber); color: var(--crt); }
.note { font-size: 13px; color: var(--dim); }

/* ---------- sections: each opens with the command that produced it */
main section { padding-block: 44px 8px; }
.cmd { margin: 0 0 18px; font: 400 15px/1.4 var(--mono); color: var(--dim); }
.cmd::before { content: "aivoice@tech:~$ "; color: var(--dim); }
.cmd b { color: var(--phos); font-weight: 500; }
h2 { font: 400 34px/1 var(--display); color: var(--phos); margin: 0 0 14px; letter-spacing: .02em; text-wrap: balance; }
h3 { font: 600 14px/1.4 var(--mono); color: var(--phos); margin: 26px 0 8px; text-transform: uppercase; letter-spacing: .08em; }
p { margin: 0 0 14px; max-width: 68ch; }
.dim { color: var(--dim); }
.amber { color: var(--amber); }
hr { border: 0; border-top: 1px dashed var(--line); margin: 36px 0 0; }

/* ls -l listing of projects */
.ls { margin: 0; padding: 0; list-style: none; font-size: 14px; border-top: 1px solid var(--line); }
.ls li {
  display: grid; grid-template-columns: 10.5ch 5ch 21ch minmax(0, 1fr) auto; gap: 0 2ch; align-items: baseline;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.ls .perm, .ls .size { color: var(--dim); font-variant-numeric: tabular-nums; }
.ls .size { text-align: right; }
.ls .name { color: var(--phos); font-weight: 500; }
.ls .desc { min-width: 0; }
.ls .go { white-space: nowrap; }
.ls .go a { text-decoration: none; }
.ls .go a::before { content: "→ "; color: var(--dim); }
.ls li.exec .name { color: var(--amber); }

/* chat transcript */
.tty { margin: 0 0 18px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); font-size: 14px; line-height: 1.7; overflow-x: auto; }
.tty p { margin: 0; max-width: none; }
.tty .you::before { content: "you> "; color: var(--amber); }
.tty .pbx { color: var(--phos); margin-bottom: 8px; }
.tty .pbx::before { content: "pbx> "; color: var(--dim); }

/* flags list */
.flags { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 30ch), 1fr)); gap: 4px 3ch; font-size: 14px; }
.flags li::before { content: "--"; color: var(--dim); }

/* code */
pre, code { font-family: var(--mono); }
code { color: var(--phos); font-size: .94em; }
pre {
  margin: 0 0 16px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line);
  font-size: 13.5px; line-height: 1.6; overflow-x: auto; color: var(--text);
}
pre .c { color: var(--dim); }
.codebox { position: relative; }
.codebox .copy { position: absolute; top: 6px; right: 6px; font: 500 12px/1 var(--mono); padding: 5px 8px; background: var(--crt); color: var(--dim); border: 1px solid var(--line); cursor: pointer; }
.codebox .copy:hover { color: var(--phos); border-color: var(--phos); }

/* two-up install blocks */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 34ch), 1fr)); gap: 0 28px; }
.cols > div { min-width: 0; }

/* tables (man page) */
.tbl { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--dim); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; }
tr:last-child td { border-bottom: 0; }
td.hash { font-size: 11.5px; color: var(--dim); word-break: break-all; min-width: 26ch; }

/* ---------- man page */
.manhead { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 26px 0; color: var(--dim); font-size: 13px; }
.man section { padding-block: 30px 0; }
.man h2 { font-size: 30px; }
.man .body { padding-left: 4ch; }
.toc { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 18px 0 0; padding: 12px 0; list-style: none; border-block: 1px dashed var(--line); font-size: 13px; }
.toc a { text-decoration: none; }
.warn { border-left: 2px solid var(--amber); padding: 2px 0 2px 14px; margin: 0 0 16px; }
.warn p { margin: 0 0 6px; }
ol.steps { margin: 0 0 16px; padding-left: 3ch; }
ol.steps li { margin-bottom: 6px; padding-left: 1ch; }
ol.steps li::marker { color: var(--dim); }
ul.plain { margin: 0 0 16px; padding-left: 2ch; list-style: "· "; }
ul.plain li { margin-bottom: 6px; padding-left: .5ch; }
ul.plain li::marker { color: var(--dim); }

/* ---------- footer */
footer { margin-top: 64px; border-top: 1px solid var(--line); font-size: 13px; color: var(--dim); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding-block: 22px 32px; }
footer a { color: var(--dim); }
footer a:hover { color: var(--phos); }

/* ---------- narrow screens */
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .ls li { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; }
  .ls .perm { display: none; }
  .ls .size { grid-column: 2; grid-row: 1; }
  .ls .name { grid-column: 1; grid-row: 1; }
  .ls .desc { grid-column: 1 / -1; grid-row: 2; color: var(--text); }
  .ls .go { grid-column: 1 / -1; grid-row: 3; }
  .man .body { padding-left: 0; }
}
.after-list { margin-top: 10px; }
.codebox pre { padding-right: 72px; }
/* keep the rain in the margins: darker glass behind the text column */
.hero .wrap > * { position: relative; }
.hero .wrap::before { content: ""; position: absolute; inset: 0 -48px; background: radial-gradient(ellipse 60% 75% at 42% 50%, rgba(4,8,5,.94) 55%, rgba(4,8,5,0) 100%); }

/* back to top: a small fixed key, bottom right; site.js hides it until you scroll */
.totop {
  position: fixed; z-index: 40;
  right: max(16px, calc(env(safe-area-inset-right, 0px) + 12px));
  bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 12px));
  padding: 7px 11px; font: 500 13px/1 var(--mono); text-decoration: none;
  color: var(--phos); background: var(--crt); border: 1px solid var(--phos);
  box-shadow: 0 0 12px rgba(116,247,154,.18);
}
.totop::before { content: "↑ "; color: var(--dim); }
.totop:hover { background: var(--phos); color: var(--crt); }
.totop:hover::before { color: var(--crt); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ---------- forms (feedback) */
.form { display: grid; gap: 18px; max-width: 68ch; margin-top: 8px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: 13px; color: var(--phos); text-transform: uppercase; letter-spacing: .06em; }
.field label .dim { text-transform: none; letter-spacing: 0; }
.field input, .field select, .field textarea {
  width: 100%; font: 400 15px/1.5 var(--mono); color: var(--text); background: var(--panel);
  border: 1px solid var(--line); padding: 10px 12px; border-radius: 0;
}
.field textarea { resize: vertical; min-height: 9em; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px dashed var(--phos); outline-offset: 2px; border-color: var(--phos); }
.field ::placeholder { color: var(--dim); opacity: .8; }
.hint { font-size: 12px; color: var(--dim); justify-self: end; font-variant-numeric: tabular-nums; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
button.btn:disabled { opacity: .5; cursor: wait; }

/* ---------- admin */
.admin td.num { text-align: right; font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 90px; padding: 8px; border: 1px solid var(--line); background: var(--panel); margin-bottom: 16px; }
.bars .bar { flex: 1; min-width: 2px; background: var(--amber); opacity: .85; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tabs .btn[aria-pressed="true"] { background: var(--phos); color: var(--crt); }
.fblist { display: grid; gap: 12px; }
.fb { border: 1px solid var(--line); background: var(--panel); padding: 12px 14px; min-width: 0; }
.fb.done { opacity: .6; }
.fb .meta { margin: 0 0 8px; font-size: 13px; }
.fb .body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 12px; max-width: none; }
.fb .actions code { overflow-wrap: anywhere; }
