@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400&display=swap');

:root {
    --canvas: #f7f7f4;
    --canvas-soft: #fafaf7;
    --surface-card: #ffffff;
    --surface-strong: #e6e5e0;
    --primary: #f54e00;
    --primary-active: #d04200;
    --ink: #26251e;
    --body: #5a5852;
    --body-strong: #26251e;
    --muted: #807d72;
    --muted-soft: #a09c92;
    --on-primary: #ffffff;
    --hairline: #e6e5e0;
    --hairline-soft: #efeee8;
    --hairline-strong: #cfcdc4;
    --semantic-success: #1f8a65;
    --semantic-error: #cf2d56;
    --rounded-xs: 4px;
    --rounded-sm: 6px;
    --rounded-md: 8px;
    --rounded-lg: 12px;
    --rounded-xl: 16px;
    --rounded-pill: 9999px;
    --section-padding: 80px;
    --max-width: 1200px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--canvas);
    color: var(--body);
    font-family: 'Inter', system-ui, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--ink);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── NAVIGATION ─── */

.site-nav {
    background-color: var(--canvas);
    border-bottom: 1px solid var(--hairline);
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.nav-logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-logo span {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.nav-menu a {
    display: block;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--body);
    border-radius: var(--rounded-md);
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-menu a:hover {
    background: var(--surface-strong);
    color: var(--ink);
}

.nav-menu a.active {
    color: var(--ink);
    background: var(--surface-strong);
}

.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: all 0.25s ease;
}

.nav-mobile {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--canvas);
    border-bottom: 1px solid var(--hairline);
    padding: 16px 24px 24px;
    z-index: 99;
}

.nav-mobile.open {
    display: block;
}

.nav-mobile ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-mobile ul a {
    display: block;
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--body);
    border-radius: var(--rounded-md);
}

.nav-mobile ul a:hover {
    background: var(--surface-strong);
    color: var(--ink);
}

/* ─── HERO ─── */

.hero-band {
    padding: var(--section-padding) 0;
    border-bottom: 1px solid var(--hairline);
}

.hero-content {
    max-width: 720px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-strong);
    color: var(--ink);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.88px;
    text-transform: uppercase;
    border-radius: var(--rounded-pill);
    padding: 4px 12px;
    margin-bottom: 24px;
}

.hero-h1 {
    font-size: 56px;
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -1.5px;
    color: var(--ink);
    margin-bottom: 20px;
}

.hero-h1 strong {
    font-weight: 400;
    color: var(--primary);
}

.hero-sub {
    font-size: 18px;
    color: var(--body);
    line-height: 1.6;
    max-width: 560px;
    margin-bottom: 16px;
}

.hero-meta {
    font-size: 13px;
    color: var(--muted);
}

/* ─── SECTION TITLES ─── */

.section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.88px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 16px;
}

.section-title {
    font-size: 36px;
    font-weight: 400;
    letter-spacing: -0.72px;
    color: var(--ink);
    line-height: 1.2;
    margin-bottom: 12px;
}

.section-sub {
    font-size: 16px;
    color: var(--body);
    line-height: 1.6;
    max-width: 600px;
}

/* ─── ARTICLE CARDS ─── */

.articles-section {
    padding: var(--section-padding) 0;
    border-bottom: 1px solid var(--hairline);
}

.articles-header {
    margin-bottom: 40px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.article-card {
    background: var(--surface-card);
    border: 1px solid var(--hairline);
    border-radius: var(--rounded-lg);
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.article-card:hover {
    border-color: var(--hairline-strong);
}

.article-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--canvas-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.article-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 24px;
}

.article-card-body {
    padding: 24px;
}

.article-card-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.88px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}

.article-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.35;
    margin-bottom: 10px;
}

.article-card-desc {
    font-size: 14px;
    color: var(--body);
    line-height: 1.55;
    margin-bottom: 16px;
}

.article-card-meta {
    font-size: 13px;
    color: var(--muted);
    border-top: 1px solid var(--hairline);
    padding-top: 14px;
}

.article-card a.card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.article-card a.card-link:hover .article-card-title {
    color: var(--primary);
}

/* ─── INTRO SECTION ─── */

.intro-section {
    padding: var(--section-padding) 0;
    border-bottom: 1px solid var(--hairline);
}

.intro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.intro-text p {
    font-size: 16px;
    color: var(--body);
    line-height: 1.6;
    margin-bottom: 16px;
}

.intro-text p:last-child {
    margin-bottom: 0;
}

.intro-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-card {
    background: var(--surface-card);
    border: 1px solid var(--hairline);
    border-radius: var(--rounded-lg);
    padding: 24px;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.88px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 26px;
    font-weight: 400;
    letter-spacing: -0.325px;
    color: var(--ink);
    margin-bottom: 4px;
}

