:root {
    --oc-green: #4A9D7C;
    --primary-color: #4A9D7C;
    --primary-dark: #3A7D62;
    --primary-light: #6BC4A0;
    --oc-blue: #6B8FBF;
    --oc-dark: #1A1F2E;
    --oc-light: #F5F8F7;
    --light-bg: #F5F8F7;
    --code-bg: #0f1218;
}

/* General Styles */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    color: var(--oc-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navbar */
.navbar-oc {
    background: linear-gradient(180deg, #1e2438 0%, var(--oc-dark) 100%);
    border-bottom: 2px solid rgba(74, 157, 124, 0.35);
}

.navbar-oc .navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
}

.navbar-oc .navbar-brand img {
    height: 36px;
    width: auto;
}

.navbar-oc .nav-link {
    color: #ffffff;
    font-weight: 600;
    letter-spacing: .2px;
    text-shadow: 0 1px 2px rgba(0,0,0,.5);
    position: relative;
    margin: 0 .25rem;
}

.navbar-oc .nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: .25rem;
    width: 0;
    height: 2px;
    background: var(--oc-green);
    transition: width .25s ease;
}

.navbar-oc .nav-link:hover::after,
.navbar-oc .nav-link:focus::after,
.navbar-oc .nav-link.active::after {
    width: 100%;
}

.navbar-oc .nav-link:hover,
.navbar-oc .nav-link:focus {
    color: var(--primary-light);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--oc-dark) 0%, #2a3040 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/images/grid-pattern.svg') repeat;
    opacity: 0.1;
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-refactor {
    background:
        radial-gradient(circle at 85% 20%, rgba(74,157,124,.2), transparent 30%),
        linear-gradient(135deg, #151a28 0%, #252d42 58%, #1d3b38 100%);
}

.text-gradient {
    color: var(--primary-light);
}

.hero-visual {
    position: relative;
    display: inline-block;
    padding: 1.5rem;
}

.hero-visual::before {
    content: '';
    position: absolute;
    inset: 8% 2% 3%;
    border: 1px solid rgba(107,196,160,.28);
    border-radius: 50% 42% 48% 46%;
    background: radial-gradient(circle, rgba(74,157,124,.15), rgba(255,255,255,.02) 65%);
}

.hero-visual .hero-character {
    position: relative;
    max-width: 340px;
    z-index: 1;
}

.hero-visual-label {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin-top: -.25rem;
    padding: .65rem 1rem;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    color: rgba(255,255,255,.88);
    background: rgba(15,18,24,.72);
    backdrop-filter: blur(8px);
    font-size: .85rem;
    font-weight: 600;
}

.status-dot {
    display: inline-block;
    width: .62rem;
    height: .62rem;
    border-radius: 50%;
    background: var(--primary-light);
    box-shadow: 0 0 0 5px rgba(107,196,160,.12);
}

.section-kicker {
    display: inline-block;
    margin-bottom: .65rem;
    color: var(--oc-green);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.section-kicker-light {
    color: var(--primary-light);
}

.project-card {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(26,31,46,.08);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(26,31,46,.06);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: rgba(74,157,124,.35);
    box-shadow: 0 18px 40px rgba(26,31,46,.11);
}

.project-number {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    color: rgba(74,157,124,.13);
    font-size: 3.6rem;
    font-weight: 800;
    line-height: 1;
}

.project-list {
    margin: 1.25rem 0 3rem;
    padding: 0;
    list-style: none;
}

.project-list li {
    position: relative;
    margin-bottom: .55rem;
    padding-left: 1.35rem;
    color: #596579;
    font-size: .9rem;
}

.project-list li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--oc-green);
    font-weight: 800;
}

.project-link {
    position: absolute;
    bottom: 1.5rem;
    color: var(--oc-green);
    font-weight: 700;
    text-decoration: none;
}

.workflow-stack {
    display: grid;
    gap: .75rem;
}

.workflow-step {
    display: grid;
    grid-template-columns: 48px 1fr;
    align-items: start;
    gap: 1rem;
    padding: 1.15rem;
    border: 1px solid rgba(26,31,46,.08);
    border-radius: 12px;
    background: var(--oc-light);
}

.workflow-step > span {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 11px;
    color: #fff;
    background: var(--oc-green);
    font-weight: 800;
}

