/* ═══════════════════════════════════════════════════════════
   UNFED AI — Project Website Styles
   Dark theme, privacy-focused aesthetic (inspired by getmonero.org)
   ═══════════════════════════════════════════════════════════ */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Source+Code+Pro:wght@400;500;600;700&display=swap');

/* --- CSS Variables --- */
:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #1c2128;
  --bg-card: #1c2128;
  --bg-code: #0d1117;

  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;

  --accent: #00d4aa;
  --accent-dim: #00a88550;
  --accent-glow: #00d4aa30;
  --accent-secondary: #58a6ff;
  --accent-warning: #d29922;
  --accent-danger: #f85149;

  --border: #30363d;
  --border-light: #21262d;

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Source Code Pro', 'Fira Code', 'Consolas', monospace;

  --max-width: 1200px;
  --nav-height: 64px;

  --radius: 8px;
  --radius-lg: 12px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 20px);
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* --- Subtle grid background --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border-light) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-light) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.3;
  pointer-events: none;
  z-index: -1;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: 2.8rem; letter-spacing: -0.02em; }
h2 { font-size: 2rem; letter-spacing: -0.01em; margin-bottom: 1rem; }
h3 { font-size: 1.4rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.1rem; margin-bottom: 0.5rem; }

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

ul,
ol {
  margin: 0 0 1rem 1.25rem;
  color: var(--text-secondary);
}

li {
  margin: 0.35rem 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #33e6be;
  text-decoration: underline;
}

strong { color: var(--text-primary); }

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section--alt {
  background: var(--bg-secondary);
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  margin-bottom: 12px;
}

.section-header h2 .accent {
  color: var(--accent);
}

.section-header p {
  max-width: 640px;
  margin: 0 auto;
  font-size: 1.1rem;
}

/* ═══════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-logo:hover {
  color: var(--accent);
  text-decoration: none;
}

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

.nav-links {
  display: flex;
  list-style: none;
  gap: 8px;
}

.nav-links a {
  display: block;
  padding: 8px 14px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.2s;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-glow);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
}

/* ═══════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════ */

.hero {
  padding: 140px 0 100px;
  text-align: center;
  position: relative;
}

.hero h1 {
  margin-bottom: 20px;
}

.hero h1 .accent {
  color: var(--accent);
}

.hero .subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

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

.btn-primary:hover {
  background: #33e6be;
  color: var(--bg-primary);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-dim);
}

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

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all 0.3s;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 1.5rem;
}

.card h3 {
  color: var(--text-primary);
}

.card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ═══════════════════════════════════════════════════════════
   FEATURE LIST (How it works steps, etc.)
   ═══════════════════════════════════════════════════════════ */

.steps {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 800px;
  margin: 0 auto;
}

.step {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.step-number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
}

.step-content h3 {
  margin-bottom: 6px;
}

.step-content p {
  font-size: 0.95rem;
}

/* ═══════════════════════════════════════════════════════════
   CODE BLOCKS
   ═══════════════════════════════════════════════════════════ */

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-code);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 16px 0 24px;
  line-height: 1.6;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.code-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

/* Syntax highlighting (simple, CSS-only) */
pre .comment { color: var(--text-muted); }
pre .flag { color: var(--accent-secondary); }
pre .value { color: var(--accent-warning); }
pre .cmd { color: var(--accent); }

/* ═══════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════ */

.table-wrap {
  overflow-x: auto;
  margin: 16px 0 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-secondary);
}

td {
  color: var(--text-secondary);
}

td code {
  font-size: 0.85em;
}

tr:hover td {
  background: var(--bg-tertiary);
}

/* ═══════════════════════════════════════════════════════════
   NODE TYPE CARDS (nodes page)
   ═══════════════════════════════════════════════════════════ */

.node-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 32px;
}

.node-card h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.node-card h3 .tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--accent-glow);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.node-card .meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.node-card .meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.node-card .meta-item strong {
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════
   COMPARISON / SPLIT LAYOUT
   ═══════════════════════════════════════════════════════════ */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.split-item {
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.split-item h3 {
  margin-bottom: 16px;
}

.split-item ul {
  list-style: none;
  padding: 0;
}

.split-item ul li {
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.split-item ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.split-item.negative ul li::before {
  background: var(--accent-danger);
}

.split-item.positive ul li::before {
  background: var(--accent);
}

/* ═══════════════════════════════════════════════════════════
   FLOW ITEMS (protocol page)
   ═══════════════════════════════════════════════════════════ */

.flow {
  position: relative;
  padding-left: 32px;
  border-left: 2px solid var(--border);
  margin: 24px 0;
}

.flow-item {
  position: relative;
  margin-bottom: 32px;
  padding-left: 24px;
}

.flow-item::before {
  content: '';
  position: absolute;
  left: -39px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-primary);
}

.flow-item h4 {
  color: var(--accent);
  margin-bottom: 6px;
}

.flow-item p {
  font-size: 0.95rem;
}

/* ═══════════════════════════════════════════════════════════
   INFO BOXES
   ═══════════════════════════════════════════════════════════ */

.info-box {
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 24px;
  margin: 24px 0;
}

.info-box p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.info-box p + p {
  margin-top: 10px;
}

.info-box pre {
  margin-top: 12px;
  margin-bottom: 0;
}

.info-box.warning {
  border-left-color: var(--accent-warning);
}

.info-box.danger {
  border-left-color: var(--accent-danger);
}

/* ═══════════════════════════════════════════════════════════
   PAGE HEADER (inner pages)
   ═══════════════════════════════════════════════════════════ */

.page-header {
  padding: 120px 0 60px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  margin-bottom: 16px;
}

.page-header p {
  font-size: 1.15rem;
  max-width: 640px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */

.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  text-align: center;
}

.footer p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

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

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

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.2rem; }

  .hero { padding: 110px 0 60px; }
  .section { padding: 48px 0; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .split {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .step {
    flex-direction: column;
    gap: 12px;
  }

  .node-card .meta {
    flex-direction: column;
    gap: 8px;
  }

}

@media (max-width: 480px) {
  h1 { font-size: 1.6rem; }
  .container { padding: 0 16px; }
  .hero { padding: 100px 0 48px; }
  .hero-cta { flex-direction: column; align-items: center; }
}
