/* ==========================================================================
   AHO-990614 — phosphor terminal portfolio (v2)
   Green phosphor on black. All Matrix flavour lives in the foreground text;
   the background is only the tube itself (no rain, no dots, no grids).
   ========================================================================== */

:root {
  --bg: #010A03;
  --bg-2: #04190A;
  --fg: #00FF41;       /* matrix green: prompts, headings, accents */
  --text: #A4F5B4;     /* softer phosphor for body copy, for readability */
  --dim: #2FA24A;      /* labels, secondary */
  --line: #0E4A1C;     /* rules */
  --hi: #E2FFE7;       /* white-hot highlight */
  --pill: #E5261F;     /* the red pill (CV), the only non-green colour */

  --plastic: #1B1C18;
  --room: #060706;

  --f-crt: 'VT323', ui-monospace, monospace;
  --f-mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --pad: clamp(18px, 3.4vw, 52px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--room);
  color: var(--text);
  font: 400 15.5px/1.65 var(--f-mono);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
p { margin: 0; }
a { color: var(--fg); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--hi); }
b { color: var(--hi); font-weight: 600; }
.dim { color: var(--dim); }
.ok { color: var(--fg); }
::selection { background: var(--fg); color: var(--bg); text-shadow: none; }
:focus-visible { outline: 1px dashed var(--fg); outline-offset: 3px; }

/* ---------- the machine ---------- */
.room {
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: 18px;
}
.monitor {
  width: min(100%, 1320px);
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 22px 22px 0;
  background: var(--plastic);
  border-radius: 20px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    inset 0 -3px 0 rgba(0, 0, 0, .45),
    0 30px 70px rgba(0, 0, 0, .7);
}
.screen {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 28px / 22px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 42%, var(--bg-2) 0%, var(--bg) 72%);
  box-shadow: 0 0 0 2px #0a0b09, 0 0 0 7px #131411;
}
.tube {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  text-shadow: 0 0 5px rgba(0, 255, 65, .28);
}
.chin {
  height: 46px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  font: 500 11px/1 var(--f-mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #5d5f56;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .04);
}
.plate small { font-size: 10px; margin-left: 12px; color: #45473f; letter-spacing: .14em; }
.power {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: 0;
  border-radius: 6px;
  background: #161713;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-shadow: inherit;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 1px 0 rgba(0, 0, 0, .6);
}
.power:hover { color: #8d8f84; }
.power:hover .led:not(.is-off) { box-shadow: 0 0 8px var(--fg), 0 0 18px rgba(0, 255, 65, .7); }
.power:active { transform: translateY(1px); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .6); }
.power:focus-visible { outline: 1px dashed var(--fg); outline-offset: 3px; }
.led.is-off { background: #0d2614; box-shadow: none; }
.led {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 0 6px var(--fg), 0 0 12px rgba(0, 255, 65, .5);
}

/* glass: scanlines + vignette + a slow refresh band; never behind content */
.glass {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  border-radius: inherit;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, .16) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 50%, transparent 58%, rgba(0, 0, 0, .5) 100%);
  box-shadow: inset 0 0 90px rgba(0, 0, 0, .65), inset 0 0 4px rgba(0, 255, 65, .18);
}
.glass::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 140px;
  top: -140px;
  background: linear-gradient(to bottom, transparent, rgba(0, 255, 65, .035), transparent);
}
html.motion .glass { animation: flicker 7s steps(1) infinite; }
html.motion .glass::after { animation: refresh 9s linear infinite; }
@keyframes flicker { 0%, 100% { opacity: 1; } 41% { opacity: .93; } 42% { opacity: 1; } 77% { opacity: .96; } 78% { opacity: 1; } }
@keyframes refresh { from { transform: translateY(0); } to { transform: translateY(calc(100vh + 280px)); } }

