@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;
    --success: #1f8a65;
    --error: #cf2d56;
}

*, *::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;
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--ink);
    text-decoration: none;
}

a:hover {
    color: var(--primary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* TOP NAV */
.top-nav {
    background: var(--canvas);
    border-bottom: 1px solid var(--hairline);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.3px;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-logo span {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-menu a {
    font-size: 14px;
    font-weight: 500;
    color: var(--body);
    line-height: 1.4;
    transition: color 0.15s;
}

.nav-menu a:hover {
    color: var(--ink);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-primary {
    background: var(--primary);
    color: var(--on-primary);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    padding: 10px 18px;
    height: 40px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background 0.15s;
}

.btn-primary:hover {
    background: var(--primary-active);
    color: var(--on-primary);
}

.btn-secondary {
    background: var(--surface-card);
    color: var(--ink);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    padding: 10px 18px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--hairline-strong);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: border-color 0.15s;
}

.btn-secondary:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    background: none;
    border: none;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: all 0.2s;
}

/* HERO */
.hero-band {
    background: var(--canvas);
    padding: 80px 0 60px;
    border-bottom: 1px solid var(--hairline-soft);
}

.hero-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.88px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 20px;
}

.hero-band h1 {
    font-size: 72px;
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -2.16px;
    color: var(--ink);
    max-width: 800px;
    margin-bottom: 24px;
}

.hero-band p {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--body);
    max-width: 560px;
    margin-bottom: 40px;
}

.hero-image {
    margin-top: 60px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--hairline);
}

.hero-image img {
    width: 100%;
    height: 440px;
    object-fit: cover;
}

/* SECTIONS */
.section {
    padding: 80px 0;
}

.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;
    line-height: 1.2;
    letter-spacing: -0.72px;
    color: var(--ink);
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--body);
    max-width: 600px;
}

.section-divider {
    border: none;
    border-top: 1px solid var(--hairline);
    margin: 0;
}

/* ARTICLE CARDS GRID */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 48px;
}

.article-card {
    background: var(--surface-card);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    display: block;
    transition: border-color 0.15s;
}

.article-card:hover {
    border-color: var(--hairline-strong);
    color: inherit;
}

.article-card-image {
    height: 200px;
    overflow: hidden;
    background: var(--canvas-soft);
}

.article-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.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);
    background: var(--surface-strong);
    padding: 4px 10px;
    border-radius: 9999px;
    margin-bottom: 12px;
}

.article-card h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink);
    margin-bottom: 8px;
}

.article-card p {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--body);
}

.article-card-meta {
    margin-top: 16px;
    font-size: 13px;
    color: var(--muted);
}

/* FEATURE CARDS */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 48px;
}

.feature-card {
    background: var(--surface-card);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    padding: 24px;
}

.feature-card-icon {
    width: 40px;
    height: 40px;
    background: var(--canvas-soft);
    border-radius: 8px;
    border: 1px solid var(--hairline);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 18px;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink);
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--body);
}

/* TWO-COLUMN SPLIT */
.split-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.split-section.reverse {
    direction: rtl;
}

.split-section.reverse > * {
    direction: ltr;
}

.split-image {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--hairline);
}

.split-image img {
    width: 100%;
    height: 360px;
    object-fit: cover;
}

.split-content h2 {
    font-size: 36px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.72px;
    color: var(--ink);
    margin-bottom: 16px;
}

.split-content p {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--body);
    margin-bottom: 12px;
}

/* ARTICLE PAGE */
.article-header {
    padding: 60px 0 48px;
    border-bottom: 1px solid var(--hairline);
}

.article-header .breadcrumb {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-header .breadcrumb a {
    color: var(--muted);
}

.article-header .breadcrumb a:hover {
    color: var(--ink);
}

.article-header h1 {
    font-size: 56px;
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -1.4px;
    color: var(--ink);
    max-width: 800px;
    margin-bottom: 20px;
}

.article-header-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    color: var(--muted);
}