.workflow-step strong { font-size: 1.05rem; }
.workflow-step p { margin: .2rem 0 0; color: #667085; font-size: .9rem; }

.current-state-section {
    background:
        radial-gradient(circle at 10% 20%, rgba(74,157,124,.17), transparent 28%),
        linear-gradient(135deg, var(--oc-dark), #252d42);
}

.state-card {
    display: flex;
    align-items: center;
    gap: .7rem;
    height: 100%;
    padding: .9rem 1rem;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    color: rgba(255,255,255,.86);
    background: rgba(255,255,255,.045);
}

.state-card i { color: var(--primary-light); font-size: 1.15rem; }

.status-panel {
    border: 1px solid rgba(107,196,160,.24);
    border-radius: 16px;
    color: #fff;
    background: rgba(15,18,24,.45);
}

.archive-notice {
    color: #2b3547;
    background: #eef5f2;
    border-bottom: 1px solid rgba(74,157,124,.2);
    font-size: .88rem;
}

.archive-notice-link {
    color: var(--primary-dark);
    font-weight: 700;
    text-decoration: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    background: rgba(74, 157, 124, 0.2);
    border: 1px solid rgba(74, 157, 124, 0.4);
    border-radius: 999px;
    color: var(--primary-light);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.hero-shape {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 100px;
    background: var(--oc-light);
    clip-path: polygon(0 100%, 100% 100%, 100% 0);
}

/* Stat Chips */
.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .65rem;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    color: #fff;
    background: rgba(255,255,255,.06);
    backdrop-filter: blur(2px);
    font-size: .85rem;
}

/* Feature Cards */
.feature-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--oc-green);
}

/* Plugin Cards */
.plugin-card {
    background: white;
    border-radius: 10px;
    border-left: 4px solid var(--oc-green);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.plugin-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,.1);
}

.plugin-card .plugin-icon {
    font-size: 1.5rem;
    color: var(--oc-green);
}

/* Code Panels */
.code-panel {
    background: var(--code-bg);
    border-radius: 12px;
    padding: 1.25rem 1.25rem 1rem;
    border: 1px solid rgba(255,255,255,.08);
    position: relative;
}

.code-panel pre {
    margin: 0;
    max-height: 380px;
    overflow-y: auto;
    overflow-x: hidden;
    color: #e6e6e6;
    background: transparent;
    font-size: .85rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.code-panel code {
    white-space: inherit;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.code-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.code-panel-header span {
    color: rgba(255,255,255,.6);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-copy {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    color: rgba(255,255,255,.6);
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: rgba(255,255,255,.2);
    color: #fff;
}

/* Architecture Layer Cards */
.arch-layer {
    background: white;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    transition: transform 0.2s ease;
}

.arch-layer:hover {
    transform: scale(1.02);
}

.arch-arrow {
    color: var(--oc-green);
    font-size: 1.5rem;
}

.architecture-flow {
    padding: 1.25rem;
    border: 1px solid rgba(26,31,46,.08);
    border-radius: 14px;
    background: var(--oc-light);
}

.arch-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    padding: 1.25rem;
    border: 1px solid rgba(74,157,124,.22);
    border-radius: 10px;
    text-align: center;
    background: #fff;
}

.arch-node i { margin-bottom: .25rem; color: var(--oc-green); font-size: 1.5rem; }
.arch-node small { color: #697386; }
.arch-node-app { color: #fff; background: var(--oc-dark); border-color: var(--oc-dark); }
.arch-node-app small { color: rgba(255,255,255,.65); }
.arch-node-app i { color: var(--primary-light); }
.arch-connector { padding: .5rem; text-align: center; color: var(--oc-green); }

/* Tech Badge */
.tech-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    background: rgba(74, 157, 124, 0.1);
    border: 1px solid rgba(74, 157, 124, 0.3);
    border-radius: 8px;
    color: var(--oc-green);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.tech-badge:hover {
    background: rgba(74, 157, 124, 0.15);
    transform: scale(1.05);
}

/* Step Number */
.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--oc-green), var(--primary-dark));
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--oc-green) 0%, var(--primary-dark) 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/images/grid-pattern.svg') repeat;
    opacity: 0.08;
}

.cta-section .container {
    position: relative;
    z-index: 1;
}

/* Buttons */
.btn-primary {
    background-color: var(--oc-green);
    border-color: var(--oc-green);
}

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

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: var(--oc-green);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
}

/* Doc Cards */
.doc-card {
    background: white;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 4px 10px rgba(0,0,0,.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.doc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,.1);
}

/* Focus states */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--oc-green);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--oc-light);
}

::-webkit-scrollbar-thumb {
    background: var(--oc-green);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
    }

    .hero-section .btn-group {
        justify-content: center;
    }

    .feature-card {
        margin-bottom: 1rem;
    }

    .hero-section .hero-character {
        max-width: 280px;
        margin: 2rem auto 0;
    }
}

@media (max-width: 480px) {
    .stat-chip {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }
}

/* ── Docs Layout ── */
.docs-hero {
    background: linear-gradient(135deg, var(--oc-dark) 0%, #2a3040 100%);
    position: relative;
    overflow: hidden;
}

.docs-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/images/grid-pattern.svg') repeat;
    opacity: 0.1;
}

.docs-hero .container { position: relative; z-index: 1; }

.docs-breadcrumb a { color: var(--primary-light); text-decoration: none; }
.docs-breadcrumb a:hover { text-decoration: underline; }
.docs-breadcrumb .separator { color: rgba(255,255,255,.4); margin: 0 .35rem; }

