@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

:root {
    /* Primary Brand Colors */
    --protoplatz-red: #B40000;
    /* Muted deep red */
    --protoaccess-red: #FF0000;
    /* Brighter sharper red */
    --neutral-grey: #808080;
    /* Neutral grey for Cloud/Devices */

    /* UI Palette */
    --text-primary: #FFFFFF;
    --text-secondary: #A0A0A0;
    --bg-base: #0A0A0A;
    /* Deep Charcoal / Black */
    --bg-sidebar: #0F0F0F;
    --border-color: #222222;
    --max-width: 1200px;

    /* Sidebar width */
    --sidebar-width: 300px;
}

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

body {
    font-family: 'IBM Plex Sans', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-base);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

/* ─── Mobile Top Bar ──────────────────────────────────────────── */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    height: 56px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.mobile-topbar .mobile-logo img {
    height: 26px;
    width: auto;
    display: block;
}

.mobile-topbar .hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--border-color);
    cursor: pointer;
    color: var(--text-primary);
    transition: border-color 0.2s ease, background 0.2s ease;
    flex-shrink: 0;
}

.mobile-topbar .hamburger-btn:hover {
    background: #1a1a1a;
    border-color: #444;
}

.hamburger-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* ─── Sidebar Overlay Backdrop ────────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 149;
    background: rgba(0, 0, 0, 0.75);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
}

/* ─── Layout ──────────────────────────────────────────────────── */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
}

.doc-layout {
    display: block;
    min-height: 100vh;
}

/* ─── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    border-right: 1px solid var(--border-color);
    padding: 48px 32px;
    overflow-y: auto;
    background: var(--bg-sidebar);
    z-index: 150;
    scrollbar-width: thin;
    scrollbar-color: #333333 transparent;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar:hover {
    scrollbar-color: #555555 transparent;
}

/* Sidebar Custom Scrollbar for better visibility */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #555555;
}

.sidebar-logo {
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo img {
    height: 32px;
    width: auto;
    display: block;
}

/* Sidebar close button — hidden on desktop */
.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: none;
    border: 1px solid var(--border-color);
    cursor: pointer;
    color: var(--text-secondary);
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.sidebar-close-btn:hover {
    color: var(--text-primary);
    border-color: #444;
}

.sidebar-close-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 60px;
}

.sidebar-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--neutral-grey);
    margin-top: 24px;
    margin-bottom: 8px;
    opacity: 0.85;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 4px;
}

.sidebar-nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    padding: 8px 0;
    transition: color 0.1s ease;
    border-bottom: 1px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    color: var(--protoplatz-red);
}

.sidebar-nav a.protoaccess:hover,
.sidebar-nav a.protoaccess.active {
    color: var(--protoaccess-red);
}

/* Spec Sheet Link */
.spec-link {
    margin-top: auto;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.spec-link:hover {
    color: var(--text-primary);
}

/* ─── Main Content Area ───────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 80px 100px;
    max-width: 1000px;
}

/* ─── Typography (Industrial Style) ──────────────────────────── */
h1,
h2,
h3,
h4 {
    font-weight: 500;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 40px;
    margin-bottom: 48px;
    color: var(--text-primary);
}

h2 {
    font-size: 24px;
    margin-top: 60px;
    margin-bottom: 24px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

h3 {
    font-size: 18px;
    margin-top: 40px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 720px;
}

ul {
    list-style: none;
    margin-bottom: 32px;
}

ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    font-size: 15px;
    color: var(--text-secondary);
}

ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 1px;
    background: var(--protoplatz-red);
}

/* ─── Diagram System (Flat Vector Style) ─────────────────────── */
.diagram-container {
    margin: 48px 0;
    padding: 32px;
    background: #0D0D0D;
    border: 1px solid var(--border-color);
}

.diagram-container img {
    width: 100%;
    height: auto;
    display: block;
}

.diagram-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #111;
    border: 1px dashed #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #444;
    text-align: center;
    padding: 40px;
}