.article-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.88px;
    text-transform: uppercase;
    background: var(--surface-strong);
    color: var(--ink);
    padding: 4px 10px;
    border-radius: 9999px;
}

.article-hero-image {
    margin: 48px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--hairline);
}

.article-hero-image img {
    width: 100%;
    height: 480px;
    object-fit: cover;
}

.article-hero-image figcaption {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--muted);
    border-top: 1px solid var(--hairline-soft);
    background: var(--canvas-soft);
    font-family: 'JetBrains Mono', monospace;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 60px;
    align-items: start;
    padding: 48px 0 80px;
}

.article-content h2 {
    font-size: 26px;
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -0.325px;
    color: var(--ink);
    margin: 40px 0 16px;
}

.article-content h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink);
    margin: 28px 0 12px;
}

.article-content p {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--body);
    margin-bottom: 20px;
}

.article-content ul,
.article-content ol {
    margin: 0 0 20px 24px;
    color: var(--body);
    font-size: 16px;
    line-height: 1.5;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content .note-block {
    background: var(--canvas-soft);
    border-left: 3px solid var(--hairline-strong);
    border-radius: 0 8px 8px 0;
    padding: 20px 24px;
    margin: 28px 0;
}

.article-content .note-block p {
    margin: 0;
    font-size: 15px;
    color: var(--body);
}

.article-content .code-block {
    background: var(--surface-card);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    padding: 20px;
    margin: 28px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink);
    overflow-x: auto;
}

.article-content .inline-image {
    margin: 32px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--hairline);
}

.article-content .inline-image img {
    width: 100%;
    height: 320px;
    object-fit: cover;
}

.article-content .inline-image figcaption {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--muted);
    border-top: 1px solid var(--hairline-soft);
    background: var(--canvas-soft);
    font-family: 'JetBrains Mono', monospace;
}

/* SIDEBAR */
.article-sidebar {
    position: sticky;
    top: 84px;
}

.sidebar-card {
    background: var(--surface-card);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.sidebar-card h4 {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.88px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 16px;
}

.sidebar-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-card ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--hairline-soft);
    font-size: 14px;
}

.sidebar-card ul li:last-child {
    border-bottom: none;
}

.sidebar-card ul li a {
    color: var(--body);
    font-size: 14px;
}

.sidebar-card ul li a:hover {
    color: var(--primary);
}

.sidebar-ref-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-ref-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--hairline-soft);
    font-size: 13px;
    color: var(--muted);
}

.sidebar-ref-list li:last-child {
    border-bottom: none;
}

.sidebar-ref-list a {
    color: var(--body);
    font-size: 13px;
    line-height: 1.4;
    display: block;
}

.sidebar-ref-list a:hover {
    color: var(--primary);
}

/* RELATED ARTICLES */
.related-section {
    padding: 60px 0;
    border-top: 1px solid var(--hairline);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 32px;
}

/* CTA BAND */
.cta-band {
    background: var(--canvas);
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
    padding: 96px 0;
    text-align: center;
}

.cta-band h2 {
    font-size: 36px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.72px;
    color: var(--ink);
    margin-bottom: 16px;
}

.cta-band p {
    font-size: 16px;
    color: var(--body);
    max-width: 480px;
    margin: 0 auto 32px;
}

/* FORM */
.contact-form-wrap {
    max-width: 560px;
}

.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);
    color: var(--ink);
    border: 1px solid var(--hairline-strong);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    font-family: inherit;
    height: 44px;
    outline: none;
    transition: border-color 0.15s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--ink);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--muted-soft);
}

.form-group textarea {
    height: auto;
    min-height: 120px;
    resize: vertical;
}

