/* ============================================================
   CELSJUX WORKSHOP — style.css
   Dark terminal theme. Purple accent. Alive.
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0a0a0f;
  --bg-tile:     #12121e;
  --bg-tile-h:   #1a1a2e;
  --bg-terminal: #0d0d18;
  --text:        #e0e0e0;
  --text-dim:    #888;
  --text-muted:  #555;
  --accent:      #9b59b6;
  --accent-glow: rgba(155, 89, 182, 0.35);
  --accent-glow-soft: rgba(155, 89, 182, 0.12);
  --green:       #27ae60;
  --amber:       #f39c12;
  --red:         #e74c3c;
  --cyan:        #1abc9c;
  --border:      rgba(155, 89, 182, 0.18);
  --border-h:    rgba(155, 89, 182, 0.55);
  --font-mono:   'JetBrains Mono', 'Courier New', monospace;
  --font-sans:   'Inter', system-ui, sans-serif;
  --radius:      8px;
  --radius-lg:   14px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* subtle noise texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

main { flex: 1; position: relative; z-index: 1; }

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(10, 10, 15, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-prompt {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  opacity: 0.7;
}

.header-title {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.orb-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  border: 1px solid rgba(155, 89, 182, 0.35);
  border-radius: 4px;
  padding: 2px 8px;
  opacity: 0.8;
  letter-spacing: 0.04em;
}

.dm-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  border: 1px solid rgba(155, 89, 182, 0.35);
  border-radius: 4px;
  padding: 2px 8px;
  opacity: 0.8;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: opacity 0.2s, border-color 0.2s;
}
.dm-badge:hover {
  opacity: 1;
  border-color: rgba(155, 89, 182, 0.7);
}

.header-sep {
  opacity: 0.3;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-status 2.4s ease-in-out infinite;
}

@keyframes pulse-status {
  0%, 100% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.6); }
  50%       { box-shadow: 0 0 0 5px rgba(39, 174, 96, 0); }
}

/* ---------- Tiles Grid ---------- */
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 32px 28px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ---------- Tile Base ---------- */
.tile {
  background: var(--bg-tile);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px 18px;
  cursor: pointer;
  transition: border-color 0.25s, transform 0.2s, box-shadow 0.25s, background 0.25s;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tile::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse at top left, var(--accent-glow-soft), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.tile:hover,
.tile:focus {
  border-color: var(--border-h);
  background: var(--bg-tile-h);
  box-shadow: 0 0 24px var(--accent-glow), 0 4px 20px rgba(0,0,0,0.5);
  transform: translateY(-3px);
  outline: none;
}

.tile:hover::before,
.tile:focus::before { opacity: 1; }

.tile-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tile-icon { font-size: 18px; }

.tile-name {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
  flex: 1;
}

.tile-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--green);
  border: 1px solid rgba(39, 174, 96, 0.4);
  border-radius: 4px;
  padding: 1px 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tile-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
}

.stat-value.flow { color: var(--green); }

.tile-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-top: auto;
}

/* ---------- Tile Animations ---------- */

/* Animation container shared */
.tile-animation {
  height: 72px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Anima Heartbeat --- */
.anima-heartbeat { position: relative; }

.heartbeat-core {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px rgba(231, 76, 60, 0.8);
  animation: hb-core 1.2s ease-in-out infinite;
  z-index: 2;
  position: relative;
}

@keyframes hb-core {
  0%   { transform: scale(1);    box-shadow: 0 0 8px rgba(231,76,60,0.8); }
  15%  { transform: scale(1.35); box-shadow: 0 0 20px rgba(231,76,60,1); }
  30%  { transform: scale(1.1);  }
  45%  { transform: scale(1.25); }
  60%  { transform: scale(1);    box-shadow: 0 0 8px rgba(231,76,60,0.4); }
  100% { transform: scale(1);    box-shadow: 0 0 8px rgba(231,76,60,0.8); }
}

.heartbeat-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(231, 76, 60, 0.5);
  animation: hb-ring 1.2s ease-out infinite;
}
.heartbeat-ring.r1 { width: 36px; height: 36px; animation-delay: 0s; }
.heartbeat-ring.r2 { width: 54px; height: 54px; animation-delay: 0.15s; }
.heartbeat-ring.r3 { width: 70px; height: 70px; animation-delay: 0.3s; }

