/* ═══ johannesbrunner.de — Page-Level Overrides ═══
 * Uses JCDN design tokens (jarvis-3/0.3.0). Only overrides structure & layout.
 */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Mono:ital,wght@0,300;0,400;0,500;1,400&display=swap');

/* ── Dark Sections (scoped via framework data-theme or manual override) ── */
.section-dark {
  --surface-bg: #0e0e0d;
  --surface-card: #1a1a18;
  --surface-elevated: #222220;
  --surface-overlay: rgba(255,255,255,0.05);
  --surface-hover: rgba(255,255,255,0.06);
  --surface-active: rgba(255,255,255,0.10);
  --surface-inset: rgba(255,255,255,0.03);
  --text-primary: #e8e8e6;
  --text-secondary: rgba(232, 232, 230, 0.72);
  --text-muted: rgba(232, 232, 230, 0.48);
  --text-disabled: rgba(232, 232, 230, 0.30);
  --border-default: rgba(232, 232, 230, 0.10);
  --border-strong: rgba(232, 232, 230, 0.18);
  --scrollbar: rgba(232, 232, 230, 0.16);
  background: var(--surface-bg);
  color: var(--text-primary);
}

.section-dark .j-card,
.section-dark .launcher-card,
.section-dark .task-card,
.section-dark .metric-card,
.section-dark .timeline-dot,
.section-dark .chart-card,
.section-dark .mini-chart {
  background: var(--surface-card);
  border-color: var(--border-default);
}

.section-dark .j-card:hover { border-color: var(--border-strong); }
.section-dark .stat-label { color: var(--text-muted); }
.section-dark .section-header p { color: var(--text-muted); }

/* ── Layout Base ── */
.section {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--sp-10) var(--sp-5);
}

.section-wide { padding: var(--sp-10) var(--sp-5); }

.section-header { text-align: center; margin-bottom: var(--sp-8); }
.section-header h2 {
  font-family: var(--font-head);
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-3);
}
.section-header p {
  max-width: 480px;
  margin: 0 auto;
  font-size: var(--fs-sm);
  line-height: 1.7;
}

.section-divider {
  width: 40px; height: 2px;
  background: var(--primary);
  border-radius: 2px;
  margin: 0 auto var(--sp-4);
}

/* ── Theme Toggle ── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--ease);
  color: var(--text-secondary);
  margin-left: var(--sp-2);
}
.theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Hero (Dark) ── */
.hero {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-12) var(--sp-5) var(--sp-10);
  position: relative;
  overflow: hidden;
}

.hero-bg-grid {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(143, 214, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 214, 0, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}

.hero-glow {
  position: absolute; top: -20vh; left: 50%;
  translate: -50% 0;
  width: 80vmax; height: 60vh;
  z-index: 0;
  background: radial-gradient(ellipse at center, rgba(143, 214, 0, 0.07) 0%, transparent 70%);
  pointer-events: none;
}

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

.hero h1 {
  font-family: var(--font-head);
  font-size: var(--fs-hero);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero .sub {
  max-width: 440px;
  font-size: var(--fs-lg);
  line-height: 1.7;
  margin: var(--sp-3) auto var(--sp-6);
}

.hero-scroll {
  position: absolute; bottom: 32px; left: 50%;
  translate: -50% 0;
  display: flex; flex-direction: column; align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  z-index: 1;
}

.hero-scroll-line {
  width: 1px; height: 32px;
  background: linear-gradient(to bottom, currentColor, transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ── Orbs ── */
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); pointer-events: none; z-index: 0;
  animation: orbFloat 24s ease-in-out infinite;
}

.orb--1 {
  top: -15%; right: -10%;
  width: 50vmax; height: 50vmax;
  background: rgba(143, 214, 0, 0.06);
  animation-delay: 0s;
}
.orb--2 {
  bottom: -20%; left: -5%;
  width: 45vmax; height: 45vmax;
  background: rgba(59, 130, 246, 0.04);
  animation-delay: -8s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -50px) scale(1.08); }
  66% { transform: translate(-30px, 30px) scale(0.95); }
}