/* CRT power-on */
html.motion .tube.is-powering { animation: crt-on .75s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes crt-on {
  0%   { transform: scale(1, .003); filter: brightness(5); opacity: .6; }
  35%  { transform: scale(1, .003); filter: brightness(5); opacity: 1; }
  70%  { transform: scale(1, 1.02); filter: brightness(1.6); }
  100% { transform: none; filter: none; }
}

/* CRT power-off: squash to a line, then a dot, then dark */
.tube.is-off { visibility: hidden; }
html.motion .tube.is-off { animation: crt-off .55s cubic-bezier(.6, 0, .8, .4) both; }
@keyframes crt-off {
  0%   { transform: none; filter: none; opacity: 1; visibility: visible; }
  55%  { transform: scale(1, .004); filter: brightness(4); opacity: 1; visibility: visible; }
  85%  { transform: scale(.004, .004); filter: brightness(6); opacity: 1; visibility: visible; }
  100% { transform: scale(0, 0); opacity: 0; visibility: hidden; }
}

/* standby card */
.standby {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad);
  overflow-y: auto;
  background: rgba(0, 4, 1, .96);
  color: var(--text);
  text-shadow: 0 0 6px rgba(0, 255, 65, .35);
}
.standby[hidden] { display: none; }
html.motion .standby:not([hidden]) { animation: standby-in .6s ease .45s both; }
@keyframes standby-in { from { opacity: 0; } to { opacity: 1; } }
.standby__card { width: min(100%, 680px); margin: auto 0; }
.standby__meta { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 13px; margin-bottom: 18px; }
.standby__name {
  margin: 0 0 12px;
  font: 400 clamp(46px, 6.4vw, 92px)/1 var(--f-crt);
  color: var(--hi);
  letter-spacing: .015em;
  text-shadow: 0 0 8px rgba(0, 255, 65, .65), 0 0 30px rgba(0, 255, 65, .25);
}
.standby__name span { display: block; }
.standby__role { font: 400 clamp(24px, 2.4vw, 32px)/1 var(--f-crt); letter-spacing: .14em; color: var(--fg); }
.standby__lead { margin-top: 12px; max-width: 58ch; }
.standby__kv { margin-top: 18px; }
.standby__actions { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 22px; }
.standby__actions .btn { text-decoration: none; display: inline-block; font-size: 22px; }
.btn--on { color: var(--hi); }
.standby__mail { margin-top: 10px; min-height: 1.6em; }

/* ---------- status line & function keys (inverse video) ---------- */
.statusbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 5px var(--pad) 3px;
  background: var(--dim);
  color: var(--bg);
  font: 20px/1 var(--f-crt);
  letter-spacing: .05em;
  text-shadow: none;
  white-space: nowrap;
}
.sb-dim { opacity: .7; }
.sb-status { display: flex; align-items: center; gap: 8px; }
.sb-power {
  display: none;
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  color: var(--bg);
  font: inherit;
  cursor: pointer;
}
.sb-power:focus-visible { outline: 1px dashed var(--bg); outline-offset: 2px; }
.statusbar .dot { background: var(--bg); box-shadow: none; }

.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 0 6px var(--fg);
}
html.motion .dot { animation: blink 1.6s steps(1) infinite; }
@keyframes blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .15; } }

.fkeys {
  display: flex;
  gap: 4px 18px;
  flex-wrap: wrap;
  padding: 7px var(--pad) 9px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  font: 20px/1 var(--f-crt);
}
.fkeys button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  text-shadow: inherit;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.fkeys b { color: var(--hi); font-weight: 400; }
.fkeys span { padding: 1px 5px; background: var(--line); color: var(--fg); }
.fkeys button:hover span, .fkeys button:focus-visible span { background: var(--fg); color: var(--bg); text-shadow: none; }

