/* ==========================================================================
   OPEN SOURCE BAGRESEARCH — Design System
   Inheriting color tokens from bagresearch.co.in + extended for open-source
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    /* Brand colors from bagresearch.co.in */
    --navy-950: #06182d;
    --navy-900: #0d2f55;
    --navy-800: #174a78;
    --navy-700: #245e91;
    --navy-600: #2d72aa;

    --red-600: #d64038;
    --red-700: #b8322c;

    --gold-500: #d8aa4f;
    --gold-400: #e8bf6a;
    --gold-300: #f2d38d;
    --cyan-400: #64e4ff;

    /* Open-source brand green */
    --green-700: #145d39;
    --green-600: #1b7f4d;
    --green-500: #237d4e;
    --green-400: #27a360;
    --green-300: #53c791;
    --green-100: #e8f9f0;

    --white: #ffffff;
    --background: #f4f7fa;
    --background-soft: #edf3f8;
    --background-warm: #f8f6f1;

    --text: #24364a;
    --text-soft: #3f5367;
    --muted: #607489;
    --line: #d8e2ec;
    --line-soft: #e8eef4;

    --success: #1b7f4d;
    --warning: #ae7413;
    --error: #c0392b;

    --shadow-small: 0 4px 14px rgba(6, 24, 45, 0.08);
    --shadow-medium: 0 12px 32px rgba(6, 24, 45, 0.12);
    --shadow-large: 0 24px 56px rgba(6, 24, 45, 0.18);
    --shadow-glow-green: 0 0 32px rgba(35, 125, 78, 0.18);

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --max-width: 1240px;
    --header-h: 68px;

    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 380ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font: inherit; }

button { cursor: pointer; }

h1, h2, h3, h4 { margin: 0; line-height: 1.2; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.container {
    width: min(calc(100% - 40px), var(--max-width));
    margin-inline: auto;
}

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   TOP ANNOUNCEMENT BAR
   ========================================================================== */

.top-bar {
    overflow: hidden;
    background: var(--navy-950);
    color: rgba(255,255,255,0.88);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.top-bar-inner {
    min-height: 46px;
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: center;
    gap: 20px;
}

.moving-message { min-width: 0; overflow: hidden; white-space: nowrap; }

.moving-message-track {
    display: inline-flex;
    align-items: center;
    min-width: max-content;
    animation: marquee 26s linear infinite;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.moving-message-track span { padding-right: 90px; }

@keyframes marquee {
    from { transform: translateX(60%); }
    to   { transform: translateX(-100%); }
}

.social-links { display: flex; align-items: center; gap: 7px; }

.social-link {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.14);
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    transition: transform var(--transition), background var(--transition), border-color var(--transition);
}

.social-link:hover, .social-link:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.12);
    outline: none;
}

.social-link svg { width: 100%; height: 100%; }

/* ==========================================================================
   MAIN HEADER
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.97);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.header-inner {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Main website pill button */
.main-website-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--navy-900);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 2px 10px rgba(13,47,85,0.22);
    flex-shrink: 0;
}

.main-website-btn::before {
    content: "↗";
    font-size: 0.9rem;
}

.main-website-btn:hover, .main-website-btn:focus-visible {
    background: var(--navy-800);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(13,47,85,0.28);
    outline: none;
}

/* Branding */
.branding {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.branding-logo {
    width: 42px; height: 42px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--line);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--navy-900);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.branding-logo img { width: 100%; height: 100%; object-fit: cover; }

.branding-text {
    font-weight: 800;
    font-size: 0.88rem;
    color: var(--navy-900);
    line-height: 1.25;
}

.branding-text .os-badge {
    display: inline-block;
    margin-top: 2px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--green-100);
    color: var(--green-600);
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Navigation */
.main-navigation { margin-left: auto; }

.main-navigation ul {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0; padding: 0;
    list-style: none;
}

.main-navigation a {
    display: block;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 600;
    transition: background var(--transition), color var(--transition);
}

.main-navigation a:hover,
.main-navigation a:focus-visible,
.main-navigation a.active {
    background: var(--background-soft);
    color: var(--navy-900);
    outline: none;
}

