/* ==========================================================================
   Brockmann-era Swiss Design + Cyberminimalism
   IBM Plex Sans | Black on White | Generous Whitespace
   ========================================================================== */

/* --------------------------------------------------------------------------
   Font Loading: IBM Plex Sans (Latin + Japanese)
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+JP:wght@400;500;700&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,700;1,400&display=swap');

/* --------------------------------------------------------------------------
   Design Tokens
   -------------------------------------------------------------------------- */
:root {
    /* Typography */
    --font-sans: 'IBM Plex Sans', 'IBM Plex Sans JP', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

    /* Sizing - based on 8px grid */
    --space-1: 0.5rem;
    /* 8px */
    --space-2: 1rem;
    /* 16px */
    --space-3: 1.5rem;
    /* 24px */
    --space-4: 2rem;
    /* 32px */
    --space-5: 3rem;
    /* 48px */
    --space-6: 4rem;
    /* 64px */
    --space-7: 6rem;
    /* 96px */

    /* Content measure */
    --measure: 65ch;

    /* Colors - poster style grey */
    --fg: #000;
    --bg: #ffffff;
    --fg-muted: #555;
    --border: #000;
}

/* --------------------------------------------------------------------------
   Base Reset & Typography
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 100%;
    /* 16px base */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg);
    min-height: 100vh;
    position: relative;
}

body {
    font-family: var(--font-sans);
    font-size: 1.125rem;
    /* 18px - comfortable reading */
    line-height: 1.7;
    color: var(--fg);
    background: transparent;

    /* Brockmann-era generous margins */
    padding: var(--space-6) var(--space-4);
    max-width: calc(var(--measure) + var(--space-6) * 2);
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Navigation - Cyberminimalism
   -------------------------------------------------------------------------- */
nav {
    margin-bottom: var(--space-6);
}

nav a {
    font-size: 3rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--fg);
    text-decoration: none;
}

nav a:hover {
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

/* --------------------------------------------------------------------------
   Article Header - Cyberminimalism + Brockmann Grid
   -------------------------------------------------------------------------- */
.poster-header {
    margin-bottom: var(--space-5);
}

.header-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    font-size: 0.875rem;
    line-height: 1.5;
    letter-spacing: 0.02em;
    margin: 0;
    padding: 0;
}

.meta-row {
    display: grid;
    grid-template-columns: 6em 1fr;
    gap: var(--space-2);
}

.header-stack dt {
    font-weight: 400;
}

.header-stack dd {
    margin: 0;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   Content Typography
   -------------------------------------------------------------------------- */
.content {
    max-width: var(--measure);
}

.content>*+* {
    margin-top: var(--space-3);
}

/* Headings - Bold hierarchy */
.content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-top: var(--space-6);
    margin-bottom: var(--space-2);
}

.content h2 {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin-top: var(--space-5);
    margin-bottom: var(--space-2);
}

.content h3 {
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.3;
    margin-top: var(--space-4);
    margin-bottom: var(--space-1);
}

.content h4,
.content h5,
.content h6 {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.4;
    margin-top: var(--space-3);
    margin-bottom: var(--space-1);
}

/* Paragraphs */
.content p {
    max-width: var(--measure);
}

/* Links */
.content a {
    color: var(--fg);
    text-decoration: underline;
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
}

.content a:hover {
    text-decoration-thickness: 2px;
}

/* Lists */
.content ul,
.content ol {
    padding-left: var(--space-3);
}

.content li {
    margin-top: var(--space-1);
}

.content li::marker {
    color: var(--fg-muted);
}

/* Blockquotes */
.content blockquote {
    border-left: 3px solid var(--fg);
    padding-left: var(--space-3);
    margin-left: 0;
    font-style: italic;
}

/* Horizontal rules */
.content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: var(--space-5) 0;
}

/* --------------------------------------------------------------------------
   Code - Constrained within column, horizontal scroll
   -------------------------------------------------------------------------- */
.content code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.1em 0.3em;
    border-radius: 2px;
}

.content pre {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.5;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border);
    padding: var(--space-2);
    overflow-x: auto;
    max-width: 100%;
}

.content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

/* --------------------------------------------------------------------------
   Images & Figures
   -------------------------------------------------------------------------- */
.content img {
    max-width: 100%;
    height: auto;
    display: block;
}

.content figure {
    margin: var(--space-4) 0;
}

.content figcaption {
    font-size: 0.875rem;
    color: var(--fg-muted);
    margin-top: var(--space-1);
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    margin: var(--space-3) 0;
}

.content th,
.content td {
    text-align: left;
    padding: var(--space-1) var(--space-2);
    border-bottom: 1px solid var(--border);
}

.content th {
    font-weight: 700;
    border-bottom-width: 2px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
footer {
    margin-top: var(--space-7);
    font-size: 0.875rem;
    color: var(--fg-muted);
}

/* --------------------------------------------------------------------------
   Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    body {
        font-size: 1rem;
        padding: var(--space-4) var(--space-2);
    }

    .content h1 {
        font-size: 1.75rem;
    }

    .content h2 {
        font-size: 1.5rem;
    }

    .content h3 {
        font-size: 1.25rem;
    }
}
