/* c64-these — style.css */

:root {
  --bg:    #020208;
  --bg-2:  #050518;
  --bg-3:  #080828;
  --blue:  #5577ff;
  --yellow: #c8c800;
  --green: #55ff55;
  --text:  #4455aa;
  --hi:    #aabbff;
  --muted: rgba(170,187,255,0.4);
  --mono:  'JetBrains Mono', 'Courier New', monospace;
  --serif: 'Cormorant Garamond', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.8;
}

/* ── KEYFRAMES ────────── */

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

@keyframes scanline-move {
  0%   { top: -2%; }
  100% { top: 102%; }
}

@keyframes fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes typewriter {
  from { width: 0; }
  to   { width: 100%; }
}

@keyframes crt-flicker {
  0%   { opacity: 1; }
  92%  { opacity: 1; }
  93%  { opacity: 0.85; }
  94%  { opacity: 1; }
  97%  { opacity: 1; }
  98%  { opacity: 0.9; }
  99%  { opacity: 1; }
  100% { opacity: 1; }
}

@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(85,119,255,0.6); }
  70%  { box-shadow: 0 0 0 14px rgba(85,119,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(85,119,255,0); }
}

@keyframes timeline-grow {
  from { width: 0; }
  to   { width: 100%; }
}

/* ── HERO / CRT SCREEN ────────── */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

/* CRT scanlines overlay on hero */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.28) 2px,
    rgba(0,0,0,0.28) 4px
  );
  pointer-events: none;
  z-index: 2;
}

/* Moving scanline beam */
.hero-scanline {
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  background: linear-gradient(to right,
    transparent,
    rgba(85,119,255,0.08),
    rgba(85,119,255,0.18),
    rgba(85,119,255,0.08),
    transparent
  );
  animation: scanline-move 5s linear infinite;
  pointer-events: none;
  z-index: 3;
}

.crt-screen {
  position: relative;
  width: min(640px, 92vw);
  background: #020212;
  border: 2px solid rgba(85,119,255,0.35);
  border-radius: 8px;
  padding: 2.5rem 2.5rem 2rem;
  box-shadow:
    0 0 40px rgba(85,119,255,0.4),
    0 0 80px rgba(85,119,255,0.15),
    inset 0 0 30px rgba(85,119,255,0.06);
  animation: crt-flicker 8s step-end infinite;
  z-index: 1;
  margin-bottom: 3rem;
}

/* Inner scanlines on CRT screen */
.crt-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.3) 2px,
    rgba(0,0,0,0.3) 4px
  );
  pointer-events: none;
  z-index: 5;
}

/* Screen glass reflection */
.crt-screen::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 55%;
  height: 40%;
  background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.03) 0%, transparent 70%);
  border-radius: 8px;
  pointer-events: none;
}

.crt-topbar {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--blue);
  opacity: 0.5;
  letter-spacing: 0.2em;
  margin-bottom: 1.5rem;
}

.crt-line {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.9;
  color: var(--blue);
  display: block;
  white-space: nowrap;
  overflow: hidden;
}

.crt-line.ready {
  color: var(--blue);
  font-size: 0.9rem;
  opacity: 0.9;
  margin-top: 0.5rem;
}

.crt-line.basic {
  color: var(--yellow);
}

.crt-line.run-cmd {
  color: var(--green);
  font-size: 0.9rem;
}

.crt-line.output {
  color: var(--blue);
  opacity: 0.8;
  font-size: 0.82rem;
}

/* Typewriter animation for each line */
.crt-line { animation: fadein 0.2s ease forwards; opacity: 0; }
.crt-line:nth-child(1)  { animation-delay: 0.3s; }
.crt-line:nth-child(2)  { animation-delay: 0.8s; }
.crt-line:nth-child(3)  { animation-delay: 1.4s; }
.crt-line:nth-child(4)  { animation-delay: 1.9s; }
.crt-line:nth-child(5)  { animation-delay: 2.4s; }
.crt-line:nth-child(6)  { animation-delay: 2.9s; }
.crt-line:nth-child(7)  { animation-delay: 3.5s; }
.crt-line:nth-child(8)  { animation-delay: 4.1s; }
.crt-line:nth-child(9)  { animation-delay: 4.6s; }
.crt-line:nth-child(10) { animation-delay: 5.1s; }