.main-navigation a.active { color: var(--navy-900); font-weight: 800; }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-button {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    font-size: 1.2rem;
    transition: background var(--transition), color var(--transition);
}

.icon-button:hover, .icon-button:focus-visible {
    background: var(--background-soft);
    color: var(--navy-900);
    outline: none;
}

.menu-button { display: none; }

/* Search panel */
.search-panel {
    display: none;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    background: var(--white);
}

.search-panel.open { display: block; }

.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-form input {
    flex: 1;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--background);
    outline: none;
}

.search-form input:focus { border-color: var(--navy-700); }

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
}

.button-primary {
    background: var(--navy-900);
    color: #fff;
    box-shadow: var(--shadow-small);
}

.button-primary:hover, .button-primary:focus-visible {
    background: var(--navy-800);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
    outline: none;
}

.button-green {
    background: var(--green-500);
    color: #fff;
    box-shadow: 0 4px 16px rgba(35,125,78,0.22);
}

.button-green:hover, .button-green:focus-visible {
    background: var(--green-700);
    transform: translateY(-1px);
    outline: none;
}

.button-outline {
    background: transparent;
    color: var(--navy-900);
    border: 1.5px solid var(--navy-700);
}

.button-outline:hover { background: var(--background-soft); }

/* ==========================================================================
   SITE FOOTER
   ========================================================================== */

.site-footer {
    background: var(--navy-950);
    color: rgba(255,255,255,0.82);
    margin-top: 80px;
}

.footer-top {
    display: grid;
    grid-template-columns: 1.6fr repeat(3, 1fr);
    gap: 40px;
    padding: 56px 0 48px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.footer-logo {
    width: 44px; height: 44px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--navy-800);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 900;
}

.footer-logo img { width: 100%; height: 100%; object-fit: cover; }

.footer-brand strong {
    font-size: 0.92rem;
    font-weight: 800;
    color: #fff;
}

.footer-about {
    color: rgba(255,255,255,0.55);
    font-size: 0.83rem;
    line-height: 1.7;
    margin: 0;
}

.footer-column h3 {
    color: #fff;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 18px;
}

.footer-links {
    margin: 0; padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.footer-links a {
    color: rgba(255,255,255,0.55);
    font-size: 0.83rem;
    transition: color var(--transition);
}

.footer-links a:hover { color: var(--gold-400); }

.footer-bottom {
    padding: 20px 0;
}

.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.76rem;
    color: rgba(255,255,255,0.38);
}

/* ==========================================================================
   PROJECT DETAIL PAGES
   ========================================================================== */

.project-report-main {
    padding: 48px 0 90px;
    background: linear-gradient(180deg, #e8edf1 0%, #f5f7f9 100%);
    min-height: 60vh;
}

.project-back-row {
    width: min(100%, 1080px);
    margin: 0 auto 18px;
}

.project-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--navy-900);
    font-size: 0.8rem;
    font-weight: 800;
    transition: color var(--transition);
}

.project-back-link:hover { color: var(--gold-500); }

.project-report-paper {
    width: min(100%, 1080px);
    margin-inline: auto;
    padding: 60px 68px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: var(--shadow-large);
}

/* Project title */
.project-title-block {
    margin-bottom: 32px;
    text-align: center;
}

.project-title-block h1 {
    max-width: 960px;
    margin: 0 auto;
    color: #bc8700;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 5vw, 3.6rem);
    font-weight: 700;
    line-height: 1.13;
}

.project-title-block h2 {
    max-width: 900px;
    margin: 18px auto 0;
    color: var(--text-soft);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.05rem, 2.5vw, 1.6rem);
    font-weight: 600;
    line-height: 1.5;
}

.project-category {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.project-meta {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.project-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--background-soft);
    color: var(--text-soft);
    font-size: 0.7rem;
    font-weight: 800;
}

.project-meta .open-source-pill {
    border-color: #79c59d;
    background: #edf9f2;
    color: #18734a;
}

/* Research highlight */
.research-highlight {
    margin: 28px 0 34px;
    padding: 20px 24px;
    border-left: 6px solid var(--green-500);
    background: #eff9f7;
}