.stat-desc {
    font-size: 13px;
    color: var(--muted);
}

/* ─── LIBRARIES SECTION ─── */

.libraries-section {
    padding: var(--section-padding) 0;
    border-bottom: 1px solid var(--hairline);
}

.libraries-header {
    margin-bottom: 40px;
}

.libraries-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.library-card {
    background: var(--surface-card);
    border: 1px solid var(--hairline);
    border-radius: var(--rounded-lg);
    padding: 24px;
    text-align: center;
}

.library-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin: 0 auto 16px;
}

.library-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 8px;
}

.library-desc {
    font-size: 13px;
    color: var(--body);
    line-height: 1.5;
}

/* ─── CODE BLOCK ─── */

.code-block {
    background: var(--surface-card);
    border: 1px solid var(--hairline);
    border-radius: var(--rounded-lg);
    padding: 20px;
    overflow-x: auto;
    margin: 24px 0;
}

.code-block pre {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 13px;
    color: var(--ink);
    line-height: 1.6;
    white-space: pre;
}

.code-block code {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 13px;
}

/* ─── ARTICLE PAGE ─── */

.article-header {
    padding: 60px 0 48px;
    border-bottom: 1px solid var(--hairline);
}

.article-breadcrumb {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 20px;
}

.article-breadcrumb a {
    color: var(--muted);
    text-decoration: underline;
    text-decoration-color: var(--hairline);
}

.article-breadcrumb a:hover {
    color: var(--ink);
}

.article-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.88px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 16px;
}

.article-h1 {
    font-size: 42px;
    font-weight: 400;
    letter-spacing: -1px;
    color: var(--ink);
    line-height: 1.15;
    margin-bottom: 20px;
    max-width: 800px;
}

.article-meta {
    font-size: 14px;
    color: var(--muted);
}

.article-meta span {
    margin-right: 16px;
}

.article-body {
    padding: 60px 0;
}

.article-content {
    max-width: 720px;
}

.article-content h2 {
    font-size: 26px;
    font-weight: 400;
    letter-spacing: -0.325px;
    color: var(--ink);
    line-height: 1.25;
    margin-top: 48px;
    margin-bottom: 16px;
}

.article-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--ink);
    margin-top: 32px;
    margin-bottom: 12px;
}

.article-content p {
    font-size: 16px;
    color: var(--body);
    line-height: 1.7;
    margin-bottom: 18px;
}

.article-content ul,
.article-content ol {
    margin: 16px 0 18px 24px;
    color: var(--body);
    font-size: 16px;
    line-height: 1.7;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--hairline-strong);
}

.article-content a:hover {
    color: var(--primary);
    text-decoration-color: var(--primary);
}

.article-image-wrap {
    margin: 32px 0;
    background: var(--canvas-soft);
    border: 1px solid var(--hairline);
    border-radius: var(--rounded-lg);
    padding: 32px;
    text-align: center;
}

.article-image-wrap img {
    max-height: 220px;
    object-fit: contain;
    margin: 0 auto;
}

.article-image-caption {
    font-size: 13px;
    color: var(--muted);
    margin-top: 12px;
}

.article-aside {
    padding: 60px 0;
    border-top: 1px solid var(--hairline);
}

.related-articles h2 {
    font-size: 22px;
    font-weight: 400;
    letter-spacing: -0.11px;
    color: var(--ink);
    margin-bottom: 24px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.related-card {
    background: var(--surface-card);
    border: 1px solid var(--hairline);
    border-radius: var(--rounded-lg);
    padding: 20px;
}

.related-card:hover {
    border-color: var(--hairline-strong);
}

.related-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
}

.related-card p {
    font-size: 13px;
    color: var(--muted);
}

/* ─── PAGE HEADER ─── */

.page-header {
    padding: 60px 0 48px;
    border-bottom: 1px solid var(--hairline);
}

.page-h1 {
    font-size: 42px;
    font-weight: 400;
    letter-spacing: -1px;
    color: var(--ink);
    line-height: 1.15;
    margin-bottom: 12px;
}

.page-sub {
    font-size: 16px;
    color: var(--muted);
}

.page-body {
    padding: 60px 0;
}

.page-content {
    max-width: 720px;
}

.page-content h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--ink);
    margin-top: 40px;
    margin-bottom: 14px;
}

.page-content p {
    font-size: 16px;
    color: var(--body);
    line-height: 1.7;
    margin-bottom: 16px;
}

.page-content ul {
    margin: 12px 0 16px 24px;
    color: var(--body);
    font-size: 16px;
    line-height: 1.7;
}

.page-content li {
    margin-bottom: 6px;
}