/* Blinking cursor */
.cursor {
  display: inline-block;
  width: 10px;
  height: 1.1em;
  background: var(--yellow);
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

.cursor-green {
  display: inline-block;
  width: 10px;
  height: 1.1em;
  background: var(--green);
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

/* Hero title below screen */
.hero-title {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  font-weight: 300;
  line-height: 1.05;
  color: var(--hi);
  text-align: center;
  letter-spacing: -0.02em;
  text-shadow: 0 0 60px rgba(85,119,255,0.25);
  margin-bottom: 1.2rem;
  position: relative;
  z-index: 1;
}

.hero-sub {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  max-width: 540px;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-block;
  border: 1px solid rgba(85,119,255,0.3);
  padding: 0.25rem 0.9rem;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 2.5rem;
  animation: fadein 0.4s ease forwards;
  position: relative;
  z-index: 1;
}

/* ── SECTIONS SHARED ────────── */

.s {
  padding: 5rem 2rem;
  border-top: 1px solid rgba(85,119,255,0.06);
}

.s-2 { background: var(--bg-2); }
.s-3 { background: var(--bg-3); }

.s-inner {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.s-full { max-width: 980px; margin: 0 auto; }

.sec-label {
  font-size: 0.6rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--blue);
  opacity: 0.55;
  margin-bottom: 1.2rem;
  font-family: var(--mono);
}

h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  line-height: 1.2;
  color: var(--hi);
  margin-bottom: 1.2rem;
}

h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--hi);
  margin-bottom: 0.8rem;
}

p { margin-bottom: 1rem; font-size: 0.9rem; }

.pull {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--hi);
  border-left: 2px solid rgba(85,119,255,0.25);
  padding-left: 1.2rem;
  margin: 1.5rem 0;
  line-height: 1.6;
}

/* ── BASIC LISTING BLOCK ────────── */

.basic-listing {
  background: #020218;
  border: 1px solid rgba(85,119,255,0.2);
  border-radius: 4px;
  padding: 1.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 2;
  box-shadow: 0 0 20px rgba(85,119,255,0.08), inset 0 0 20px rgba(85,119,255,0.04);
  position: relative;
  overflow: hidden;
}

.basic-listing::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.2) 2px,
    rgba(0,0,0,0.2) 4px
  );
  pointer-events: none;
}

.bl-header {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--blue);
  opacity: 0.45;
  margin-bottom: 1rem;
}

.bl-line {
  display: block;
  color: var(--yellow);
}

.bl-line .ln {
  color: rgba(85,119,255,0.5);
  min-width: 2.5rem;
  display: inline-block;
}

.bl-line .kw {
  color: var(--hi);
}

.bl-line .str {
  color: var(--green);
}

.bl-line .num {
  color: rgba(200,200,0,0.7);
}

.bl-line.comment {
  color: rgba(85,119,255,0.4);
  font-size: 0.72rem;
}

/* ── PIXEL BORDER ────────── */

.pixel-border {
  box-shadow:
    0   0   0 2px var(--bg),
    0   0   0 4px rgba(85,119,255,0.4),
    0   0   0 6px var(--bg),
    0   0   0 8px rgba(85,119,255,0.15);
  border-radius: 2px;
}

/* ── TERMINAL BLOCK ────────── */

.terminal-block {
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(85,119,255,0.12);
  border-radius: 3px;
  padding: 1.2rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 2;
  color: var(--muted);
}

.tb-prompt { color: var(--green); }
.tb-key    { color: var(--blue); }
.tb-val    { color: var(--hi); opacity: 0.8; }
.tb-comment { color: rgba(85,119,255,0.35); font-size: 0.7rem; }

/* ── CONVERGENCE TABLE / INFOGRAPHIC ────────── */

.conv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-family: var(--mono);
}

.conv-table th {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  opacity: 0.55;
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(85,119,255,0.15);
}

.conv-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(85,119,255,0.05);
  vertical-align: top;
  line-height: 1.5;
}

.conv-table tr:hover td {
  background: rgba(85,119,255,0.04);
}

.conv-table .col-game  { color: var(--green); }
.conv-table .col-code  { color: var(--yellow); }
.conv-table .col-note  { color: var(--muted); font-size: 0.75rem; }

/* ── TIMELINE INFOGRAPHIC ────────── */

.timeline {
  position: relative;
  padding: 2rem 0;
  margin-top: 2rem;
}

.timeline-rail {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 2px;
  background: rgba(85,119,255,0.2);
  transform: translateY(-50%);
  overflow: hidden;
}

.timeline-rail::after {
  content: '';
  display: block;
  height: 100%;
  background: linear-gradient(to right, var(--blue), var(--green));
  animation: timeline-grow 2s ease forwards;
  animation-delay: 0.5s;
  width: 0;
}

.timeline-items {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
  gap: 0.5rem;
}

.tl-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.tl-dot {
  width: 14px;
  height: 14px;
  border: 2px solid var(--blue);
  background: var(--bg);
  position: relative;
  /* pixel-art square dot */
  border-radius: 0;
}

.tl-dot::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: var(--blue);
}

