/* ============================================================
   RoboTunnel — Design System
   Dark tech aesthetic: near-black + electric cyan accent
   Font: Inter (Google Fonts)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --bg:        #080b0f;
  --bg-2:      #0d1117;
  --bg-3:      #111820;
  --surface:   #141c26;
  --border:    rgba(0, 212, 255, 0.12);
  --accent:    #00d4ff;
  --accent-dim:#00a8cc;
  --accent-glow: rgba(0, 212, 255, 0.15);
  --text:      #e8edf3;
  --text-2:    #8b98a8;
  --text-3:    #4a5568;
  --mono:      'JetBrains Mono', monospace;
  --sans:      'Inter', -apple-system, sans-serif;
  --radius:    8px;
  --radius-lg: 14px;
  --max-w:     1080px;
  --header-h:  64px;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4 { line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.15rem; font-weight: 500; }

p { color: var(--text-2); max-width: 64ch; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dim); }

code, .mono {
  font-family: var(--mono);
  font-size: 0.875em;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15em 0.4em;
}

pre code {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  font-size: inherit;
  color: inherit;
  white-space: pre-wrap; /* allow wrapping in terminal if too long */
}

pre {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.825rem;
  line-height: 1.6;
  color: #c9d1d9;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.3);
}

pre .c { color: var(--text-3); }   /* comment */
pre .k { color: var(--accent); }   /* keyword */
pre .s { color: #a5d6ff; }         /* string */

/* ── Layout ─────────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

section { padding: 5rem 0; }

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

/* ── Header / Nav ───────────────────────────────────────────── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(8, 11, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.logo svg { width: 28px; height: 28px; }

.logo span.accent { color: var(--accent); }

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2rem;
}

nav ul li a {
  font-size: 0.875rem;
  color: var(--text-2);
  transition: color 0.2s;
}

nav ul li a:hover { color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}

.btn-primary:hover {
  background: #00eeff;
  color: #000;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--accent-glow);
  color: var(--text);
  border-color: var(--accent);
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  padding-top: calc(var(--header-h) + 5rem);
  padding-bottom: 4rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 100px;
  padding: 0.35rem 1rem;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 2rem;
}

.hero-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

.hero h1 { margin-bottom: 1.25rem; }

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-2);
  max-width: 56ch;
  margin: 0 auto 2.5rem;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 4rem;
}

/* ── Architecture Diagrams (Base & Utils) ──────────────────── */
.arch-diagram {
  max-width: 780px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-2);
  padding: 3rem;
}

.arch-diagram svg {
  width: 100%;
  height: auto;
  display: block;
}

.diag-label { fill: var(--text); font-family: var(--sans); font-weight: 600; font-size: 14px; }
.diag-sub { fill: var(--text-2); font-family: var(--mono); font-size: 11px; }
.diag-line { stroke: var(--border); stroke-width: 1.5; stroke-dasharray: 4 4; }
.diag-arrow { fill: var(--accent); }

.draw-path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw 2s ease forwards;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.pulse-node {
  animation: node-pulse 3s infinite ease-in-out;
}

@keyframes node-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.4); transform: scale(1.02); }
}

/* ── Docs ───────────────────────────────────────────────────── */
.docs-layout > *,
.docs-content,
.docs-content section,
.docs-sidebar,
.docs-note {
  min-width: 0;
}

.docs-sidebar,
.docs-note {
  overflow: hidden;
}

.docs-card h2,
.docs-card h3,
.docs-card p,
.docs-card li,
.docs-sidebar a,
.docs-note {
  overflow-wrap: anywhere;
}

.docs-card code,
.docs-note code,
.docs-sidebar code {
  white-space: normal;
  overflow-wrap: anywhere;
}

.docs-card ul,
.docs-card ol {
  margin-left: 0;
  padding-left: 1.7rem;
}

.docs-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  color: var(--text-3);
  font-size: 0.82rem;
}

.docs-breadcrumb a {
  color: var(--text-2);
}

.docs-breadcrumb a:hover {
  color: var(--text);
}

.docs-link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  align-items: stretch;
}

.docs-link-card {
  display: block;
  min-width: 0;
  height: 100%;
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.06), rgba(20, 28, 38, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  color: var(--text);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.docs-link-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 212, 255, 0.3);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

