/* RadTome Cybernetic Design System - Vanilla CSS */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,300;0,400;0,500;0,700;1,400&family=Outfit:wght@400;600;700;800&display=swap');

:root {
  --bg-dark: #050508;
  --bg-card: rgba(12, 12, 18, 0.82);
  --bg-card-hover: rgba(20, 20, 32, 0.95);
  --border-subtle: rgba(255, 140, 0, 0.22);
  --border-glow: rgba(255, 176, 32, 0.45);
  --primary-amber: #ffb020;
  --primary-orange: #ff6b35;
  --accent-cyan: #00e5ff;
  --accent-green: #00ff66;
  --accent-purple: #9d4edd;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-amber: #c8a84b;
  --font-mono: 'Roboto Mono', monospace;
  --font-sans: 'Outfit', sans-serif;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-mono);
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
  background-color: var(--bg-dark);
}

/* Background Canvas */
#tron-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

/* CRT Scanline & Screen Texture */
.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  transition: opacity 0.3s ease;
}

.crt-overlay.disabled {
  opacity: 0;
}

.crt-scanline {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
  animation: scanline 7s linear infinite;
}

.crt-texture {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.25) 2px,
    rgba(0, 0, 0, 0.25) 4px
  );
  opacity: 0.5;
}

.crt-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 60%, rgba(0, 0, 0, 0.7) 100%);
}

@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

/* Main Layout */
.app-container {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(5, 5, 8, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  transition: transform var(--transition-fast);
}

.brand-logo:hover {
  transform: translateY(-1px);
}

.brand-svg-icon {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 0 8px rgba(255, 176, 32, 0.5));
}

.brand-name {
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, #ffb020 0%, #ff6b35 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-link {
  font-size: 0.825rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  transition: color var(--transition-fast), background-color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-amber);
  background: rgba(255, 176, 32, 0.08);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  color: var(--primary-amber);
  border-color: var(--primary-amber);
  background: rgba(255, 176, 32, 0.1);
  box-shadow: 0 0 10px rgba(255, 176, 32, 0.2);
}

.btn-primary-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #ffb020, #ff6b35);
  color: #050508;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.5rem 0.95rem;
  border-radius: 4px;
  text-decoration: none;
  box-shadow: 0 0 16px rgba(255, 107, 53, 0.35);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-primary-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 22px rgba(255, 176, 32, 0.6);
}

/* Hero Section */
.hero-section {
  padding: 4.5rem 0 3rem;
  position: relative;
}

.sys-prompt-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-green);
  background: rgba(0, 255, 102, 0.06);
  border: 1px solid rgba(0, 255, 102, 0.3);
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 1.25rem;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse-dot-anim 2s infinite ease-in-out;
}

@keyframes pulse-dot-anim {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hero-title {
  font-family: var(--font-sans);
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  color: #ffffff;
}

.gradient-text {
  background: linear-gradient(135deg, #ffb020 0%, #ff6b35 50%, #ff2200 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(255, 107, 53, 0.3);
}

.hero-lead {
  font-size: 1.05rem;
  color: #cbd5e1;
  max-width: 820px;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.hero-lead strong {
  color: var(--primary-amber);
}

/* Terminal Console Box */
.terminal-box {
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 140, 0, 0.08);
  margin-top: 2rem;
  backdrop-filter: blur(8px);
}

.terminal-bar {
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.terminal-title {
  font-size: 0.725rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.terminal-content {
  padding: 1.25rem;
  font-size: 0.825rem;
  line-height: 1.7;
}

.terminal-line {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.t-prompt {
  color: var(--accent-cyan);
  font-weight: 700;
  user-select: none;
}

.t-cmd {
  color: #f1f5f9;
}

.t-out {
  color: var(--text-amber);
}

.t-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  background: rgba(255, 176, 32, 0.15);
  border: 1px solid rgba(255, 176, 32, 0.3);
  color: var(--primary-amber);
  margin-right: 0.4rem;
  border-radius: 2px;
}

/* Telemetry Grid Bar */
.telemetry-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 3.5rem 0 2rem;
}

.telemetry-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 1.1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition-fast);
  backdrop-filter: blur(8px);
}

.telemetry-card:hover {
  border-color: var(--primary-amber);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(255, 176, 32, 0.12);
}

.telemetry-icon {
  font-size: 1.5rem;
  color: var(--primary-amber);
  background: rgba(255, 176, 32, 0.1);
  width: 44px;
  height: 44px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 176, 32, 0.2);
}

.telemetry-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.05em;
}