.research-highlight p {
    margin: 0;
    color: #244d46;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.7;
    text-align: justify;
}

/* Section navigation */
.project-section-navigation {
    position: sticky;
    top: var(--header-h);
    z-index: 30;
    margin: 0 -68px 40px;
    padding: 11px 68px;
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(10px);
}

.project-section-navigation-inner {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.project-section-navigation-inner::-webkit-scrollbar { display: none; }

.project-section-navigation a {
    flex: 0 0 auto;
    padding: 7px 12px;
    border-radius: 999px;
    color: var(--navy-900);
    font-size: 0.7rem;
    font-weight: 800;
    transition: background var(--transition), color var(--transition);
}

.project-section-navigation a:hover,
.project-section-navigation a:focus-visible {
    background: var(--navy-900);
    color: #fff;
    outline: none;
}

/* Report content */
.report-section {
    margin-top: 46px;
    scroll-margin-top: 110px;
}

.report-section:first-of-type { margin-top: 0; }

.report-section-title {
    margin: 0 0 22px;
    color: #171717;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
}

.report-section-subtitle {
    margin: 28px 0 14px;
    color: #21364a;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.22rem;
    line-height: 1.4;
}

.report-section p {
    margin: 0 0 16px;
    color: #292929;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1rem;
    line-height: 1.76;
    text-align: justify;
}

/* Abstract */
.abstract-box {
    padding: 24px 26px;
    border: 1px solid #d2e3df;
    border-left: 6px solid var(--green-500);
    background: #f5fbf9;
}

.abstract-box p:last-child { margin-bottom: 0; }

.keyword-line {
    margin-top: 16px;
    padding: 14px 16px;
    border-left: 4px solid var(--navy-900);
    background: #f2f6f9;
    color: #30465a;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.65;
}

/* Safety notice */
.safety-notice {
    position: relative;
    margin-top: 28px;
    padding: 22px 24px;
    border: 2px solid #d38c22;
    border-left-width: 7px;
    border-radius: 10px;
    background: #fff8e9;
}

.safety-notice h3 {
    margin: 0;
    color: #754a00;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.2rem;
}

.safety-notice p {
    margin: 10px 0 0;
    color: #614b25;
    font-size: 0.9rem;
    line-height: 1.67;
}

/* Images */
.project-image {
    width: 100%;
    margin: 26px auto 36px;
    text-align: center;
}

.project-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 720px;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 10px;
    background: var(--white);
}

.project-image.filter-unit img { width: min(100%, 440px); max-height: 620px; }

.project-image figcaption {
    max-width: 850px;
    margin: 10px auto 0;
    color: var(--muted);
    font-size: 0.74rem;
    font-style: italic;
    line-height: 1.55;
}

/* Context grid */
.context-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 14px;
    margin-top: 24px;
}

.context-card {
    min-height: 160px;
    padding: 20px;
    border: 1px solid var(--line);
    border-top: 5px solid var(--navy-900);
    border-radius: var(--radius-md);
    background: var(--background-soft);
}

.context-card span {
    color: #af7900;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.context-card h3 {
    margin: 10px 0 0;
    color: #20364a;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.06rem;
    line-height: 1.38;
}

.context-card p {
    margin: 8px 0 0;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.84rem;
    line-height: 1.55;
    text-align: left;
}

/* Materials */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 16px;
    margin-top: 24px;
}

.materials-card {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--background-soft);
}

.materials-card h3 {
    margin: 0;
    color: #1b344a;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.16rem;
}

.materials-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 8px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.materials-list li {
    padding: 10px 12px;
    border-left: 4px solid var(--green-500);
    background: var(--white);
    color: #405568;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.84rem;
    line-height: 1.45;
}

/* Layer functions */
.layer-function-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 12px;
    margin-top: 22px;
}

.layer-function {
    padding: 16px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--green-500);
    background: #f7faf9;
}

.layer-function strong {
    display: block;
    color: #21473e;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.95rem;
}

.layer-function span {
    display: block;
    margin-top: 6px;
    color: #607568;
    font-size: 0.79rem;
    line-height: 1.53;
}

/* Methodology */
.methodology-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: methodology;
}