.tl-item:nth-child(odd) .tl-dot::after { background: var(--blue); }
.tl-item:nth-child(even) .tl-dot::after { background: var(--green); }

.tl-dot.pulse { animation: pulse-dot 2.5s ease-out infinite; }

.tl-year {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--blue);
  letter-spacing: 0.12em;
  order: -1;
}

.tl-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
  max-width: 80px;
}

/* ── COMPARE GRID ────────── */

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 0;
  margin-top: 1.5rem;
  border: 1px solid rgba(85,119,255,0.1);
  border-radius: 4px;
  overflow: hidden;
}

.compare-divider {
  background: rgba(85,119,255,0.15);
}

.compare-col {
  padding: 1.5rem;
}

.compare-col.game-col { background: rgba(85,255,85,0.03); }
.compare-col.code-col { background: rgba(200,200,0,0.03); }

.compare-col-head {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(85,119,255,0.08);
}

.compare-col.game-col .compare-col-head { color: var(--green); }
.compare-col.code-col .compare-col-head { color: var(--yellow); }

.compare-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.8rem;
}

.compare-row .cr-label {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.4;
}

.compare-row .cr-val {
  font-size: 0.82rem;
  color: var(--hi);
}

/* ── SIDE-BY-SIDE HUD ────────── */

.hud-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.hud-box {
  background: rgba(0,0,10,0.8);
  border: 1px solid rgba(85,119,255,0.15);
  border-radius: 3px;
  padding: 1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.hud-box-label {
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  opacity: 0.5;
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(85,119,255,0.08);
}

.hud-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.2rem 0;
  border-bottom: 1px solid rgba(85,119,255,0.04);
  font-size: 0.72rem;
}

.hud-item .hi-key { color: var(--muted); }
.hud-item .hi-val { color: var(--hi); }

/* Progress bar inside HUD */
.hud-bar {
  margin-top: 0.6rem;
  height: 4px;
  background: rgba(85,119,255,0.1);
  border-radius: 1px;
  overflow: hidden;
}

.hud-bar-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 1px;
  transition: width 0.3s ease;
}

/* ── INLINE PIXEL ART SVG SECTION ────────── */

.pixel-art-section {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

/* ── CLOSE ────────── */

.s-close {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 2rem;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* CRT scanlines on close section */
.s-close::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.15) 2px,
    rgba(0,0,0,0.15) 4px
  );
  pointer-events: none;
}

.close-inner {
  max-width: 620px;
  position: relative;
  z-index: 1;
}

.close-prompt {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--blue);
  opacity: 0.5;
  letter-spacing: 0.2em;
  margin-bottom: 1.5rem;
}

.close-text {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 300;
  line-height: 1.25;
  color: var(--hi);
  margin-bottom: 1.5rem;
}

.close-text em {
  font-style: italic;
  color: var(--yellow);
}

.close-sub {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 2rem;
  line-height: 1.75;
}

.close-cursor {
  font-family: var(--mono);
  font-size: 1.2rem;
  color: var(--yellow);
  animation: blink 1s step-end infinite;
}

.close-meta {
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  color: var(--blue);
  opacity: 0.2;
  margin-top: 2rem;
}

/* ── INFO BOXES ────────── */

.info-box {
  background: rgba(85,119,255,0.04);
  border: 1px solid rgba(85,119,255,0.12);
  border-radius: 3px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.info-box-label {
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  opacity: 0.6;
  margin-bottom: 0.5rem;
  font-family: var(--mono);
}

.info-box p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.info-box strong { color: var(--hi); }

/* ── STATS ROW ────────── */

.stats-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.stat-item {
  flex: 1;
  min-width: 120px;
  background: rgba(85,119,255,0.04);
  border: 1px solid rgba(85,119,255,0.1);
  border-radius: 3px;
  padding: 1rem;
  text-align: center;
}

.stat-num {
  font-family: var(--mono);
  font-size: 1.8rem;
  color: var(--hi);
  display: block;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.stat-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── FOOTER ────────── */

.site-footer {
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.7rem;
  border-top: 1px solid rgba(85,119,255,0.06);
  font-family: var(--mono);
}

.site-footer a {
  color: var(--blue);
  text-decoration: none;
  opacity: 0.3;
}

.site-footer a:hover { opacity: 0.8; }

/* ── RESPONSIVE ────────── */

@media (max-width: 780px) {
  .s-inner      { grid-template-columns: 1fr; gap: 2rem; }
  .compare-grid { grid-template-columns: 1fr; }
  .compare-divider { display: none; }
  .hud-compare  { grid-template-columns: 1fr; }
  .timeline-items { gap: 0; }
  .tl-label { display: none; }
  .stats-row { gap: 0.8rem; }
  .crt-screen { padding: 1.5rem; }
  .crt-line { font-size: 0.7rem; }
}