.form-submit-btn {
    background: var(--primary);
    color: var(--on-primary);
    font-size: 14px;
    font-weight: 500;
    padding: 10px 24px;
    height: 44px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.form-submit-btn:hover {
    background: var(--primary-active);
}

.form-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-status {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.form-status.success {
    background: #f0faf6;
    color: var(--success);
    border: 1px solid #b8e6d4;
}

.form-status.error {
    background: #fff0f3;
    color: var(--error);
    border: 1px solid #f5b8c4;
}

/* FOOTER */
.footer {
    background: var(--canvas);
    border-top: 1px solid var(--hairline);
    padding: 64px 0 48px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-brand p {
    font-size: 14px;
    color: var(--body);
    margin-top: 12px;
    max-width: 240px;
    line-height: 1.5;
}

.footer-col h5 {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.88px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 16px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    font-size: 14px;
    color: var(--body);
    line-height: 1.4;
}

.footer-col ul li a:hover {
    color: var(--ink);
}

.footer-bottom {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--hairline-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--muted);
}

.footer-bottom a {
    color: var(--muted);
    font-size: 13px;
}

.footer-bottom a:hover {
    color: var(--ink);
}

/* COOKIE BANNER */
#cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: var(--canvas);
    border-radius: 12px;
    padding: 20px 24px;
    max-width: 560px;
    width: calc(100% - 48px);
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 9999;
    box-shadow: none;
}

#cookie-banner p {
    font-size: 14px;
    color: var(--canvas-soft);
    line-height: 1.5;
    flex: 1;
}

#cookie-banner a {
    color: #f7f7f4;
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.cookie-accept {
    background: var(--primary);
    color: var(--on-primary);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.cookie-reject {
    background: transparent;
    color: var(--canvas-soft);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(247,247,244,0.3);
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

/* PAGE HEADER (about/privacy/terms) */
.page-header {
    padding: 60px 0 48px;
    border-bottom: 1px solid var(--hairline);
}

.page-header h1 {
    font-size: 56px;
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -1.4px;
    color: var(--ink);
    margin-bottom: 12px;
}

.page-header p {
    font-size: 16px;
    color: var(--body);
    max-width: 560px;
}

.page-content {
    max-width: 760px;
    padding: 48px 0 80px;
}

.page-content h2 {
    font-size: 26px;
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -0.325px;
    color: var(--ink);
    margin: 40px 0 16px;
}

.page-content h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink);
    margin: 28px 0 12px;
}

.page-content p {
    font-size: 16px;
    line-height: 1.5;
    color: var(--body);
    margin-bottom: 20px;
}

.page-content ul, .page-content ol {
    margin: 0 0 20px 24px;
    color: var(--body);
    font-size: 16px;
    line-height: 1.5;
}

.page-content li {
    margin-bottom: 8px;
}

/* ABOUT PAGE SPECIAL */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
    padding: 60px 0;
}

.about-image {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--hairline);
}

.about-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

/* LOADING SPINNER */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .hero-band h1 {
        font-size: 56px;
        letter-spacing: -1.4px;
    }

    .articles-grid,
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 32px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .article-layout {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        position: static;
    }

    .split-section {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .split-section.reverse {
        direction: ltr;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--canvas);
        border-bottom: 1px solid var(--hairline);
        flex-direction: column;
        gap: 0;
        padding: 8px 0;
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        padding: 12px 24px;
    }

    .nav-actions {
        display: none;
    }

    .nav-hamburger {
        display: flex;
    }

    .top-nav {
        position: relative;
    }
}

@media (max-width: 640px) {
    .hero-band h1 {
        font-size: 32px;
        letter-spacing: -0.8px;
    }

    .section-title {
        font-size: 28px;
    }

    .articles-grid,
    .feature-grid {
        grid-template-columns: 1fr;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .article-header h1 {
        font-size: 32px;
        letter-spacing: -0.6px;
    }

    .page-header h1 {
        font-size: 36px;
        letter-spacing: -0.8px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    #cookie-banner {
        flex-direction: column;
        gap: 16px;
    }

    .cookie-actions {
        width: 100%;
    }

    .cookie-accept,
    .cookie-reject {
        flex: 1;
        text-align: center;
        justify-content: center;
    }
}
