/* Wexyz — portfolio, drawn as an amber terminal. One stylesheet for every page. */

:root {
  color-scheme: dark;
  --bg: #080604;
  --fg: #FF8A2A;        /* neon orange: normal text */
  --hot: #FFD9B0;       /* white-hot: emphasis */
  --mid: #C8661C;       /* secondary text */
  --dim: #9A4E16;       /* decoration only */
  --rule: #4A260C;      /* frame lines */
  --glow: rgba(255, 122, 26, 0.5);
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  --pixel: "VT323", "JetBrains Mono", ui-monospace, monospace;
  --pad: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; padding-bottom: 72px;
  background: var(--bg); color: var(--fg);
  font-family: var(--mono); font-size: 15px; line-height: 1.6; font-variant-ligatures: none;
  text-shadow: 0 0 7px var(--glow);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
@media (max-width: 640px) { body { font-size: 13.5px; } }

/* the tube: scanlines, then a vignette with a faint warm bloom in the middle */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.24) 0 1px, transparent 1px 3px);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: 91; pointer-events: none;
  background:
    radial-gradient(110% 80% at 50% 38%, rgba(255, 110, 20, 0.055), transparent 60%),
    radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, 0.62) 100%);
}

::selection { background: var(--fg); color: var(--bg); text-shadow: none; }
p, dl, dd, ol, ul, pre, figure, h1, h2, h3 { margin: 0; padding: 0; }
ol, ul { list-style: none; }
h1, h2, h3 { font-weight: 400; }
a { color: var(--hot); text-decoration: underline; text-decoration-color: var(--dim); text-underline-offset: 3px; }
a:hover { background: var(--fg); color: var(--bg); text-shadow: none; text-decoration: none; }
:focus-visible { outline: 1px solid var(--hot); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hot { color: var(--hot); text-shadow: 0 0 6px rgba(255, 170, 90, 0.85), 0 0 22px rgba(255, 110, 20, 0.5); }
.mid { color: var(--mid); }
[id] { scroll-margin-top: 28px; }

.skip { position: fixed; left: 8px; top: -60px; z-index: 95; background: var(--fg); color: var(--bg); text-shadow: none; padding: 6px 12px; text-decoration: none; }
.skip:focus { top: 8px; }

/* ---------- screen ---------- */
.tty { width: min(100% - 2 * var(--pad), 118ch); margin-inline: auto; padding-top: clamp(24px, 6vh, 56px); animation: flicker 7s linear infinite; }
@keyframes flicker { 0%, 46%, 54%, 100% { opacity: 1; } 48% { opacity: 0.975; } 50% { opacity: 0.94; } 52% { opacity: 0.985; } }
.motd { color: var(--mid); margin-bottom: 2.2em; }
.block { margin-bottom: clamp(52px, 10vh, 104px); }
.block.tight { margin-bottom: clamp(28px, 5vh, 48px); }

/* prompt + typed command */
.cmd { margin-bottom: 1.3em; white-space: pre-wrap; overflow-wrap: anywhere; }
.ps1 { color: var(--mid); }
.typed { color: var(--hot); }
.cur {
  display: none; width: 1ch; height: 1.15em; margin-left: 1px; vertical-align: text-bottom;
  background: var(--fg); box-shadow: 0 0 10px var(--glow); animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.js .block.is-wait .cur, .js .block.is-typing .cur { display: inline-block; }
.js .block.is-typing .cur { animation: none; }
/* output stays hidden until its command has been typed, then prints line by line */
.js .block.is-wait .out, .js .block.is-typing .out { visibility: hidden; }
.js .block.is-done .out > * { animation: print 1ms steps(1, end) both; animation-delay: calc(var(--n, 0) * 60ms); }
@keyframes print { from { opacity: 0; } to { opacity: 1; } }

/* ---------- whoami ---------- */
.logo {
  display: block; width: min(100%, 760px); height: auto; margin: 0.2em 0 1.7em; color: var(--fg);
  filter: drop-shadow(0 0 5px rgba(255, 122, 26, 0.8)) drop-shadow(0 0 26px rgba(255, 90, 0, 0.38));
}
.logo .b { fill: currentColor; }
.logo .l { fill: none; stroke: currentColor; stroke-width: 1.15; opacity: 0.8; }
.lead {
  font-family: var(--pixel); font-size: clamp(1.75rem, 3.7vw, 3rem); line-height: 1.02; letter-spacing: 0.01em;
  max-width: 38ch; margin-bottom: 0.8em;
}
.kv { display: grid; grid-template-columns: 8ch minmax(0, 1fr); gap: 0.25em 2ch; max-width: 92ch; margin-bottom: 2em; }
.kv dt { color: var(--mid); }
.keys { display: flex; flex-wrap: wrap; gap: 1.2ch 2ch; }
.key {
  display: inline-block; padding: 0.42em 1.6ch; border: 1px solid var(--fg); color: var(--fg); text-decoration: none;
  box-shadow: 0 0 12px rgba(255, 122, 26, 0.18), inset 0 0 12px rgba(255, 122, 26, 0.08);
}
.key.solid { background: var(--fg); color: var(--bg); text-shadow: none; font-weight: 700; }
.key:hover { background: var(--hot); border-color: var(--hot); color: var(--bg); }

/* ---------- ls -l ---------- */
.ls .total { color: var(--mid); }
.ls a {
  display: grid; grid-template-columns: 11ch 10ch 15ch 1fr; gap: 0 2ch; padding: 0.12em 0;
  color: var(--fg); text-decoration: none;
}
.ls a b { color: var(--hot); font-weight: 700; }
.ls a .p { color: var(--mid); }
.ls a:hover, .ls a:hover b, .ls a:hover .p { background: var(--fg); color: var(--bg); text-shadow: none; }
@media (max-width: 640px) { .ls a { grid-template-columns: 10ch 15ch 1fr; } .ls a .p { display: none; } }

/* ---------- windows ---------- */
.win { border: 1px solid var(--rule); background: rgba(255, 122, 26, 0.016); box-shadow: 0 0 34px rgba(255, 100, 10, 0.05); }
.win.fit { width: fit-content; min-width: min(100%, 66ch); max-width: 100%; }
.win-top { display: flex; justify-content: space-between; flex-wrap: wrap; border-bottom: 1px solid var(--rule); font-size: 0.87em; }
.win-name { background: var(--fg); color: var(--bg); text-shadow: none; font-weight: 700; padding: 0.3em 1.4ch; }
.win-meta { padding: 0.3em 1.4ch; color: var(--mid); text-transform: uppercase; letter-spacing: 0.08em; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); }
.doc { padding: clamp(18px, 2.8vw, 38px); display: flex; flex-direction: column; }
.doc > p { max-width: 62ch; }
.title {
  font-family: var(--pixel); font-size: clamp(3.6rem, 7.4vw, 5.6rem); line-height: 0.82; letter-spacing: 0.03em; text-transform: uppercase;
  margin-bottom: 0.32em;
}
.sub { color: var(--mid); margin: 1.8em 0 0.6em; }
.sub::before { content: "# "; color: var(--dim); }
.doc-foot { margin-top: auto; padding-top: 2em; display: flex; flex-direction: column; gap: 0.5em; }
.stat { text-transform: uppercase; letter-spacing: 0.06em; }
.led { display: inline-block; width: 1ch; height: 1ch; margin-right: 1ch; background: var(--hot); box-shadow: 0 0 10px var(--hot); animation: blink 1.6s steps(1) infinite; }
.go::before { content: "-> "; color: var(--mid); }
.flip .doc { order: 2; }

.pane {
  position: relative; min-height: 460px; border-left: 1px solid var(--rule);
  background: radial-gradient(rgba(255, 122, 26, 0.13) 1px, transparent 1.3px) 0 0 / 20px 20px, #060403;
}
.flip .pane { border-left: 0; border-right: 1px solid var(--rule); }
.pane > svg, .pane > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pane-hud, .pane-cap {
  position: absolute; left: 1.6ch; right: 1.6ch; z-index: 2; display: flex; justify-content: space-between; gap: 2ch;
  font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mid); pointer-events: none; white-space: nowrap;
}
.pane-hud { top: 0.9em; }
.pane-cap { bottom: 0.8em; }
.pane-hud b { font-weight: 400; color: var(--fg); }
.pane-hud .alert { background: var(--hot); color: var(--bg); text-shadow: none; padding: 0 1ch; font-weight: 700; animation: blink 0.7s steps(1) infinite; }
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .flip .doc { order: 0; }
  .pane, .flip .pane { min-height: 0; aspect-ratio: 4 / 3; border: 0; border-top: 1px solid var(--rule); }
  .pane.dwg { aspect-ratio: auto; }
  .pane-cap span:last-child { display: none; }
}