@keyframes hb-ring {
  0%   { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1);   opacity: 0; }
}

/* --- Vox Waveform --- */
.vox-waveform { align-items: flex-end; gap: 0; }

.wave-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 56px;
}

.bar {
  display: block;
  width: 5px;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
  animation: wave-bar 1.4s ease-in-out infinite;
  box-shadow: 0 0 6px var(--accent-glow);
}

.bar:nth-child(1)  { animation-delay: 0.00s; }
.bar:nth-child(2)  { animation-delay: 0.09s; }
.bar:nth-child(3)  { animation-delay: 0.18s; }
.bar:nth-child(4)  { animation-delay: 0.27s; }
.bar:nth-child(5)  { animation-delay: 0.36s; }
.bar:nth-child(6)  { animation-delay: 0.45s; }
.bar:nth-child(7)  { animation-delay: 0.54s; }
.bar:nth-child(8)  { animation-delay: 0.63s; }
.bar:nth-child(9)  { animation-delay: 0.54s; }
.bar:nth-child(10) { animation-delay: 0.45s; }
.bar:nth-child(11) { animation-delay: 0.36s; }
.bar:nth-child(12) { animation-delay: 0.27s; }
.bar:nth-child(13) { animation-delay: 0.18s; }
.bar:nth-child(14) { animation-delay: 0.09s; }
.bar:nth-child(15) { animation-delay: 0.00s; }
.bar:nth-child(16) { animation-delay: 0.09s; }

@keyframes wave-bar {
  0%, 100% { height: 8px;  opacity: 0.6; }
  50%       { height: 48px; opacity: 1;   }
}

/* --- CelestOS Moon --- */
.celestos-moon { position: relative; }

.moon-body {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e8d5f5, #9b59b6 60%, #4a235a);
  box-shadow: 0 0 20px rgba(155, 89, 182, 0.6), 0 0 40px rgba(155, 89, 182, 0.2);
  animation: moon-float 4s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

.moon-glow {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(155, 89, 182, 0.25) 0%, transparent 70%);
  animation: moon-glow-pulse 4s ease-in-out infinite;
}

@keyframes moon-float {
  0%, 100% { transform: translateY(0px);   }
  50%       { transform: translateY(-6px); }
}

@keyframes moon-glow-pulse {
  0%, 100% { transform: scale(1);   opacity: 0.7; }
  50%       { transform: scale(1.3); opacity: 1; }
}

.moon-orbit {
  position: absolute;
  border: 1px solid rgba(155, 89, 182, 0.2);
  border-radius: 50%;
  animation: orbit-spin linear infinite;
}
.moon-orbit.o1 {
  width: 58px; height: 58px;
  animation-duration: 6s;
}
.moon-orbit.o2 {
  width: 78px; height: 78px;
  animation-duration: 10s;
  animation-direction: reverse;
}

@keyframes orbit-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* --- RTK Counter --- */
.rtk-counter-wrap {
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.rtk-counter-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

#rtk-count {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--amber);
  text-shadow: 0 0 12px rgba(243, 156, 18, 0.6);
  min-width: 80px;
  text-align: right;
  transition: color 0.1s;
}

.rtk-unit {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.rtk-bar-wrap {
  width: 100%;
  height: 4px;
  background: rgba(243, 156, 18, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

.rtk-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--amber), #f8c471);
  border-radius: 2px;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(243, 156, 18, 0.5);
}

/* --- RTK Today Line --- */
.rtk-today {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.65;
  letter-spacing: 0.03em;
  margin-top: -4px;
}

/* --- DeltaMesh Topology --- */
.deltamesh-topology {
  width: 100%;
  height: 100%;
}

.mesh-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.mesh-line {
  stroke: rgba(155, 89, 182, 0.4);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  animation: dash-flow 2s linear infinite;
}

.pulse-line {
  stroke: rgba(155, 89, 182, 0.2);
  stroke-width: 1;
  animation-duration: 3s;
}

@keyframes dash-flow {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: -16; }
}