/* ---------- the session ---------- */
.term {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  outline: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.wrap { max-width: 1020px; padding: 26px var(--pad) 48px; }

.post {
  font: 21px/1.2 var(--f-crt);
  color: var(--dim);
  padding-bottom: 18px;
}
.post__l { white-space: pre-wrap; }
html.motion .post__l { visibility: hidden; }
html.motion .post__l.on { visibility: visible; }

.blk { padding: 26px 0 34px; border-top: 1px dashed var(--line); scroll-margin-top: 4px; }
.cmd { margin-bottom: 14px; color: var(--hi); font-weight: 500; }
.ps1 { color: var(--fg); font-weight: 500; margin-right: .4em; }
html.motion .blk:not(.is-run) .out { visibility: hidden; }
.tw-off { visibility: hidden; }
.cmd .tw-caret { background: var(--fg); color: var(--bg); }

.h {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 18px;
  font: 400 clamp(32px, 3.4vw, 46px)/1 var(--f-crt);
  letter-spacing: .05em;
  color: var(--fg);
  text-shadow: 0 0 8px rgba(0, 255, 65, .45);
}
.h small { font-size: .5em; color: var(--dim); letter-spacing: .1em; }
.h::after { content: ""; flex: 1; height: 1px; background: var(--line); align-self: center; }

.meta { color: var(--dim); font-size: 13.5px; margin: -6px 0 14px; }
.sub { color: var(--dim); font-size: 13.5px; margin: 22px 0 8px; }
.sub::before { content: "# "; }
.prose { max-width: 66ch; font-size: 17px; line-height: 1.7; }

/* whoami */
.name {
  margin: 4px 0 14px;
  font: 400 clamp(54px, 8.4vw, 128px)/1 var(--f-crt);
  letter-spacing: .015em;
  color: var(--hi);
  text-shadow: 0 0 6px rgba(0, 255, 65, .6), 0 0 26px rgba(0, 255, 65, .22);
}
.name span { display: block; }
.role {
  font: 400 clamp(26px, 2.6vw, 36px)/1 var(--f-crt);
  letter-spacing: .14em;
  color: var(--fg);
}
.lead { margin-top: 12px; font-size: 17px; max-width: 60ch; }

.kv { margin: 22px 0 0; max-width: 680px; }
.kv > div {
  display: grid;
  grid-template-columns: 10ch 1fr;
  gap: 16px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
}
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--dim); }
.kv dt::after { content: ":"; }
.kv dd { margin: 0; color: var(--hi); overflow-wrap: anywhere; }
.kv .live { display: flex; align-items: center; gap: 10px; color: var(--fg); }

