/* ---------- fonts ---------- */
@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/SpaceMono-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/SpaceMono-Bold.ttf") format("truetype");
}
@font-face {
  font-family: "Space Mono";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/SpaceMono-Italic.ttf") format("truetype");
}

/* ---------- theme tokens ---------- */
:root {
  --mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --amber: oklch(0.82 0.145 73);
  --bright: oklch(0.92 0.13 80);
  --dim: oklch(0.64 0.12 70);
  --faint: oklch(0.5 0.09 66);
  --margin: clamp(10px, 2.8vw, 30px);
  --pad-y: clamp(30px, 5vw, 60px);
  --pad-x: clamp(24px, 6vw, 84px);
}

/* ---------- reset / base ---------- */
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
html,
body {
  margin: 0;
}
body {
  min-height: 100vh;
  background: #0a0805;
  font-family: var(--mono);
  padding: var(--margin);
  display: flex;
}

/* ---------- CRT screen chrome ---------- */
.screen {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 2 * var(--margin));
  overflow: hidden;
  padding: var(--pad-y) var(--pad-x);
  border-radius: clamp(16px, 2.4vw, 28px) / clamp(12px, 1.8vw, 22px);
  background: radial-gradient(
    125% 130% at 50% 38%,
    oklch(0.205 0.04 70) 0%,
    oklch(0.155 0.03 68) 46%,
    oklch(0.105 0.02 66) 100%
  );
  color: var(--amber);
  text-shadow:
    -0.4px 0 0 oklch(0.62 0.2 25 / 0.35),
    0.4px 0 0 oklch(0.7 0.13 215 / 0.35),
    0 0 1px oklch(0.82 0.145 73 / 0.9),
    0 0 7px oklch(0.78 0.14 72 / 0.55);
  box-shadow:
    inset 0 0 4px 1px oklch(0.92 0.13 80 / 0.25),
    inset 0 0 120px 24px oklch(0 0 0 / 0.62),
    inset 0 0 50px 8px oklch(0 0 0 / 0.55);
  animation:
    flicker 5.5s infinite steps(60),
    turn-on 0.95s ease-out 1;
}
/* rolling scanline band drifting down the tube */
.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    oklch(0.92 0.13 80 / 0.06) 48%,
    oklch(0.92 0.13 80 / 0.1) 50%,
    oklch(0.92 0.13 80 / 0.06) 52%,
    transparent 100%
  );
  background-size: 100% 32%;
  background-repeat: no-repeat;
  background-position: 0 -32%;
  animation: roll 7s linear infinite;
}
.scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: repeating-linear-gradient(
    to bottom,
    oklch(0 0 0 / 0) 0 2px,
    oklch(0 0 0 / 0.22) 2px 4px
  );
  opacity: 0.7;
}
/* animated film grain */
.scan::after {
  content: "";
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
  animation: grain 0.6s steps(3) infinite;
}
.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  border-radius: inherit;
  background: radial-gradient(
    80% 55% at 50% 6%,
    oklch(1 0 0 / 0.05) 0%,
    transparent 55%
  );
}
@media (prefers-reduced-motion: reduce) {
  .screen,
  .screen::before,
  .scan::after,
  .led,
  .cursor {
    animation: none !important;
  }
}
@keyframes flicker {
  0%,
  100% {
    opacity: 1;
  }
  47% {
    opacity: 1;
  }
  48% {
    opacity: 0.94;
  }
  49% {
    opacity: 1;
  }
  72% {
    opacity: 1;
  }
  73% {
    opacity: 0.96;
  }
  74% {
    opacity: 1;
  }
}
/* power-on: snap open from a horizontal line, then settle */
@keyframes turn-on {
  0% {
    transform: scaleY(0.002);
    filter: brightness(6);
    opacity: 0.9;
  }
  50% {
    transform: scaleY(0.004);
    filter: brightness(6);
    opacity: 1;
  }
  65% {
    transform: scaleY(1);
    filter: brightness(2.2);
  }
  100% {
    transform: scaleY(1);
    filter: brightness(1);
  }
}
/* rolling scanline band */
@keyframes roll {
  from {
    background-position: 0 -32%;
  }
  to {
    background-position: 0 132%;
  }
}
/* film grain jitter */
@keyframes grain {
  0% {
    transform: translate(0, 0);
  }
  33% {
    transform: translate(-4%, 3%);
  }
  66% {
    transform: translate(3%, -3%);
  }
  100% {
    transform: translate(0, 0);
  }
}