.diagram-placeholder span {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.diagram-placeholder h4 {
    color: #666;
    font-size: 16px;
}

.diagram-label {
    font-size: 12px;
    color: var(--neutral-grey);
    margin-top: 16px;
    text-align: center;
}

/* ─── Spec Sheet Block ────────────────────────────────────────── */
.spec-block {
    margin-top: 60px;
    padding: 32px;
    background: #0F0F0F;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.spec-block-content h4 {
    margin-top: 0;
    margin-bottom: 8px;
}

.spec-block-content p {
    margin-bottom: 0;
    font-size: 14px;
}

.btn-download {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-download:hover {
    background: #1A1A1A;
    border-color: #444;
}

/* ─── Sections ────────────────────────────────────────────────── */
section {
    margin-bottom: 80px;
}

/* ─── Footer ──────────────────────────────────────────────────── */
footer {
    padding: 80px 100px;
    margin-left: var(--sidebar-width);
    border-top: 1px solid var(--border-color);
    background: var(--bg-base);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.footer-nav {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 12px;
}

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

.copyright {
    font-size: 12px;
    color: var(--neutral-grey);
}

/* ─── Reveal on scroll ────────────────────────────────────────── */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════════════════════════════ */

/* ─── Tablet (≤ 1024px) ───────────────────────────────────────── */
@media (max-width: 1024px) {
    /* Show the mobile top bar */
    .mobile-topbar {
        display: flex;
    }

    /* Show overlay backdrop */
    .sidebar-overlay {
        display: block;
    }

    /* Sidebar becomes a slide-in drawer */
    .sidebar {
        transform: translateX(-100%);
        top: 0;
        padding-top: 64px;
        /* room for close button */
        box-shadow: 4px 0 32px rgba(0, 0, 0, 0.6);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Show close button inside sidebar on mobile */
    .sidebar-close-btn {
        display: flex;
    }

    /* Content & footer lose the sidebar offset and get top padding for topbar */
    .main-content {
        margin-left: 0;
        padding: 40px 48px;
        padding-top: calc(56px + 40px);
        /* topbar height + spacing */
        max-width: 100%;
    }

    footer {
        margin-left: 0;
        padding: 48px;
    }

    h1 {
        font-size: 32px;
        margin-bottom: 36px;
    }

    h2 {
        font-size: 20px;
        margin-top: 48px;
    }

    .diagram-container {
        padding: 20px;
        margin: 32px 0;
    }

    .spec-block {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
}

/* ─── Large Mobile / Small Tablet (≤ 768px) ──────────────────── */
@media (max-width: 768px) {
    .main-content {
        padding: 32px 24px;
        padding-top: calc(56px + 32px);
    }

    footer {
        padding: 40px 24px;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    h1 {
        font-size: 28px;
        margin-bottom: 28px;
    }

    h2 {
        font-size: 18px;
        margin-top: 40px;
    }

    h3 {
        font-size: 16px;
    }

    p {
        font-size: 15px;
        max-width: 100%;
    }

    ul li {
        font-size: 14px;
    }

    .diagram-container {
        padding: 16px;
        margin: 24px 0;
    }

    .diagram-placeholder {
        padding: 24px;
    }

    .spec-block {
        padding: 24px;
    }

    .btn-download {
        width: 100%;
        justify-content: center;
    }
}

/* ─── Mobile (≤ 480px) ────────────────────────────────────────── */
@media (max-width: 480px) {
    .mobile-topbar {
        padding: 0 16px;
    }

    .main-content {
        padding: 24px 16px;
        padding-top: calc(56px + 24px);
    }

    footer {
        padding: 32px 16px;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 24px;
    }

    h2 {
        font-size: 16px;
        margin-top: 32px;
        margin-bottom: 16px;
    }

    h3 {
        font-size: 15px;
        margin-top: 28px;
    }

    p {
        font-size: 14px;
        margin-bottom: 18px;
    }

    .diagram-container {
        padding: 12px;
        margin: 20px 0;
    }

    .sidebar {
        width: min(var(--sidebar-width), calc(100vw - 48px));
    }

    .footer-nav {
        gap: 16px;
    }

    section {
        margin-bottom: 48px;
    }

    /* Bigger touch targets for sidebar nav links */
    .sidebar-nav a {
        padding: 11px 0;
        font-size: 15px;
    }
}