.methodology-list li {
    counter-increment: methodology;
    display: grid;
    grid-template-columns: 48px minmax(0,1fr);
    gap: 14px;
    align-items: center;
    min-height: 68px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--background-soft);
    color: #2d4053;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.93rem;
    line-height: 1.62;
}

.methodology-list li::before {
    content: counter(methodology, decimal-leading-zero);
    width: 42px; height: 42px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--navy-900);
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 0.72rem;
    font-weight: 900;
}

/* Test protocol */
.test-protocol-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 12px;
    margin-top: 22px;
}

.test-protocol-item {
    padding: 18px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--background-soft);
    text-align: center;
}

.test-protocol-item strong {
    display: block;
    color: var(--navy-900);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1rem;
}

.test-protocol-item span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.45;
}

/* Results table */
.results-table-wrap {
    margin-top: 26px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.results-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

.results-table th, .results-table td {
    padding: 13px 14px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.results-table th {
    background: var(--navy-900);
    color: #fff;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.results-table td {
    color: #354a5d;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.83rem;
    line-height: 1.45;
}

.results-table tr:last-child td { border-bottom: 0; }
.results-table th:last-child, .results-table td:last-child { border-right: 0; }

.results-table .group-row td {
    background: #edf4f7;
    color: #173a50;
    font-family: Arial, sans-serif;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.improved-value { color: #17714b; font-weight: 900; }

/* Result summary */
.result-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 12px;
    margin-top: 24px;
}

.result-summary-card {
    padding: 20px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--background-soft);
    text-align: center;
}

.result-summary-card strong {
    display: block;
    color: #14714e;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.32rem;
}

.result-summary-card span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.73rem;
    line-height: 1.45;
}

/* Discussion */
.discussion-list {
    display: grid;
    gap: 12px;
    margin: 0; padding: 0;
    list-style: none;
}

.discussion-list li {
    padding: 15px 17px;
    border-left: 5px solid var(--green-500);
    background: #f5faf8;
    color: #314b45;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.92rem;
    line-height: 1.65;
}

/* Applications */
.application-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 13px;
    margin-top: 24px;
}

.application-item {
    padding: 18px;
    border: 1px solid var(--line);
    border-left: 5px solid #258054;
    background: #f3faf6;
    color: #2c4053;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.93rem;
    font-weight: 700;
    line-height: 1.55;
}

/* Open source section */
.open-source-resources {
    position: relative;
    overflow: hidden;
    padding: 30px;
    border: 2px solid #65ae83;
    border-radius: 16px;
    background: linear-gradient(135deg, #effbf4, #fff);
}

.open-source-resources::after {
    content: "</>";
    position: absolute; right: 22px; bottom: -16px;
    color: rgba(35,134,83,0.07);
    font-family: monospace;
    font-size: 7rem;
    font-weight: 900;
}

.open-source-resources h2 {
    position: relative; z-index: 1;
    margin: 0; color: #145d39;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.55rem, 3vw, 2rem);
}

.open-source-resources p {
    position: relative; z-index: 1;
    max-width: 780px;
    margin: 12px 0 0;
    color: #345b47;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.7;
    text-align: justify;
}

.resource-list {
    position: relative; z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 10px;
    margin-top: 20px;
}

.resource-item {
    min-height: 74px;
    display: flex; align-items: center; justify-content: center;
    padding: 12px;
    border: 1px solid #b8dbc6;
    border-radius: 9px;
    background: #fff;
    color: #1d6341;
    font-size: 0.78rem;
    font-weight: 900;
    text-align: center;
}

.open-source-button {
    position: relative; z-index: 1;
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 47px;
    margin-top: 22px;
    padding: 0 20px;
    border-radius: 7px;
    background: #237d4e;
    color: #fff;
    font-size: 0.81rem;
    font-weight: 900;
    text-decoration: none;
    animation: openSourcePulse 2s ease-in-out infinite;
}

.open-source-button:hover, .open-source-button:focus-visible {
    background: #145d39;
    outline: none;
}

@keyframes openSourcePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(35,125,78,0); }
    50%       { box-shadow: 0 0 0 8px rgba(35,125,78,0.12); }
}

