@import "tailwindcss";

@font-face {
  font-family: "IBM VGA";
  src: url("/Web437_IBM_VGA_8x16.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-sans:
    "IBM VGA", ui-monospace, "SF Mono", "Monaco", "Inconsolata", "Roboto Mono",
    "Source Code Pro", monospace;
  --font-mono:
    "IBM VGA", ui-monospace, "SF Mono", "Monaco", "Inconsolata", "Roboto Mono",
    "Source Code Pro", monospace;

  /* 16-color palette */
  --black: #000000;
  --blue: #0000aa;
  --green: #00aa00;
  --cyan: #00aaaa;
  --red: #aa0000;
  --magenta: #aa00aa;
  --brown: #aa5500;
  --light-gray: #aaaaaa;
  --dark-gray: #555555;
  --light-blue: #5555ff;
  --light-green: #55ff55;
  --light-cyan: #55ffff;
  --light-red: #ff5555;
  --light-magenta: #ff55ff;
  --yellow: #ffff55;
  --white: #ffffff;
  --panel-bg-alpha: 0.2;
  --panel-gloss-alpha: 0.05;
  --panel-border-inset: 0.6rem;
  --panel-bg: rgba(0, 0, 0, var(--panel-bg-alpha));
  --panel-blur: 10px;
  --fallback-glow-a: rgba(85, 255, 255, 0.18);
  --fallback-glow-b: rgba(85, 85, 255, 0.16);
  --fallback-glow-c: rgba(255, 85, 85, 0.14);
}

html {
  min-height: 100%;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  isolation: isolate;
  margin: 0;
  overflow: hidden;
  background-color: var(--black);
  color: var(--white);
  font-family: "IBM VGA", monospace;
  font-size: 1.25rem;
  white-space: normal;
  line-height: 1;
}

body::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  z-index: -30;
  background: var(--black);
  opacity: 0;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: none;
}

body[data-background-mode="failed"]::before {
  opacity: 1;
  animation: fallback-drift 18s linear infinite alternate;
}

@media (prefers-reduced-motion: reduce) {
  body[data-background-mode="failed"]::before {
    animation: none;
  }
}

@keyframes fallback-drift {
  from {
    transform: translate3d(-3%, -2%, 0) scale(1);
  }

  to {
    transform: translate3d(3%, 2%, 0) scale(1.12);
  }
}

::selection {
  background-color: var(--light-blue);
  color: var(--black);
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

/* Desktop font size */
@media (min-width: 768px) {
  body {
    font-size: 1.5rem;
  }
}

.page-frame {
  height: 100vh;
  height: 100dvh;
  width: min(80ch, 100vw);
  margin: 0 auto;
  padding: 1rem;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 2ch;
}

#outlet {
  display: block;
  min-height: 0;
  overflow: hidden;
  user-select: none;
}

#outlet.qa-outlet {
  overflow: hidden;
}

#outlet:focus {
  outline: none;
}

.site-shell {
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  user-select: text;
}

@media (min-width: 768px) {
  .site-shell {
    width: min(100%, 60%);
  }
}

.site-panel-frame {
  position: relative;
  overflow: hidden;
}

.site-panel-frost {
  position: absolute;
  inset: var(--panel-border-inset);
  pointer-events: none;
  overflow: hidden;
  background:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, var(--panel-gloss-alpha)),
      transparent 24%
    ),
    var(--panel-bg);
}

.site-panel-border {
  position: absolute;
  inset: var(--panel-border-inset);
  border: 2px solid var(--white);
  pointer-events: none;
}

.site-panel-content {
  position: relative;
  z-index: 1;
}

.site-region {
  width: 100%;
}

/* Global focus ring styles for all tabbable elements */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus,
[tabindex]:focus,
[contenteditable]:focus {
  outline: 2px solid white;
  outline-offset: -2px;
  border-radius: 0;
}

/* Link styles - blue without underline */
a {
  color: var(--light-blue);
  text-decoration: none;
  text-underline-offset: 0.2ch;
}

a:hover,
a:focus-visible,
a[aria-current="page"] {
  background-color: var(--light-blue);
  color: var(--black);
  text-decoration: underline;
}

a[aria-current="page"] {
  color: var(--yellow);
  background-color: transparent;
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0;
  transform: translateY(-150%);
  padding: 0.5ch 1ch;
  background: var(--yellow);
  color: var(--black);
  z-index: 20;
}

.skip-link:focus {
  transform: translateY(1rem);
}

/* Form inputs */
.qa-input-wrap {
  position: relative;
  padding: 1ch;
  background-color: rgba(0, 0, 0, 0.18);
  border: 2px solid var(--white);
  display: flex;
  flex-direction: column;
  gap: 1ch;
}

.qa-page {
  min-height: 0;
  width: 100%;
}

.qa-list-scroll {
  padding-top: 1.5ch;
  padding-bottom: 1.5ch;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  padding-right: 0.5ch;
}

.qa-list-scroll::-webkit-scrollbar {
  width: 1ch;
}

.qa-list-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.qa-list-scroll::-webkit-scrollbar-thumb {
  background-color: var(--dark-gray);
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
}

.qa-list-scroll::-webkit-scrollbar-thumb:hover {
  background-color: var(--light-gray);
}

.qa-stats {
  color: var(--dark-gray);
  text-align: center;
}

.qa-textarea {
  width: 100%;
  min-height: 2lh;
  background-color: transparent;
  border: none;
  caret-color: var(--white);
  caret-shape: block;
  color: var(--light-gray);
  padding: 0;
  overflow-y: auto;
  resize: none;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.qa-textarea::placeholder {
  color: var(--dark-gray);
}

.qa-input-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1ch;
  pointer-events: auto;
}

.qa-bar-text {
  color: var(--dark-gray);
}

.qa-button {
  border: none;
  padding: 0;
  color: var(--yellow);
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
  pointer-events: auto;
}

.qa-button:hover {
  background-color: var(--yellow);
  color: var(--black);
}

.qa-button-message:hover {
  background: transparent;
}

.qa-button:disabled {
  color: var(--dark-gray);
  cursor: wait;
}

.qa-button:disabled:hover {
  background: transparent;
  color: var(--dark-gray);
}

.qa-meta {
  margin-top: 0.5ch;
  color: var(--dark-gray);
}

.qa-item {
  position: relative;
}

.qa-list-item {
  border-top: none;
}

.qa-list-item + .qa-list-item {
  margin-top: 1.5ch;
  padding-top: 1.5ch;
  border-top: 2px solid var(--white);
}

.qa-list-label {
  margin-bottom: 1ch;
  color: var(--white);
}

.qa-item-meta {
  position: absolute;
  top: 0;
  right: 0;
  display: none;
  padding: 0.75ch 1ch;
  background-color: rgba(0, 0, 0, 0.9);
  box-shadow: inset 0 0 0 1px var(--dark-gray);
  color: var(--light-gray);
  z-index: 5;
}

.qa-item:hover .qa-item-meta,
.qa-item:focus-within .qa-item-meta,
.qa-item:focus .qa-item-meta {
  display: block;
}

.qa-inline-action {
  border: none;
  background: transparent;
  color: var(--light-blue);
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2ch;
}

.qa-inline-action:hover,
.qa-inline-action:focus-visible {
  background-color: var(--light-blue);
  color: var(--black);
}

.qa-textarea::selection {
  background-color: var(--light-blue);
  color: var(--black);
}

.qa-textarea:focus {
  outline: none;
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1ch;
  color: var(--dark-gray);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Project markdown content */