.mesh-node {
  fill: var(--bg-tile);
  stroke: var(--accent);
  stroke-width: 1.5;
  animation: node-pulse 2.5s ease-in-out infinite;
}

.mesh-node.hub {
  fill: rgba(155, 89, 182, 0.2);
  stroke: var(--accent);
  stroke-width: 2;
  animation-duration: 2s;
}

@keyframes node-pulse {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(155,89,182,0.4)); }
  50%       { filter: drop-shadow(0 0 8px rgba(155,89,182,0.9)); }
}

.mesh-label {
  fill: var(--text);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
}

.packet {
  fill: var(--accent);
  filter: drop-shadow(0 0 3px var(--accent));
  opacity: 0.9;
}
.p1 { fill: var(--accent); }
.p2 { fill: var(--cyan); }
.p3 { fill: var(--green); }

/* --- Chronicle Stars --- */
.chronicle-stars { position: relative; overflow: hidden; border-radius: 6px; }

.star-field {
  position: relative;
  width: 100%;
  height: 100%;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  animation: twinkle linear infinite;
}

/* Star positions and sizes */
.s1  { width:2px; height:2px; top:15%; left:10%; animation-duration:2.1s; animation-delay:0.0s; }
.s2  { width:3px; height:3px; top:25%; left:30%; animation-duration:3.3s; animation-delay:0.4s; }
.s3  { width:2px; height:2px; top:60%; left:20%; animation-duration:2.7s; animation-delay:0.8s; }
.s4  { width:4px; height:4px; top:40%; left:50%; animation-duration:1.9s; animation-delay:0.2s; color: var(--accent); background: var(--accent); }
.s5  { width:2px; height:2px; top:75%; left:70%; animation-duration:2.5s; animation-delay:1.1s; }
.s6  { width:3px; height:3px; top:10%; left:80%; animation-duration:3.0s; animation-delay:0.6s; }
.s7  { width:2px; height:2px; top:50%; left:90%; animation-duration:2.2s; animation-delay:1.5s; }
.s8  { width:3px; height:3px; top:85%; left:45%; animation-duration:2.8s; animation-delay:0.9s; }
.s9  { width:2px; height:2px; top:20%; left:60%; animation-duration:3.5s; animation-delay:0.3s; }
.s10 { width:4px; height:4px; top:65%; left:8%;  animation-duration:2.0s; animation-delay:1.3s; color: var(--amber); background: var(--amber); }
.s11 { width:2px; height:2px; top:35%; left:75%; animation-duration:2.6s; animation-delay:0.7s; }
.s12 { width:3px; height:3px; top:80%; left:88%; animation-duration:3.1s; animation-delay:0.1s; }
.s13 { width:2px; height:2px; top:5%;  left:45%; animation-duration:2.4s; animation-delay:1.7s; }
.s14 { width:3px; height:3px; top:55%; left:35%; animation-duration:2.9s; animation-delay:0.5s; }
.s15 { width:2px; height:2px; top:92%; left:60%; animation-duration:2.3s; animation-delay:1.0s; }

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.4); }
}

/* ---------- Project Detail Panels ---------- */
.project-details {
  padding: 0 28px 32px;
  max-width: 1400px;
  margin: 0 auto;
}

.detail-panel {
  display: none;
  background: var(--bg-tile);
  border: 1px solid var(--border-h);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  padding: 32px 36px;
  position: relative;
  animation: panel-slide-in 0.3s ease;
  box-shadow: 0 0 32px var(--accent-glow);
}

.detail-panel.open {
  display: block;
}