/* Open source notice */
.open-source-notice {
    position: relative;
    margin-top: 48px;
    overflow: hidden;
    padding: 26px 28px;
    border: 3px solid #237d4e;
    border-radius: 13px;
    background: #f1fbf5;
}

.open-source-notice::before {
    content: "OPEN SOURCE";
    position: absolute; top: 12px; right: 14px;
    padding: 5px 8px;
    border-radius: 5px;
    background: #237d4e;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.1em;
}

.open-source-notice h2 {
    max-width: calc(100% - 130px);
    margin: 0; color: #145d39;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.45rem;
    line-height: 1.35;
}

.open-source-notice p {
    margin: 12px 0 0; color: #2f4f3e;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.93rem;
    font-weight: 700;
    line-height: 1.67;
    text-align: justify;
}

/* Simulator styles */
.filter-simulator {
    overflow: hidden;
    border: 1px solid #d4dde5;
    border-radius: 18px;
    background: #071a26;
    box-shadow: 0 18px 43px rgba(7,26,38,0.2);
}

.simulator-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 18px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    background: #10364a;
    color: #fff;
}

.simulator-header strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.12rem;
}

.simulator-header span {
    color: #72f5ae;
    font-size: 0.67rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.simulator-body {
    display: grid;
    grid-template-columns: minmax(300px, 0.9fr) minmax(0,1.1fr);
    gap: 24px;
    padding: 24px;
}

.sim-filter-column {
    display: grid; align-content: center;
    padding: 22px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 14px;
    background: rgba(255,255,255,0.06);
}

.sim-water-input, .sim-water-output {
    width: min(100%, 240px);
    min-height: 72px;
    display: grid; place-items: center;
    margin-inline: auto;
    border-radius: 10px;
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.84rem;
    font-weight: 800;
    text-align: center;
}

.sim-water-input { background: linear-gradient(180deg, #a8a26a, #777442); }
.sim-water-output { background: linear-gradient(180deg, #92ddef, #4eb0ce); }

.sim-flow-arrow {
    margin: 8px 0;
    color: rgba(255,255,255,0.55);
    font-size: 1.35rem;
    font-weight: 900;
    text-align: center;
}

.sim-filter-stages {
    display: grid; gap: 6px;
    width: min(100%, 260px);
    margin: 0 auto;
}

.sim-stage {
    padding: 10px 13px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 7px;
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.7);
    font-size: 0.77rem;
    font-weight: 800;
    text-align: center;
    transition: background 250ms ease, color 250ms ease, transform 250ms ease;
}

.sim-stage.active {
    background: #27865d; color: #fff;
    transform: scale(1.025);
    box-shadow: 0 0 0 4px rgba(39,134,93,0.15);
}

.sim-stage.completed { background: rgba(39,134,93,0.24); color: #8ef0ba; }

.simulator-panel { display: grid; align-content: start; gap: 14px; }

.simulator-card {
    padding: 17px;
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.simulator-card h3 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1rem;
}

.sample-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 8px;
    margin-top: 13px;
}

.sample-button, .simulation-button {
    min-height: 42px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 0.73rem;
    font-weight: 900;
    cursor: pointer;
}

.sample-button:hover, .sample-button:focus-visible, .sample-button.active {
    background: #1d6681; outline: none;
}

.simulation-button {
    width: 100%; margin-top: 12px;
    background: #27865d;
}

.simulation-button:hover, .simulation-button:focus-visible {
    background: #1b6847; outline: none;
}

.simulation-button:disabled { opacity: 0.55; cursor: wait; }

.simulation-progress {
    height: 12px; overflow: hidden;
    margin-top: 13px;
    border-radius: 999px;
    background: rgba(255,255,255,0.11);
}

.simulation-progress-fill {
    width: 0; height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #53c791, #8fe3b7);
    transition: width 350ms ease;
}

.simulation-status {
    margin: 9px 0 0;
    color: rgba(255,255,255,0.7);
    font-size: 0.74rem;
    line-height: 1.5;
}

/* Quality grid */
.quality-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 8px;
    margin-top: 13px;
}

.quality-item {
    padding: 11px 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.07);
    text-align: center;
}

.quality-item strong { display: block; color: #fff; font-size: 1.04rem; }

.quality-item span {
    display: block; margin-top: 3px;
    color: rgba(255,255,255,0.6);
    font-size: 0.61rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.05em;
}

.sample-description {
    margin-top: 12px; padding: 11px;
    border-radius: 8px;
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.74);
    font-size: 0.76rem; line-height: 1.55;
}

/* Result image grid */
.result-image-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
    gap: 22px;
    align-items: center;
    margin-top: 26px;
}

.result-image-grid figure { margin: 0; }

/* Filter construction */
.filter-construction {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(300px, 1.18fr);
    gap: 30px;
    align-items: start;
    margin-top: 26px;
}

.construction-description {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--background-soft);
}

