/* ==========================================================================
   FONTS (self-hosted, SIL Open Font License; licences in /static/fonts)
   ========================================================================== */
@font-face {
    font-family: 'Source Sans 3';
    font-style: normal;
    font-display: swap;
    font-weight: 200 900;
    src: url('/static/fonts/source-sans-3-latin-ext-wght-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: 'Source Sans 3';
    font-style: normal;
    font-display: swap;
    font-weight: 200 900;
    src: url('/static/fonts/source-sans-3-latin-wght-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: 'Source Sans 3';
    font-style: italic;
    font-display: swap;
    font-weight: 200 900;
    src: url('/static/fonts/source-sans-3-latin-ext-wght-italic.woff2') format('woff2');
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: 'Source Sans 3';
    font-style: italic;
    font-display: swap;
    font-weight: 200 900;
    src: url('/static/fonts/source-sans-3-latin-wght-italic.woff2') format('woff2');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: 'Roboto Mono';
    font-style: normal;
    font-display: swap;
    font-weight: 100 700;
    src: url('/static/fonts/roboto-mono-latin-ext-wght-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: 'Roboto Mono';
    font-style: normal;
    font-display: swap;
    font-weight: 100 700;
    src: url('/static/fonts/roboto-mono-latin-wght-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* ==========================================================================
   VARIABLES & THEME
   ========================================================================== */
:root {
    --bg-dark: #0a111a;

    /* Opaque text card surfaces */
    --bg-surface: rgba(10, 16, 26, 0.3);
    --bg-surface-elevated: rgba(14, 22, 34, 0.3);

    --border-color: rgba(90, 120, 160, 0.45);
    --border-color-hover: rgba(97, 175, 239, 0.7);

    --primary-color: #61afef;
    --primary-glow: rgba(97, 175, 239, 0.25);
    --accent-cyan: #56b6c2;
    --accent-green: #98c379;
    --accent-orange: #e5a065;

    --text-primary: #ffffff;
    --text-secondary: #c5d1e0;
    --text-muted: #8ea0b8;

    --font-mono: 'Roboto Mono', monospace;
    --font-sans: 'Source Sans 3', sans-serif;

    --header-height: 100px;
    --max-width: 1200px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --transition-fast: 0.15s ease;
    --transition-norm: 0.25s ease;
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--bg-dark);
    color: var(--text-primary);
}

body {
    font-family: var(--font-sans);
    line-height: 1.65;
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    background-color: var(--bg-dark);

    /* Background water image with darkness overlay */
    background-image:
        linear-gradient(rgba(10, 17, 26, 0.84), rgba(10, 17, 26, 0.90)),
        url('/static/img/bg.jpg');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

@media (max-width: 860px) {
    body {
        background-attachment: scroll;
    }
}

body.nav-open, body.modal-open {
    overflow: hidden;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-cyan);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

[id] {
    scroll-margin-top: calc(var(--header-height) + 1.5rem);
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */
.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

/* ==========================================================================
   HEADER & LOGO (NO BACKDROP-FILTER TO PREVENT FIXED TRAPPING)
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 14, 20, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
}

.nav-container {
    max-width: var(--max-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 100% PURE WHITE LOGO */
.nav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    height: 100%;
    min-width: 45px;
}

.nav-brand img {
    height: 80px;
    width: auto;
    min-width: 45px;
    max-width: 300px;
    display: block;
    object-fit: contain;
    filter: brightness(0) invert(1) !important;
    opacity: 1 !important;
    transition: opacity var(--transition-fast);
}

.nav-brand:hover img {
    opacity: 0.85 !important;
}

/* CLEAN TOGGLE BUTTON (NO UGLY BOX OUTLINE) */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 8px;
    z-index: 10001;
    -webkit-tap-highlight-color: transparent;
}

.nav-toggle:focus,
.nav-toggle:active {
    outline: none;
    border: none;
    box-shadow: none;
}

.hamburger-bar {
    width: 26px;
    height: 2px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

/* Turn bars into clean centered X */
.nav-toggle.is-active .hamburger-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.nav-toggle.is-active .hamburger-bar:nth-child(2) {
    opacity: 0;
}
.nav-toggle.is-active .hamburger-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Full-Screen Mobile Backdrop */
.nav-backdrop {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(4, 7, 12, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-norm), visibility var(--transition-norm);
}

.nav-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Desktop Navigation */
.nav-list {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.5rem 0.25rem;
    position: relative;
    transition: color var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

.nav-item-dropdown {
    position: relative;
}

.dropdown-trigger-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dropdown-arrow-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 230px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem 0;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-norm);
}

.dropdown-menu li a {
    display: block;
    padding: 0.65rem 1.25rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.dropdown-menu li a:hover {
    background: rgba(97, 175, 239, 0.15);
    color: var(--primary-color);
}

.nav-item-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ==========================================================================
   PAGE INTRO & TYPOGRAPHY
   ========================================================================== */
.page-intro {
    padding: 2.5rem 0 2rem;
    text-align: center;
}

.intro-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.05;
    gap: 0.2rem;
    margin-bottom: 1.5rem;
}

/* The heading is one h1 for search engines; the outline line is a span inside it. */
h1.large-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    text-align: center;
}

.large-heading {
    font-family: var(--font-sans);
    font-size: clamp(2.4rem, 6.5vw, 4.8rem);
    font-weight: 700;
    letter-spacing: 0.09em;        /* Wide, airy spacing as seen in screenshot */
    color: #dce3ed;                /* Soft light gray/off-white */
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

/* BOTTOM LINE: "JOURNEY" */
.large-heading-outline {
    font-family: var(--font-mono);
    font-size: clamp(2.4rem, 6.5vw, 4.8rem);
    font-weight: 700;
    letter-spacing: 0.09em;        /* Matches top line spacing */
    color: transparent;

    /* Thin, elegant, subtle 1px stroke */
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
}


.subtitle-container {
    max-width: 780px;
    margin: 0 auto;
}

.subtitle {
    font-size: clamp(1.05rem, 2.2vw, 1.25rem);
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.6;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.lead-text {
    font-size: 1.15rem;
    color: #e2ebf5;
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* ==========================================================================
   CONTENT CARDS
   ========================================================================== */
.tech-pills-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.5rem 0 2.5rem;
}

.pill {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-cyan);
    background: var(--bg-surface);
    border: 1px solid rgba(86, 182, 194, 0.4);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.bio-summary {
    max-width: 860px;
    margin: 0 auto 3rem;
    text-align: center;
    padding: 2.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.pathways-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.pathway-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.pathway-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-color-hover);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.card-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--accent-orange);
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.pathway-card h3 {
    font-size: 1.35rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.pathway-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
}

.card-link {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ==========================================================================
   2-COLUMN LAYOUT & SIDEBAR
   ========================================================================== */
.page-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    margin-top: 1.5rem;
    align-items: start;
}

.sticky-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.index-nav h2 {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.index-nav ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.index-nav a {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.index-nav a span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--primary-color);
}

.index-nav a:hover, .index-nav a.active {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
}

/* ==========================================================================
   PILLARS & ARTICLES
   ========================================================================== */
.page-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.pillar-item, .path-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.pillar-header {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.pillar-num {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.pillar-item h3, .path-item h3 {
    font-size: 1.35rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.pillar-lead {
    font-size: 1rem;
    color: var(--text-secondary);
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 1rem;
}

.feature-list li {
    font-size: 0.95rem;
    color: #e2ebf5;
    line-height: 1.6;
    padding-left: 1.25rem;
    position: relative;
}

.feature-list li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

.feature-list--numbered {
    counter-reset: feature;
}

.feature-list--numbered li {
    counter-increment: feature;
    padding-left: 1.6rem;
}

.feature-list--numbered li::before {
    content: counter(feature) ".";
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.pillar-body p + p, .path-item p + p {
    margin-top: 0.85rem;
}

.pillar-subheading {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 1.75rem;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.tag-row .pill {
    font-size: 0.72rem;
    padding: 0.2rem 0.6rem;
}

.section-title--center {
    text-align: center;
}

.large-heading--long,
.large-heading--long .large-heading-outline {
    font-size: clamp(2rem, 5.2vw, 3.8rem);
}

/* Leadership cards on the About page */
.philosophy-points {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.25rem;
}

.philo-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.philo-card h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.philo-card p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==========================================================================
   ARCHITECTURE DIAGRAM (test bench on the Software page)
   Three columns on wide screens; one column on phones.
   ========================================================================== */
.arch-diagram {
    --arch-gap: 0.75rem;
    --arch-host-pad: 1.25rem;
    --arch-line: rgba(142, 160, 184, 0.75);
    margin: 1.75rem 0 0.5rem;
}

.arch-host {
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(6, 10, 16, 0.35);
    padding: var(--arch-host-pad);
}

.arch-host-label {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.75rem;
    margin-bottom: 1rem;
}

.arch-host-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-primary);
}

.arch-host-note {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.arch-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--arch-gap);
}

.arch-node {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-align: center;
    padding: 0.75rem 0.9rem;
    background: rgba(14, 22, 34, 0.75);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: var(--radius-sm);
}

.arch-node strong {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.arch-node span {
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.arch-node--web { border-top-color: var(--accent-cyan); }
.arch-node--hw { border-top-color: var(--accent-green); }

.arch-node--broker {
    max-width: 440px;
    margin: 0 auto;
    border-top-color: var(--accent-orange);
}

.arch-bus {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-align: center;
    color: var(--accent-cyan);
    background: rgba(86, 182, 194, 0.08);
    border: 1px dashed rgba(86, 182, 194, 0.55);
    border-radius: 999px;
    padding: 0.45rem 1rem;
}

.arch-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--arch-gap);
    padding: 0.3rem 0;
}

.arch-links--single {
    grid-template-columns: 1fr;
}

/* A vertical line with an arrowhead at the bottom. */
.arch-arrow {
    display: block;
    position: relative;
    width: 2px;
    height: 1.5rem;
    margin: 0 auto;
    background: var(--arch-line);
}

.arch-arrow::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -2px;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid var(--arch-line);
}

/* From the broker out of the host box, then split to the three hardware groups. */
.arch-fan {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--arch-gap);
    padding: 1.1rem 0 0.3rem;
}

.arch-fan::before {
    content: "";
    position: absolute;
    left: 50%;
    top: calc(-1 * var(--arch-host-pad) - 1px);
    width: 2px;
    height: calc(var(--arch-host-pad) + 1px + 1.1rem);
    background: var(--arch-line);
    transform: translateX(-1px);
}

.arch-fan::after {
    content: "";
    position: absolute;
    top: 1.1rem;
    left: calc((100% - 2 * var(--arch-gap)) / 6);
    right: calc((100% - 2 * var(--arch-gap)) / 6);
    height: 2px;
    background: var(--arch-line);
}

.arch-diagram figcaption {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

@media screen and (max-width: 600px) {
    .arch-diagram {
        --arch-host-pad: 0.9rem;
    }

    .arch-row,
    .arch-links,
    .arch-fan {
        grid-template-columns: 1fr;
    }

    .arch-links .arch-arrow:nth-child(n+2),
    .arch-fan .arch-arrow:nth-child(n+2),
    .arch-fan::after {
        display: none;
    }

    .arch-fan {
        padding-top: 0;
    }

    .arch-fan::before {
        height: calc(var(--arch-host-pad) + 1px);
    }

    /* Each row of three stacks inside one group, so one arrow serves all three. */
    .arch-row {
        border: 1px dashed var(--border-color);
        border-radius: var(--radius-md);
        padding: 0.75rem;
    }
}

.code-block {
    position: relative;
    margin: 1.25rem 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.code-block pre {
    margin: 0;
    overflow-x: auto;
    padding: 1.25rem;
    font-size: 0.85rem;
    background: rgba(6, 10, 16, 0.98);
}

.code-copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(33, 38, 52, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 2;
}

.code-copy-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.code-copy-btn.copied {
    color: var(--accent-green);
    border-color: var(--accent-green);
}

.btn-primary {
    display: inline-block;
    background: var(--primary-color);
    color: #0a0d13;
    font-weight: 600;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-top: 1.25rem;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-primary:hover {
    background: var(--accent-cyan);
    color: #0a0d13;
    transform: translateY(-2px);
}

/* ==========================================================================
   PROJECTS GRID & MODAL
   ========================================================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.75rem;
    margin-top: 2rem;
}

.project-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-color-hover);
}

.project-image {
    width: 100%;
    height: 220px;
    background: #101924;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-norm);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
}

.project-info h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
}

.project-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.project-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-muted);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 10, 16, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-norm);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.modal-body img {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
}

.modal-text {
    padding: 1.75rem;
}

.modal-text h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.modal-text p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-fast);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.back-to-top.is-shown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-color);
    color: var(--bg-dark);
    border-color: var(--primary-color);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    border-top: 1px solid var(--border-color);
    background: #090e17;
    padding: 3rem 1.25rem 2rem;
    margin-top: auto;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.footer-cta h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.footer-cta p {
    max-width: 600px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.social-links a {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.social-links a:hover {
    color: var(--primary-color);
}

.copyright {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================================================
   MOBILE DRAWER & RESPONSIVENESS FIX
   ========================================================================== */
@media screen and (max-width: 860px) {
    .nav-toggle {
        display: flex;
    }

    /* Full-viewport drawer that will never be trapped or scrollbar-clipped */
    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: 82%;
        max-width: 320px;
        height: 100vh;
        height: 100dvh;
        background: #0c1420;
        border-left: 1px solid var(--border-color);
        padding: calc(var(--header-height) + 1.5rem) 1.5rem 2rem;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        box-shadow: -8px 0 35px rgba(0, 0, 0, 0.75);
        z-index: 10000;
        display: flex;
        flex-direction: column;
    }

    .nav-menu.is-open {
        transform: translateX(0);
    }

    .nav-list {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        width: 100%;
    }

    .nav-list > li {
        width: 100%;
    }

    .nav-link {
        font-size: 1.15rem;
        font-weight: 600;
        color: var(--text-primary);
        display: block;
        padding: 0.85rem 0.5rem;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    }

    .nav-link.active::after {
        display: none;
    }

    .nav-link.active {
        color: var(--primary-color);
    }

    .dropdown-trigger-row {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .dropdown-arrow-btn {
        font-size: 1.1rem;
        color: var(--primary-color);
        padding: 0.5rem 1rem;
    }

    .dropdown-menu {
        position: static;
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(18, 28, 44, 0.85);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: var(--radius-sm);
        box-shadow: none;
        margin: 0.5rem 0 0.75rem;
        padding: 0.3rem 0;
        display: none;
    }

    .dropdown-menu.is-mobile-open {
        display: block;
    }

    .dropdown-menu li a {
        padding: 0.65rem 1rem;
        font-size: 0.95rem;
        color: var(--text-secondary);
    }

    .page-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .sticky-sidebar {
        display: none;
    }

    .pillar-item, .path-item {
        padding: 1.5rem;
    }

    .pillar-header {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media screen and (max-width: 480px) {
    .main-content {
        padding: 1.25rem 1rem 3rem;
    }

    .pathways-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   DOWNLOADS PAGE STYLES
   ========================================================================== */
.downloads-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.download-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.download-card-header h2 {
    font-size: 1.6rem;
    color: var(--text-primary);
    margin-top: 0.25rem;
    font-weight: 700;
}

.app-description {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 1rem 0;
}

.app-requirements {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    background: rgba(0, 0, 0, 0.25);
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1.5rem;
}

.req-label {
    color: var(--accent-orange);
    font-weight: 600;
}

/* Versions List */
.versions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.version-row {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.version-row.latest-version {
    border-color: rgba(97, 175, 239, 0.6);
    box-shadow: 0 4px 16px rgba(97, 175, 239, 0.1);
}

.version-meta {
    flex: 1;
}

.version-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.version-tag {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.badge-latest {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    background: rgba(152, 195, 121, 0.15);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.release-date, .file-size {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.version-notes {
    margin: 0.5rem 0 0.5rem 1rem;
    list-style: disc;
}

.version-notes li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.checksum-text code {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    word-break: break-all;
}

/* Download Button */
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--primary-color);
    color: #0a0d13;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.7rem 1.25rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.btn-download:hover {
    background: var(--accent-cyan);
    color: #0a0d13;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(86, 182, 194, 0.3);
}

.download-icon {
    stroke: currentColor;
}

/* Mobile Responsiveness for Download Rows */
@media screen and (max-width: 680px) {
    .download-card {
        padding: 1.5rem;
    }

    .version-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
    }

    .btn-download {
        justify-content: center;
        width: 100%;
    }
}
/* ==========================================================================
   APPS LIST
   ========================================================================== */
.app-card-head {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.app-icon {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 18px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.app-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
    margin-top: 1.25rem;
}

.app-links .btn-primary {
    margin-top: 0;
}

.text-link {
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

/* ==========================================================================
   APP SECTION (tabs, overview, documents)
   ========================================================================== */
.app-subnav {
    max-width: 900px;
    margin: 0 auto 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.app-tabs, .lang-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.app-tabs a, .lang-switch a {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.45rem 1rem;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    transition: all var(--transition-fast);
}

.lang-switch a {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 0.45rem 0.8rem;
}

.app-tabs a:hover, .lang-switch a:hover {
    color: var(--text-primary);
    border-color: var(--border-color-hover);
}

.app-tabs a[aria-current="page"], .lang-switch a[aria-current="true"] {
    color: #0a0d13;
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.app-section {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.section-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.app-logo {
    width: min(320px, 70%);
    margin: 0 auto 1.25rem;
}

/* Get the app */
.get-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.get-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.get-card.is-ready {
    border-color: rgba(97, 175, 239, 0.6);
}

.get-card h3 {
    font-size: 1.3rem;
}

.get-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.get-meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.get-card .btn-download {
    align-self: flex-start;
    margin-top: auto;
}

.btn-download.is-disabled {
    background: transparent;
    color: var(--text-muted);
    border: 1px dashed var(--border-color);
    cursor: default;
    pointer-events: none;
}

.badge-soon {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--accent-orange);
    border: 1px solid var(--accent-orange);
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.checksum {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.checksum summary {
    cursor: pointer;
    color: var(--text-secondary);
}

.checksum code {
    display: block;
    margin-top: 0.4rem;
    font-family: var(--font-mono);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.4rem 0.55rem;
    border-radius: 4px;
    word-break: break-all;
}

.note {
    font-size: 0.88rem;
    color: var(--text-muted);
    border-left: 2px solid var(--accent-orange);
    padding-left: 0.75rem;
}

/* Documents (privacy policy, terms, deletion) */
.doc {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    color: #e2ebf5;
}

.doc h1 {
    font-size: clamp(1.7rem, 4vw, 2.2rem);
    line-height: 1.2;
    margin-bottom: 0.4rem;
}

.doc .doc-meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}

.doc h2 {
    font-size: 1.25rem;
    margin: 2.25rem 0 0.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(90, 120, 160, 0.25);
}

.doc h3 {
    font-size: 1.02rem;
    color: var(--text-primary);
    margin: 1.25rem 0 0.4rem;
}

.doc p, .doc li {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.doc p + p {
    margin-top: 0.75rem;
}

.doc ul, .doc ol {
    margin: 0.5rem 0 0.75rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.doc ul {
    list-style: disc;
}

.doc ol {
    list-style: decimal;
}

.doc strong {
    color: var(--text-primary);
}

.doc a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.doc .lead {
    font-size: 1.1rem;
    color: #e2ebf5;
}

.doc .callout {
    margin: 1.25rem 0;
    padding: 1.25rem 1.5rem;
    background: var(--bg-surface-elevated);
    border: 1px solid rgba(97, 175, 239, 0.5);
    border-radius: var(--radius-md);
}

.doc .callout .btn-primary {
    margin-top: 0.75rem;
    text-decoration: none;
}

.doc-toc {
    margin-bottom: 1.5rem;
    font-size: 0.92rem;
}

.doc-toc ol {
    margin-left: 1.4rem;
    gap: 0.2rem;
}

@media screen and (max-width: 680px) {
    .doc {
        padding: 1.5rem 1.25rem;
    }

    .app-subnav {
        justify-content: center;
    }

    .app-tabs {
        justify-content: center;
    }
}