/* ── Floating Particles ── */
.particles { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.particle {
  position: absolute;
  width: 2px; height: 2px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0% { opacity: 0; transform: translateY(0) translateX(0); }
  10% { opacity: 0.5; }
  90% { opacity: 0.5; }
  100% { opacity: 0; transform: translateY(-100vh) translateX(30px); }
}

/* ── Stats Dashboard (Dark) ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.stats-grid .j-card {
  border: none; border-radius: 0;
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
}

.stats-grid .j-card:hover {
  transform: none; box-shadow: none; border-color: transparent;
}

.stat-value {
  font-family: var(--font-head);
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
}

.stat-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: var(--sp-1);
}

/* ── Metrics Cards (Dark) ── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
}

.metric-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  transition: border-color 0.25s;
}
.metric-card:hover { border-color: var(--border-strong); }

.metric-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-2);
}

.metric-value {
  font-family: var(--font-head);
  font-size: var(--fs-lg);
  font-weight: 700;
  margin-bottom: var(--sp-2);
}

.metric-bar {
  height: 4px;
  background: var(--border-default);
  border-radius: 4px;
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--primary);
  transition: width 1.5s ease;
}

/* ── Charts (Dark) ── */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}

.chart-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-3);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mini-chart {
  height: 48px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.mini-chart-bar {
  flex: 1;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
  opacity: 0.15;
  transition: opacity 0.5s;
  min-height: 2px;
}

.mini-chart-bar:nth-child(5n+1) { opacity: 0.25; }
.mini-chart-bar:nth-child(5n+2) { opacity: 0.35; }
.mini-chart-bar:nth-child(5n+3) { opacity: 0.5; }
.mini-chart-bar:nth-child(5n+4) { opacity: 0.35; }
.mini-chart-bar:nth-child(5n+5) { opacity: 0.2; }

.chart-value {
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  font-weight: 600;
}

/* ── Terminal (Dark) ── */
.j-alert--ok.terminal {
  padding: 0;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.j-alert--ok.terminal .term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface-bg);
  border-bottom: 1px solid var(--border-default);
}

.j-alert--ok.terminal .term-dots { display: flex; gap: 6px; }
.j-alert--ok.terminal .term-dot { width: 10px; height: 10px; border-radius: 50%; }
.j-alert--ok.terminal .term-dot:nth-child(1) { background: #ff5f56; }
.j-alert--ok.terminal .term-dot:nth-child(2) { background: #ffbd2e; }
.j-alert--ok.terminal .term-dot:nth-child(3) { background: #27c93f; }

.j-alert--ok.terminal .term-title {
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  margin-left: 8px;
}

.j-alert--ok.terminal .term-body {
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 1.8;
}

/* ── Feed Grid (Light) ── */
.feed-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

/* ── Resource List ── */
.resource-list { padding: var(--sp-3); }

.resource-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border-default);
}
.resource-row:last-child { border-bottom: none; }

.resource-row .label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  font-family: var(--font-mono);
}

.resource-row .label .host { font-weight: 500; }
.resource-row .label .ip { font-size: var(--fs-xs); }

/* ── Timeline (Dark) ── */
.timeline { position: relative; max-width: 720px; margin: 0 auto; }
.timeline::before {
  content: '';
  position: absolute; left: 50%; translate: -50% 0;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--border-strong);
}

.timeline-item { position: relative; display: flex; padding-bottom: var(--sp-8); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:nth-child(odd) { flex-direction: row; }
.timeline-item:nth-child(even) { flex-direction: row-reverse; }
.timeline-spacer { width: 50%; }
.timeline-content { width: 50%; padding: 0 var(--sp-5); }
.timeline-item:nth-child(odd) .timeline-content { text-align: right; }
.timeline-item:nth-child(even) .timeline-content { text-align: left; }

.timeline-dot {
  position: absolute; left: 50%; top: 4px; translate: -50% 0;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface-card);
  border: 2px solid var(--primary);
  z-index: 1;
}
.timeline-dot--current { background: var(--primary); box-shadow: 0 0 12px rgba(143, 214, 0, 0.3); }

.timeline-version { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--primary); font-weight: 500; }
.timeline-date { font-family: var(--font-mono); font-size: var(--fs-xs); }
.timeline-title { font-family: var(--font-head); font-weight: 700; font-size: var(--fs-md); margin: var(--sp-1) 0 var(--sp-1); }
.timeline-desc { font-size: var(--fs-sm); line-height: 1.6; }

/* ── System Status Bar (Dark) ── */
.status-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.status-cell {
  background: var(--surface-card);
  padding: var(--sp-3) var(--sp-4);
  text-align: center;
}

.status-cell-value {
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--primary);
}

.status-cell-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

