/* ============================================================
   OpenSoul — GitHub Pages Site Styles
   Modern, clean design with dark/light theme support
   ============================================================ */

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

:root {
  --accent: #ff5a36;
  --accent-light: #ff8a6b;
  --accent-glow: rgba(255, 90, 54, 0.15);
  --bg: #ffffff;
  --bg-alt: #f8f9fb;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #555770;
  --text-muted: #8b8da3;
  --border: #e4e6ee;
  --code-bg: #f3f4f8;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --nav-height: 64px;
  --max-width: 1200px;
  --transition: 0.25s ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f1a;
    --bg-alt: #161625;
    --bg-card: #1c1c2e;
    --text: #e8e8f0;
    --text-secondary: #a0a0b8;
    --text-muted: #6e6e88;
    --border: #2a2a40;
    --code-bg: #1e1e30;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  }
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

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

img {
  max-width: 100%;
  height: auto;
}

code {
  font-family: "JetBrains Mono", "Fira Code", "SF Mono", Consolas, monospace;
  background: var(--code-bg);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.88em;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  overflow-x: auto;
  font-size: 0.9em;
  line-height: 1.6;
}
pre code {
  background: none;
  padding: 0;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: box-shadow var(--transition);
}
@media (prefers-color-scheme: dark) {
  .nav {
    background: rgba(15, 15, 26, 0.88);
  }
}
.nav.scrolled {
  box-shadow: var(--shadow-md);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
}
.nav-logo img {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

.nav-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-light);
  color: #fff;
  box-shadow: 0 4px 20px rgba(255, 90, 54, 0.35);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: all var(--transition);
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .nav-toggle {
    display: block;
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 12px;
    box-shadow: var(--shadow-md);
  }
  .nav-actions .btn span.btn-text {
    display: none;
  }
}

/* --- Hero --- */
.hero {
  padding: calc(var(--nav-height) + 80px) 24px 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 900px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
}

.hero-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero h1 .gradient {
  background: linear-gradient(135deg, var(--accent), #ff9966, var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

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

.hero-badges {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 36px;
}
.hero-badges img {
  height: 24px;
}

.hero-terminal {
  max-width: 560px;
  margin: 48px auto 0;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: left;
}
.hero-terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: var(--border);
}
.hero-terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.hero-terminal-dot:nth-child(1) {
  background: #ff5f57;
}
.hero-terminal-dot:nth-child(2) {
  background: #febc2e;
}
.hero-terminal-dot:nth-child(3) {
  background: #28c840;
}
.hero-terminal-bar span {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
}

.hero-terminal pre {
  margin: 0;
  border: none;
  border-radius: 0;
  padding: 20px 24px;
  font-size: 0.88rem;
}
.hero-terminal .prompt {
  color: var(--accent);
}
.hero-terminal .comment {
  color: var(--text-muted);
}

/* --- Sections --- */
section {
  padding: 80px 24px;
}
section:nth-child(even) {
  background: var(--bg-alt);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}
.section-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 12px;
}
.section-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* --- Feature Cards Grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all var(--transition);
}
.feature-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-glow);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 650;
  margin-bottom: 10px;
}
.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* --- Channel Logos --- */
.channels-showcase {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
}
.channel-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.channel-pill:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}

/* --- Architecture Diagram --- */
.arch-diagram {
  max-width: 900px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
}
.arch-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}
.arch-node {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 22px;
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 120px;
  text-align: center;
}
.arch-node.gateway {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
  padding: 18px 32px;
}
.arch-arrow {
  font-size: 1.3rem;
  color: var(--text-muted);
}
.arch-outputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --- Steps --- */
.steps {
  max-width: 700px;
  margin: 0 auto;
  counter-reset: step;
}
.step {
  position: relative;
  padding-left: 72px;
  padding-bottom: 40px;
  counter-increment: step;
}
.step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 48px;
  height: 48px;
  background: var(--accent-glow);
  border: 2px solid var(--accent);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}
.step::after {
  content: "";
  position: absolute;
  left: 23px;
  top: 52px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.step:last-child::after {
  display: none;
}
.step:last-child {
  padding-bottom: 0;
}

.step h3 {
  font-size: 1.1rem;
  font-weight: 650;
  margin-bottom: 8px;
}
.step p,
.step pre {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* --- Tech Table --- */
.tech-table {
  width: 100%;
  border-collapse: collapse;
  max-width: 600px;
  margin: 0 auto;
}
.tech-table th,
.tech-table td {
  padding: 12px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.tech-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tech-table td:first-child {
  font-weight: 500;
}

/* --- Footer --- */
.footer {
  padding: 48px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.footer-links a:hover {
  color: var(--accent);
}
.footer-copy {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- Page Header (sub-pages) --- */
.page-header {
  padding: calc(var(--nav-height) + 60px) 24px 48px;
  text-align: center;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 12px;
}
.page-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* --- Prose Content --- */
.prose {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.prose h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 48px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.prose h3 {
  font-size: 1.2rem;
  font-weight: 650;
  margin: 32px 0 12px;
}
.prose p {
  margin-bottom: 16px;
  color: var(--text-secondary);
}
.prose ul,
.prose ol {
  margin-bottom: 16px;
  padding-left: 24px;
  color: var(--text-secondary);
}
.prose li {
  margin-bottom: 6px;
}
.prose strong {
  color: var(--text);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}
.prose th,
.prose td {
  padding: 10px 16px;
  text-align: left;
  border: 1px solid var(--border);
  font-size: 0.93rem;
}
.prose th {
  background: var(--bg-alt);
  font-weight: 600;
}

/* --- Utility --- */
.text-center {
  text-align: center;
}
.mt-0 {
  margin-top: 0;
}
.mb-0 {
  margin-bottom: 0;
}

/* --- Animation on scroll --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
