/* =====================================================================
   simulai.xyz  ---  Swiss grid, terracotta warm
   Sidebar composition, 6-column content grid, visible structure.
   ===================================================================== */

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

:root {
    --bg: #FAF6F0;
    --sidebar-bg: #F2EDE6;
    --terracotta: #B88A6A;
    --clay: #8A5A3A;
    --swiss-red: #C4443A;
    --ink: #2A2420;
    --warm-grey: #7A7068;
    --rule: rgba(184, 138, 106, 0.40);
    --grid-line: rgba(184, 138, 106, 0.08);

    --sidebar-w: 240px;
    --content-pad: 48px;
    --column-gap: 24px;

    --font-display: "Barlow Condensed", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-body: "IBM Plex Sans", "Inter", system-ui, sans-serif;
    --font-mono: "IBM Plex Mono", "Menlo", "Consolas", monospace;
}

html, body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.8;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-variant-numeric: tabular-nums;
}

body {
    min-height: 100vh;
    padding-left: var(--sidebar-w);
    position: relative;
    overflow-x: hidden;
}

/* -----------------------  Particles canvas  ----------------------- */

#particle-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}

/* -----------------------  Sidebar  ----------------------- */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--rule);
    z-index: 5;
    overflow-y: auto;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;
    padding: 32px 24px 28px;
}

.sidebar-header {
    margin-bottom: 48px;
}

.brand-mark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.95rem;
    letter-spacing: 0.04em;
    line-height: 0.95;
    color: var(--ink);
    text-transform: uppercase;
}

.brand-suffix {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    color: var(--clay);
    text-transform: uppercase;
    margin-top: 4px;
}

.brand-meta {
    margin-top: 20px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    color: var(--warm-grey);
    text-transform: uppercase;
    line-height: 1.5;
}

.sidebar-nav {
    position: relative;
    margin-top: auto;
    margin-bottom: auto;
}

.nav-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    color: var(--warm-grey);
    text-transform: uppercase;
    margin-bottom: 18px;
}

.nav-list {
    list-style: none;
    position: relative;
}

.nav-list li {
    position: relative;
}

.nav-list a {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 9px 0 9px 12px;
    text-decoration: none;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.1;
    transition: color 0.2s ease;
    border-left: 1px solid transparent;
}

.nav-list a:hover {
    color: var(--clay);
}

.nav-list a.active {
    color: var(--ink);
}

.nav-num {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    color: var(--terracotta);
    font-weight: 500;
    min-width: 18px;
}

.nav-text {
    font-weight: 500;
}

.nav-indicator {
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 36px;
    background: var(--swiss-red);
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.3, 0.1, 0.2, 1), height 0.4s ease;
    pointer-events: none;
}

.sidebar-footer {
    border-top: 1px solid var(--rule);
    padding-top: 18px;
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.readout-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.readout-label {
    color: var(--warm-grey);
}

.readout-value {
    color: var(--ink);
    font-weight: 500;
}

/* -----------------------  Content area  ----------------------- */

.content {
    position: relative;
    width: 100%;
    max-width: calc(100vw - var(--sidebar-w));
    padding: 0 var(--content-pad);
    z-index: 2;
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: var(--content-pad);
    right: var(--content-pad);
    height: 100%;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    column-gap: var(--column-gap);
    pointer-events: none;
    z-index: 0;
}

.grid-overlay .col-line {
    display: block;
    width: 1px;
    height: 100%;
    background: var(--grid-line);
    justify-self: start;
}

.grid-overlay .col-line:last-child {
    justify-self: end;
}

/* -----------------------  Section scaffolding  ----------------------- */

.section {
    position: relative;
    padding: 80px 0 96px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    column-gap: var(--column-gap);
    row-gap: 28px;
    opacity: 0;
    transform: translateY(0);
    transition: opacity 0.6s linear;
    z-index: 2;
}

.section.visible {
    opacity: 1;
}

.section-head {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    padding-bottom: 10px;
    position: relative;
}

.section-rule {
    flex: 1;
    height: 1px;
    background: var(--terracotta);
    opacity: 0.55;
}

.section-number {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.1rem;
    letter-spacing: 0.12em;
    color: var(--clay);
    font-variant-numeric: tabular-nums;
    min-width: 2ch;
    text-align: right;
}

.section-title {
    grid-column: 1 / span 4;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.4rem, 5.5vw, 4.5rem);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1.02;
    color: var(--ink);
    margin-top: 12px;
}