.telemetry-lbl {
  font-size: 0.725rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Section Header Styles */
.section-header {
  margin-bottom: 2.25rem;
  position: relative;
}

.section-tag {
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: var(--primary-orange);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.section-tag::before {
  content: '>';
  color: var(--accent-green);
  font-weight: 700;
}

.section-title {
  font-family: var(--font-sans);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.section-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.4rem;
  max-width: 720px;
}

.section-line {
  height: 2px;
  width: 60px;
  background: linear-gradient(90deg, var(--primary-orange), var(--primary-amber));
  margin-top: 0.85rem;
}

/* Filter Controls */
.filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active {
  color: #050508;
  background: var(--primary-amber);
  border-color: var(--primary-amber);
  font-weight: 700;
  box-shadow: 0 0 14px rgba(255, 176, 32, 0.4);
}

/* Project Showcase Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 2rem;
  margin-bottom: 5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  backdrop-filter: blur(12px);
  position: relative;
}

.project-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.85), 0 0 24px rgba(255, 176, 32, 0.15);
}

.card-media-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  background: #000000;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.4s ease;
  filter: brightness(0.92) contrast(1.05);
}

.project-card:hover .card-img {
  transform: scale(1.04);
  filter: brightness(1);
}

.card-status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(5, 5, 8, 0.9);
  border: 1px solid var(--primary-amber);
  color: var(--primary-amber);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.project-title {
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
}

.project-version {
  font-size: 0.725rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.project-tagline {
  font-size: 0.825rem;
  color: var(--primary-amber);
  margin-bottom: 0.85rem;
  font-weight: 500;
}

.project-desc {
  font-size: 0.825rem;
  color: #cbd5e1;
  line-height: 1.65;
  margin-bottom: 1.25rem;
  flex: 1;
}

/* Card Metrics Grid */
.card-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 0.75rem;
  margin-bottom: 1.25rem;
}

.metric-item {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metric-value {
  font-size: 0.75rem;
  color: #e2e8f0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.tech-tag {
  font-size: 0.675rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 1rem;
}

.btn-card-primary {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--primary-amber);
  color: #050508;
  font-weight: 700;
  font-size: 0.775rem;
  padding: 0.55rem 0.85rem;
  border-radius: 4px;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-card-primary:hover {
  background: #ffc44d;
  box-shadow: 0 0 16px rgba(255, 176, 32, 0.4);
}

.btn-card-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.775rem;
  padding: 0.55rem 0.85rem;
  border-radius: 4px;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-card-secondary:hover {
  border-color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

/* Codex Articles Section */
.codex-section {
  padding: 4rem 0;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.4);
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
  text-decoration: none;
  color: inherit;
}

.article-card:hover {
  border-color: var(--primary-amber);
  transform: translateY(-2px);
  background: var(--bg-card-hover);
  box-shadow: 0 8px 24px rgba(255, 176, 32, 0.1);
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
}

.article-category {
  letter-spacing: 0.15em;
  font-weight: 700;
  text-transform: uppercase;
}

.article-read-time {
  color: var(--text-muted);
}

.article-title {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  margin-bottom: 0.65rem;
}

.article-summary {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex: 1;
}

.article-link-anchor {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-amber);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
}

.article-card:hover .article-link-anchor {
  color: #ffc44d;
  text-decoration: underline;
}

/* Philosophy & Etymology Banner */
.lore-section {
  padding: 4rem 0;
  border-top: 1px solid var(--border-subtle);
}

.lore-box {
  border: 1px solid rgba(255, 140, 0, 0.35);
  background: rgba(10, 10, 15, 0.85);
  border-radius: 8px;
  padding: 2.25rem;
  position: relative;
  overflow: hidden;
}

.lore-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary-amber), var(--primary-orange));
}

.lore-title {
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-amber);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.etymology-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.etym-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 4px;
}

.etym-word {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-amber);
  margin-bottom: 0.25rem;
}

.etym-def {
  font-size: 0.825rem;
  color: #cbd5e1;
}

.quote-callout {
  font-style: italic;
  color: var(--text-amber);
  border-left: 2px solid var(--primary-amber);
  padding-left: 1rem;
  margin-top: 1.5rem;
  font-size: 0.95rem;
}

/* Backlink Hub Matrix */
.backlink-hub {
  padding: 4rem 0 5rem;
  border-top: 1px solid var(--border-subtle);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.hub-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  background: var(--bg-card-hover);
  box-shadow: 0 6px 20px rgba(0, 229, 255, 0.12);
}

.hub-domain {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 0.25rem;
}

.hub-desc {
  font-size: 0.775rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: #020204;
  padding: 3rem 0;
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.5rem;
  gap: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  list-style: none;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--primary-amber);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .telemetry-bar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .crt-scanline {
    display: none !important;
  }
}
