/* StakeSquid Design Language - Engineer's terminal-notebook */
/* Dark-first, near-black bg, squid-ink violet accent, mono numbers */

@font-face {
    font-family: 'Space Grotesk';
    src: url(/assets/fonts/space-grotesk.woff2) format('woff2');
    font-weight: 300 700;
    font-display: swap;
}

:root {
    /* Colors - Dark First */
    --bg: #0b0e16;
    --bg-card: #10141f;
    --border: #2a3140;
    --text: #e5e9f0;
    --text-dim: #8b93a7;
    --accent: #8b7cf6;
    --glow: #22d3ee;
    --text-bright: #ffffff;
    --bg-elevated: #1a1c28;
    --border-bright: #404858;
    --mono: 'SF Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-heading: 'Space Grotesk', var(--font-sans);
    --measure: 65ch;
    --line-height: 1.7;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f7f8fa;
        --bg-card: #ffffff;
        --border: #e2e5ec;
        --text: #171a21;
        --text-dim: #5b6372;
        --accent: #6d5ce6;
        --glow: #0891b2;
        --text-bright: #000000;
        --bg-elevated: #f0f1f3;
        --border-bright: #c0c5ce;
    }
}

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

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

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: var(--line-height);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header - Tight wordmark with squid logo */
header {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

header .header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--text-bright);
    text-decoration: none;
    letter-spacing: -0.02em;
    font-family: var(--font-heading);
}

.logo-icon {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text .stake {
    font-size: 0.95em;
    line-height: 1;
}

.logo-text .squid {
    font-size: 1.05em;
    line-height: 1;
}

nav {
    font-family: var(--font-heading);
}

nav a {
    color: var(--text-dim);
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--accent);
}

/* Main content */
main {
    padding: 2rem 0;
}

footer {
    padding: 3rem 0 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
}

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

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

/* Typography */
h1, h2, h3 {
    font-family: var(--font-heading);
}

h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 .mono {
    font-family: var(--mono);
    font-weight: 600;
    color: var(--accent);
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
}

p {
    margin-bottom: 1.25rem;
    max-width: var(--measure);
}

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

a:hover {
    opacity: 0.8;
}

/* Monospace numbers and metrics */
.mono,
.number,
.stat-number,
.code,
pre,
code {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
}

/* Hero section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.hero h1 {
    font-size: 2.75rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-dim);
    max-width: 700px;
    margin: 0 auto;
}

.hero-graphic {
    margin: 2rem 0;
}

.hero-graphic svg {
    max-width: 100%;
    height: auto;
    width: min(880px, 100%);
}

.loop-graphic {
    margin: 2rem 0;
}

.loop-graphic svg {
    max-width: 100%;
    height: auto;
    width: min(880px, 100%);
}

/* Stat tiles - the data IS the hero */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-secondary {
    display: block;
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-top: 0.35rem;
}

.stat-provenance {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
    opacity: 0.7;
}

/* Cards - no drop shadows, thin rules */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 0;
}

.card h2,
.card h3 {
    margin-top: 0;
}

.card:first-child {
    margin-top: 0;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: var(--text-bright);
    border: none;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.95rem;
}

.btn:hover {
    background: var(--accent-subtle);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border-bright);
}

.btn-secondary:hover {
    background: var(--border-bright);
    color: var(--text-bright);
}

/* Tags */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--accent);
}

/* Code blocks */
.code-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 1.25rem;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 0.9rem;
    margin: 1.25rem 0;
    line-height: 1.6;
}

.code-block code {
    background: none;
    padding: 0;
    color: var(--text);
    /* bare <code> is inline and collapses newlines — command blocks must be copy-pasteable */
    display: block;
    white-space: pre;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

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

.table tr:hover {
    background: var(--bg-elevated);
}

/* Blockquotes */
blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    margin-left: 0;
    color: var(--text-dim);
    font-style: italic;
}

/* Utility classes */
.text-muted {
    color: var(--text-dim);
}

.text-mono {
    font-family: var(--mono);
}

.updated {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
}

/* Chains directory specific */
.chains-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.chain-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s;
}

.chain-card:hover {
    border-color: var(--accent);
}

.chain-monogram {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.chain-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.chain-card .meta {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.chain-card .chain-id {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-dim);
}

.chain-logo {
    width: 48px;
    height: 48px;
    margin-bottom: 0.75rem;
}

/* Inline squid for footer etc */
.squid-icon-inline {
    display: inline-block;
    width: 16px;
    height: 16px;
    fill: var(--accent);
    vertical-align: middle;
    margin-right: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    header nav {
        display: block;
        margin-top: 1rem;
    }
    
    header nav a {
        display: block;
        margin: 0.5rem 0;
    }
    
    .chains-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation for loading states */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 2s ease-in-out infinite;
}