.docs-link-card h3 {
  margin-bottom: 0.45rem;
  overflow-wrap: anywhere;
}

.docs-link-card p {
  max-width: none;
  overflow-wrap: anywhere;
}

.docs-link-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.85rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-family: var(--mono);
}

.docs-table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  font-size: 0.94rem;
}

.docs-table th,
.docs-table td {
  text-align: left;
  padding: 0.85rem 0.9rem;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
  height: auto;
}

.docs-table th {
  color: var(--text);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.02);
}

.docs-table td {
  color: var(--text-2);
}

.docs-table code {
  white-space: nowrap;
}

.docs-code-list {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.42rem 0.5rem;
}

.docs-code-list code {
  white-space: nowrap;
}

pre.docs-code-block {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  border: 0.5px solid rgba(0, 188, 212, 0.18);
  background: #0d1117;
  padding: 2.65rem 1rem 1rem;
  box-shadow: none;
}

pre.docs-code-block::before {
  content: attr(data-code-label);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2rem;
  display: flex;
  align-items: center;
  padding: 0 0.9rem;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.07);
  background: #161b22;
  color: rgba(0, 188, 212, 0.8);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

pre.docs-code-block code {
  display: block;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.8rem;
  line-height: 1.65;
  color: #e6edf3;
}

pre.docs-code-block[data-code-nowrap="true"] code {
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}

.docs-code-copy {
  position: absolute;
  top: 0.32rem;
  right: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-width: 3.5rem;
  padding: 0.17rem 0.52rem;
  border-radius: 5px;
  border: 0.5px solid rgba(0, 188, 212, 0.3);
  background: transparent;
  color: rgba(0, 188, 212, 0.8);
  font-family: var(--sans);
  font-size: 0.69rem;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.docs-code-copy:hover {
  color: #00bcd4;
  border-color: rgba(0, 188, 212, 0.45);
  background: rgba(0, 188, 212, 0.1);
}

.docs-code-copy[data-copy-state="done"] {
  color: #00161c;
  border-color: rgba(0, 188, 212, 0.55);
  background: rgba(0, 188, 212, 0.92);
}

.docs-table-errors {
  table-layout: fixed;
  min-width: 1120px;
}

.docs-table-errors th:nth-child(1),
.docs-table-errors td:nth-child(1) {
  width: 20%;
}

.docs-table-errors th:nth-child(2),
.docs-table-errors td:nth-child(2) {
  width: 9%;
}

.docs-table-errors th:nth-child(3),
.docs-table-errors td:nth-child(3) {
  width: 19%;
}

.docs-table-errors th:nth-child(4),
.docs-table-errors td:nth-child(4) {
  width: 52%;
}

.docs-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 212, 255, 0.06);
  color: var(--accent);
  font-size: 0.76rem;
  font-family: var(--mono);
}

.docs-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.docs-kpi {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.docs-kpi strong {
  display: block;
  color: var(--text);
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.docs-kpi span {
  color: var(--text-2);
  font-size: 0.88rem;
}

/* ── Why / Mission ──────────────────────────────────────────── */
.mission-section { background: var(--bg-2); }

.mission-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-top: 3rem;
}

.mission-text p + p { margin-top: 1rem; }

blockquote {
  border-left: 3px solid var(--accent);
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.05rem;
  color: var(--text);
  font-style: italic;
  margin: 1.5rem 0;
}

/* ── Scenarios / Features ────────────────────────────────────── */
.scenarios-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.scenario-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.scenario-card:hover {
  border-color: rgba(0, 212, 255, 0.35);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.06);
}

.scenario-icon {
  width: 40px; height: 40px;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.scenario-card h3 { margin-bottom: 0.5rem; }
.scenario-card p { font-size: 0.9rem; margin-bottom: 1rem; }

.scenario-cmd {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  display: block;
}

/* ── Trust / Principles ─────────────────────────────────────── */
.trust-section { background: var(--bg-3); }

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}

.trust-item {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.trust-item .icon {
  font-size: 1.5rem;
  line-height: 1;
}

.trust-item h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.trust-item p { font-size: 0.875rem; }

/* ── Pricing Teaser ─────────────────────────────────────────── */
.pricing-teaser {
  text-align: center;
}

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 700px;
  margin: 3rem auto 0;
}

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: left;
  position: relative;
  transition: border-color 0.2s;
}