@keyframes panel-slide-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.detail-close {
  position: absolute;
  top: 18px;
  right: 20px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.detail-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.detail-inner h2 {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-icon { font-size: 22px; }

.detail-inner blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 24px;
  font-size: 14px;
}

.detail-inner h3 {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 20px 0 10px;
}

.detail-inner p {
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 10px;
  font-size: 14px;
}

.detail-inner ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.detail-inner ul li {
  color: var(--text-dim);
  font-size: 14px;
  padding-left: 16px;
  position: relative;
}

.detail-inner ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.detail-inner code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(155, 89, 182, 0.12);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 3px;
}

.stack-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(155, 89, 182, 0.1);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 5px 14px;
  border-radius: 20px;
  margin-top: 4px;
}

.detail-note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Signal table */
.signal-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.signal-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(155, 89, 182, 0.06);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.sig-icon { font-size: 16px; flex-shrink: 0; }

.sig-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  min-width: 90px;
  flex-shrink: 0;
}

.sig-desc {
  font-size: 13px;
  color: var(--text-dim);
}

/* Before/after */
.before-after {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.ba-col {
  flex: 1;
  min-width: 160px;
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
  padding: 10px 14px;
  border: 1px solid var(--border);
}

.ba-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.ba-label.before { color: var(--red); }
.ba-label.after  { color: var(--green); }

.ba-text {
  font-size: 13px;
  color: var(--text-dim);
}

.ba-arrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 20px;
  flex-shrink: 0;
}

/* Topology diagram */
.topology-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 12px 0;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 13px;
}

.topo-node {
  color: var(--text);
  padding: 4px 10px;
  border: 1px solid var(--border-h);
  border-radius: 5px;
  background: var(--bg-tile-h);
}

.topo-node.hub {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.topo-line {
  color: var(--text-muted);
  font-size: 12px;
}

/* ---------- Terminal ---------- */
.terminal-section {
  max-width: 1400px;
  margin: 0 auto 32px;
  padding: 0 28px;
}

.terminal-titlebar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #1a1a2a;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 10px 16px;
}

.term-dots { display: flex; gap: 6px; align-items: center; }

