/* =========================================================
   The Data Conspiracy
   Shared visual system
========================================================= */

:root {
    --page-background: #f5f6f4;
    --surface: #ffffff;
    --charcoal: #17232d;
    --yellow: #ffb20a;
    --yellow-dark: #dc9400;
    --text: #17232d;
    --muted-text: #66717a;
    --line: #d9dddf;
    --content-width: 1220px;

    /* Home hero viewport offsets (header + fixed footer). */
    --home-header-offset: 117px;
    --home-footer-offset: 72px;
}

/* Base */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;

    display: flex;
    flex-direction: column;

    background: var(--page-background);
    color: var(--text);

    font-family:
        "Arial Narrow",
        "Roboto Condensed",
        "Helvetica Neue",
        Arial,
        sans-serif;

    line-height: 1.6;
}

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

a {
    color: inherit;
}

a:focus-visible {
    outline: 2px solid var(--yellow);
    outline-offset: 4px;
}

/* Header */
.site-header {
    flex: none;

    background: var(--surface);
    border-top: 4px solid var(--yellow);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    width: min(var(--content-width), calc(100% - 48px));
    min-height: 112px;
    margin-inline: auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
}

.brand {
    width: min(280px, 28vw);

    display: block;
    text-decoration: none;
}

.brand img {
    width: 100%;
    height: auto;
}

/* Navigation */
.main-navigation {
    align-self: stretch;

    display: flex;
    align-items: stretch;

    border-left: 1px solid var(--line);
}

.main-navigation a {
    min-width: 105px;
    padding: 0 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-right: 1px solid var(--line);

    color: var(--charcoal);
    text-decoration: none;

    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;

    transition:
        background-color 150ms ease,
        color 150ms ease;
}

.main-navigation a:hover,
.main-navigation a:focus-visible {
    background: var(--charcoal);
    color: #ffffff;
    outline: none;
}

.main-navigation a.active {
    position: relative;
}

.main-navigation a.active::after {
    content: "";

    position: absolute;
    right: 20px;
    bottom: 25px;
    left: 20px;

    height: 3px;
    background: var(--yellow);
}

/* Home */
.home {
    flex: 1;
    padding-bottom: 72px;
}

.home-hero {
    width: 100%;
    min-height: max(320px, calc(100vh - var(--home-header-offset) - var(--home-footer-offset)));
    min-height: max(320px, calc(100svh - var(--home-header-offset) - var(--home-footer-offset)));
    min-height: max(320px, calc(100dvh - var(--home-header-offset) - var(--home-footer-offset)));

    display: grid;
    place-items: center;

    padding: clamp(24px, 6vh, 60px) 24px;

    background-color: #333f3f;
    background-image:
        linear-gradient(
            rgba(8, 14, 20, 0.30),
            rgba(8, 14, 20, 0.30)
        ),
        url("assets/BG-hexagon.webp");
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
}

.home-content {
    width: min(900px, 100%);
    text-align: center;
}

.home-payoff {
    margin: 0;

    color: rgba(255, 255, 255, 0.92);

    font-family:
        "IBM Plex Mono",
        "Roboto Mono",
        "Courier New",
        monospace;

    font-size: clamp(1.35rem, 2.8vw, 2.4rem);
    font-weight: 300;
    line-height: 1.35;
    letter-spacing: 0.015em;
}

.home-actions {
    margin-top: 46px;

    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
}

.home-button {
    min-width: 170px;
    min-height: 52px;
    padding: 0 26px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    border: 1px solid var(--charcoal);
    color: rgba(255, 255, 255, 0.92);
    border-color: rgba(255, 255, 255, 0.92);
    

    text-decoration: none;

    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;

    transition:
        background-color 150ms ease,
        color 150ms ease,
        border-color 150ms ease;
}

.home-button:hover,
.home-button:focus-visible {
    background: var(--yellow);
    border-color: var(--yellow);
    color: var(--charcoal);
}


/* ---------------------------------------------------------
    Software section
--------------------------------------------------------- */

.software-page {
    background: var(--surface);
}

.software-container {
    width: min(var(--content-width), calc(100% - 48px));
    margin-inline: auto;
    padding-block: 72px 96px;
}

.page-heading {
    margin-bottom: 52px;
}

