:root {
    --color-bg: #ffffff;
    --color-bg-alt: #f6f7f9;
    --color-bg-raised: #ffffff;
    --color-text: #1c2128;
    --color-text-muted: #57606a;
    --color-border: #d8dee4;
    --color-accent: #e8792a;
    --color-accent-dark: #c25f16;
    --color-blue: #4f74b5;
    --color-blue-dark: #33518a;
    --color-code-bg: #1c2128;
    --color-code-text: #e6edf3;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #14171c;
        --color-bg-alt: #1b1f26;
        --color-bg-raised: #1b1f26;
        --color-text: #e6edf3;
        --color-text-muted: #9aa5b1;
        --color-border: #2d333b;
        --color-code-bg: #0d1117;
        --color-code-text: #e6edf3;
    }
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 4.5rem;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
}

a {
    color: var(--color-blue);
}

@media (prefers-color-scheme: dark) {
    a {
        color: #7ea6e0;
    }
}

code, pre {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.88em;
}

p code, li code, td code {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 0.1em 0.4em;
}

pre {
    background: var(--color-code-bg);
    color: var(--color-code-text);
    border-radius: 8px;
    padding: 1.1rem 1.3rem;
    overflow-x: auto;
    line-height: 1.55;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

.wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ---- Nav ---- */

.site-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--color-bg) 88%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border);
}

.site-nav .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.brand {
    display: flex;
    align-items: center;
    margin-top: 10px;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--color-text);
    font-weight: 700;
    font-size: 1.1rem;
}

.brand img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    margin-top: 10px;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
}

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

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--color-accent);
    color: #fff !important;
    padding: 0.45rem 0.95rem;
    border-radius: 6px;
    font-weight: 600 !important;
}

.nav-cta:hover {
    background: var(--color-accent-dark);
}

/* Mobile nav toggle — same checkbox pattern as the documentation sidebar,
   so both pages collapse into a hamburger at the same breakpoint (900px). */

.nav-toggle {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.nav-toggle-label {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 6px;
    font-size: 1.3rem;
    line-height: 1;
    color: var(--color-text);
    cursor: pointer;
}

.nav-toggle:focus-visible ~ .wrap .nav-toggle-label {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.mobile-nav-panel {
    display: none;
    flex-direction: column;
    border-top: 1px solid var(--color-border);
}

.mobile-nav-panel a {
    padding: 0.85rem 1.5rem;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--color-border);
}

.mobile-nav-panel a:hover {
    color: var(--color-text);
    background: var(--color-bg-alt);
}

.nav-toggle:checked ~ .mobile-nav-panel {
    display: flex;
}

@media (max-width: 900px) {
    .nav-links {
        display: none;
    }

    .nav-toggle-label {
        display: inline-flex;
    }
}

/* ---- Hero ---- */

.hero {
    position: relative;
    overflow: hidden;
    padding: 5rem 1rem 4rem;
    border-top: none;
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    z-index: 0;
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
}

.hero::before {
    width: 420px;
    height: 420px;
    top: -140px;
    left: -100px;
    background: var(--color-accent);
    opacity: 0.16;
}

.hero::after {
    width: 380px;
    height: 380px;
    bottom: -160px;
    right: -80px;
    background: var(--color-blue);
    opacity: 0.14;
}

@media (prefers-color-scheme: dark) {
    .hero::before {
        opacity: 0.28;
    }

    .hero::after {
        opacity: 0.24;
    }
}

.hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3.5rem;
}

.hero-content {
    flex: 1 1 480px;
    min-width: 0;
}

.hero-image {
    flex: 0 0 auto;
}

.hero-image img {
    width: 260px;
    height: auto;
}

.hero h1 {
    font-size: 3rem;
    margin: 0 0 0.75rem;
    letter-spacing: -0.02em;
}

.hero .lead {
    color: var(--color-text-muted);
    font-size: 1.2rem;
    max-width: 560px;
    margin: 0;
}

