@font-face {
  font-family: "C64";
  src: url("./assets/C64_Pro_Mono-STYLE.ttf") format("truetype");
}

:root {
  --bg: #7c71da;
  --panel: #3e32a2;
  --panel-deep: #26156f;
  --panel-soft: #5142ba;
  --text: #d7d4ff;
  --muted: #b7b0ff;
  --line: #8f86eb;
  --accent: #9df871;
  --accent-warm: #ffcf70;
  --danger: #ff8f87;
  --shadow: rgba(14, 6, 48, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05), transparent 10%),
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.035) 0,
      rgba(255, 255, 255, 0.035) 2px,
      transparent 2px,
      transparent 6px
    ),
    var(--bg);
  color: var(--text);
  font-family: "C64", monospace;
  line-height: 1.45;
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

.screen-shell {
  width: min(1380px, calc(100vw - 28px));
  margin: 14px auto;
  padding: 20px;
  border: 4px solid var(--line);
  background: var(--panel);
  box-shadow:
    0 0 0 8px rgba(62, 50, 162, 0.55),
    0 26px 70px var(--shadow);
}

.panel {
  padding: 18px;
  border: 3px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 26%),
    var(--panel-deep);
}

.boot-banner {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 12px 14px 20px;
  text-align: center;
  color: var(--muted);
}

.boot-banner p,
.prompt-line,
.footer-note {
  margin: 0;
}

.boot-line {
  white-space: nowrap;
}

.header-tools {
  position: absolute;
  top: 12px;
  right: 14px;
  display: flex;
  justify-content: flex-end;
}

.lang-switch {
  display: inline-flex;
  gap: 6px;
}

.lang-button {
  min-width: 64px;
  min-height: 34px;
  padding: 4px 10px;
  border: 2px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.lang-button:hover,
.lang-button:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.lang-button[aria-pressed="true"] {
  background: var(--accent);
  color: #20104f;
}

.shell-grid {
  display: grid;
  grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
}

.sidebar-title {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.nav-section-parent {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  min-width: 0;
}

.nav-link,
.nav-toggle {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 2px solid transparent;
  text-decoration: none;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.2;
}

.nav-toggle {
  width: 100%;
  font: inherit;
  text-align: center;
  cursor: pointer;
  padding-inline: 0;
}

.nav-toggle::after {
  content: "+";
  color: var(--accent);
}

.nav-toggle[aria-expanded="true"]::after {
  content: "-";
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-toggle:hover,
.nav-toggle:focus-visible {
  border-color: var(--accent);
  color: #fff7d7;
  outline: none;
}

.nav-link.is-active,
.nav-toggle.is-active {
  border-color: var(--line);
  color: #20104f;
  background: var(--accent);
}

.nav-section {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.nav-group {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin-left: 12px;
  padding: 0 10px 0 12px;
  border-left: 2px solid rgba(143, 134, 235, 0.7);
}

.nav-group[data-open="false"] {
  display: none;
}

.nav-link-child {
  padding-left: 16px;
  font-size: 0.88rem;
}

.layout {
  display: grid;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(1.45rem, 2.6vw, 2.45rem);
  line-height: 1.15;
  color: #fff7d7;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.1rem, 1.9vw, 1.7rem);
  color: #fff7d7;
}

h3 {
  color: #fff7d7;
}

.lede {
  max-width: 42rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 22px;
  align-items: center;
}

.hero-art {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.logo-art,
.scene-art {
  display: block;
  width: min(100%, 420px);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 3px solid rgba(183, 176, 255, 0.24);
  background: rgba(0, 0, 0, 0.22);
}

.hero-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 2px solid var(--line);
  text-decoration: none;
  color: var(--text);
  background: var(--panel-soft);
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease;
}

.cta:hover,
.cta:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  outline: none;
}

.cta-primary {
  color: #20104f;
  background: var(--accent);
}

.cta-secondary {
  background: transparent;
}

.text-link {
  color: #fff7d7;
  text-decoration: none;
  border-bottom: 2px solid rgba(255, 247, 215, 0.3);
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}

.split-panel,
.info-grid,
.mini-posts,
.post-list {
  display: grid;
  gap: 16px;
}

.split-panel {
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
}

.info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-card,
.stat-box,
.project-row,
.demo-card,
.post-card,
.mini-post {
  border: 2px solid rgba(183, 176, 255, 0.26);
  background: rgba(255, 255, 255, 0.03);
}

.feature-card,
.stat-box,
.demo-card,
.post-card,
.mini-post {
  padding: 16px;
}

.mini-posts,
.post-list,
.project-directory,
.demo-directory {
  display: grid;
  gap: 14px;
}

.project-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 16px;
}

.demo-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.project-status,
.project-copy,
.project-actions {
  display: grid;
  gap: 10px;
}

.demo-card-copy,
.demo-card-actions {
  display: grid;
  gap: 10px;
}

.project-actions {
  justify-items: end;
}

.demo-card-actions {
  justify-items: end;
}

.project-note,
.muted-note,
.post-date,
.stat-label {
  color: var(--muted);
}

.demo-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid currentColor;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.status-live {
  color: var(--accent);
}

.status-build {
  color: var(--accent-warm);
}

.status-lab {
  color: var(--danger);
}

.list-block {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
}

.list-block li + li {
  margin-top: 8px;
}

.page-header {
  display: grid;
  gap: 12px;
}

.demo-frame-head {
  display: grid;
  gap: 18px;
  margin-bottom: 16px;
}

.demo-frame-shell {
  border: 2px solid rgba(183, 176, 255, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 22%),
    rgba(7, 7, 32, 0.9);
  padding: 10px;
  overflow: hidden;
}

.demo-frame {
  display: block;
  width: 100%;
  min-height: 720px;
  border: 0;
  background: #05060b;
}

.demo-frame-editor {
  min-height: 980px;
}

.site-footer {
  margin-top: 20px;
}

.prompt-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--accent);
}

.prompt-label {
  color: #fff7d7;
}

.footer-note {
  margin-top: 14px;
  color: var(--muted);
}

.cursor {
  animation: blink 1s steps(1, end) infinite;
}

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

@media (max-width: 980px) {
  .screen-shell {
    width: min(100vw - 14px, 100%);
    margin: 7px auto;
    padding: 10px;
    border-width: 3px;
  }

  .shell-grid,
  .hero,
  .split-panel,
  .info-grid,
  .project-row,
  .demo-card {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .nav-section-parent {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .project-actions {
    justify-items: start;
  }

  .demo-card-actions {
    justify-items: start;
  }

  .header-tools {
    position: static;
    justify-content: flex-start;
  }

  .boot-banner {
    padding: 8px 8px 14px;
    text-align: left;
  }

  .boot-line {
    white-space: normal;
  }
}

@media (max-width: 640px) {
  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .nav-group {
    margin-left: 8px;
    padding: 0 8px 0 10px;
  }

  .nav-section-parent {
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .hero-actions,
  .inline-actions,
  .prompt-line {
    flex-direction: column;
    align-items: flex-start;
  }

  .demo-frame {
    min-height: 540px;
  }

  .demo-frame-editor {
    min-height: 760px;
  }
}