/* ─── CONTACT FORM ─── */

.contact-section {
    padding: var(--section-padding) 0;
    border-top: 1px solid var(--hairline);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
    align-items: start;
}

.contact-info h2 {
    font-size: 26px;
    font-weight: 400;
    letter-spacing: -0.325px;
    color: var(--ink);
    margin-bottom: 16px;
}

.contact-info p {
    font-size: 15px;
    color: var(--body);
    line-height: 1.65;
    margin-bottom: 16px;
}

.contact-detail {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--body);
}

.contact-detail-label {
    font-weight: 600;
    color: var(--ink);
    min-width: 60px;
}

.contact-form-wrap {
    background: var(--surface-card);
    border: 1px solid var(--hairline);
    border-radius: var(--rounded-lg);
    padding: 32px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: var(--surface-card);
    border: 1px solid var(--hairline-strong);
    border-radius: var(--rounded-md);
    padding: 12px 16px;
    height: 44px;
    font-size: 15px;
    color: var(--ink);
    font-family: inherit;
    transition: border-color 0.15s ease;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--ink);
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--muted-soft);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--on-primary);
    font-size: 14px;
    font-weight: 500;
    padding: 10px 18px;
    height: 40px;
    border-radius: var(--rounded-md);
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
    font-family: inherit;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-active);
}

.btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.form-message {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: var(--rounded-md);
    font-size: 14px;
    display: none;
}

.form-message.success {
    background: #e8f6f1;
    color: var(--semantic-success);
    border: 1px solid #c0e5d9;
    display: block;
}

.form-message.error {
    background: #fce8ec;
    color: var(--semantic-error);
    border: 1px solid #f5c2cb;
    display: block;
}

/* ─── FOOTER ─── */

.site-footer {
    background: var(--canvas);
    border-top: 1px solid var(--hairline);
    padding: 64px 0 48px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 48px;
}

.footer-brand p {
    font-size: 14px;
    color: var(--body);
    line-height: 1.6;
    margin-top: 12px;
    max-width: 220px;
}

.footer-col h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: 0.02em;
    margin-bottom: 14px;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col ul a {
    font-size: 14px;
    color: var(--body);
    transition: color 0.15s ease;
}

.footer-col ul a:hover {
    color: var(--ink);
}

.footer-bottom {
    border-top: 1px solid var(--hairline);
    padding-top: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.footer-bottom p {
    font-size: 13px;
    color: var(--muted);
}

.footer-bottom-links {
    display: flex;
    gap: 20px;
}

.footer-bottom-links a {
    font-size: 13px;
    color: var(--muted);
}

.footer-bottom-links a:hover {
    color: var(--ink);
}

/* ─── COOKIE BANNER ─── */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--ink);
    color: var(--canvas);
    padding: 20px 24px;
    z-index: 200;
    display: none;
}

.cookie-banner.visible {
    display: block;
}

.cookie-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.cookie-text {
    font-size: 14px;
    color: var(--canvas-soft);
    line-height: 1.5;
    flex: 1;
    min-width: 200px;
}

.cookie-text a {
    color: var(--canvas);
    text-decoration: underline;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-btn-accept {
    background: var(--primary);
    color: var(--on-primary);
    border: none;
    padding: 9px 18px;
    height: 38px;
    border-radius: var(--rounded-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease;
}

.cookie-btn-accept:hover {
    background: var(--primary-active);
}

.cookie-btn-reject {
    background: transparent;
    color: var(--canvas-soft);
    border: 1px solid rgba(255,255,255,0.25);
    padding: 9px 18px;
    height: 38px;
    border-radius: var(--rounded-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s ease;
}

.cookie-btn-reject:hover {
    border-color: rgba(255,255,255,0.5);
}

/* ─── DISCLAIMER ─── */

.disclaimer-bar {
    background: var(--canvas-soft);
    border-top: 1px solid var(--hairline);
    padding: 12px 24px;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}

/* ─── UTILITIES ─── */

.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-muted { color: var(--muted); }
.text-ink { color: var(--ink); }
.text-primary { color: var(--primary); }

/* ─── RESPONSIVE ─── */

@media (max-width: 1024px) {
    .libraries-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 56px;
    }

    .hero-h1 {
        font-size: 36px;
        letter-spacing: -0.72px;
    }

    .section-title {
        font-size: 28px;
    }

    .article-h1 {
        font-size: 30px;
    }

    .page-h1 {
        font-size: 30px;
    }

    .nav-menu {
        display: none;
    }

    .nav-hamburger {
        display: flex;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .intro-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .libraries-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero-h1 {
        font-size: 28px;
    }

    .libraries-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .intro-stats {
        grid-template-columns: 1fr;
    }
}
