/* ── Reset ───────────────────────────────────────────────────────── */

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #111;
}

/* ── Screen ─────────────────────────────────────────────────────── */

.screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  animation: flicker 12s infinite;
}

/* Scanlines */
.screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.13) 2px,
    rgba(0, 0, 0, 0.13) 4px
  );
  pointer-events: none;
  z-index: 2;
}

/* Vignette */
.screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0, 0, 0, 0.55) 100%
  );
  pointer-events: none;
  z-index: 2;
}

.screen__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: calc(7.5vh + 1vmin) calc(7.5vw + 1vmin) calc(13.5vh + 1vmin);
  color: #FFB000;
  font-family: 'VT323', 'Courier New', monospace;
  font-size: clamp(1.1rem, 2.2vmin, 1.6rem);
  line-height: 1.4;
  text-shadow:
    0 0 5px #FFB000,
    0 0 10px rgba(255, 176, 0, 0.7),
    0 0 20px rgba(255, 176, 0, 0.35);
  overflow-y: auto;
  scrollbar-width: none;
}

.screen__inner::-webkit-scrollbar { display: none; }

/* ── Flicker ─────────────────────────────────────────────────────── */

@keyframes flicker {
  0%,  88%, 100% { filter: brightness(1); }
  89%            { filter: brightness(0.93); }
  90%            { filter: brightness(1.02); }
  91%            { filter: brightness(0.96); }
  94%, 95%       { filter: brightness(0.98); }
}

/* ── Links ──────────────────────────────────────────────────────── */

a {
  color: #FFB000;
  text-decoration: none;
}

/* ── Menu ───────────────────────────────────────────────────────── */

.menu {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  padding-top: 0.5em;
}

.menu__item {
  display: block;
  cursor: pointer;
  width: fit-content;
  padding: 0 0.2em;
}

.menu--horizontal {
  flex-direction: row;
  gap: 1em;
}

.menu__item:hover,
.menu__item--focused {
  background: #FFB000;
  color: #000;
}

/* ── Monitor frame SVG ───────────────────────────────────────────── */

.monitor-frame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

/* ── Menu Panel (index) ─────────────────────────────────────────── */

.menu-panel {
  width: 100%;
  height: 100%;
  border: 1px solid #FFB000;
  box-shadow:
    0 0 6px #FFB000,
    0 0 14px rgba(255,176,0,0.5),
    inset 0 0 8px rgba(255,176,0,0.04);
  display: flex;
  flex-direction: column;
}

.menu-panel__title {
  padding: 0.4em 1em;
  text-align: center;
  border-bottom: 1px solid #FFB000;
  letter-spacing: 0.15em;
}

.menu-panel__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5em 3em;
}

.menu-panel__keys {
  padding: 0.4em 1em;
  border-top: 1px solid #FFB000;
  text-align: center;
}

/* ── CV ─────────────────────────────────────────────────────────── */

.cv-pre {
  font: inherit;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

/* ── Chernobyl timeline ─────────────────────────────────────────── */

.timeline__connector {
  padding-left: 0.2em;
}

/* ── Mobile ─────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .monitor-frame { display: none; }
  .screen__inner { padding: 1.5rem 1rem 2rem; font-size: 1.1rem; }
  .menu__item { min-height: 44px; display: flex; align-items: center; }
  .menu-panel__body { padding: 1.5em 1.5em; }
  .menu-panel__keys { font-size: 0.9em; }
  .back-link { min-height: 44px; display: inline-flex; align-items: center; }
}
