/* ===========================================
   Anzaran - Shared Styles
   =========================================== */

/* CSS Variables */
:root {
    --color-bg: #ffffff;
    --color-text: #0f0f0f;
    --color-text-secondary: #666666;
    --color-border: #e5e5e5;
    --color-accent: #0066ff;
    --color-accent-hover: #0052cc;
    --color-surface: #fafafa;
    --color-surface-elevated: #f5f5f5;
}

/* Nothing may be wider than its container: a long token, a wide table or a
   code block scrolls or wraps instead of pushing the page sideways. */
img,
pre,
table,
code,
canvas,
svg {
    max-width: 100%;
}

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

/* Base Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Accessibility */
.skip-to-content {
    position: fixed;
    top: -60px;
    left: 0;
    background: var(--color-accent);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1001;
}

.skip-to-content:focus {
    top: 0;
}

/* ===========================================
   Navigation
   =========================================== */
nav[role="navigation"][aria-label="Main navigation"] {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--color-text);
    text-decoration: none;
}

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

.nav-links a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color 0.2s;
}

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

.nav-links a.active {
    color: var(--color-text);
}

/* Mobile menu: a <details> wrapper around the existing link list. Above the
   breakpoint the summary is hidden and the list is the usual row, so the
   desktop navigation is unchanged; below it the summary is the ☰ button and
   the list drops down. No JavaScript - <details> is keyboard-accessible and
   works with scripting off. */
.nav-menu summary {
    display: none;
    list-style: none;
    cursor: pointer;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--color-text);
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
}

.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* ===========================================
   Buttons
   =========================================== */
.btn {
    padding: 0.4rem 0.875rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
    line-height: 1.4;
}

.btn-primary {
    background: var(--color-text);
    color: white;
}

.btn-primary:hover {
    background: #333333;
}

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

.btn-secondary:hover {
    background: var(--color-surface);
    border-color: #d0d0d0;
}

/* ===========================================
   Section Layouts
   =========================================== */
.section {
    padding: 6rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-number {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    max-width: 700px;
    margin-bottom: 3rem;
    line-height: 1.6;
}

/* ===========================================
   Footer
   =========================================== */
footer {
    position: relative;
    padding: 4rem 2rem 2rem;
    border-top: 1px solid var(--color-border);
    max-width: 1400px;
    margin: 0 auto;
    z-index: 1;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-column {
    position: relative;
}

.footer-column h3,
.footer-column h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 0.75rem;
}

.footer-column a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s;
}

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

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

/* ===========================================
   Code Blocks (Terminal Style)
   =========================================== */
.code-showcase {
    background: var(--color-text);
    color: #e5e5e5;
    border-radius: 8px;
    padding: 2.5rem;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.code-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.code-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #444;
}

pre {
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    line-height: 1.7;
}

code {
    font-family: 'JetBrains Mono', monospace;
    color: #e5e5e5;
}

.code-comment { color: #6a9955; }
.code-keyword { color: #569cd6; }
.code-string { color: #ce9178; }
.code-function { color: #dcdcaa; }
.code-number { color: #b5cea8; }

/* ===========================================
   Animations
   =========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.8s ease-out;
}

/* ===========================================
   Responsive - Base
   =========================================== */
@media (max-width: 768px) {
    .section-title {
        font-size: 1.875rem;
    }

    /* The links become a dropdown behind the ☰ button. */
    .nav-menu summary {
        display: flex;
    }

    /* Sit with the call to action on the right, not stranded mid-bar. */
    .nav-menu {
        margin-left: auto;
        margin-right: 0.25rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        align-items: stretch;
        padding: 0.5rem 1.25rem 1rem;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    }

    .nav-menu[open] .nav-links {
        display: flex;
    }

    .nav-links a {
        display: flex;
        align-items: center;
        min-height: 44px;
        font-size: 1rem;
    }

    nav[role="navigation"][aria-label="Main navigation"] {
        position: fixed;
    }

    .nav-container {
        padding: 0.75rem 1.25rem;
        position: relative;
    }

    .logo {
        display: flex;
        align-items: center;
        min-height: 44px;
    }

    /* Comfortable targets and a little more width for the content. */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
    }

    .section {
        padding: 4rem 1.25rem;
    }

    footer {
        padding: 3rem 1.25rem 2rem;
    }

    .footer-grid {
        gap: 2rem;
    }

    .footer-column a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .section-number {
        font-size: 0.75rem;
    }
}