/* ---------- shared layout: inner / titlebar / led / prompt / cursor ---------- */
.inner {
  position: relative;
  z-index: 1;
  font-size: clamp(13px, 1.05rem + 0.2vw, 16px);
  line-height: 1.75;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  flex: 1;
}
.impressum .inner {
  line-height: 1.8;
  display: flex;
  flex-direction: column;
}

.titlebar {
  color: var(--faint);
  font-size: clamp(11px, 2.6vw, 12.5px);
  letter-spacing: 0.08em;
  padding-bottom: 16px;
  margin-bottom: clamp(22px, 4vw, 30px);
  border-bottom: 1px dashed oklch(0.5 0.09 66 / 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
}
.led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--bright);
  box-shadow: 0 0 9px 1px oklch(0.92 0.13 80 / 0.9);
  animation: flicker 5.5s infinite steps(60);
}

.prompt {
  color: var(--amber);
  font-weight: 700;
}
.tilde {
  color: var(--faint);
}
.cursor {
  color: var(--bright);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  50.01%,
  100% {
    opacity: 0;
  }
}

/* ---------- index page ---------- */
.line {
  color: var(--bright);
  word-break: break-word;
}
.gap {
  margin-top: clamp(18px, 3.4vw, 24px);
}
.host {
  display: inline;
}
.cmd {
  color: var(--bright);
}

.out {
  color: var(--amber);
}
.big {
  font-size: clamp(30px, 9vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  margin-top: 6px;
  color: var(--bright);
  letter-spacing: 0.01em;
}
.muted {
  color: var(--dim);
}

.list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.row {
  display: grid;
  align-items: baseline;
  gap: 2px 18px;
  grid-template-columns: 108px 160px 210px 1fr;
  grid-template-areas: "perm name host note";
  padding: 7px 10px;
  margin: 0 -10px;
  text-decoration: none;
  color: var(--amber);
  transition: background 0.14s ease;
}
.row:hover,
.row:focus-visible {
  background: oklch(0.82 0.145 73 / 0.14);
  outline: none;
}
.perm {
  grid-area: perm;
  color: var(--faint);
  font-size: 0.82em;
}
.fname {
  grid-area: name;
  color: var(--bright);
  font-weight: 700;
}
.row:hover .fname,
.row:focus-visible .fname {
  text-decoration: underline;
}
.fhost {
  grid-area: host;
  color: var(--dim);
  font-size: 0.86em;
}
.fnote {
  grid-area: note;
  color: var(--dim);
  font-size: 0.86em;
}

/* not-ready entries — visible but inactive */
.row.disabled {
  cursor: default;
  opacity: 0.55;
}
.row.disabled .fname {
  color: var(--dim);
}
.row.disabled:hover,
.row.disabled:focus-visible {
  background: none;
}
.row.disabled:hover .fname {
  text-decoration: none;
}
.soon {
  margin-left: 8px;
  padding: 1px 6px;
  border: 1px solid oklch(0.5 0.09 66 / 0.6);
  border-radius: 4px;
  font-size: 0.78em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  white-space: nowrap;
}

/* hero — gremlin mascot beside the name */
.hero {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3.4vw, 34px);
  margin-top: 6px;
}
.ascii {
  margin: 0;
  color: var(--amber);
  font-family: var(--mono);
  line-height: 1.15;
  font-size: clamp(11px, 2.4vw, 15px);
  white-space: pre;
  text-shadow: 0 0 7px oklch(0.78 0.14 72 / 0.6);
  flex: none;
}