.construction-description p:last-child { margin-bottom: 0; }

/* Filter diagram */
.filter-layer-diagram {
    padding: 23px;
    border: 1px solid #d7dfe5;
    border-radius: 14px;
    background: linear-gradient(180deg, #f9fbfc, #edf3f6);
}

.filter-candle {
    width: min(100%, 350px);
    margin: 0 auto;
    overflow: hidden;
    border: 5px solid #aebac4;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(25,45,62,0.11);
}

.filter-space, .filter-layer {
    display: flex; align-items: center; justify-content: center;
    min-height: 62px; padding: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.09);
    color: #24394c;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.85rem; font-weight: 800;
    line-height: 1.4; text-align: center;
}

.filter-space {
    min-height: 72px;
    background: linear-gradient(180deg, #dff2fb, #eef9fd);
    color: #31617a;
}

.layer-pebbles { background: radial-gradient(circle at 18% 40%, #a79b8b 0 7px, transparent 8px), radial-gradient(circle at 53% 50%, #7f7468 0 9px, transparent 10px), radial-gradient(circle at 82% 36%, #b8ad9e 0 8px, transparent 9px), #d7d0c5; }
.layer-sand { background: repeating-linear-gradient(0deg, #dcc997 0 4px, #d2bc82 4px 8px); }
.layer-charcoal { background: repeating-linear-gradient(135deg, #272d31 0 7px, #3a4146 7px 14px); color: #fff; }
.layer-celite { background: repeating-linear-gradient(0deg, #ece8dc 0 5px, #dcd5c5 5px 10px); }
.layer-cotton { background: radial-gradient(circle, #fff 0 8px, #edf1f4 9px 12px, transparent 13px), #f7f9fa; }
.layer-mesh { min-height: 40px; background: repeating-linear-gradient(45deg, transparent 0 5px, rgba(34,63,84,0.17) 5px 6px), repeating-linear-gradient(-45deg, transparent 0 5px, rgba(34,63,84,0.17) 5px 6px), #eaf0f4; }

/* Smart bin specific */
.spec-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 14px;
    margin-top: 24px;
}

.spec-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-top: 4px solid var(--navy-800);
    border-radius: var(--radius-md);
    background: var(--background-soft);
    text-align: center;
}

.spec-card strong {
    display: block;
    color: var(--navy-900);
    font-size: 1.1rem;
    font-family: 'JetBrains Mono', monospace;
}

.spec-card span {
    display: block; margin-top: 6px;
    color: var(--muted); font-size: 0.73rem;
}

.component-list {
    display: grid; gap: 10px;
    margin: 0; padding: 0; list-style: none;
}

.component-list li {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--background-soft);
}

.component-icon {
    flex-shrink: 0;
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border-radius: 8px;
    background: var(--navy-900);
    color: #fff;
    font-size: 1rem;
}

.component-info strong {
    display: block;
    color: var(--text); font-size: 0.88rem;
}

.component-info span {
    color: var(--muted); font-size: 0.78rem;
    line-height: 1.5;
}

/* Code block */
.code-block {
    margin-top: 20px;
    overflow-x: auto;
    border-radius: var(--radius-md);
    background: #0d1117;
}

.code-block pre {
    margin: 0;
    padding: 24px;
    color: #e6edf3;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    white-space: pre;
}

/* ==========================================================================
   RESPONSIVE — Project pages
   ========================================================================== */

@media (max-width: 980px) {
    .project-report-paper { padding: 46px 36px; }
    .project-section-navigation { margin-inline: -36px; padding-inline: 36px; }
    .filter-construction, .simulator-body, .result-image-grid { grid-template-columns: 1fr; }
    .context-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .test-protocol-grid, .result-summary-grid, .resource-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .spec-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 720px) {
    .project-report-main { padding: 24px 0 56px; }
    .project-report-paper { padding: 34px 22px; }
    .project-section-navigation { margin-inline: -22px; padding-inline: 22px; }
    .context-grid, .materials-grid, .materials-list, .layer-function-grid,
    .application-grid, .resource-list, .quality-grid, .sample-buttons,
    .spec-grid { grid-template-columns: 1fr; }
    .test-protocol-grid, .result-summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .simulator-body { padding: 16px; }
    .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 470px) {
    .project-report-paper { padding: 28px 16px; }
    .project-section-navigation { margin-inline: -16px; padding-inline: 16px; }
    .test-protocol-grid, .result-summary-grid { grid-template-columns: 1fr; }
    .methodology-list li { grid-template-columns: 1fr; }
    .open-source-notice { padding: 58px 18px 22px; }
    .open-source-notice h2 { max-width: none; font-size: 1.25rem; }
    .footer-top { grid-template-columns: 1fr; gap: 28px; }
}

/* ==========================================================================
   HEADER RESPONSIVE
   ========================================================================== */

@media (max-width: 860px) {
    .main-navigation { display: none; }
    .main-navigation.open {
        display: block;
        position: fixed;
        top: var(--header-h);
        left: 0; right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--line);
        padding: 16px 20px;
        z-index: 999;
        box-shadow: var(--shadow-medium);
    }
    .main-navigation.open ul { flex-direction: column; gap: 4px; }
    .menu-button { display: grid; }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .moving-message-track { animation: none; }
    .open-source-button { animation: none; }
}

/* ========================================================================== 
   OPEN SOURCE SECTION — INSTITUTIONAL OVERRIDES (2026)
   ========================================================================== */

body {
    background: #f2f5f7;
}

.site-header {
    background: rgba(255,255,255,.985);
    border-bottom: 1px solid #cfd9e2;
    box-shadow: 0 4px 14px rgba(6,24,45,.05);
}

.branding-logo {
    border-radius: 50%;
    border-color: #c8d5df;
}

.branding-text {
    font-family: Georgia, "Times New Roman", serif;
    font-size: .94rem;
    font-weight: 700;
    color: #0d2f55;
}

.branding-text .os-badge {
    margin-top: 4px;
    border-radius: 2px;
    background: #edf2f6;
    color: #48667e;
    font-family: Inter, Arial, sans-serif;
    font-size: .56rem;
    letter-spacing: .08em;
}

.main-navigation a {
    border-radius: 3px;
}

.main-website-btn {
    border-radius: 3px;
    background: #0d2f55;
}

.site-footer {
    background: #071b31;
    border-top: 5px solid #d8aa4f;
}

.footer-brand strong {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
    font-size: 1.08rem;
}

.footer-logo {
    border-radius: 50%;
}

.project-report-main {
    background: #eef2f5;
}

.project-report-paper {
    border-radius: 4px;
    border: 1px solid #d2dce4;
    box-shadow: 0 10px 28px rgba(6,24,45,.08);
}

.project-title-block {
    border-bottom-color: #d6e0e8;
}

.project-title-block h1,
.report-section-title {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
}

.research-highlight {
    border-radius: 3px;
    border-left-width: 5px;
}

.project-section-navigation {
    border-radius: 0;
}

.spec-card,
.context-card,
.materials-card,
.role-card {
    border-radius: 4px;
}

.open-source-resources {
    border-radius: 4px;
    background: linear-gradient(135deg, #0c3155, #16577b);
}

.open-source-button {
    border-radius: 3px;
}

.open-source-notice {
    border-radius: 4px;
    border-left: 5px solid #d8aa4f;
}

.code-block {
    border-radius: 4px;
}
