/* ============================================
   S2S Protocol Documentation Website
   Dark theme inspired by modelcontextprotocol.io
   ============================================ */

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #1c2129;
    --border: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --blue: #58a6ff;
    --green: #3fb950;
    --orange: #d29922;
    --red: #f85149;
    --purple: #bc8cff;
    --link: #58a6ff;
    --code-bg: #1c2129;
    --card-hover: #1f2937;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
    --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Nav ---- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    height: 64px;
    gap: 32px;
}

.nav-logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-logo .logo-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: invert(1);
}

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

.nav-links a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

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

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-github {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    transition: border-color 0.2s;
}

.btn-github:hover {
    border-color: var(--text-secondary);
    text-decoration: none;
}

/* ---- Hero ---- */
.hero {
    padding: 140px 24px 80px;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    background: rgba(63, 185, 80, 0.1);
    border: 1px solid rgba(63, 185, 80, 0.3);
    color: var(--green);
    font-size: 13px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: 52px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--blue) 50%, var(--green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto 40px;
    line-height: 1.5;
}

.hero-diagram {
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin: 40px auto 0;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 36px;
}

.btn-primary {
    background: var(--green);
    color: #0d1117;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary:hover { opacity: 0.9; text-decoration: none; color: #0d1117; }

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color 0.2s;
}

.btn-secondary:hover { border-color: var(--text-secondary); text-decoration: none; }

/* ---- Sections ---- */
.section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 80px 24px;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 48px;
    max-width: 600px;
}

/* ---- Stats bar ---- */
.stats-bar {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 40px 24px;
}

.stats-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
}

.stat-item .stat-value {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 4px;
}

.stat-item .stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ---- Feature cards ---- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ---- Use cases ---- */
.usecase-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.usecase-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px 28px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.usecase-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.usecase-item h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.usecase-item p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ---- How it works ---- */
.how-image {
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-top: 24px;
}

/* ---- Code block ---- */
.code-block {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 24px;
    overflow-x: auto;
    margin: 20px 0;
}

.code-block pre {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
}

.code-block .comment { color: var(--text-muted); }
.code-block .keyword { color: var(--purple); }
.code-block .string { color: var(--green); }
.code-block .func { color: var(--blue); }
.code-block .decorator { color: var(--orange); }

/* ---- Card links (Start Building) ---- */
.card-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.card-link {
    display: block;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: border-color 0.2s, transform 0.2s;
}

.card-link:hover {
    border-color: var(--blue);
    transform: translateY(-2px);
    text-decoration: none;
}

.card-link-icon {
    font-size: 24px;
    margin-bottom: 12px;
}

.card-link h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.card-link p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ---- Install block ---- */
.install-block {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    max-width: 500px;
}

.install-block code {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--green);
}

.install-block .dollar {
    color: var(--text-muted);
}

/* ---- Footer ---- */
.footer {
    border-top: 1px solid var(--border);
    padding: 40px 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.footer a { color: var(--text-secondary); }
.footer a:hover { color: var(--text-primary); }

/* ---- Doc pages ---- */
.doc-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 24px 60px;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 48px;
}

.sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.sidebar-section a {
    display: block;
    padding: 5px 12px;
    font-size: 14px;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.sidebar-section a:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
}

.sidebar-section a.active {
    background: rgba(88, 166, 255, 0.1);
    color: var(--blue);
}

.sidebar-section a.sub {
    padding-left: 24px;
    font-size: 13px;
}

.doc-content {
    max-width: 760px;
}

.doc-content h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.doc-content h2 {
    font-size: 24px;
    font-weight: 600;
    margin-top: 48px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.doc-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
}

.doc-content p {
    margin-bottom: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.doc-content ul, .doc-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.doc-content li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

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

.doc-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.doc-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

.doc-content th {
    text-align: left;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-primary);
}

.doc-content td {
    padding: 10px 16px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hero h1 { font-size: 32px; }
    .features-grid { grid-template-columns: 1fr; }
    .stats-inner { grid-template-columns: repeat(2, 1fr); }
    .card-links { grid-template-columns: 1fr; }
    .doc-layout { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .nav-links { display: none; }
}