/* finger / .plan */
.finger {
  margin-top: 8px;
  line-height: 1.7;
}
.finger .f-head {
  color: var(--dim);
  font-size: 0.9em;
}
.finger .f-head b {
  color: var(--bright);
  font-weight: 700;
}
.finger .f-plan-label {
  color: var(--bright);
  font-weight: 700;
  margin-top: 8px;
}
.finger .f-plan {
  color: var(--dim);
  max-width: 60ch;
}
.cmd-link {
  color: var(--bright);
  text-decoration: none;
}
.cmd-link:hover,
.cmd-link:focus-visible {
  text-decoration: underline;
  outline: none;
}
.cmd-link .arr {
  color: var(--amber);
}

.tail {
  margin-top: auto;
  padding-top: clamp(18px, 3.4vw, 24px);
}

/* ---------- impressum page ---------- */
.cmd-line {
  color: var(--bright);
  margin-bottom: clamp(22px, 4vw, 30px);
  word-break: break-word;
}
h1 {
  font-size: clamp(26px, 7vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 4px;
  color: var(--bright);
  letter-spacing: 0.01em;
}

h1.title {
  margin-bottom: clamp(24px, 4.5vw, 34px);
}

.sub {
  color: var(--dim);
  font-size: 0.86em;
  margin-bottom:   clamp(24px, 4.5vw, 34px);
}
.block {
  margin-bottom: clamp(20px, 3.6vw, 26px);
}
.label {
  color: var(--faint);
  font-size: 0.8em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.val {
  color: var(--amber);
}
.val a {
  color: var(--bright);
}
.note {
  color: var(--dim);
  font-size: 0.86em;
  line-height: 1.7;
  max-width: 60ch;
  margin-top: 4px;
}
.impressum .tail {
  padding-top: clamp(20px, 4vw, 30px);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.back {
  color: var(--bright);
  text-decoration: none;
}
.back:hover,
.back:focus-visible {
  text-decoration: underline;
  outline: none;
}
.back .arr {
  color: var(--amber);
}

/* ---------- legal text (datenschutz) ---------- */
.legal {
  color: var(--dim);
  font-size: 0.9em;
  max-width: 72ch;
}
.legal h1 {
  margin-bottom: clamp(20px, 4vw, 28px);
}
.legal h2 {
  font-size: clamp(16px, 4.4vw, 19px);
  font-weight: 700;
  color: var(--bright);
  letter-spacing: 0.02em;
  margin: clamp(30px, 5vw, 42px) 0 10px;
  padding-top: clamp(14px, 2.6vw, 18px);
  border-top: 1px dashed oklch(0.5 0.09 66 / 0.5);
}
.legal h3 {
  font-size: clamp(14px, 3.6vw, 15.5px);
  font-weight: 700;
  color: var(--amber);
  margin: clamp(20px, 3.4vw, 26px) 0 6px;
}
.legal h4 {
  font-size: 0.95em;
  font-weight: 700;
  color: var(--dim);
  margin: 16px 0 4px;
}
.legal p {
  line-height: 1.7;
  margin: 0 0 12px;
}
.legal ul {
  margin: 0 0 12px;
  padding-left: 1.4em;
}
.legal li {
  line-height: 1.7;
  margin-bottom: 6px;
}
.legal a {
  color: var(--bright);
  word-break: break-word;
}
.legal a:hover,
.legal a:focus-visible {
  outline: none;
  text-decoration: underline;
}

/* ---------- responsive (index listing) ---------- */
/* tablet — drop the perm column, let the note wrap underneath */
@media (max-width: 860px) {
  .row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name host" "note note";
    gap: 3px 16px;
  }
  .perm {
    display: none;
  }
  .fhost {
    text-align: right;
  }
}
/* phone — fully stacked rows */
@media (max-width: 540px) {
  .row {
    grid-template-columns: 1fr;
    grid-template-areas: "name" "host" "note";
    gap: 1px;
    padding: 9px 10px;
  }
  .fhost {
    text-align: left;
  }
  .line {
    line-height: 1.6;
  }
  .prompt .userhost {
    display: inline;
  }
}
/* very narrow — shorten the prompt so command lines don't wrap awkwardly */
@media (max-width: 380px) {
  .prompt .userhost {
    display: none;
  }
  .prompt:has(.userhost)::before {
    content: "$";
  }
  .tilde {
    display: none;
  }
}