.section-body {
    grid-column: 2 / span 4;
    max-width: 60ch;
}

.section-body p + p {
    margin-top: 18px;
}

.section-body .lead {
    font-size: 1.15rem;
    line-height: 1.65;
    color: var(--ink);
}

.section-aside {
    grid-column: 5 / span 2;
    border-top: 1px solid var(--rule);
    padding-top: 16px;
    margin-top: 14px;
    color: var(--warm-grey);
    font-size: 0.92rem;
    line-height: 1.6;
}

.aside-label {
    margin-bottom: 10px;
    color: var(--clay);
}

/* -----------------------  Hero  ----------------------- */

.hero {
    padding-top: 92px;
    padding-bottom: 120px;
    border-bottom: 1px solid var(--rule);
}

.hero-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    column-gap: var(--column-gap);
    row-gap: 32px;
    align-items: start;
}

.hero-label {
    grid-column: 1 / span 3;
}

.hero-date {
    grid-column: 5 / span 2;
    text-align: right;
    color: var(--clay);
}

.mono-label {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    letter-spacing: 0.14em;
    color: var(--terracotta);
    text-transform: uppercase;
    font-weight: 500;
}

.hero-title {
    grid-column: 1 / span 5;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(3rem, 8vw, 6.5rem);
    letter-spacing: 0.015em;
    text-transform: uppercase;
    line-height: 0.95;
    color: var(--ink);
}

.title-line {
    display: block;
}

.title-line.accent {
    color: var(--clay);
    font-weight: 500;
    font-style: italic;
    text-transform: none;
    letter-spacing: -0.005em;
    font-family: "IBM Plex Serif", "IBM Plex Sans", Georgia, serif;
    font-size: 0.82em;
    margin-top: 6px;
}

.hero-lede {
    grid-column: 2 / span 4;
    font-size: 1.2rem;
    line-height: 1.65;
    color: var(--ink);
    max-width: 60ch;
}

.hero-datapanel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: var(--column-gap);
    row-gap: 16px;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 24px 0;
    margin-top: 18px;
}

.datapoint {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.data-num {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    line-height: 1;
    color: var(--swiss-red);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.data-unit {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--warm-grey);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* -----------------------  Method list  ----------------------- */

.method-list {
    grid-column: 1 / -1;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    column-gap: var(--column-gap);
    row-gap: 24px;
    border-top: 1px solid var(--rule);
    padding-top: 28px;
    margin-top: 12px;
}

.method-list li {
    grid-column: span 6;
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--rule);
}

.method-list li:last-child {
    border-bottom: none;
}

.method-num {
    color: var(--swiss-red);
    font-weight: 500;
    font-size: 0.82rem;
    padding-top: 4px;
}

.method-body h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.4rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 6px;
    color: var(--ink);
}

.method-body p {
    color: var(--warm-grey);
    font-size: 0.98rem;
    line-height: 1.65;
    max-width: 58ch;
}

.pull-quote {
    grid-column: 1 / -1;
    margin-top: 32px;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.6rem, 3.4vw, 2.4rem);
    letter-spacing: 0.01em;
    line-height: 1.15;
    color: var(--clay);
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 36px 0;
    text-transform: uppercase;
}

/* -----------------------  Systems grid  ----------------------- */

.systems-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: var(--column-gap);
    row-gap: 0;
    border-top: 1px solid var(--rule);
    border-left: 1px solid var(--rule);
    margin-top: 12px;
}

.system-card {
    padding: 28px 24px 32px;
    border-right: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg);
    transition: background 0.3s ease;
    position: relative;
}

.system-card:hover {
    background: var(--sidebar-bg);
}

.system-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.system-dot {
    width: 10px;
    height: 10px;
    background: var(--swiss-red);
    display: inline-block;
}

.system-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1.1;
    color: var(--ink);
}

.system-card p {
    color: var(--warm-grey);
    font-size: 0.98rem;
    line-height: 1.6;
    max-width: 44ch;
}

.system-meta {
    margin-top: auto;
    color: var(--clay);
    padding-top: 16px;
    border-top: 1px solid var(--rule);
}

/* -----------------------  Metrics / table  ----------------------- */

