/* ─────────────────────────────────────────────────────────────────────────
   petr-janda.terminal — old-school phosphor CRT
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --bg:           #050a05;
  --bg-deep:      #020402;
  --phosphor:     #33ff66;
  --phosphor-dim: rgba(51, 255, 102, 0.55);
  --phosphor-muted: rgba(51, 255, 102, 0.30);
  --amber:        #ffb000;
  --red:          #ff0040;
  --white:        #d6ffe2;

  --glow: 0 0 4px var(--phosphor), 0 0 12px rgba(51, 255, 102, 0.35);
  --glow-strong: 0 0 6px var(--phosphor), 0 0 20px rgba(51, 255, 102, 0.55);

  --mono:    'JetBrains Mono', 'IBM Plex Mono', 'Courier New', monospace;
  --display: 'VT323', 'JetBrains Mono', monospace;

  --content-w: 980px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--phosphor);
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.65;
  overflow-x: hidden;
  text-shadow: var(--glow);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--phosphor); color: var(--bg); text-shadow: none; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--phosphor-muted); border: 1px solid var(--bg); }

a { color: var(--phosphor); text-decoration: none; }
a:hover { color: var(--white); text-shadow: var(--glow-strong); }

/* ─── MATRIX RAIN ──────────────────────────────────────────────────────── */
#matrix {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  opacity: 0.08;
  z-index: 0;
  pointer-events: none;
}
body.matrix-amp #matrix { opacity: 0.32; }

/* ─── CRT EFFECT ───────────────────────────────────────────────────────── */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0)        0px,
    rgba(0, 0, 0, 0)        2px,
    rgba(0, 0, 0, 0.25)     3px,
    rgba(0, 0, 0, 0.10)     4px
  );
  mix-blend-mode: multiply;
}

.crt-vignette {
  position: fixed;
  inset: 0;
  z-index: 9001;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.85) 100%),
    radial-gradient(ellipse at center, transparent 75%, rgba(0, 30, 0, 0.40) 100%);
}

.crt-flicker {
  position: fixed;
  inset: 0;
  z-index: 9002;
  pointer-events: none;
  background: rgba(51, 255, 102, 0.025);
  animation: flicker 0.15s infinite alternate;
}

@keyframes flicker {
  0%   { opacity: 0.94; }
  100% { opacity: 1.00; }
}

/* ─── BOOT SEQUENCE ────────────────────────────────────────────────────── */
.boot {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px;
  cursor: pointer;
}

.boot.is-done {
  pointer-events: none;
  animation: boot-fade 0.6s forwards;
}

@keyframes boot-fade {
  to { opacity: 0; transform: translateY(-20px); }
}

.boot__log {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  color: var(--phosphor);
  text-shadow: var(--glow);
  max-width: var(--content-w);
  margin: 0 auto;
  width: 100%;
}

.boot__log .ok       { color: var(--phosphor); }
.boot__log .warn     { color: var(--amber); }
.boot__log .fail     { color: var(--red); }
.boot__log .dim      { color: var(--phosphor-muted); }

.boot__skip {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--phosphor-muted);
  letter-spacing: 0.1em;
  animation: blink 1.2s infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ─── STATUS BAR ───────────────────────────────────────────────────────── */
.statusbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 18px;
  background: var(--phosphor);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 700;
  text-shadow: none;
  border-bottom: 2px solid var(--bg);
}

