@import url('https://fonts.googleapis.com/css2?family=VT323&family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg: #0C0C0C;            /* CRT terminal ground — not pure black */
  --surface: #131513;
  --surface-2: #191c19;
  --surface-3: #222622;
  --green: #3CFF6E;         /* Clarence phosphor green */
  --green-dim: #4F6B57;     /* REM line color */
  --ink: #D8D8D2;           /* System response gray */
  --ink-faint: #6f766f;
  --cream: #F2EEE6;
  --line: rgba(60, 255, 110, 0.22);
  --line-soft: rgba(216, 216, 210, 0.14);
  --danger: #ff6b5e;
  --shadow: 0 0 0 1px rgba(60, 255, 110, 0.15), 0 16px 36px -16px rgba(0, 0, 0, 0.9);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important; /* Authentic DOS design: 100% square corners everywhere */
}

html, body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', 'DejaVu Sans Mono', monospace;
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
}

body {
  background-image: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.014) 0px,
    rgba(255, 255, 255, 0.014) 1px,
    transparent 1px,
    transparent 3px
  );
}

::selection {
  background: var(--green);
  color: #04140a;
}

/* ---- Scanline Overlay ---- */
.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 20%, rgba(60, 255, 110, 0.05), transparent 75%);
  z-index: 1000;
}

/* ---- Animated Blinking Cursor ---- */
.cursor {
  display: inline-block;
  background: var(--green);
  width: .55em;
  height: .9em;
  vertical-align: -.12em;
  animation: blink 1.1s steps(1) infinite;
}

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

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

/* ---- Typography & Links ---- */
h1, h2, h3, h4 {
  font-family: 'VT323', Consolas, monospace;
  font-weight: 400;
  color: var(--green);
  letter-spacing: .02em;
}

h1 { font-size: clamp(3rem, 9vw, 5.4rem); line-height: 1; }
h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: .4em; }
h3 { font-size: 1.35rem; margin-bottom: .4em; color: var(--green); }

a {
  color: var(--green);
  text-decoration: underline;
  text-decoration-color: rgba(60, 255, 110, 0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

a:hover {
  color: #68ff92;
  text-decoration-color: var(--green);
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

code.inline {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  padding: .1em .45em;
  font-size: .92em;
  color: var(--green);
}

.mono { font-family: 'IBM Plex Mono', monospace; }

/* ---- Layout Wrap ---- */
.page-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(12, 12, 12, 0.95);
  backdrop-filter: blur(4px);
  position: sticky;
  top: 0;
  z-index: 500;
}

.header-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-logo {
  font-family: 'VT323', monospace;
  font-size: 1.6rem;
  color: var(--green);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.header-logo .logo-prompt {
  color: var(--green-dim);
}

.header-nav {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.nav-item {
  font-family: 'VT323', monospace;
  font-size: 1.15rem;
  color: var(--ink-faint);
  text-decoration: none;
  padding: 0.2em 0.4em;
}

.nav-item:hover {
  color: var(--green);
  background: var(--surface-2);
}

.site-main {
  flex: 1;
  max-width: 1160px;
  margin: 0 auto;
  width: 100%;
  padding: 2.5rem 1.5rem 5rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 2rem 1.5rem;
}

.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.footer-rem {
  font-family: 'VT323', monospace;
  font-size: 1.15rem;
  color: var(--green-dim);
}

.footer-legal {
  color: var(--ink-faint);
  font-size: 0.78rem;
}

/* ---- Terminal Hero Section ---- */
.hero-section {
  margin-bottom: 4rem;
}

.terminal-window {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.terminal-bar {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  padding: 0.45rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.bar-dot {
  width: 10px;
  height: 10px;
  background: var(--green);
  display: inline-block;
}

.bar-title {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  color: var(--ink);
}

.bar-status {
  margin-left: auto;
  font-family: 'VT323', monospace;
  font-size: 0.95rem;
  color: var(--green-dim);
}

.terminal-body {
  padding: 2.5rem 2rem;
}

.boot-sequence {
  margin-bottom: 1.8rem;
  font-size: 0.86rem;
  color: var(--green-dim);
}

.boot-line {
  margin-bottom: 0.25em;
}

.boot-line b {
  color: var(--ink);
  font-weight: 500;
}

.status-ok {
  color: var(--green);
}

/* ---- Three-Line Lockup with Blinking Cursor ---- */
.brand-lockup {
  margin: 1.6rem 0 1.8rem;
}

.brand-name {
  font-family: 'VT323', monospace;
  font-size: clamp(3.2rem, 9vw, 5.8rem);
  line-height: 1;
  color: var(--green);
  text-shadow: 0 0 20px rgba(60, 255, 110, 0.35);
  display: inline-block;
}

.brand-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.15rem;
  color: var(--ink);
  margin-top: 0.5em;
}

.brand-rem {
  font-family: 'VT323', monospace;
  font-size: 1.25rem;
  color: var(--green-dim);
  margin-top: 0.35em;
  letter-spacing: .05em;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--ink);
  max-width: 68ch;
  margin: 1.6rem 0;
  line-height: 1.7;
}

/* ---- Meta Pills ---- */
.meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.5rem 0 2.5rem;
}

.pill {
  font-family: 'VT323', monospace;
  font-size: 1.05rem;
  padding: 0.35em 0.8em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}

.pill b {
  color: var(--green);
  font-weight: 400;
}

/* ---- Downloads Block ---- */
.download-block {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  padding-top: 1.8rem;
}

.download-header {
  font-family: 'VT323', monospace;
  font-size: 1.25rem;
  color: var(--green);
  margin-bottom: 1.2rem;
}

.dl-prompt {
  color: var(--green-dim);
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.dl-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 1.4rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: transform 0.1s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.dl-card:hover {
  background: var(--surface-3);
  border-color: var(--green);
  box-shadow: 0 0 16px rgba(60, 255, 110, 0.18);
}

.dl-os {
  font-family: 'VT323', monospace;
  font-size: 1.35rem;
  color: var(--green);
  margin-bottom: 0.3em;
}

.dl-file {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.4em;
}

.dl-sub {
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin-bottom: 1.2em;
}

.dl-action {
  margin-top: auto;
  font-family: 'VT323', monospace;
  font-size: 1.15rem;
  color: var(--green);
}

/* ---- Content Sections ---- */
.content-section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--line);
}

.section-eyebrow {
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  letter-spacing: .12em;
  color: var(--green-dim);
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 0.5em;
}

.dir-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2em;
  height: 1.6em;
  background: var(--surface-2);
  color: var(--green);
  border: 1px solid var(--line);
  font-size: 0.9em;
}

.section-lede {
  font-size: 1.05rem;
  color: var(--ink-faint);
  max-width: 70ch;
  margin-bottom: 2rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}

.retro-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.retro-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.6em;
}