/* Sidebar */
.docs-sidebar {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.docs-sidebar .nav-link {
    color: #4a5568;
    font-weight: 500;
    padding: .45rem .75rem;
    border-radius: 6px;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    transition: all .15s ease;
}

.docs-sidebar .nav-link:hover { color: var(--oc-green); background: rgba(74,157,124,.06); }
.docs-sidebar .nav-link.active { color: var(--oc-green); background: rgba(74,157,124,.1); font-weight: 600; }

.docs-nav-heading {
    display: block;
    padding: .2rem .75rem .35rem;
    color: #8a94a6;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.docs-sidebar .docs-subnav .nav-link {
    font-size: .82rem;
    padding: .3rem .75rem .3rem 2.25rem;
    font-weight: 400;
}

.docs-sidebar .docs-subnav .nav-link.active { font-weight: 600; }

/* Topic Cards */
.topic-card {
    background: white;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: transform .2s ease, box-shadow .2s ease;
    display: block;
}

.topic-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,.1);
    color: inherit;
    text-decoration: none;
}

.topic-card .topic-icon { font-size: 1.5rem; color: var(--oc-green); }

/* Doc Content */
.doc-content h2 { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid rgba(0,0,0,.06); }
.doc-content h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.doc-content h3 { margin-top: 1.5rem; }

.doc-content .table { font-size: .88rem; }
.doc-content .table thead th { background: var(--oc-light); font-weight: 600; white-space: nowrap; }

.callout {
    border-left: 4px solid var(--oc-green);
    background: rgba(74,157,124,.06);
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
}

.callout-warning {
    border-left-color: #e6a817;
    background: rgba(230,168,23,.08);
}

.callout-info {
    border-left-color: var(--oc-blue);
    background: rgba(107,143,191,.08);
}

/* Mobile offcanvas docs sidebar */
.docs-offcanvas .offcanvas-body .nav-link { font-size: 1rem; padding: .55rem .75rem; }
.docs-offcanvas .offcanvas-body .docs-subnav .nav-link { padding-left: 2.25rem; }

/* Syntax highlight tokens */
.code-panel .token-keyword { color: #c586c0; }
.code-panel .token-string { color: #ce9178; }
.code-panel .token-comment { color: #6a9955; }
.code-panel .token-type { color: #4ec9b0; }
.code-panel .token-property { color: #9cdcfe; }
.code-panel .token-value { color: #b5cea8; }

/* ── Blog ── */
.blog-hero {
    background: linear-gradient(135deg, var(--oc-dark) 0%, #2a3040 100%);
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/images/grid-pattern.svg') repeat;
    opacity: 0.1;
}

.blog-hero .container { position: relative; z-index: 1; }

.blog-card-featured {
    background: linear-gradient(135deg, var(--oc-dark) 0%, #2e3a4e 100%);
    border-radius: 12px;
    border: 1px solid rgba(74,157,124,0.25);
    transition: transform .2s ease, box-shadow .2s ease;
}

.blog-card-featured:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

.blog-card {
    background: white;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    transition: transform .2s ease, box-shadow .2s ease;
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,.1);
}

.blog-topic-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: .25rem .6rem;
    border-radius: 4px;
}

.badge-engineering { background: rgba(74,157,124,.15); color: var(--oc-green); }
.badge-release { background: rgba(107,143,191,.15); color: var(--oc-blue); }
.badge-tutorial { background: rgba(230,168,23,.12); color: #b8860b; }

/* ── Install ── */
.install-hero {
    background: linear-gradient(135deg, var(--oc-dark) 0%, #24384a 58%, #235a50 100%);
    position: relative;
    overflow: hidden;
}

.install-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/images/grid-pattern.svg') repeat;
    opacity: .12;
}

.install-hero .container { position: relative; z-index: 1; }

.install-command {
    max-width: 850px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0,0,0,.25);
}

.install-command pre {
    padding: 1.35rem;
    background: #111827;
    color: #d1fae5;
    overflow-x: auto;
}

.install-command code { white-space: nowrap; }

.install-info-card,
.install-sidebar-card {
    background: var(--oc-light);
    border: 1px solid rgba(15,118,110,.12);
    border-radius: 12px;
    padding: 1.5rem;
}

.install-info-icon { color: var(--oc-green); font-size: 2rem; }

.install-steps {
    list-style: none;
    padding: 0;
}

.install-steps li {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.install-steps li > span {
    display: inline-flex;
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--oc-green);
    color: white;
    font-weight: 700;
}

.install-steps p { color: #667085; margin: .2rem 0 0; }

.install-troubleshooting dt { color: var(--oc-dark); margin-top: 1rem; }
.install-troubleshooting dt:first-child { margin-top: 0; }
.install-troubleshooting dd { color: #667085; margin: .25rem 0 0; }

@media (max-width: 576px) {
    .install-command pre { padding: 1rem; font-size: .78rem; }
    .install-command code { white-space: pre-wrap; overflow-wrap: anywhere; }
    .install-info-card, .install-sidebar-card { padding: 1.2rem; }
}