/* experience: ls -l */
.ls { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ls__item { border-bottom: 1px solid var(--line); }
.ls__row {
  appearance: none;
  background: none;
  border: 0;
  width: 100%;
  color: inherit;
  font: inherit;
  text-shadow: inherit;
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: 2ch 10ch 19ch 15ch minmax(0, 1fr) 9ch;
  gap: 14px;
  align-items: baseline;
  padding: 11px 6px;
}
.ls__row:hover { background: rgba(0, 255, 65, .06); }
.ls__caret { color: var(--fg); }
.ls__perm { color: var(--dim); }
.ls__date { color: var(--text); white-space: nowrap; }
.ls__name { color: var(--hi); font-weight: 600; }
.ls__role { color: var(--text); }
.ls__state { color: var(--dim); text-align: right; }
.is-running .ls__state { color: var(--fg); }
html.motion .is-running .ls__state { animation: blink 1.6s steps(1) infinite; }

.ls__body {
  display: grid;
  gap: 8px;
  padding: 2px 6px 18px calc(6px + 2ch + 10ch + 28px);
}
.ls__body[hidden] { display: none; }
html.motion .ls__body:not([hidden]) { animation: unroll .4s steps(8) both; }
@keyframes unroll { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.ls__sum { color: var(--hi); }
.ls__log { list-style: none; margin: 0; padding: 0; counter-reset: ln; }
.ls__log li { counter-increment: ln; display: grid; grid-template-columns: 4ch 1fr; }
.ls__log li::before { content: counter(ln, decimal-leading-zero); color: var(--dim); }
.ls__stack { color: var(--dim); font-size: 13.5px; }

/* stack table, dashed rules for an ASCII feel */
.tbl { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.tbl th, .tbl td {
  border: 1px dashed var(--line);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  font-weight: 400;
}
.tbl thead th {
  font: 20px/1 var(--f-crt);
  letter-spacing: .1em;
  color: var(--fg);
  border-bottom: 1px solid var(--dim);
}
.tbl tbody th { color: var(--fg); font-weight: 600; white-space: nowrap; }
.tbl td { color: var(--text); }
.tbl .n { text-align: right; width: 5ch; color: var(--hi); }

/* education */
.edu { list-style: none; margin: 0; padding: 0; }
.edu li {
  display: grid;
  grid-template-columns: 16ch minmax(0, 1fr) minmax(0, .8fr);
  gap: 18px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}
.edu__y { color: var(--fg); }
.edu__t { color: var(--hi); }
.edu__i { color: var(--dim); }
.lang { list-style: none; margin: 0; padding: 0; }
.lang li { display: flex; gap: 16px; align-items: baseline; padding: 3px 0; }
.lang__bar { color: var(--fg); letter-spacing: .02em; }

/* contact */
.form { max-width: 760px; margin-top: 6px; }
.fl {
  display: grid;
  grid-template-columns: 10ch 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 6px 8px;
  border-left: 2px solid transparent;
}
.fl:focus-within { border-left-color: var(--fg); background: rgba(0, 255, 65, .04); }
.fl label { color: var(--fg); }
.fl label::after { content: " >"; color: var(--dim); }
.fl input, .fl textarea {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--hi);
  font: inherit;
  text-shadow: inherit;
  caret-color: var(--fg);
  padding: 0;
  resize: none;
}
.fl input::placeholder, .fl textarea::placeholder { color: #1E7A36; opacity: 1; }
.fl[data-invalid] label { color: var(--hi); }
.fl[data-invalid] label::after { content: " ! required"; color: var(--hi); }
.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 12px 8px 0; }
.btn {
  appearance: none;
  background: none;
  border: 0;
  color: var(--fg);
  font: 24px/1 var(--f-crt);
  text-shadow: inherit;
  padding: 4px 6px;
  cursor: pointer;
}
.btn:hover, .btn:focus-visible { background: var(--fg); color: var(--bg); text-shadow: none; }
.form__status { color: var(--dim); font-size: 13.5px; }
.btn--dim { color: var(--dim); font-size: 20px; }
.form__hint { color: var(--dim); font-size: 12.5px; padding: 8px 8px 0; max-width: 62ch; }

.choice { margin: 30px 0 22px; }
.choice__row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 26px; }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 12px 34px 9px;
  border-radius: 999px;
  background: var(--pill);
  color: #1a0303;
  font: 32px/1 var(--f-crt);
  letter-spacing: .08em;
  text-decoration: none;
  text-shadow: none;
  box-shadow:
    0 0 20px rgba(229, 38, 31, .45),
    inset 0 3px 0 rgba(255, 255, 255, .28),
    inset 0 -5px 0 rgba(0, 0, 0, .25);
  transition: box-shadow .2s, transform .2s;
}
.pill:hover { color: #1a0303; transform: translateY(-1px); box-shadow: 0 0 34px rgba(229, 38, 31, .7), inset 0 3px 0 rgba(255, 255, 255, .28), inset 0 -5px 0 rgba(0, 0, 0, .25); }
.pill:focus-visible { outline-color: var(--pill); outline-offset: 5px; }
.bluepill {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  color: var(--dim);
  font: inherit;
  text-shadow: inherit;
  cursor: pointer;
  text-decoration: underline dashed var(--line);
  text-align: left;
  text-underline-offset: 4px;
}
.bluepill:hover { color: var(--fg); }
.kv--links { margin-top: 0; }
.reveal {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  color: var(--fg);
  font: inherit;
  text-shadow: inherit;
  cursor: pointer;
}
.reveal:hover, .reveal:focus-visible { background: var(--fg); color: var(--bg); text-shadow: none; }

/* live shell */
.shell { padding: 22px 0 8px; border-top: 1px dashed var(--line); }
.shell__out { white-space: pre-wrap; }
.shell__out:empty { display: none; }
.shell__out .ln { padding: 1px 0; }
.shell__out .echo { color: var(--hi); }
.shell__out .err { color: var(--hi); }
.shell__out .gap { height: 10px; }
.prompt { display: flex; align-items: baseline; margin: 6px 0 10px; }
.prompt__field { position: relative; flex: 1; min-width: 0; }
.prompt input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 0;
  color: var(--hi);
  font: inherit;
  text-shadow: inherit;
  caret-color: var(--fg);
}
.prompt input:placeholder-shown { caret-color: transparent; }
.cursor {
  position: absolute;
  left: 0; top: 50%;
  width: .62em; height: 1.15em;
  transform: translateY(-50%);
  background: var(--fg);
  box-shadow: 0 0 8px rgba(0, 255, 65, .6);
  display: none;
}
.prompt input:placeholder-shown + .cursor { display: block; }
html.motion .cursor { animation: blink 1.05s steps(1) infinite; }