.statusbar__seg {
  padding: 0 14px;
  border-right: 1px solid rgba(5, 10, 5, 0.4);

  &--brand { font-weight: 900; padding-left: 0; }
  &--mid   { margin-left: auto; }
  &--right { border-right: 0; padding-right: 0; display: inline-flex; align-items: center; gap: 8px; }
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--bg);
  border-radius: 50%;

  &--live { animation: pulse 1.4s infinite; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ─── TERMINAL MAIN ────────────────────────────────────────────────────── */
.terminal {
  position: relative;
  z-index: 1;
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 70px 24px 80px;
}

@media (max-width: 720px) {
  html, body { font-size: 13px; }
  .terminal { padding: 60px 12px 80px; }
}

/* ─── BANNER ───────────────────────────────────────────────────────────── */
.banner {
  margin: 24px 0 56px;
  text-align: center;
}

.banner__ascii {
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.1;
  letter-spacing: 0;
  color: var(--phosphor);
  text-shadow: var(--glow-strong);
  overflow-x: auto;
  white-space: pre;
  display: inline-block;
  text-align: left;
  animation: glitch 7s infinite;
}

@media (max-width: 980px) {
  .banner__ascii { font-size: 7px; }
}
@media (max-width: 720px) {
  .banner__ascii { font-size: 5px; }
}
@media (max-width: 480px) {
  .banner__ascii { font-size: 3.5px; }
}

@keyframes glitch {
  0%, 96%, 100% {
    transform: translate(0);
    text-shadow: var(--glow-strong);
  }
  97% {
    transform: translate(-2px, 0);
    text-shadow:
      -2px 0 var(--red),
      2px 0 var(--phosphor),
      0 0 12px var(--phosphor);
  }
  98% {
    transform: translate(2px, 0);
    text-shadow:
      2px 0 var(--red),
      -2px 0 var(--phosphor),
      0 0 12px var(--phosphor);
  }
  99% {
    transform: translate(0, -1px);
  }
}

.banner__sub {
  font-family: var(--display);
  font-size: 26px;
  line-height: 1.3;
  letter-spacing: 0.02em;
  margin-top: 20px;
  color: var(--phosphor);

  .sep { color: var(--phosphor-muted); }
}

/* ─── BLINKING CURSOR ──────────────────────────────────────────────────── */
.cursor {
  display: inline-block;
  background: var(--phosphor);
  color: var(--bg);
  width: 0.6em;
  text-align: center;
  animation: blink 1.1s steps(1) infinite;
  text-shadow: none;
  box-shadow: 0 0 8px var(--phosphor);

  &--input {
    margin-left: 2px;
    line-height: 1;
  }
}

/* ─── BLOCK SECTION ────────────────────────────────────────────────────── */
.block {
  margin: 64px 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s, transform 0.6s;
}

.block.in-view {
  opacity: 1;
  transform: none;
}

.reveal.in-view {
  opacity: 1;
}

.reveal {
  opacity: 0;
  transition: opacity 0.7s;
}

.banner.reveal {
  transform: none;
}

/* ─── PROMPT ───────────────────────────────────────────────────────────── */
.prompt {
  font-family: var(--mono);
  font-size: 14px;
  margin-bottom: 18px;
  color: var(--phosphor);
  border-bottom: 1px dashed var(--phosphor-muted);
  padding-bottom: 16px;

  &__user { color: var(--amber); text-shadow: 0 0 6px rgba(255, 176, 0, 0.45); }
  &__path { color: var(--white); }
  &__cmd  {
    color: var(--white);
    margin-left: 4px;
    text-shadow: 0 0 6px rgba(214, 255, 226, 0.55);
  }
  &__cmd::after {
    content: '_';
    color: var(--phosphor);
    animation: blink 1s steps(1) infinite;
    margin-left: 1px;
  }
  &__cmd.is-done::after {
    display: none;
  }
}

.prompt--live {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom-color: var(--phosphor);
}

.prompt__input {
  flex: 1;
  min-width: 120px;
  background: transparent;
  border: 0;
  outline: 0;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--white);
  text-shadow: 0 0 6px rgba(214, 255, 226, 0.55);
  caret-color: transparent;
  padding: 2px 0;

  &::placeholder { color: var(--phosphor-muted); }
}

/* ─── OUTPUT BLOCK ─────────────────────────────────────────────────────── */
.output {
  padding-left: 0;
  margin-bottom: 16px;
}

.prose {
  font-size: 14.5px;
  line-height: 1.7;
  margin-bottom: 14px;
  max-width: 72ch;
}

.muted   { color: var(--phosphor-muted); }
.hi      { color: var(--white); text-shadow: 0 0 6px rgba(214, 255, 226, 0.55); }
.glow    { color: var(--white); text-shadow: var(--glow-strong); }
.ok      { color: var(--phosphor); }
.warn    { color: var(--amber); }
.fail    { color: var(--red); }
.redacted { color: var(--red); }
.str     { color: var(--amber); }
.key     { color: var(--phosphor-muted); }

