:root {
  color-scheme: dark;
  --background: #020202;
  --text: #d8d8d8;
  --strong: #f2f2f2;
  --muted: #8d8d8d;
  --faint: #666;
  --border: #292929;
  --panel: rgba(8, 8, 8, 0.96);
  --hover: rgba(255, 255, 255, 0.08);
}

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

html,
body {
  width: 100%;
  height: 100%;
  background: var(--background);
}

body {
  min-height: 100dvh;
  padding-top: clamp(0.85rem, 3.2vh, 1.85rem);
  background: var(--background);
  color: var(--text);
  font-family: "Courier New", ui-monospace, monospace;
  font-size: clamp(13px, 0.8vw, 15px);
  line-height: 1.32;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.035), transparent 26rem),
    radial-gradient(circle at 54% 34%, rgba(255, 255, 255, 0.018), transparent 28rem);
}

.ascii-wave {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.16);
  font-family: "Courier New", ui-monospace, monospace;
  font-size: clamp(12px, 0.96vw, 16px);
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.2);
  white-space: pre;
  user-select: none;
}

.terminal {
  position: relative;
  z-index: 2;
  width: min(calc(100vw - 2rem), 78ch);
  margin: 0 auto;
  padding: 0;
  color: var(--text);
  text-align: left;
  text-shadow:
    0 1px 14px rgba(0, 0, 0, 0.95),
    0 0 16px rgba(0, 0, 0, 0.78);
}

.terminal-block + .terminal-block {
  margin-top: 0.98rem;
}

.line {
  min-height: 1.32em;
  overflow-wrap: anywhere;
}

.prompt,
strong {
  color: var(--strong);
}

u {
  text-decoration-color: var(--muted);
  text-underline-offset: 0.16em;
}

a,
button {
  color: var(--strong);
  font: inherit;
}

a {
  text-decoration: none;
  text-underline-offset: 0.18em;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

button {
  appearance: none;
  background: none;
}

button:focus-visible,
a:focus-visible {
  outline: 1px solid var(--strong);
  outline-offset: 3px;
}

.link-list {
  list-style: none;
  display: grid;
  gap: 0.32rem;
  margin-top: 0.58rem;
}

.link-list li {
  overflow-wrap: anywhere;
}

.link-list li::before {
  content: "• ";
  color: var(--faint);
}

.prompt-line {
  display: flex;
  align-items: center;
  margin-top: 1.55rem;
  color: var(--muted);
}

.cmd {
  white-space: pre;
}

.cursor {
  display: inline-block;
  color: var(--strong);
  animation: blink 1s step-start infinite;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.76);
}

.modal.is-open {
  display: flex;
}

.modal-content {
  width: min(100%, 360px);
  padding: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: none;
}

.modal-header {
  padding-bottom: 0.65rem;
  margin-bottom: 0.9rem;
  color: var(--strong);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  text-align: center;
}

.modal-options {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.modal-option,
.modal-close {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
}

.modal-option {
  flex: 1;
}

.modal-option:hover,
.modal-option:focus-visible,
.modal-close:hover,
.modal-close:focus-visible {
  background: var(--hover);
}

.modal-footer {
  text-align: center;
}

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

@media (max-width: 768px) {
  body {
    padding-top: 0.75rem;
    font-size: 12.25px;
  }

  .terminal {
    width: calc(100vw - 1.5rem);
  }

  .terminal-block + .terminal-block {
    margin-top: 0.75rem;
  }

  .link-list {
    gap: 0.28rem;
  }

  .modal-content {
    padding: 1rem;
  }

  .modal-options {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-height: 640px) {
  body {
    padding-top: 0.45rem;
    font-size: 11.75px;
  }

  .terminal-block + .terminal-block {
    margin-top: 0.62rem;
  }

  .prompt-line {
    margin-top: 1rem;
  }
}

@media (max-width: 480px) {
  body {
    padding-top: 0.45rem;
    font-size: 11.5px;
  }

  .terminal {
    width: calc(100vw - 1rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation: none;
  }

  .ascii-wave {
    opacity: 0.45;
  }
}