/* intro */
.intro {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--pad) calc(var(--pad) * 1.5);
  background: var(--bg);
  cursor: pointer;
}
.intro[hidden] { display: none; }
.intro__line {
  font: clamp(30px, 3.6vw, 52px)/1.2 var(--f-crt);
  color: var(--fg);
  text-shadow: 0 0 8px rgba(0, 255, 65, .55);
  min-height: 1.2em;
}
.intro__line::after { content: "█"; margin-left: 2px; }
html.motion .intro__line::after { animation: blink 1.05s steps(1) infinite; }
.intro__skip {
  position: absolute;
  bottom: 22px; left: calc(var(--pad) * 1.5);
  font: 19px/1 var(--f-crt);
  color: var(--dim);
  letter-spacing: .08em;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .ls__row { grid-template-columns: 2ch 19ch 15ch minmax(0, 1fr) 9ch; }
  .ls__perm { display: none; }
  .ls__body { padding-left: calc(6px + 2ch + 14px); }
}

@media (max-width: 768px) {
  body { font-size: 14.5px; }
  .room { padding: 0; }
  .monitor { padding: 0; border-radius: 0; background: var(--bg); box-shadow: none; }
  .screen { border-radius: 0; box-shadow: none; }
  .glass { box-shadow: inset 0 0 50px rgba(0, 0, 0, .55); }
  .chin { display: none; }

  .statusbar { font-size: 17px; padding-top: max(5px, env(safe-area-inset-top)); }
  .sb-clock, .sb-dim { display: none; }
  .sb-power { display: inline; }
  .standby { align-items: flex-start; }
  .standby__actions .btn { font-size: 20px; }

  .wrap { padding: 18px var(--pad) 36px; }
  .post { font-size: 17px; }
  .blk { padding: 22px 0 28px; }
  .prose, .lead { font-size: 15.5px; }
  .name { font-size: clamp(46px, 15vw, 84px); }
  .role { font-size: 25px; }
  .kv > div { grid-template-columns: 10ch 1fr; gap: 10px; }

  .ls__row {
    grid-template-columns: 2ch minmax(0, 1fr) auto;
    grid-template-areas:
      "caret date state"
      ".     name name"
      ".     role role";
    gap: 2px 10px;
    padding: 12px 4px;
  }
  .ls__caret { grid-area: caret; }
  .ls__date { grid-area: date; font-size: 13px; color: var(--dim); }
  .ls__state { grid-area: state; font-size: 13px; }
  .ls__name { grid-area: name; font-size: 15.5px; }
  .ls__role { grid-area: role; }
  .ls__body { padding: 0 4px 16px calc(4px + 2ch + 10px); }

  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl th, .tbl td { display: block; }
  .tbl tr { position: relative; border: 1px dashed var(--line); border-bottom: 0; padding: 10px 12px; }
  .tbl tr:last-child { border-bottom: 1px dashed var(--line); }
  .tbl th, .tbl td { border: 0; padding: 0; width: auto; }
  .tbl tbody th { margin-bottom: 4px; }
  .tbl .n { position: absolute; top: 10px; right: 12px; }

  .edu li { grid-template-columns: 1fr; gap: 0; }
  .edu__y { font-size: 13px; }

  .fl { grid-template-columns: 1fr; gap: 2px; }
  .pill { font-size: 28px; }

  .fkeys {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 8px;
    font-size: 18px;
    padding-bottom: max(9px, env(safe-area-inset-bottom));
  }
  .fkeys::-webkit-scrollbar { display: none; }
  .fkeys b { display: none; }
  .fkeys span { padding: 4px 8px; }

  .intro__line { font-size: 30px; }
}

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