/* numbered steps (Photon) */
.steps { margin-top: 1.6em; border-top: 1px dashed var(--rule); }
.steps li { display: grid; grid-template-columns: 2ch 3ch minmax(0, 1fr); gap: 0 1ch; padding: 0.7em 0; border-bottom: 1px dashed var(--rule); color: var(--mid); }
.steps li::before { content: " "; white-space: pre; color: var(--hot); }
.steps li.is-on::before { content: ">"; }
.steps b { font-weight: 700; color: var(--fg); letter-spacing: 0.08em; }
.steps li.is-on { color: var(--fg); }
.steps li.is-on b { background: var(--fg); color: var(--bg); text-shadow: none; padding: 0 1ch; }

/* plus-list (Bale) and dotted table rows (Waflis, contact) */
.plus { columns: 2; column-gap: 3ch; }
.plus li { break-inside: avoid; padding: 0.1em 0; }
.plus li::before { content: "+ "; color: var(--mid); }
@media (max-width: 420px) { .plus { columns: 1; } }
.rows li, .rows a { display: flex; align-items: baseline; gap: 1ch; padding: 0.14em 0; }
.rows li > a { flex: 1; padding: 0; }
.rows .n { color: var(--mid); min-width: 3ch; }
.rows .dots { flex: 1; min-width: 2ch; border-bottom: 1px dotted var(--dim); transform: translateY(-0.3em); }
.rows .v { color: var(--mid); text-transform: uppercase; letter-spacing: 0.06em; }
.rows a { color: var(--fg); text-decoration: none; }
.rows a .v { color: var(--hot); text-transform: none; letter-spacing: 0; }
.rows a:hover, .rows a:hover .n, .rows a:hover .v { background: var(--fg); color: var(--bg); text-shadow: none; }

