/* Cybernode — phosphor on void, IPv6 rain */

:root {
  --void: #030806;
  --void-2: #07120d;
  --phosphor: #5cffa1;
  --phosphor-dim: #2a7a52;
  --grid: #10261b;
  --text: #c9f2d9;
  --muted: #7fa892;
  --cyan: #2fe6ff;
  --magenta: #ff2e88;

  --display: "Chakra Petch", system-ui, sans-serif;
  --term: "VT323", ui-monospace, monospace;

  --measure: 66ch;
  --gutter: clamp(16px, 5vw, 48px);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--display);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* CRT scanlines over everything, very faint */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgb(0 0 0 / 0) 0 2px, rgb(0 0 0 / .18) 2px 3px);
  z-index: 50;
}

a { color: var(--phosphor); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: #fff; text-shadow: 0 0 8px var(--phosphor); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--phosphor); color: var(--void); padding: 6px 10px; z-index: 100; }
.skip:focus { left: 8px; }

.wrap { width: min(100% - 2 * var(--gutter), 860px); margin-inline: auto; }
.ps1 { color: var(--phosphor-dim); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: 12vh var(--gutter) 10vh;
  isolation: isolate;
  overflow: hidden;
}
.hero::before { /* vignette so the type reads over the rain */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 55% at 30% 50%, rgb(3 8 6 / .88), rgb(3 8 6 / .35) 70%, rgb(3 8 6 / .1)),
    linear-gradient(to bottom, transparent 70%, var(--void));
}
#rain { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }

.hero__inner { width: min(100%, 1100px); min-width: 0; margin-inline: auto; }

.handle {
  font: 1.35rem/1 var(--term);
  color: var(--phosphor-dim);
  margin: 0 0 .5rem;
}

.wordmark {
  position: relative;
  margin: 0;
  font: 700 clamp(2.25rem, 12.5vw, 11.5rem)/.86 var(--display);
  letter-spacing: -.04em;
  color: var(--phosphor);
  text-shadow: 0 0 18px rgb(92 255 161 / .45), 0 0 60px rgb(92 255 161 / .2);
  overflow-wrap: anywhere;
}
/* chromatic split layers — only visible while .is-glitching */
.wordmark::before, .wordmark::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  text-shadow: none;
}
.wordmark::before { color: var(--cyan); mix-blend-mode: screen; }
.wordmark::after { color: var(--magenta); mix-blend-mode: screen; }
.wordmark.is-glitching::before { opacity: .85; animation: split-a .45s steps(2) both; }
.wordmark.is-glitching::after { opacity: .85; animation: split-b .45s steps(2) both; }

@keyframes split-a {
  0%   { transform: translate(-6px, 0); clip-path: inset(10% 0 60% 0); }
  25%  { transform: translate(5px, -2px); clip-path: inset(55% 0 20% 0); }
  50%  { transform: translate(-3px, 2px); clip-path: inset(30% 0 45% 0); }
  75%  { transform: translate(4px, 0); clip-path: inset(75% 0 5% 0); }
  100% { transform: none; clip-path: inset(0 0 100% 0); }
}
@keyframes split-b {
  0%   { transform: translate(6px, 1px); clip-path: inset(65% 0 10% 0); }
  25%  { transform: translate(-5px, 0); clip-path: inset(15% 0 70% 0); }
  50%  { transform: translate(3px, -1px); clip-path: inset(45% 0 30% 0); }
  75%  { transform: translate(-4px, 2px); clip-path: inset(5% 0 80% 0); }
  100% { transform: none; clip-path: inset(100% 0 0 0); }
}

.tagline {
  margin: 1.25rem 0 0;
  font: 300 clamp(1.15rem, 2.6vw, 1.6rem)/1.3 var(--display);
  color: var(--text);
  max-width: 28ch;
}