.retro-card p {
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.65;
}

/* ---- Semantic Flex Table Styling (Zero <table> Policy) ---- */
.terminal-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.terminal-flex-table {
  display: flex;
  flex-direction: column;
  width: 100%;
  font-size: 0.88rem;
}

.terminal-flex-header {
  display: flex;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.terminal-flex-th {
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  letter-spacing: .05em;
  color: var(--green-dim);
  padding: 0.75rem 1rem;
  font-weight: 400;
  display: flex;
  align-items: center;
}

.terminal-flex-body {
  display: flex;
  flex-direction: column;
}

.terminal-flex-row {
  display: flex;
  border-bottom: 1px solid var(--line-soft);
  transition: background-color 0.15s ease;
}

.terminal-flex-row:hover {
  background: rgba(60, 255, 110, 0.05);
}

.terminal-flex-td {
  padding: 0.75rem 1rem;
  vertical-align: top;
  display: flex;
  align-items: center;
  color: var(--ink);
}

/* Flex Column Widths */
.col-module { flex: 1.2 1 140px; }
.col-target { flex: 1.3 1 150px; }
.col-purpose { flex: 2.5 1 240px; }
.col-status { flex: 0.8 1 90px; }
.col-layer { flex: 1.2 1 130px; }
.col-path { flex: 1.6 1 170px; }
.col-responsibility { flex: 2.5 1 240px; }
.col-deps { flex: 1 1 100px; }
.col-scope { flex: 2.2 1 220px; }
.col-trash { flex: 1.8 1 180px; }
.col-behavior { flex: 1 1 110px; }
.col-command { flex: 1.8 1 200px; }

.badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15em 0.55em;
  border: 1px solid currentColor;
  display: inline-block;
}

.badge.ok {
  color: var(--green);
  border-color: var(--green);
}

/* ---- Not Found Card ---- */
.not-found-card {
  background: var(--surface);
  border: 1px solid var(--danger);
  padding: 2.5rem;
  margin: 3rem 0;
}

.btn-retro {
  display: inline-block;
  font-family: 'VT323', monospace;
  font-size: 1.25rem;
  color: var(--green);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 0.4em 1em;
  margin-top: 1rem;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-retro:hover {
  background: var(--surface-3);
  border-color: var(--green);
}

/* ==========================================================================
   Mobile & Small Screen Optimizations
   ========================================================================== */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    gap: 0.65rem;
  }

  .header-nav {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .nav-item {
    font-size: 1.1rem;
    padding: 0.4em 0.6em;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line-soft);
    background: var(--surface);
  }

  .site-main {
    padding: 1.5rem 1rem 3rem;
  }

  .terminal-bar {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  .terminal-body {
    padding: 1rem;
  }

  .brand-name {
    font-size: clamp(2.5rem, 11vw, 4rem);
    word-break: break-all;
  }

  .brand-tag {
    font-size: 1.05rem;
  }

  .hero-desc {
    font-size: 0.95rem;
  }

  .meta-pills {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }

  .meta-pills .pill {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .download-grid,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .dl-card {
    padding: 1.15rem;
  }

  /* Responsive Terminal Flex Table - Collapse to Cards */
  .terminal-table-wrap {
    border: none;
    background: transparent;
    box-shadow: none;
    overflow-x: visible;
  }

  .terminal-flex-table {
    gap: 0.85rem;
  }

  .terminal-flex-header {
    display: none !important;
  }

  .terminal-flex-body {
    gap: 0.85rem;
  }

  .terminal-flex-row {
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow);
    gap: 0.4rem;
  }

  .terminal-flex-td {
    padding: 0.35rem 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px dashed var(--line-soft);
    font-size: 0.85rem;
  }

  .terminal-flex-td:last-child {
    border-bottom: none;
  }

  .terminal-flex-td::before {
    content: attr(data-label);
    font-family: 'VT323', monospace;
    font-size: 1rem;
    letter-spacing: .04em;
    color: var(--green-dim);
    margin-right: 0.75rem;
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 2.4rem; }
  h2 { font-size: 1.6rem; }
  h3 { font-size: 1.2rem; }

  .boot-sequence {
    font-size: 0.75rem;
  }

  .btn-retro {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
}

/* ==========================================================================
   Pong Loading & Lockdown Overlay Styles
   ========================================================================== */

/* Fullscreen black opacity backdrop locking down the page */
.clarence-loading-overlay {
  background-color: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: all;
  user-select: none;
  cursor: wait;
}

.clarence-loading-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 99999;
}