.hero-actions {
    display: flex;
    gap: 0.9rem;
    justify-content: flex-start;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    text-decoration: none;
    padding: 0.7rem 1.4rem;
    border-radius: 7px;
    font-weight: 600;
    font-size: 0.95rem;
}

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

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

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

.btn-secondary:hover {
    background: var(--color-bg-alt);
}

.badges {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 2rem;
}

@media (max-width: 900px) {
    .hero-inner {
        flex-direction: column-reverse;
        text-align: center;
        gap: 2rem;
    }

    .hero-content {
        flex-basis: auto;
    }

    .hero .lead {
        margin: 0 auto;
    }

    .hero-actions,
    .badges {
        justify-content: center;
    }

    .hero-image {
        display: none;
    }
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
}

/* ---- Sections ---- */

section {
    padding: 4.5rem 0;
    border-top: 1px solid var(--color-border);
}

.section-head {
    text-align: center;
    max-width: 620px;
    margin: 0 auto 3rem;
}

.section-head .kicker {
    color: var(--color-accent-dark);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

@media (prefers-color-scheme: dark) {
    .section-head .kicker {
        color: var(--color-accent);
    }
}

.section-head h2 {
    font-size: 2rem;
    margin: 0.5rem 0 0.75rem;
}

.section-head p {
    color: var(--color-text-muted);
    margin: 0;
}

/* ---- Philosophy cards ---- */

.principles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

@media (max-width: 900px) {
    .principles {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .principles {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.5rem;
}

.card .icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.02rem;
}

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

/* ---- Modules grid ---- */

.modules {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.1rem;
}

@media (max-width: 900px) {
    .modules {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .modules {
        grid-template-columns: 1fr;
    }
}

.module-card {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1.1rem 1.25rem;
    background: var(--color-bg-raised);
}

.module-card .module-num {
    display: inline-block;
    color: var(--color-accent);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
}

.module-card h3 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
}

.module-card p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.87rem;
}

/* ---- Code showcase ---- */

.showcase-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 860px) {
    .showcase-grid {
        grid-template-columns: 1fr;
    }
}

.showcase-grid h3 {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin: 0 0 0.6rem;
    font-weight: 600;
}

/* ---- Response envelope ---- */

.envelope-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 760px) {
    .envelope-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Stack strip ---- */

.stack-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    justify-content: center;
}

.stack-item {
    border: 1px solid var(--color-border);
    background: var(--color-bg-alt);
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

/* ---- Final CTA ---- */

.cta-band {
    text-align: center;
    background: var(--color-bg-alt);
    border-radius: 16px;
    padding: 3.5rem 2rem;
    border: 1px solid var(--color-border);
}

.cta-band h2 {
    margin: 0 0 0.5rem;
    font-size: 1.8rem;
}

.cta-band p {
    color: var(--color-text-muted);
    margin: 0 0 1.75rem;
}

/* ---- Footer ---- */

footer.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 2rem 0;
}

.footer-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    justify-self: center;
}

.share-bar {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.share-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-right: 0.25rem;
}

.share-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.share-link svg {
    width: 1.05rem;
    height: 1.05rem;
    fill: currentColor;
}

.share-link:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background: var(--color-bg-alt);
}

footer.site-footer a {
    color: var(--color-text-muted);
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.footer-logo:first-child {
    justify-self: start;
}

.footer-organifox {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    justify-self: end;
}

.footer-email {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    text-decoration: none;
}

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

.footer-logo img {
    height: 32px;
    width: auto;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

.footer-logo-fennec img {
    height: 80px;
}

.footer-logo:hover img {
    opacity: 1;
}

.footer-copyright {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    text-align: center;
}

@media (max-width: 560px) {
    .footer-inner {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 1.25rem;
    }

    .footer-logo:first-child,
    .footer-organifox {
        justify-self: center;
    }
}