.page-label {
    margin: 0;

    color: var(--yellow-dark);

    font-family:
        "IBM Plex Mono",
        "Courier New",
        monospace;

    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.software-list {
    border-top: 1px solid var(--line);
}

.software-item {
    min-height: 300px;

    display: grid;
    grid-template-columns: minmax(260px, 38%) minmax(0, 62%);

    border-bottom: 1px solid var(--line);
}

.software-image {
    display: grid;
    place-items: center;

    padding: 46px;

    background: transparent;
    border-right: 1px solid var(--line);
}

.software-image a {
    display: block;
    width: min(100%, 320px);
}

.software-image img {
    width: 100%;
    height: auto;

    transition:
        transform 160ms ease,
        opacity 160ms ease;
}

.software-image a:hover img,
.software-image a:focus-visible img {
    transform: scale(1.025);
    opacity: 0.88;
}

.software-description {
    padding: 48px 56px;
}

.software-description h3 {
    margin: 0;

    color: var(--charcoal);

    font-size: clamp(1.4rem, 2.2vw, 2rem);
    font-weight: 400;
    line-height: 1.1;
}

.software-description > p:not(.software-version):not(.software-contents-label) {
    max-width: 660px;

    margin: 24px 0 0;

    color: var(--muted-text);

    font-family:
        "IBM Plex Mono",
        "Courier New",
        monospace;

    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.8;
}

.software-link {
    display: inline-block;

    margin-top: 30px;
    padding-bottom: 4px;

    border-bottom: 1px solid var(--charcoal);

    color: var(--charcoal);
    text-decoration: none;

    font-family:
        "IBM Plex Mono",
        "Courier New",
        monospace;

    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.software-link::after {
    content: " →";
    color: var(--yellow-dark);
}

.software-link:hover,
.software-link:focus-visible {
    border-bottom-color: var(--yellow);
    color: var(--yellow-dark);
}

.software-version {
    margin: 10px 0 0;

    color: var(--yellow-dark);

    font-family:
        "IBM Plex Mono",
        "Courier New",
        monospace;

    font-size: 0.68rem;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.software-contents-label {
    margin: 28px 0 10px;

    color: var(--charcoal);

    font-family:
        "IBM Plex Mono",
        "Courier New",
        monospace;

    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.software-contents {
    margin: 0;
    padding-left: 20px;

    color: var(--muted-text);

    font-family:
        "IBM Plex Mono",
        "Courier New",
        monospace;

    font-size: 0.88rem;
    font-weight: 300;
    line-height: 1.9;
}

.software-contents li::marker {
    color: var(--yellow-dark);
}


/* ---------------------------------------------------------
    Software section — mobile
--------------------------------------------------------- */

@media (max-width: 760px) {
    .software-container {
        width: calc(100% - 24px);
        padding-block: 48px 70px;
    }

    .software-item {
        grid-template-columns: 1fr;
    }

    .software-image {
        min-height: 250px;

        padding: 36px;

        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .software-image a {
        width: min(100%, 260px);
    }

    .software-description {
        padding: 36px 24px 44px;
    }
}


/* Footer */

.site-footer {
    position: static;
    background: var(--page-background);
}

body[data-page="home"] .site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.footer-inner {
    width: min(var(--content-width), calc(100% - 48px));
    min-height: 72px;
    margin-inline: auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;

    color: var(--muted-text);

    font-family:
        "IBM Plex Mono",
        "Courier New",
        monospace;

    font-size: 0.72rem;
    font-weight: 300;
    letter-spacing: 0.04em;
}

.footer-inner p {
    margin: 0;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.footer-links a {
    color: var(--muted-text);
    text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible {
    color: var(--yellow-dark);
}

/* Tablet */
@media (max-width: 1050px) {
    :root {
        --home-header-offset: 182px;
    }

    .header-inner {
        flex-direction: column;
        align-items: stretch;

        gap: 0;
        padding-top: 18px;
    }

    .brand {
        width: min(280px, 85vw);
        margin-bottom: 16px;
    }

    .main-navigation {
        width: 100%;
        border-top: 1px solid var(--line);
    }

    .main-navigation a {
        flex: 1;
        min-width: 0;
        min-height: 58px;
    }
    
    .main-navigation a.active::after {
        bottom: 7px;
    }
}

/* Mobile */
@media (max-width: 720px) {
    :root {
        --home-header-offset: 214px;
        --home-footer-offset: 112px;
    }

    .header-inner,
    .footer-inner {
        width: calc(100% - 24px);
    }

    .brand {
        width: min(260px, 100%);
    }

    .main-navigation {
        overflow-x: auto;
    }

    .main-navigation a {
        flex: none;
        min-width: 125px;
    }

    .home-hero {
        padding: 22px 16px;
        background-position: center 24%;
    }

    .home {
        padding-bottom: calc(var(--home-footer-offset) + 26px);
    }

    .home-actions {
        margin-top: 24px;
    }

    .home-button {
        min-height: 46px;
    }

    .footer-inner {
        padding-block: 22px;

        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
}


/* ---------------------------------------------------------
   Publications page
--------------------------------------------------------- */

.publications-page {
    flex: 1;
    background: var(--surface);
}

.publications-container {
    width: min(var(--content-width), calc(100% - 48px));
    margin-inline: auto;
    padding-block: 72px 96px;
}

.publication-software {
    border-top: 0;
}

.publication-software-heading {
    display: flex;
    align-items: flex-end;
    gap: 20px;

    padding: 32px 0 12px;
    border-bottom: 1px solid var(--line);
}

.publication-group {
    padding: 12px 0 32px;
}

.publication-software-heading + .publication-group {
    padding-top: 0;
}

.publication-software-logo {
    width: 180px;
    height: auto;
    object-fit: contain;
    flex: none;
}

.publication-software-title {
    margin: 0;
    flex: 1;
    padding-bottom: 0;
    text-align: right;

    color: var(--charcoal);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.publication-group h3 {
    margin: 0;
    padding-bottom: 16px;
    text-align: right;

    border-bottom: 1px solid var(--line);

    color: var(--charcoal);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.publication-meta,
.publication-note {
    margin: 10px 0 0;

    color: var(--muted-text);

    font-family:
        "IBM Plex Mono",
        "Courier New",
        monospace;

    font-size: 0.82rem;
    font-weight: 300;
    line-height: 1.7;
}

.publication-year {
    color: var(--yellow-dark);

    font-family:
        "IBM Plex Mono",
        "Courier New",
        monospace;

    font-size: 0.78rem;
}

.publication-content h4 {
    max-width: 800px;
    margin: 0;

    color: var(--charcoal);

    font-size: 1rem;
    font-weight: 400;
    line-height: 1.45;
}

.publication-meta {
    margin-top: 7px;
    font-size: 0.78rem;
    line-height: 1.6;
}

.publication-meta a {
    color: var(--charcoal);
    text-decoration: none;
    border-bottom: 1px solid var(--charcoal);
}

.publication-meta a:hover,
.publication-meta a:focus-visible {
    color: var(--yellow-dark);
    border-bottom-color: var(--yellow);
}

.publication-note {
    margin-top: 8px;
}

.publication-title-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.publication-badge {
    flex: none;
    padding: 3px 7px;

    background: var(--yellow);
    color: var(--charcoal);

    font-family:
        "IBM Plex Mono",
        "Courier New",
        monospace;

    font-size: 0.62rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.publication-item {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);

    padding: 20px 16px;
    background: var(--page-background);

    border-bottom: 1px solid var(--line);
}

.publication-group {
    border-bottom: 0;
}


/* ---------------------------------------------------------
   Publications page — mobile
--------------------------------------------------------- */

@media (max-width: 760px) {
    .publication-software-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .publication-software-logo {
        width: clamp(120px, 45vw, 170px);
    }

    .publication-software-title {
        flex: none;
        width: 100%;
        text-align: right;
    }

    .publications-container {
        width: calc(100% - 24px);
        padding-block: 48px 90px;
    }

    .publication-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .publication-title-row {
        display: block;
    }

    .publication-badge {
        display: inline-block;
        margin-top: 10px;
    }
}


/* ---------------------------------------------------------
   About page
--------------------------------------------------------- */

.about-page {
    flex: 1;
    background: var(--surface);
}

.about-container {
    width: min(var(--content-width), calc(100% - 48px));
    margin-inline: auto;
    padding-block: 72px 96px;
}

.about-heading {
    margin-bottom: 46px;
}

.about-sections {
    border-top: 1px solid var(--line);
}

.about-section {
    display: grid;
    grid-template-columns: 28% 72%;

    border-bottom: 1px solid var(--line);
}

.about-section h2 {
    margin: 0;
    padding: 34px 32px 34px 18px;
    background: var(--page-background);

    color: var(--charcoal);

    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.about-content {
    padding: 32px 0 36px 42px;
    border-left: 1px solid var(--line);
}

.about-content p {
    max-width: 760px;
    margin: 0;

    color: var(--muted-text);

    font-family:
        "IBM Plex Mono",
        "Courier New",
        monospace;

    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.8;
}

.about-content p + p {
    margin-top: 18px;
}

.project-list {
    margin: 22px 0 0;
    padding-left: 20px;

    color: var(--charcoal);

    font-family:
        "IBM Plex Mono",
        "Courier New",
        monospace;

    font-size: 0.82rem;
    line-height: 1.9;
}

.project-list li::marker {
    color: var(--yellow-dark);
}

/* Mobile */
@media (max-width: 760px) {
    .about-container {
        width: calc(100% - 24px);
        padding-block: 48px 70px;
    }

    .about-section {
        grid-template-columns: 1fr;
    }

    .about-section h2 {
        padding: 26px 0 14px;
    }

    .about-content {
        padding: 0 0 32px;
        border-left: 0;
    }
}