.metrics-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: var(--column-gap);
    row-gap: 0;
    border-top: 1px solid var(--rule);
    border-left: 1px solid var(--rule);
    margin-top: 12px;
}

.metric {
    padding: 28px 24px;
    border-right: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.metric-value {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.4rem, 4.5vw, 3.8rem);
    line-height: 1;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.metric-unit {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--clay);
    margin-left: 4px;
    vertical-align: top;
    padding-top: 8px;
}

.metric-caption {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--warm-grey);
    line-height: 1.5;
}

.data-table {
    grid-column: 1 / -1;
    width: 100%;
    border-collapse: collapse;
    margin-top: 36px;
    font-size: 0.92rem;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--rule);
    font-variant-numeric: tabular-nums;
}

.data-table thead th {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--warm-grey);
    font-weight: 500;
    border-bottom: 1px solid var(--ink);
}

.data-table tbody tr:hover {
    background: var(--sidebar-bg);
}

.data-table td:first-child {
    font-family: var(--font-mono);
    color: var(--clay);
    letter-spacing: 0.06em;
    font-size: 0.86rem;
}

.tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 3px 10px;
    border: 1px solid var(--terracotta);
    color: var(--clay);
}

/* -----------------------  Process grid  ----------------------- */

.process-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: var(--column-gap);
    row-gap: 20px;
    border-top: 1px solid var(--rule);
    padding-top: 28px;
    margin-top: 12px;
}

.process-step {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 12px;
    border-right: 1px solid var(--rule);
}

.process-step:last-child {
    border-right: none;
}

.process-index {
    color: var(--swiss-red);
}

.process-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.8rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--ink);
    line-height: 1;
}

.process-step p {
    color: var(--warm-grey);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* -----------------------  Colophon  ----------------------- */

.colophon-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: var(--column-gap);
    row-gap: 32px;
    margin-top: 12px;
    border-top: 1px solid var(--rule);
    padding-top: 28px;
}

.colophon-block > .mono-label {
    margin-bottom: 10px;
    color: var(--swiss-red);
}

.colophon-block p {
    color: var(--ink);
    font-size: 0.98rem;
    line-height: 1.7;
    max-width: 56ch;
}

.swatch-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 20px;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink);
}

.swatch-list li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 1px solid var(--rule);
}

.page-foot {
    grid-column: 1 / -1;
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid var(--ink);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    color: var(--warm-grey);
}

/* -----------------------  Responsive  ----------------------- */

@media (max-width: 960px) {
    :root {
        --sidebar-w: 0px;
        --content-pad: 28px;
    }

    body {
        padding-left: 0;
        padding-top: 68px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--rule);
        z-index: 10;
    }

    .sidebar-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        min-height: 0;
        padding: 12px 20px;
        gap: 12px;
        flex-wrap: wrap;
    }

    .sidebar-header {
        margin-bottom: 0;
    }

    .brand-meta { display: none; }
    .sidebar-nav { display: none; }

    .sidebar-footer {
        border-top: none;
        padding-top: 0;
        margin-top: 0;
        flex-direction: row;
        gap: 16px;
    }

    .readout-row:nth-child(n+3) { display: none; }

    .content {
        max-width: 100vw;
        padding: 0 var(--content-pad);
    }

    .grid-overlay {
        left: var(--content-pad);
        right: var(--content-pad);
        grid-template-columns: repeat(3, 1fr);
    }
    .grid-overlay .col-line:nth-child(n+5) { display: none; }

    .section-title,
    .section-body,
    .section-aside,
    .hero-title,
    .hero-lede,
    .hero-label,
    .hero-date {
        grid-column: 1 / -1;
    }

    .hero-date { text-align: left; }

    .hero-datapanel { grid-template-columns: repeat(2, 1fr); }
    .systems-grid,
    .colophon-grid { grid-template-columns: 1fr; }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .process-grid { grid-template-columns: repeat(2, 1fr); }

    .process-step {
        border-right: none;
        border-bottom: 1px solid var(--rule);
        padding-bottom: 16px;
    }
}

@media (max-width: 560px) {
    .metrics-grid { grid-template-columns: 1fr; }
    .process-grid { grid-template-columns: 1fr; }
    .hero-datapanel { grid-template-columns: 1fr 1fr; }
    .swatch-list { grid-template-columns: 1fr; }
    .data-table { font-size: 0.82rem; }
    .data-table th, .data-table td { padding: 10px 8px; }
}