.term-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.term-dot.red    { background: #ff5f57; }
.term-dot.yellow { background: #febc2e; }
.term-dot.green  { background: #28c840; }

.term-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.terminal-body {
  background: var(--bg-terminal);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 16px 20px;
  min-height: 280px;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  /* scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-terminal);
}

.terminal-body::-webkit-scrollbar { width: 5px; }
.terminal-body::-webkit-scrollbar-track { background: var(--bg-terminal); }
.terminal-body::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

#term-output {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}

.term-line {
  white-space: pre-wrap;
  word-break: break-word;
}

.term-line.boot-line { color: var(--text-dim); }
.term-line.spacer    { height: 6px; }
.term-line.cmd-echo  { color: var(--text); }
.term-line.cmd-echo::before { content: 'celsjux@opus:~$ '; color: var(--accent); }
.term-line.response  { color: #a3d6b5; }
.term-line.error     { color: var(--red); }
.term-line.highlight { color: var(--accent); }
.term-line.comment   { color: var(--text-muted); }
.term-line.easter    { color: #f8c471; }

.hl { color: var(--accent); }

.term-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.term-prompt {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

.term-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  caret-color: var(--accent);
}

.term-input::placeholder {
  animation: cursor-blink 1.1s step-end infinite;
  color: var(--accent);
}

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

/* ---------- Coming Soon ---------- */
.coming-soon {
  max-width: 1400px;
  margin: 0 auto 24px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.65;
}

.cs-label {
  color: var(--accent);
  opacity: 0.7;
  font-style: normal;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid rgba(155, 89, 182, 0.25);
  border-radius: 4px;
  padding: 1px 7px;
  flex-shrink: 0;
}

.cs-item { color: var(--text-muted); }

.cs-sep {
  color: var(--text-muted);
  opacity: 0.4;
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 16px 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-contact {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-contact a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
}

.footer-contact a:hover {
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent-glow);
}

.footer-sep {
  color: var(--text-muted);
  opacity: 0.35;
}

.footer-right { color: var(--text-muted); opacity: 0.5; }

/* ---------- WebGL Globe Section ---------- */
.webgl-globe-section {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
  background: #0a0a0f;
  margin-bottom: 0;
}

#webgl-globe {
  width: 100%;
  height: 100%;
}

.globe-hud-top {
  position: absolute;
  top: 24px;
  left: 28px;
  z-index: 10;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(168, 85, 247, 0.5);
  pointer-events: none;
}

.globe-hud-top strong {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: rgba(236, 220, 255, 0.9);
  text-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

.webgl-globe-label {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  opacity: 0.7;
  pointer-events: none;
}

.webgl-globe-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  opacity: 0.6;
}

@media (max-width: 640px) {
  .webgl-globe-section {
    height: 400px;
  }
}

/* ---------- Seasoned Tile ---------- */
.seasoned-counter-wrap {
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.seasoned-counter-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

#seasoned-count {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 14px rgba(155, 89, 182, 0.7);
  min-width: 80px;
  text-align: right;
  transition: color 0.1s;
}

.seasoned-unit {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.seasoned-epochs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.epoch-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.vps-dot {
  background: var(--cyan);
  box-shadow: 0 0 6px rgba(26, 188, 156, 0.7);
}

.pc-dot {
  background: var(--accent);
  box-shadow: 0 0 6px rgba(155, 89, 182, 0.8);
  animation: pc-dot-pulse 2s ease-in-out infinite;
}

@keyframes pc-dot-pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(155, 89, 182, 0.6); }
  50%       { box-shadow: 0 0 14px rgba(155, 89, 182, 1); }
}

.epoch-label {
  font-size: 9px;
  opacity: 0.7;
  letter-spacing: 0.08em;
}

.seasoned-cost {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.02em;
  cursor: default;
  user-select: none;
}

/* ---------- Seasoned Detail Panel ---------- */
.seasoned-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  .seasoned-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.seasoned-big-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(155, 89, 182, 0.07);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  text-align: center;
}

.seasoned-big-num {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(155, 89, 182, 0.5);
}

.seasoned-big-num.masked-cost {
  font-size: 16px;
  color: var(--text-muted);
  text-shadow: none;
  letter-spacing: 0.05em;
  user-select: none;
}

.seasoned-big-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Era timeline */
.era-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 12px 0;
}

.era-block {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
}

.era-block.era-vps {
  border-left: 3px solid var(--cyan);
}

.era-block.era-pc {
  border-left: 3px solid var(--accent);
}

.era-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.era-vps .era-dot {
  background: var(--cyan);
  box-shadow: 0 0 6px rgba(26, 188, 156, 0.6);
}

.era-pc .era-dot {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(155, 89, 182, 0.8);
  animation: pc-dot-pulse 2s ease-in-out infinite;
}

.era-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.era-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.era-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.era-tokens {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin-top: 2px;
}

.era-note {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 2px;
}

.era-connector {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.45;
  padding: 6px 0;
  letter-spacing: 0.08em;
}

/* RTK note inside Seasoned detail */
.seasoned-rtk-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(243, 156, 18, 0.06);
  border: 1px solid rgba(243, 156, 18, 0.2);
  border-radius: 8px;
  margin: 10px 0;
  font-size: 13px;
  color: var(--text-dim);
}

.seasoned-rtk-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.seasoned-rtk-note strong {
  color: var(--amber);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .tiles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .tiles-grid {
    grid-template-columns: 1fr;
    padding: 20px 16px;
    gap: 14px;
  }

  .site-header {
    padding: 12px 16px;
  }

  .header-prompt { display: none; }

  .terminal-section,
  .project-details {
    padding: 0 16px 24px;
  }

  .detail-panel {
    padding: 24px 20px;
  }

  .detail-inner h2 { font-size: 17px; }

  .before-after { flex-direction: column; }
  .ba-arrow { transform: rotate(90deg); }

  .site-footer {
    padding: 14px 16px;
    flex-direction: column;
    text-align: center;
  }

  .topology-diagram { flex-direction: column; }
  .topo-line { transform: rotate(90deg); }
}