/* ─── CARD WITH ASCII CORNERS ──────────────────────────────────────────── */
.card {
  position: relative;
  border: 1px solid var(--phosphor-muted);
  padding: 28px 32px;
  margin-bottom: 24px;
  background: rgba(51, 255, 102, 0.03);
}

.card--frame .card__corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--phosphor);
  border-style: solid;

  &--tl { top: -2px;  left: -2px;  border-width: 2px 0 0 2px; }
  &--tr { top: -2px;  right: -2px; border-width: 2px 2px 0 0; }
  &--bl { bottom: -2px; left: -2px;  border-width: 0 0 2px 2px; }
  &--br { bottom: -2px; right: -2px; border-width: 0 2px 2px 0; }
}

/* ─── MANIFEST DL ──────────────────────────────────────────────────────── */
.manifest {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px 24px;
  font-family: var(--mono);
  font-size: 14px;

  dt {
    color: var(--phosphor-muted);
    letter-spacing: 0.05em;
    &::after { content: '::'; margin-left: 8px; color: var(--phosphor); }
  }
  dd {
    color: var(--white);
    text-shadow: 0 0 4px rgba(214, 255, 226, 0.4);
  }
}

/* ─── MANIFEST TABLE (ASCII BOX) ───────────────────────────────────────── */
.manifest-table,
.ops,
.contact-frame {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre;
  overflow-x: auto;
  color: var(--phosphor);
}

@media (max-width: 720px) {
  .manifest-table,
  .ops {
    font-size: 11px;
  }
}

/* ─── CREED / ALIASES ──────────────────────────────────────────────────── */
.creed {
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 2;
  padding: 16px 0;
}

.creed__line {
  position: relative;
  padding-left: 14px;

  &::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--phosphor-muted);
  }
}

/* ─── CONTACT ──────────────────────────────────────────────────────────── */
.contact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 14px 0;
  border: 1px solid var(--phosphor-muted);
}

.contact__row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px dashed var(--phosphor-muted);
  color: var(--phosphor);
  transition: background 0.2s, color 0.2s;

  &:last-child { border-bottom: 0; }
  &:hover:not(.contact__row--static) {
    background: rgba(51, 255, 102, 0.08);
    color: var(--white);
  }
}

.contact__key {
  color: var(--amber);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-shadow: 0 0 6px rgba(255, 176, 0, 0.4);
}

.contact__val {
  color: var(--white);
  font-size: 14px;
  text-shadow: 0 0 4px rgba(214, 255, 226, 0.45);
}

.contact__cta {
  font-size: 11px;
  color: var(--phosphor-muted);
  letter-spacing: 0.1em;
}

.contact__row:hover .contact__cta { color: var(--phosphor); }

@media (max-width: 600px) {
  .contact__row {
    grid-template-columns: 60px 1fr;
    .contact__cta { display: none; }
  }
}

/* ─── INTERACTIVE SHELL ────────────────────────────────────────────────── */
.block--prompt {
  margin-top: 80px;
  border-top: 1px dashed var(--phosphor-muted);
  padding-top: 32px;
}

.shell-output {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.65;
  margin-top: 16px;
  white-space: pre-wrap;
  color: var(--phosphor);
  min-height: 1em;
}

.shell-output .echo  { color: var(--phosphor-muted); }
.shell-output .res   { color: var(--white); }
.shell-output .err   { color: var(--red); }

/* ─── FOOTLINE ─────────────────────────────────────────────────────────── */
.footline {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  background: var(--phosphor);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 6px 18px;
  border-top: 2px solid var(--bg);
  text-shadow: none;
}

.footline__seg {
  padding: 0 14px;
  border-right: 1px solid rgba(5, 10, 5, 0.4);

  &--mode  { background: var(--bg); color: var(--phosphor); padding: 4px 10px; margin-right: 6px; border-right: 0; text-shadow: var(--glow); }
  &--mid   { margin-left: auto; }
  &--right { border-right: 0; }
}

@media (max-width: 600px) {
  .footline__seg--mid { display: none; }
}

/* ─── PRINT (just in case) ─────────────────────────────────────────────── */
@media print {
  .scanlines, .crt-vignette, .crt-flicker, #matrix, .boot, .footline, .statusbar { display: none !important; }
  html, body { background: white; color: black; text-shadow: none; }
}