.clarence-loading-relative {
  position: absolute;
  inset: 0;
  z-index: 50;
}

.clarence-loading-card {
  background: var(--surface, #131513);
  color: var(--green, #3CFF6E);
  border: 2px solid var(--green, #3CFF6E);
  box-shadow: 0 0 25px rgba(60, 255, 110, 0.25), 0 24px 48px rgba(0, 0, 0, 0.95);
  padding: 1.75rem 2.25rem;
  min-width: 280px;
  max-width: min(480px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  text-align: center;
  pointer-events: auto;
  animation: clarence-fade-scale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.clarence-loading-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-family: 'VT323', Consolas, monospace;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line, rgba(60, 255, 110, 0.22));
  padding-bottom: 0.5rem;
  margin-bottom: 0.25rem;
}

.clarence-loading-prompt {
  color: var(--green, #3CFF6E);
  font-weight: bold;
}

.clarence-loading-title {
  color: var(--ink, #D8D8D2);
  font-size: 1.15rem;
}

.clarence-loading-badge {
  color: var(--danger, #ff6b5e);
  font-size: 0.95rem;
  font-weight: bold;
  animation: clarence-blink-badge 1.4s infinite;
}

.clarence-loading-court {
  padding: 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.clarence-loading-message {
  font-family: 'IBM Plex Mono', Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink, #D8D8D2);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.5;
}

.clarence-loading-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  gap: 0.75rem;
}

.clarence-loading-message-inline {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-faint, #6f766f);
  font-family: 'IBM Plex Mono', monospace;
}

/* Authentic Pong Loader */
.fa-pong-loader {
  position: relative;
  display: inline-block;
  width: 72px;
  height: 36px;
  border: 1px solid var(--line, rgba(60, 255, 110, 0.4));
  background: var(--bg, #0C0C0C);
  overflow: hidden;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.8), 0 0 8px rgba(60, 255, 110, 0.15);
}

.fa-pong-paddle {
  position: absolute;
  top: 4px;
  width: 4px;
  height: 14px;
  background: var(--green, #3CFF6E);
  box-shadow: 0 0 6px var(--green, #3CFF6E);
}

.fa-pong-paddle-left {
  left: 4px;
  animation: fa-pong-paddle-bob 1.1s ease-in-out infinite;
}

.fa-pong-paddle-right {
  right: 4px;
  animation: fa-pong-paddle-bob 1.1s ease-in-out infinite reverse;
}

.fa-pong-ball {
  position: absolute;
  width: 5px;
  height: 5px;
  background: var(--green, #3CFF6E);
  box-shadow: 0 0 6px var(--green, #3CFF6E);
  animation: fa-pong-ball-bounce 2.2s linear infinite;
}

.fa-loader-primary .fa-pong-paddle,
.fa-loader-primary .fa-pong-ball {
  background: var(--green, #3CFF6E);
  box-shadow: 0 0 6px var(--green, #3CFF6E);
}

.fa-loader-gold .fa-pong-paddle,
.fa-loader-gold .fa-pong-ball {
  background: #f6c445;
  box-shadow: 0 0 6px #f6c445;
}

.fa-loader-danger .fa-pong-paddle,
.fa-loader-danger .fa-pong-ball {
  background: var(--danger, #ff6b5e);
  box-shadow: 0 0 6px var(--danger, #ff6b5e);
}

@keyframes fa-pong-paddle-bob {
  0%, 100% {
    top: 3px;
  }
  50% {
    top: 19px;
  }
}

@keyframes fa-pong-ball-bounce {
  0% {
    left: 12%;
    top: 15%;
  }
  20% {
    left: 80%;
    top: 68%;
  }
  40% {
    left: 18%;
    top: 80%;
  }
  60% {
    left: 80%;
    top: 25%;
  }
  80% {
    left: 16%;
    top: 45%;
  }
  100% {
    left: 12%;
    top: 15%;
  }
}

@keyframes clarence-fade-scale {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes clarence-blink-badge {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0.35;
  }
}