.trace {
  margin-top: clamp(2rem, 6vh, 3.5rem);
  font: 1.35rem/1.25 var(--term);
  max-width: 34rem;
  border-left: 2px solid var(--phosphor-dim);
  padding: .25rem 0 .25rem 1rem;
  background: linear-gradient(to right, rgb(3 8 6 / .75), transparent);
}
.trace__cmd { margin: 0 0 .4rem; color: var(--text); }
.trace__out { margin: 0; display: grid; gap: .1rem; }
.trace__out div { display: grid; grid-template-columns: 5.5ch minmax(0, 1fr); gap: 1ch; }
.trace__out dt { color: var(--phosphor-dim); }
.trace__out dd { margin: 0; color: var(--phosphor); overflow-wrap: anywhere; }
.trace__out dd.v6 { color: var(--cyan); text-shadow: 0 0 8px rgb(47 230 255 / .5); }
.trace__out dd.v4 { color: #ffd166; }

.hero__down {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  translate: -50% 0;
  font: 2rem/1 var(--term);
  color: var(--phosphor-dim);
  text-decoration: none;
  padding: .25rem .75rem;
}
.hero__down:hover { color: var(--phosphor); }

/* ---------- sections ---------- */

main > section { padding-block: clamp(3.5rem, 9vw, 6.5rem); }
main > section + section { border-top: 1px dashed var(--grid); }

.h2 {
  margin: 0 0 1.25rem;
  font: 600 clamp(1.6rem, 4.2vw, 2.6rem)/1.1 var(--display);
  color: #e9fff1;
  letter-spacing: -.01em;
  max-width: 24ch;
}
.h2--path { font: 400 clamp(2rem, 5vw, 2.8rem)/1 var(--term); color: var(--phosphor); }

.intro p, .contact > p { max-width: var(--measure); color: var(--text); margin: 0; }
.intro p { font-size: 1.15rem; }

/* ---------- log: git-log timeline ---------- */

.commits { list-style: none; margin: 2rem 0 0; padding: 0; position: relative; }
.commits::before { /* the branch line */
  content: "";
  position: absolute;
  left: 7px;
  top: .6rem;
  bottom: .6rem;
  width: 2px;
  background: linear-gradient(to bottom, var(--phosphor), var(--phosphor-dim) 30%, var(--grid));
}
.commit { position: relative; padding: 0 0 2.5rem 2.5rem; }
.commit:last-child { padding-bottom: 0; }
.commit::before { /* node on the branch */
  content: "";
  position: absolute;
  left: 0;
  top: .45rem;
  width: 16px;
  height: 16px;
  border: 2px solid var(--phosphor-dim);
  background: var(--void);
  transform: rotate(45deg) scale(.8);
}
.commit--head::before { border-color: var(--phosphor); background: var(--phosphor); box-shadow: 0 0 14px var(--phosphor); }
.commit--root::before { border-style: dotted; }

.commit__meta { font: 1.2rem/1 var(--term); color: var(--muted); display: flex; gap: 1ch; flex-wrap: wrap; align-items: baseline; }
.hash { color: #ffd166; }
.ref { color: var(--void); background: var(--phosphor); padding: 0 .4ch; }
.commit h3 { margin: .35rem 0 .5rem; font: 600 1.35rem/1.25 var(--display); color: #e9fff1; }
.commit p { margin: 0; max-width: var(--measure); }
.badge { display: inline-block; margin-top: 1.25rem; filter: grayscale(1) contrast(1.1); opacity: .8; }
.badge:hover { filter: none; opacity: 1; }
.badge img { display: block; max-width: 100%; height: auto; }

/* ---------- shell ---------- */

.term {
  border: 1px solid var(--phosphor-dim);
  background: var(--void-2);
  box-shadow: 0 0 0 1px rgb(92 255 161 / .06), 0 0 40px rgb(92 255 161 / .07) inset;
  font: 1.3rem/1.3 var(--term);
}
.term__bar { display: flex; align-items: center; gap: 6px; padding: .4rem .75rem; border-bottom: 1px solid var(--grid); color: var(--muted); }
.term__bar span { width: 10px; height: 10px; border: 1px solid var(--phosphor-dim); }
.term__bar em { font-style: normal; margin-left: auto; font-size: 1.05rem; }
.term__out { padding: .75rem 1rem 0; max-height: 22rem; overflow-y: auto; scrollbar-color: var(--phosphor-dim) transparent; }
.term__out p { margin: 0 0 .15rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.term__out .echo { color: var(--muted); }
.term__out .err { color: var(--magenta); }
.term__out .hi { color: var(--cyan); }
kbd { font: inherit; color: var(--phosphor); }
.term__line { display: flex; gap: 1ch; padding: .25rem 1rem .9rem; align-items: baseline; }
.term__line label { flex: none; }
.term__line input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: var(--phosphor);
  font: inherit;
  caret-color: var(--phosphor);
  padding: 0;
}
.term__line input:focus { outline: none; }
.term:focus-within { border-color: var(--phosphor); }

@media (max-width: 520px) {
  .term__line { flex-direction: column; gap: 0; }
  .term__line input { width: 100%; }
}

/* ---------- contact + footer ---------- */

.links { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .75rem; }
.links a {
  display: inline-block;
  padding: .55rem 1rem;
  border: 1px solid var(--phosphor-dim);
  text-decoration: none;
  font-weight: 600;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  background: linear-gradient(var(--void), var(--void)) padding-box;
}
.links a:hover { background: var(--phosphor); color: var(--void); text-shadow: none; }

.foot { padding: 3rem 0 4rem; border-top: 1px dashed var(--grid); }
.foot blockquote { margin: 0; max-width: 46ch; }
.foot blockquote p { margin: 0; font: 300 1.2rem/1.5 var(--display); color: var(--text); }
.foot cite { display: block; margin-top: .5rem; font: 1.2rem var(--term); color: var(--muted); font-style: normal; }
.foot cite::before { content: "— "; }
.foot__sig { margin: 2.5rem 0 0; font: 1.1rem var(--term); color: var(--phosphor-dim); }
