:root {
  color-scheme: dark;
  --bg: #020704;
  --screen: #06100a;
  --text: #93ff9f;
  --dim: #56c864;
  --glow: rgba(117, 255, 133, 0.45);
  --border: rgba(117, 255, 133, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-x: hidden;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  color: var(--text);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 35%, rgba(56, 138, 63, 0.12), transparent 42%),
    linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2));
}

.terminal {
  width: min(920px, 100%);
  position: relative;
}

.screen {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid rgba(117, 255, 133, 0.12);
  background: linear-gradient(rgba(2, 11, 5, 0.9), rgba(2, 9, 4, 0.92)), var(--screen);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.015) inset,
    0 0 80px rgba(44, 255, 80, 0.045) inset;
}

.scanlines,
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.scanlines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.018) 0,
    rgba(255, 255, 255, 0.018) 1px,
    transparent 2px,
    transparent 4px
  );
  mix-blend-mode: screen;
  opacity: 0.55;
}

.vignette {
  background: radial-gradient(circle, transparent 55%, rgba(0, 0, 0, 0.48) 100%);
}

.boot,
.profile,
.jack-panel,
.links,
.room-service,
h1,
.subtle {
  position: relative;
  z-index: 2;
}

.boot {
  margin-bottom: 64px;
  font-size: clamp(0.74rem, 1.4vw, 0.9rem);
  line-height: 1.75;
  color: var(--dim);
  text-shadow: 0 0 10px var(--glow);
}

.boot p,
.profile p,
.jack-panel p,
.subtle {
  margin: 0;
}

.identity h1 {
  margin: 0;
  font-size: clamp(2.8rem, 9vw, 6.8rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
  font-weight: 800;
  text-shadow:
    0 0 10px rgba(117, 255, 133, 0.42),
    0 0 28px rgba(117, 255, 133, 0.16);
}

.subtle {
  margin-top: 12px;
  color: var(--dim);
  font-size: clamp(0.8rem, 1.5vw, 0.95rem);
}

.profile {
  margin-top: 40px;
  line-height: 1.75;
  font-size: clamp(0.96rem, 1.9vw, 1.15rem);
  text-shadow: 0 0 8px rgba(117, 255, 133, 0.23);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 28px;
}

.links a,
.room-service {
  color: var(--text);
  text-decoration: none;
}

.links a {
  border: 1px solid var(--border);
  padding: 9px 12px;
  font-size: 0.9rem;
  transition:
    background-color 120ms ease,
    box-shadow 120ms ease,
    transform 120ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .links a:hover,
  .links a:focus-visible,
  .room-service:hover,
  .room-service:focus-visible,
  #jackButton:hover,
  #jackButton:focus-visible {
    text-shadow: 0 0 10px var(--glow);
  }

  .links a:hover,
  .links a:focus-visible {
    background: rgba(117, 255, 133, 0.06);
    box-shadow: 0 0 18px rgba(117, 255, 133, 0.12);
    transform: translateY(-1px);
  }
}

.jack-panel {
  margin-top: 56px;
  display: grid;
  gap: 16px;
  justify-items: start;
  font-size: clamp(0.9rem, 1.6vw, 1rem);
}

#jackButton {
  appearance: none;
  border: 1px solid var(--text);
  background: transparent;
  color: var(--text);
  font: inherit;
  padding: 12px 16px;
  cursor: pointer;
  min-height: 44px;
  text-shadow: 0 0 8px rgba(117, 255, 133, 0.28);
}

#jackButton[aria-pressed='true'] {
  background: rgba(117, 255, 133, 0.07);
  box-shadow: 0 0 20px rgba(117, 255, 133, 0.12) inset;
}

.room-service {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  margin-top: 72px;
  font-size: clamp(1rem, 2.3vw, 1.25rem);
  letter-spacing: 0.01em;
  transition: filter 120ms ease;
}

.room-service::after {
  content: '↗';
  margin-left: 10px;
  opacity: 0;
  transform: translateX(-4px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .room-service:hover::after,
  .room-service:focus-visible::after {
    opacity: 0.8;
    transform: translateX(0);
  }
}

.cursor {
  display: inline-block;
  animation: blink 1.05s steps(1, end) infinite;
}

.glitching .screen {
  animation: glitch-shake 90ms steps(2, end) 6;
}

.glitching .identity,
.glitching .jack-panel,
.glitching .room-service {
  animation: glitch-flicker 80ms steps(2, end) 7;
}

@keyframes blink {
  0%,
  48% {
    opacity: 1;
  }
  49%,
  100% {
    opacity: 0;
  }
}

@keyframes glitch-shake {
  0% {
    transform: translate(0);
  }
  25% {
    transform: translate(-1px, 1px);
  }
  50% {
    transform: translate(2px, -1px);
  }
  75% {
    transform: translate(-1px, 0);
  }
  100% {
    transform: translate(0);
  }
}

@keyframes glitch-flicker {
  0%,
  100% {
    opacity: 1;
    filter: none;
  }
  45% {
    opacity: 0.72;
    filter: brightness(1.8);
  }
  55% {
    opacity: 0.4;
    filter: contrast(1.8);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 600px) {
  body {
    padding: 12px;
    align-items: start;
  }

  .screen {
    min-height: 0;
    padding: 28px 22px 36px;
  }

  .boot {
    margin-bottom: 46px;
  }

  .identity h1 {
    font-size: clamp(2.5rem, 16vw, 4.1rem);
  }

  .links {
    display: grid;
    grid-template-columns: 1fr;
  }

  .links a {
    width: 100%;
  }

  .jack-panel {
    margin-top: 44px;
  }

  .room-service {
    margin-top: 54px;
  }
}

@media (max-width: 640px) {
  .links {
    display: flex;
    flex-direction: column;
    align-items: start;
    gap: 0.75rem;
  }

  .links a {
    width: auto;
    min-width: 12rem;
    justify-content: center;
    text-align: center;
  }
}