/* ---------- Live Sync Indicator ---------- */
.live-sync-bar {
  text-align: right;
  padding: 4px 8px 0;
  min-height: 18px;
}
.live-sync-ts {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.5;
  letter-spacing: 0.03em;
}
.live-sync-ts:not(:empty) {
  opacity: 0.6;
}

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ---------- O.R.B. Slide-Out Panel ---------- */

/* Make the badge look clickable */
.orb-badge {
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
  user-select: none;
}
.orb-badge:hover,
.orb-badge:focus {
  opacity: 1;
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.7);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.35);
  outline: none;
}

/* Backdrop overlay */
.orb-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.orb-backdrop.orb-open {
  opacity: 1;
  pointer-events: all;
}

/* Panel */
.orb-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 100vw;
  background: #0e0e1a;
  border-left: 1px solid rgba(155, 89, 182, 0.3);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.6);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow: hidden;
}
.orb-panel.orb-open {
  transform: translateX(0);
}

/* Panel header */
.orb-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(155, 89, 182, 0.2);
  flex-shrink: 0;
  gap: 12px;
}

.orb-panel-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.orb-panel-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
  object-fit: cover;
}

.orb-panel-title {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
}

.orb-panel-subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  margin-top: 1px;
}

.orb-panel-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 13px;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s;
}
.orb-panel-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Panel scrollable body */
.orb-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) #0e0e1a;
}
.orb-panel-body::-webkit-scrollbar { width: 4px; }
.orb-panel-body::-webkit-scrollbar-track { background: #0e0e1a; }
.orb-panel-body::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* Tagline */
.orb-desc-tagline {
  font-size: 18px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Description */
.orb-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.65;
}

/* Feature chips */
.orb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.orb-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 20px;
  padding: 3px 10px;
  letter-spacing: 0.04em;
  background: rgba(168, 85, 247, 0.07);
}

/* Screenshot carousel */
.orb-screenshots-wrap {
  position: relative;
}

.orb-screenshots {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 85, 247, 0.4) transparent;
}
.orb-screenshots::-webkit-scrollbar { height: 3px; }
.orb-screenshots::-webkit-scrollbar-track { background: transparent; }
.orb-screenshots::-webkit-scrollbar-thumb { background: rgba(168, 85, 247, 0.4); border-radius: 2px; }

.orb-screenshot {
  height: 200px;
  width: auto;
  border-radius: 10px;
  flex-shrink: 0;
  scroll-snap-align: start;
  object-fit: cover;
  border: 1px solid rgba(155, 89, 182, 0.2);
  transition: border-color 0.2s;
}
.orb-screenshot:hover {
  border-color: rgba(168, 85, 247, 0.6);
  cursor: pointer;
}

/* Lightbox */
.orb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
}
.orb-lightbox.active {
  display: flex;
}
.orb-lightbox img {
  max-height: 90vh;
  max-width: 90vw;
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.3);
}
.orb-lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 28px;
  color: #a855f7;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.orb-lightbox-close:hover { opacity: 1; }
.orb-lightbox-caption {
  position: absolute;
  bottom: 20px;
  text-align: center;
  width: 100%;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  font-family: var(--font-mono);
}

/* Captions — show the one matching the scroll position */
.orb-captions {
  min-height: 22px;
  position: relative;
}

.orb-caption {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.orb-caption.active {
  opacity: 1;
  pointer-events: auto;
  position: relative;
}

/* Links */
.orb-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.orb-link-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 14px;
  text-decoration: none;
  background: rgba(155, 89, 182, 0.05);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.orb-link-badge:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(155, 89, 182, 0.1);
}

/* Footer */
.orb-footer {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.5;
  text-align: center;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

/* Mobile: full width */
@media (max-width: 480px) {
  .orb-panel {
    width: 100vw;
    border-left: none;
  }
}
