/* /contact - green-phosphor terminal. Everything is scoped to html.term,
   so the rest of the site is unaffected. */

html.term {
  --phos: #46ff82;
  --phos-hi: #c4ffd6;
  --phos-dim: rgba(70, 255, 130, .58);
  --phos-faint: rgba(70, 255, 130, .3);
  --crt-bg: #020502;
  --glow: 0 0 1px rgba(70, 255, 130, .85), 0 0 7px rgba(70, 255, 130, .38), 0 0 20px rgba(70, 255, 130, .12);
  background: var(--crt-bg);
}

html.term body {
  min-height: 100vh;
  min-height: 100svh;
  background: var(--crt-bg);
  color: var(--phos);
  font: 400 15px/1.55 ui-monospace, "SF Mono", SFMono-Regular, Menlo, "DejaVu Sans Mono", "Liberation Mono", Consolas, monospace;
  text-shadow: var(--glow);
  letter-spacing: .02em;
}

/* the site's middle finger, aimed at the cat (mouse/trackpad only) */
@media (hover: hover) and (pointer: fine) {
  html.term body { cursor: url("/assets/cursor/finger-v1.png") 16 7, auto; }
}

/* ------------------------------------------------------------ CRT */
/* scanlines */
html.term body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom,
    rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, .26) 3px, rgba(0, 0, 0, 0) 4px);
}
/* curved-glass vignette + a faint, irregular brightness flicker */
html.term body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  box-shadow: inset 0 0 16vmin rgba(0, 0, 0, .9), inset 0 0 3vmin rgba(0, 0, 0, .6);
  animation: crt-flicker 7s steps(1, end) infinite;
}
@keyframes crt-flicker {
  0%, 100% { opacity: 1; }
  31% { opacity: .9; }
  32% { opacity: 1; }
  67% { opacity: .95; }
  68% { opacity: 1; }
  88% { opacity: .93; }
  89% { opacity: 1; }
}

/* ------------------------------------------------------------ menu on this page */
html.term .menu {
  color: var(--phos);
  filter: drop-shadow(0 0 3px rgba(70, 255, 130, .45));
}

/* ------------------------------------------------------------ layout */
.terminal {
  box-sizing: border-box;
  width: min(100%, 66ch);
  margin: 0 auto;
  padding: max(56px, 7vh) 20px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);   /* never wider than the screen */
  gap: 1.4em;
}
.terminal > * { min-width: 0; }

.term-head h1 {
  margin: 0 0 .7em;
  font: inherit;
  font-weight: 700;
  font-size: 1.05em;
  letter-spacing: .28em;
}

.log { margin: 0; padding: 0; list-style: none; }
.row { display: flex; align-items: baseline; gap: .25ch; margin: 0; white-space: nowrap; }
.row .k { flex: none; }
.row .lead { flex: 1 1 2ch; min-width: 2ch; overflow: hidden; color: var(--phos-dim); }
.row .lead::before { content: "................................................................................"; }
.row .v { flex: none; font-weight: 700; }
.inv { background: var(--phos); color: var(--crt-bg); text-shadow: none; padding: 0 .35ch; box-shadow: var(--glow); }

/* ------------------------------------------------------------ the cat */
.cat-wrap { position: relative; margin: .4em 0; display: flex; justify-content: center; }
.cat {
  margin: 0;
  font: inherit;
  font-weight: 700;
  font-size: min(17px, calc((100vw - 32px) / (var(--cols, 52) * .62)));
  line-height: 1.12;
  letter-spacing: 0;
  white-space: pre;
  color: var(--phos);
  cursor: inherit;
  user-select: none;
}
.cat .eye { color: var(--phos-hi); text-shadow: 0 0 2px var(--phos-hi), 0 0 10px rgba(70, 255, 130, .55); }

.zzz {
  position: absolute;
  top: -.4em;
  right: 12%;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  transition: opacity .8s ease;
  pointer-events: none;
}
.zzz span { display: inline-block; }
.zzz span:nth-child(2) { font-size: 1.3em; transform: translate(.2em, -.6em); }
.zzz span:nth-child(3) { font-size: 1.7em; transform: translate(.4em, -1.3em); }
body[data-cat="asleep"] .zzz { opacity: 1; animation: zzz 3.2s ease-in-out infinite; }
@keyframes zzz { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ------------------------------------------------------------ contact + status */
.contact .email {
  color: var(--phos-hi);
  text-decoration: none;
  border-bottom: 1px dashed var(--phos-dim);
  cursor: pointer;
  outline: none;
}
.contact .email:hover, .contact .email:focus-visible {
  background: var(--phos);
  color: var(--crt-bg);
  text-shadow: none;
  border-bottom-color: transparent;
  box-shadow: var(--glow);
}
.hint { margin: .2em 0 0; color: var(--phos-dim); font-size: .85em; }

.status { min-height: 3.4em; }
.status p { margin: 0; }
.status .loud { font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.status-sub { color: var(--phos-dim); }
.cursor {
  display: inline-block;
  width: .62em;
  height: 1.08em;
  margin-left: .2ch;
  vertical-align: -.18em;
  background: var(--phos);
  box-shadow: var(--glow);
  animation: cursor-blink 1.06s steps(1, end) infinite;
}
@keyframes cursor-blink { 50% { opacity: 0; } }

/* boot sequence (contact.js adds .pending, then removes it line by line) */
[data-boot] { transition: opacity .12s steps(2, end); }
[data-boot].pending { opacity: 0; }

.sr-only, .offscreen {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

/* ------------------------------------------------------------ small screens */
@media (max-width: 560px) {
  html.term body { font-size: 13px; }
  .terminal { padding: 64px 16px 40px; gap: 1.3em; }
  .term-head h1 { letter-spacing: .16em; }
}

/* ------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  html.term body::after { animation: none; }
  .cursor { animation: none; }
  body[data-cat="asleep"] .zzz { animation: none; }
  [data-boot], .zzz { transition: none; }
}