/* ---------- Photon diagram ---------- */
#photonVis { filter: drop-shadow(0 0 3px rgba(255, 122, 26, 0.75)); }
#photonVis .track { fill: none; stroke: var(--fg); stroke-opacity: 0.75; stroke-width: 1.4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
#photonVis .track.new { stroke: var(--hot); stroke-opacity: 1; stroke-width: 1.8; }
#photonVis .track.old { stroke-opacity: 0.4; stroke-dasharray: 0.012 0.016; stroke-dashoffset: 0 !important; }
#photonVis .obs { fill: none; stroke: var(--fg); stroke-opacity: 0.8; stroke-width: 1; transition: opacity 0.35s; }
#photonVis .sat { transition: opacity 0.3s; }
#photonVis .sat.a { fill: var(--hot); }
#photonVis .sat.b { fill: var(--bg); stroke: var(--hot); stroke-width: 1.7; }
#photonVis .range { stroke: var(--fg); stroke-opacity: 0.7; stroke-width: 1; stroke-dasharray: 3 4; transition: opacity 0.3s; }
#photonVis .range.hot { stroke: var(--hot); stroke-opacity: 1; stroke-dasharray: none; stroke-width: 1.5; }
#photonVis .ring { fill: none; stroke: var(--hot); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: ping 1.5s ease-out infinite; }
#photonVis .ring.r2 { animation-delay: 0.5s; }
@keyframes ping { 0% { transform: scale(0.35); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
#photonVis #pvFlag, #photonVis #pvBurn { transition: opacity 0.35s; }
#photonVis .burn { fill: var(--hot); }
#photonVis .lbl { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; fill: var(--mid); }
#photonVis .lbl.hi { fill: var(--hot); }

#baleVis { filter: drop-shadow(0 0 4px rgba(255, 122, 26, 0.4)); }

/* ---------- engineering drawing (Waflis) ---------- */
.dwg svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 0 3px rgba(255, 122, 26, 0.7)); }
.pane.dwg { display: flex; align-items: center; padding: 76px clamp(14px, 2.6vw, 34px) 56px; }
.pane.dwg > svg { position: static; height: auto; }
.dwg .ln { fill: none; stroke: var(--fg); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.dwg .ln.fill { fill: rgba(255, 122, 26, 0.06); }
.dwg .ln.thin { stroke-width: 1; stroke-opacity: 0.7; }
.dwg .ln.hid { stroke-width: 1; stroke-opacity: 0.7; stroke-dasharray: 6 4; }
.dwg .ln.cl { stroke-width: 0.9; stroke-opacity: 0.55; stroke-dasharray: 18 5 3 5; }
.dwg .ln.dim { stroke-width: 0.9; stroke-opacity: 0.65; }
.dwg .arrow { fill: var(--fg); }
.dwg .lbl { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; fill: var(--mid); }
.dwg .lbl.big { font-size: 13px; fill: var(--hot); }
.dwg .balloon circle { fill: #060403; stroke: var(--fg); stroke-width: 1.2; }
.dwg .balloon text { font-family: var(--mono); font-size: 11.5px; fill: var(--hot); text-anchor: middle; dominant-baseline: central; }
.stamp {
  position: absolute; right: clamp(14px, 3vw, 34px); top: 48px; z-index: 2; transform: rotate(-6deg);
  background: var(--fg); color: var(--bg); text-shadow: none; font-weight: 700; font-size: 0.82em; letter-spacing: 0.22em; padding: 0.25em 1.2ch 0.25em 1.4ch;
  box-shadow: 0 0 16px rgba(255, 122, 26, 0.45);
}
/* lines draw themselves once the sheet scrolls into view */
.js .dwg .d { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
.js .dwg .f { opacity: 0; transition: opacity 0.9s 1s; }
.js .dwg.is-drawn .d { animation: draw 1.7s ease-out forwards; animation-delay: var(--dl, 0s); }
.js .dwg.is-drawn .f { opacity: 1; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- skills.toml ---------- */
.toml { padding: clamp(16px, 2.6vw, 32px); line-height: 1.75; overflow-x: auto; font-family: var(--mono); font-size: 1em; }
.toml .h { color: var(--hot); font-weight: 700; }
.toml .k { color: var(--fg); }
.toml .s { color: var(--hot); }
.toml .c { color: var(--mid); }
.toml .big { font-family: var(--pixel); font-size: 2.6em; line-height: 0.95; vertical-align: -0.1em; letter-spacing: 0.02em; }

/* ---------- contact ---------- */
.mail-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4em 3ch; margin-bottom: 1.8em; }
.mail { font-family: var(--pixel); font-size: clamp(2.5rem, 8.4vw, 6.2rem); line-height: 0.95; text-decoration: none; overflow-wrap: anywhere; }
.copy { font: inherit; text-shadow: inherit; color: var(--fg); background: none; border: 1px solid var(--fg); padding: 0.3em 1.4ch; cursor: pointer; }
.copy:hover, .copy.is-done { background: var(--fg); color: var(--bg); text-shadow: none; }
.contact-rows { max-width: 64ch; }

/* ---------- interactive shell ---------- */
.sh { padding: clamp(14px, 2.2vw, 26px); cursor: text; }
.sh-out { white-space: pre-wrap; overflow-wrap: anywhere; }
.sh-out .echo { color: var(--hot); }
.sh-out .echo .ps1 { color: var(--mid); }
.sh-out .err { color: var(--mid); }
.sh-line { display: flex; gap: 1ch; align-items: baseline; }
.sh-line input {
  flex: 1; min-width: 0; font: inherit; color: var(--hot); text-shadow: inherit; caret-color: var(--fg);
  background: none; border: 0; outline: 0; padding: 0;
}
.hint { margin-top: 1.2em; color: var(--mid); display: flex; flex-wrap: wrap; gap: 0.8ch 1.4ch; align-items: center; }
.hint button { font: inherit; text-shadow: inherit; color: var(--fg); background: none; border: 1px solid var(--rule); padding: 0.1em 1.2ch; cursor: pointer; }
.hint button:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); text-shadow: none; }

.eof { color: var(--mid); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1ch 3ch; padding-bottom: 12px; }

/* ---------- status line (the nav) ---------- */
.tmux {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; align-items: stretch;
  background: var(--fg); color: #140900; text-shadow: none; font-size: 13px; font-weight: 500; line-height: 26px; white-space: nowrap;
  box-shadow: 0 0 26px rgba(255, 122, 26, 0.38);
}
.tmux a, .tmux span { padding: 0 1ch; color: inherit; text-decoration: none; }
.tmux a.is-active, .tmux a:hover { background: #140900; color: var(--fg); }
.tmux .right { margin-left: auto; }
@media (max-width: 640px) { .tmux { font-size: 12px; } .tmux .sess, .tmux .right .host { display: none; } }
@media (max-width: 420px) { .tmux .right { display: none; } }

/* ---------- Waflis drawing-sheet page ---------- */
.title.huge { font-size: clamp(5rem, 17vw, 12rem); margin-bottom: 0.2em; }
.sheet-bar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0 3ch; padding: 0.5em 1.6ch; border-bottom: 1px solid var(--rule); font-size: 0.87em; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mid); }
.sheet-dwg {
  position: relative; padding: clamp(18px, 4vw, 48px) clamp(10px, 3vw, 40px) clamp(12px, 2vw, 24px);
  background:
    linear-gradient(rgba(255, 122, 26, 0.1) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(90deg, rgba(255, 122, 26, 0.1) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(rgba(255, 122, 26, 0.04) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(255, 122, 26, 0.04) 1px, transparent 1px) 0 0 / 24px 24px,
    #060403;
}
.sheet-dwg .stamp { top: clamp(26px, 5vw, 64px); }
.sheet-scroll { overflow-x: auto; }
.sheet-scroll svg { min-width: 680px; }
@media (max-width: 760px) { .sheet-dwg .stamp { position: static; display: inline-block; margin: 0 0 16px 6px; transform: rotate(-3deg); } }
.sheet-cap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0 3ch; padding-top: 1em; font-size: 0.82em; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mid); }
.title-block { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1.2fr; border-top: 1px solid var(--rule); }
.title-block div { padding: 0.7em 1.6ch 0.8em; border-left: 1px solid var(--rule); min-width: 0; }
.title-block div:first-child { border-left: 0; }
.title-block small { display: block; font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.1em; color: var(--mid); }
@media (max-width: 860px) {
  .title-block { grid-template-columns: 1fr 1fr; }
  .title-block div { border-left: 0; border-bottom: 1px solid var(--rule); }
  .title-block div:nth-child(even) { border-left: 1px solid var(--rule); }
  .title-block div:last-child { border-bottom: 0; }
}
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 2em 6ch; }
@media (max-width: 800px) { .two { grid-template-columns: 1fr; } }
.notes { counter-reset: n; }
.notes li { counter-increment: n; display: grid; grid-template-columns: 4ch minmax(0, 1fr); padding: 0.35em 0; }
.notes li::before { content: "0" counter(n); color: var(--mid); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tty, .led, .cur, .pane-hud .alert, #photonVis .ring { animation: none; }
  .js .block.is-done .out > * { animation: none; }
  .js .dwg .d { stroke-dasharray: none; stroke-dashoffset: 0; animation: none !important; }
  .js .dwg .f { opacity: 1; transition: none; }
}