.pricing-card.featured {
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.07);
}

.pricing-card .badge {
  position: absolute;
  top: -12px; right: 1.5rem;
  background: var(--accent);
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.7rem;
  border-radius: 100px;
}

.price {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 1rem 0 0.25rem;
}

.price-detail { font-size: 0.85rem; color: var(--text-2); margin-bottom: 1.25rem; }

.pricing-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.pricing-card li {
  font-size: 0.875rem;
  color: var(--text-2);
  display: flex;
  gap: 0.5rem;
}

.pricing-card li::before { content: '✓'; color: var(--accent); font-weight: 700; }

/* ── Contact / CTA ──────────────────────────────────────────── */
.cta-section {
  text-align: center;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
}

.email-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 1rem;
}

/* ── Instant Beta Form ───────────────────────────────────────── */
.beta-access {
  background: radial-gradient(circle at top left, rgba(0, 212, 255, 0.12), rgba(8, 11, 15, 0.95) 42%), var(--bg-2);
  border-top: 1px solid var(--border);
}

.beta-access-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 1.25rem;
  align-items: start;
}

.beta-panel,
.beta-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.beta-panel {
  padding: 1.5rem;
}

.beta-panel p {
  color: var(--text-2);
}

.beta-highlights {
  list-style: none;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.55rem;
}

.beta-highlights li {
  color: var(--text);
  font-size: 0.93rem;
  display: flex;
  gap: 0.55rem;
}

.beta-highlights li::before {
  content: "•";
  color: var(--accent);
  font-weight: 700;
}

.beta-form {
  padding: 1.35rem;
  display: grid;
  gap: 0.9rem;
}

.beta-form label {
  font-size: 0.82rem;
  color: var(--text-2);
  font-weight: 500;
}

.beta-form input,
.beta-form select,
.beta-form textarea {
  margin-top: 0.35rem;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid rgba(0, 212, 255, 0.2);
  background: rgba(8, 11, 15, 0.75);
  color: var(--text);
  font: inherit;
  padding: 0.65rem 0.72rem;
}

.beta-form textarea {
  min-height: 108px;
  resize: vertical;
}

.beta-form input:focus,
.beta-form select:focus,
.beta-form textarea:focus {
  outline: none;
  border-color: rgba(0, 212, 255, 0.5);
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.12);
}

.beta-submit {
  justify-content: center;
}

.beta-submit[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.beta-form-hint {
  margin-top: -0.15rem;
  font-size: 0.78rem;
  color: var(--text-3);
}

.beta-form-error {
  font-size: 0.84rem;
  color: #ffc2c2;
  border: 1px solid rgba(255, 110, 110, 0.4);
  background: rgba(90, 25, 25, 0.32);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
}

.beta-form-success {
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: var(--radius);
  background: rgba(0, 212, 255, 0.06);
  padding: 0.8rem;
  display: grid;
  gap: 0.7rem;
}

.beta-success-title {
  color: var(--text);
  font-size: 0.9rem;
}

.beta-token-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  align-items: end;
}

.beta-token-row input {
  font-family: var(--mono);
  font-size: 0.84rem;
}

.beta-copy-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.62rem 0.8rem;
  cursor: pointer;
}

.beta-copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.beta-entitlements {
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.beta-entitlements li {
  color: var(--text);
  font-size: 0.88rem;
  display: flex;
  gap: 0.5rem;
}

.beta-entitlements li::before {
  content: "✓";
  color: var(--accent);
}

/* ── Footer ────────────────────────────────────────────────── */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

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

.footer-links a {
  font-size: 0.875rem;
  color: var(--text-3);
}

.footer-links a:hover { color: var(--text-2); }

.footer-copy { font-size: 0.8rem; color: var(--text-3); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .mission-grid,
  .scenarios-grid,
  .trust-grid,
  .pricing-cards,
  .docs-link-grid,
  .docs-kpi-grid { grid-template-columns: 1fr; }

  .beta-access-grid,
  .beta-token-row { grid-template-columns: 1fr; }

  nav ul { display: none; }

  pre.docs-code-block {
    padding: 3.5rem 1rem 1rem;
  }

  .docs-code-copy {
    top: 0.72rem;
    right: 0.72rem;
  }
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fade-up 0.6s ease both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.35s; }