/* ── Task Board ── */
.task-board { grid-template-columns: repeat(3, 1fr); }

/* ── Animated Cursor ── */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.cursor-blink {
  display: inline-block;
  width: 8px; height: 15px;
  background: var(--primary);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

/* ── Badge Helper ── */
.prompt-badge { padding: 1px 6px !important; font-size: 10px !important; }

/* ── Dot Tag ── */
.dot-online {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
  background: #27c93f;
  animation: j-pulse 2s ease-in-out infinite;
}

/* ── Status Dot System ── */
.status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-dot--ok { background: var(--status-online); }
.status-dot--warn { background: var(--status-warn); }
.status-dot--error { background: var(--status-error); }
.status-dot--off { background: var(--text-muted); opacity: 0.5; }

/* ── Live Feed Status ── */
.event-stream .event-stream-header { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border-default); font-size: var(--fs-xs); }
.event-stream .event-stream-body { padding: var(--sp-2) 0; }
.event-stream .event-row { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border-default); }
.event-stream .event-row:hover { background: var(--surface-hover); }
.event-stream .event-row-line1 { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); }
.event-stream .event-time { font-family: var(--font-mono); font-size: var(--fs-xs); flex-shrink: 0; }
.event-stream .event-instance { font-family: var(--font-mono); font-size: var(--fs-xs); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-stream .event-row-line2 { font-size: var(--fs-xs); padding-left: var(--sp-2); }

/* ── Icon Row ── */
.icon-row {
  display: flex;
  justify-content: center;
  gap: var(--sp-6);
  padding: var(--sp-6);
}
.icon-row-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  font-size: 24px;
}
.icon-row-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Log Preview (Dark) ── */
.log-preview {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.7;
}

.log-line {
  display: flex;
  gap: var(--sp-2);
  padding: 1px 0;
  white-space: pre-wrap;
  word-break: break-all;
}
.log-line:hover { background: var(--surface-hover); }
.log-ts { color: var(--text-secondary); flex-shrink: 0; }
.log-level--info { color: var(--status-info); font-weight: 600; }
.log-level--warn { color: var(--status-warn); font-weight: 600; }
.log-level--ok { color: var(--status-ok); font-weight: 600; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .feed-grid { grid-template-columns: 1fr; }
  .task-board { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .status-row { grid-template-columns: repeat(2, 1fr); }

  .hero { min-height: 80vh; padding: var(--sp-8) var(--sp-4); }

  .timeline::before { left: 12px; }
  .timeline-item,
  .timeline-item:nth-child(even) { flex-direction: row; }
  .timeline-spacer { width: 28px; }
  .timeline-content { width: calc(100% - 28px); padding: 0 var(--sp-4); text-align: left !important; }
  .timeline-dot { left: 12px; }
}
/* ── Showcase Grid ── */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
  max-width: 860px;
  margin: 0 auto;
}

.showcase-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-5);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  text-decoration: none;
  position: relative;
  transition: all var(--dur-normal) var(--ease);
  overflow: hidden;
}

.showcase-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  opacity: 0;
  transition: opacity var(--dur-normal) var(--ease);
}

.showcase-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.showcase-card:hover::before {
  opacity: 1;
}

.showcase-icon {
  font-size: 28px;
  margin-bottom: var(--sp-1);
}

.showcase-title {
  font-family: var(--font-head);
  font-size: var(--fs-lg);
  font-weight: 700;
}

.showcase-desc {
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.showcase-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin-top: auto;
}

.showcase-arrow {
  position: absolute;
  bottom: var(--sp-5);
  right: var(--sp-5);
  font-size: 18px;
  opacity: 0;
  transform: translateX(-8px);
  transition: all var(--dur-fast) var(--ease);
}

.showcase-card:hover .showcase-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ── Tech Grid ── */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
  max-width: 720px;
  margin: 0 auto;
}

.tech-card {
  padding: var(--sp-4);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  transition: border-color var(--dur-normal) var(--ease);
}

.tech-card:hover {
  border-color: var(--border-strong);
}

.tech-card-icon {
  font-size: 22px;
  margin-bottom: var(--sp-2);
}

.tech-card-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--fs-md);
  margin-bottom: var(--sp-1);
}

.tech-card-desc {
  font-size: var(--fs-sm);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .showcase-grid { grid-template-columns: 1fr; }
  .tech-grid { grid-template-columns: 1fr; }
}
