@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');
:root {
  --bg: #030712;
  --bg-alt: #0b1324;
  --panel: #10182c;
  --accent: #6df0ff;
  --accent-soft: #89a5ff;
  --text: #f6f7fb;
  --muted: #9aa4bc;
}

* { box-sizing: border-box; }
body {
  font-family: 'Space Grotesk', Arial, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.hero {
  padding: 60px clamp(20px, 6vw, 80px);
  background: radial-gradient(circle at top left, #17223a, #050910 70%);
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.logo { font-weight: 600; font-size: 1.1rem; letter-spacing: 1px; }
.links a { margin-left: 16px; font-size: 0.95rem; color: var(--muted); }
.links a:hover { color: var(--accent); }

.hero-copy h1 { font-size: clamp(2rem, 5vw, 3.8rem); margin: 10px 0; }
.hero-copy p { max-width: 640px; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: 4px; color: var(--accent-soft); font-size: 0.85rem; }
.hero-cta { margin-top: 24px; display: flex; gap: 16px; flex-wrap: wrap; }
.hero-cta .primary { background: var(--accent); color: #04121c; padding: 12px 24px; border-radius: 999px; font-weight: 600; }
.hero-cta .ghost { border: 1px solid var(--muted); padding: 12px 24px; border-radius: 999px; color: var(--muted); }

.hero-stats { margin-top: 50px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.hero-stats span { font-size: 2.4rem; font-weight: 600; color: var(--accent); }
.hero-stats p { color: var(--muted); }

section { padding: 50px clamp(20px, 6vw, 80px); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; background: var(--bg-alt); }
.grid article { background: var(--panel); padding: 24px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.04); }
.grid h3 { margin-top: 0; }

.pillars { background: #050b16; }
.pillars h2 { margin-bottom: 24px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.card { background: var(--panel); padding: 18px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); }

.cta { background: linear-gradient(120deg, #111f3b, #06101f); }
.cta .hero-cta { margin-top: 16px; }

footer { text-align: center; padding: 30px; color: var(--muted); font-size: 0.9rem; border-top: 1px solid rgba(255,255,255,0.05); }

@media (max-width: 720px) {
  .links { width: 100%; margin-top: 10px; }
  .links a { margin: 0 8px 8px 0; display: inline-block; }
}

/* Diagnostics dashboard layout */
body.diagnostics-body {
  background-color: #050a15;
  color: #00d2ff;
  font-family: 'Courier New', Courier, monospace;
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

body.diagnostics-body .dashboard-shell {
  width: 95vw;
  max-width: 1400px;
  border: 2px solid #00d2ff;
  box-shadow: 0 0 20px rgba(0, 210, 255, 0.3), inset 0 0 20px rgba(0, 210, 255, 0.2);
  padding: 15px;
  position: relative;
  background: radial-gradient(circle at center, #0a1128 0%, #02050a 100%);
}

body.diagnostics-body .dashboard-shell::before,
body.diagnostics-body .dashboard-shell::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  border: 3px solid #00d2ff;
}
body.diagnostics-body .dashboard-shell::before { top: -2px; left: -2px; border-right: none; border-bottom: none; }
body.diagnostics-body .dashboard-shell::after { bottom: -2px; right: -2px; border-left: none; border-top: none; }

body.diagnostics-body .dashboard-container {
  display: grid;
  grid-template-columns: 1fr 1.8fr 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 15px;
}

body.diagnostics-body .panel {
  border: 1px solid #004488;
  padding: 16px;
  background: rgba(5, 10, 21, 0.85);
  box-shadow: inset 0 0 15px rgba(0, 68, 136, 0.3);
  display: flex;
  flex-direction: column;
}

.diagnostics-header {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 210, 255, 0.3);
  padding-bottom: 10px;
}

.primary-nav a {
  color: #66b2ff;
  margin-left: 12px;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 2px;
}

.tag { text-transform: uppercase; letter-spacing: 3px; font-size: 0.8rem; color: #88ff00; }
.text-green { color: #88ff00; }
.small-text { font-size: 0.8rem; line-height: 1.4; color: #66b2ff; }

.data-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(60px, 1fr));
  gap: 6px;
  font-size: 0.85rem;
  margin: 12px 0 24px;
}

.diagnostic-log {
  border: 1px solid #004488;
  padding: 12px;
  font-size: 0.75rem;
  color: #66b2ff;
}

.center-panel {
  border: none;
  box-shadow: none;
  align-items: center;
  justify-content: center;
}

.ring-container {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1/1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
}

.ring-outer {
  width: 100%;
  height: 100%;
  border-top: 4px solid #00d2ff;
  border-bottom: 4px solid #00d2ff;
  animation: spin 10s linear infinite;
  box-shadow: 0 0 20px #00d2ff, inset 0 0 20px #00d2ff;
}

.ring-inner-1 { width: 85%; height: 85%; border: 2px dashed #88ff00; animation: spin-reverse 15s linear infinite; }
.ring-inner-2 { width: 70%; height: 70%; border: 3px solid #004488; border-left-color: #00d2ff; border-right-color: #00d2ff; animation: spin 8s linear infinite; }

.ring-core {
  width: 55%;
  height: 55%;
  border: 1px solid rgba(0, 210, 255, 0.3);
  background: radial-gradient(circle, rgba(0, 210, 255, 0.12) 0%, transparent 70%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 15px;
  font-size: 0.85rem;
}

.ring-stats {
  position: absolute;
  bottom: -80px;
  width: 110%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  font-size: 0.75rem;
}

.ring-stats span { font-size: 1.4rem; color: #88ff00; display: block; }

.right-panel .menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}

.right-panel .menu-list li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(0, 68, 136, 0.6);
  display: flex;
  justify-content: space-between;
  color: #66b2ff;
}

.primary-subsystem { margin-top: auto; }
.primary-subsystem h3 { font-size: 0.85rem; margin-bottom: 6px; color: #88ff00; }

.bottom-panel {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(0, 210, 255, 0.3);
}

.bottom-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.nav-item {
  border: 1px solid #004488;
  padding: 3px 16px;
  font-size: 0.8rem;
}

.nav-item.active {
  border-color: #88ff00;
  color: #88ff00;
}

.bottom-data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.bottom-data-grid article {
  border: 1px solid rgba(0, 210, 255, 0.2);
  padding: 12px;
  font-size: 0.85rem;
}

.bottom-data-grid h4 { margin: 0 0 8px; color: #88ff00; }
.bottom-data-grid ul { padding-left: 16px; margin: 0; }
.bottom-data-grid ul li { margin-bottom: 4px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-reverse { to { transform: rotate(-360deg); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.blink { animation: blink 2s infinite; }

@media (max-width: 960px) {
  body.diagnostics-body .dashboard-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .ring-stats { position: static; width: 100%; margin-top: 20px; }
}

/* Template page layout */
.template-body {
  margin: 0;
  padding: 20px;
  background-color: #0d1115;
  color: #64b5f6;
  font-family: 'Share Tech Mono', monospace;
  height: 100vh;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.template-nav {
  position: absolute;
  top: 10px;
  left: 20px;
  z-index: 5;
  font-family: 'Share Tech Mono', monospace;
}

.template-nav a {
  color: #88ff00;
  text-decoration: none;
  letter-spacing: 2px;
  font-size: 0.75rem;
  text-transform: uppercase;
  display: inline-block;
}

.template-nav a:hover {
  text-decoration: underline;
}

.template-body .dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  grid-template-rows: 2fr 1fr;
  gap: 15px;
  width: 100%;
  max-width: 1400px;
  height: 95vh;
  background: #080b0e;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  border: 1px solid #1a252f;
}

.template-body .panel {
  background-color: #131a20;
  border: 1px solid #2c3e50;
  border-radius: 4px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.template-body .panel-header {
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-bottom: 1px solid #2c3e50;
  padding-bottom: 5px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  color: #4a6b8c;
}

.template-body .system-panel { grid-column: 1 / 2; grid-row: 1 / 2; }
.template-body .network-panel { grid-column: 2 / 3; grid-row: 1 / 2; }
.template-body .terminal-panel { grid-column: 3 / 4; grid-row: 1 / 2; }
.template-body .file-panel { grid-column: 1 / 3; grid-row: 2 / 3; }
.template-body .keyboard-panel { grid-column: 3 / 4; grid-row: 2 / 3; display:flex; flex-direction:column; justify-content:flex-end; }

.template-body .clock {
  font-size: 3em;
  margin: 10px 0;
  color: #82b1ff;
  text-shadow: 0 0 5px rgba(130,177,255,0.5);
}

.template-body .sys-stats p {
  margin: 5px 0;
  font-size: 0.9em;
  display: flex;
  justify-content: space-between;
}

.template-body .sys-note { color: #4a6b8c; text-transform: uppercase; letter-spacing: 1px; }

.template-body .network-globe {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8em;
  text-align: center;
  border: 1px dashed #2c3e50;
  margin: 10px auto;
  border-radius: 50%;
  aspect-ratio: 1/1;
  max-height: 150px;
}

.template-body .terminal-output {
  flex-grow: 1;
  overflow-y: auto;
  font-size: 0.9em;
  line-height: 1.4;
  color: rgb(139, 233, 253);
  display: flex;
  flex-direction: column;
}

.template-body #terminal-text {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.template-body .cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background-color: #82b1ff;
  animation: blink 1s step-end infinite;
  vertical-align: middle;
  margin-left: 2px;
}

.template-body .folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 15px;
  margin-top: 10px;
}

.template-body .folder { text-align: center; font-size: 0.7em; }
.template-body .folder-icon {
  width: 40px;
  height: 30px;
  background-color: #2c3e50;
  border-radius: 2px 4px 4px 4px;
  position: relative;
  margin: 0 auto 5px auto;
}
.template-body .folder-icon::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 0;
  width: 15px;
  height: 5px;
  background-color: #2c3e50;
  border-radius: 4px 4px 0 0;
}

.template-body .keyboard-row { display:flex; justify-content:center; gap:5px; margin-bottom:5px; }
.template-body .key { border:1px solid #2c3e50; padding:8px 12px; border-radius:3px; font-size:0.8em; text-align:center; cursor:pointer; transition: background 0.2s; }
.template-body .key:hover { background-color:#2c3e50; color:#fff; }
.template-body .key.space { width:40%; }
.template-body .key.enter { width:10%; }

.template-body ::-webkit-scrollbar { width: 6px; }
.template-body ::-webkit-scrollbar-track { background: #0d1115; }
.template-body ::-webkit-scrollbar-thumb { background: #2c3e50; }

@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0; } }

@media (max-width: 960px) {
  .template-body { padding: 10px; }
  .template-body .dashboard { grid-template-columns: 1fr; grid-template-rows: repeat(5, auto); height:auto; overflow-y:auto; }
}

.md-preview {
  background-color: #0f141a;
  border: 1px solid #1f2a33;
  border-radius: 6px;
  padding: 16px;
  color: #dfe7ff;
  font-family: 'Share Tech Mono', monospace;
  line-height: 1.5;
}

.md-preview h2,
.md-preview h3 {
  margin-top: 0;
  color: #88ff00;
  letter-spacing: 1px;
}

.md-preview ul {
  padding-left: 20px;
}

.md-preview code,
.md-preview pre {
  background-color: #0b0f13;
  border: 1px solid #1f2a33;
  border-radius: 4px;
  padding: 8px;
  color: #89c2ff;
  font-size: 0.8rem;
  display: block;
  overflow-x: auto;
}

.md-preview a {
  color: #66b2ff;
  text-decoration: none;
}

.md-preview a:hover {
  text-decoration: underline;
}

.terminal-text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

.terminal-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 12px;
  border-bottom: 1px solid #2c3e50;
  padding-bottom: 8px;
}

.terminal-section {
  font-size: 1rem;
  font-weight: 500;
  margin: 24px 0 10px;
  border-bottom: 1px solid #2c3e50;
  padding-bottom: 6px;
}

.terminal-math {
  text-align: center;
  margin: 16px 0;
  font-size: 1rem;
}

.terminal-list {
  margin: 0 0 16px 24px;
  padding-left: 0;
  list-style: disc;
}

.terminal-list li { margin-bottom: 6px; }

.terminal-note {
  font-size: 0.9rem;
}

.terminal-code {
  background-color: #0b0f13;
  border: 1px solid #1f2a33;
  border-radius: 4px;
  padding: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
}

.terminal-list a,
.terminal-code a {
  color: rgb(139, 233, 253);
  text-decoration: none;
}

.terminal-list a:hover,
.terminal-code a:hover {
  text-decoration: underline;
}

.terminal-preview {
  width: 100%;
  padding: 10px 0;
}

.terminal-card {
  background-color: #121a26;
  border: 1px solid #4b1b24;
  border-radius: 8px;
  padding: 24px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.35), 0 0 16px rgba(249, 76, 47, 0.15);
}

.terminal-heading {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 12px;
  color: #88d3ff;
}

.terminal-subheading {
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 18px;
  color: #f2cb5d;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.terminal-math {
  text-align: center;
  font-size: 1rem;
  margin: 18px 0;
  color: #88d3ff;
}

.terminal-list {
  list-style: none;
  padding-left: 0;
  margin: 12px 0 18px;
}

.terminal-list li {
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.terminal-list li span {
  color: #88d3ff;
  font-weight: 600;
  margin-right: 4px;
}

.terminal-note {
  font-size: 0.9rem;
  color: #9fb2cf;
  margin: 0;
}

.terminal-output.static-preview {
  overflow: hidden;
}

.terminal-output.static-preview #terminal-text {
  white-space: normal;
}

.terminal-output.static-preview .terminal-card {
  padding: 16px;
}

.terminal-output.static-preview .terminal-heading {
  font-size: 1.1rem;
}

.terminal-output.static-preview .terminal-subheading {
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.terminal-output.static-preview .terminal-list li,
.terminal-output.static-preview .terminal-note {
  font-size: 0.8rem;
}

@keyframes terminalReveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.terminal-line {
  opacity: 0;
  transform: translateY(8px);
  animation: terminalReveal 0.6s ease forwards;
}

.terminal-line.line-1 { animation-delay: 0.1s; }
.terminal-line.line-2 { animation-delay: 0.3s; }
.terminal-line.line-3 { animation-delay: 0.5s; }
.terminal-line.line-4 { animation-delay: 0.7s; }
.terminal-line.line-5 { animation-delay: 0.9s; }
.terminal-line.line-6 { animation-delay: 1.1s; }
.terminal-line.line-7 { animation-delay: 1.3s; }
.terminal-line.line-8 { animation-delay: 1.5s; }
