/* Layout, typography, components, responsive */

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

/* Base */
html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Newsreader', 'Newsreader Fallback', Georgia, serif;
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--ink);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: var(--ink);
    color: var(--bg);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.875rem;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: var(--space-xs);
}

/* Layout */
.page {
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.content {
    max-width: var(--content-max);
    margin: 0 auto;
}

/* Navigation */
.site-nav {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.9375rem;
    line-height: 1;
    letter-spacing: 0.02em;
}

.site-nav a {
    color: var(--ink);
    text-decoration: none;
}

.site-nav a:hover {
    color: var(--accent);
}

.nav-home {
    font-weight: 500;
    padding: 0.5rem 0;
    display: inline-block;
}

.nav-links {
    display: flex;
    gap: var(--space-md);
    list-style: none;
}

.nav-links a {
    color: var(--ink-light);
    padding: 0.5rem 0;
    display: inline-block;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links .current {
    color: var(--ink);
}

/* Typography */
h1 {
    font-family: 'Newsreader', 'Newsreader Fallback', Georgia, serif;
    font-size: 2.25rem;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-bottom: var(--space-sm);
}

h2 {
    font-family: 'Newsreader', 'Newsreader Fallback', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--ink);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
}

h3 {
    font-family: 'Newsreader', 'Newsreader Fallback', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--ink);
    margin-top: var(--space-md);
    margin-bottom: var(--space-xs);
}

p {
    margin-bottom: var(--space-sm);
    text-wrap: pretty;
}

h1,
h2,
h3,
.descriptor,
blockquote p {
    text-wrap: balance;
}

/* Links */
a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

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

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

/* Subtitle */
.subtitle {
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--ink-light);
    margin-bottom: var(--space-sm);
}

/* Metadata line */
.meta {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    letter-spacing: 0.01em;
    color: var(--ink-light);
}

/* Blockquote (Ordinary Test) */
blockquote {
    border-left: 4px solid var(--accent);
    padding-left: var(--space-md);
    margin: var(--space-md) 0;
    font-size: 1.375rem;
    line-height: 1.7;
}

/* Shorthand (italic) */
.shorthand {
    font-style: italic;
    margin-top: var(--space-sm);
    margin-bottom: var(--space-md);
}

/* Conceptual arrival sentence (e.g. "That pattern is the Selection Mirage.") */
.concept-arrival {
    font-style: italic;
    font-size: 1.25rem;
    margin-top: var(--space-sm);
}

/* Boundary conditions */
.boundary-conditions {
    list-style: decimal;
    padding-left: var(--space-md);
    color: var(--ink);
}

.boundary-conditions li {
    margin-bottom: var(--space-sm);
}

/* Section divider */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: var(--space-lg) 0;
}

/* Citation block */
.citation {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg-subtle);
    padding: var(--space-sm);
    border-radius: 2px;
}

/* Citation meta (below citation block) */
.citation-meta {
    margin-top: var(--space-sm);
}

/* Work items (homepage) */
.work-list {
    margin-top: var(--space-md);
}

.work-item {
    margin-bottom: var(--space-md);
}

.work-item h3 {
    margin-top: 0;
    margin-bottom: var(--space-xs);
}

.work-item p {
    margin-bottom: var(--space-xs);
}

.work-item a {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.875rem;
    display: inline-block;
    padding: 0.25rem 0;
}

/* Product sub-entry inside a work item (Dokim under KRINO Systems) */
.work-sub {
    margin-top: var(--space-sm);
    padding-left: var(--space-sm);
    border-left: 1px solid var(--border);
}

/* Education list */
.education-list {
    list-style: none;
    font-size: 1rem;
    line-height: 1.75;
}

/* Current work list (about page and 404) */
.current-work-list {
    list-style: none;
    line-height: 2.25;
}

/* Descriptor line (appears on homepage hero and About page) */
.descriptor {
    font-family: 'Newsreader', 'Newsreader Fallback', Georgia, serif;
    font-size: 1.125rem;
    color: var(--ink-light);
    font-style: italic;
}

/* Homepage hero */
.hero {
    text-align: center;
    padding: var(--space-xl) 0 var(--space-lg);
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: var(--space-sm);
}

.hero .descriptor {
    font-size: 1.375rem;
}

/* Footer */
.site-footer {
    max-width: var(--content-max);
    margin: var(--space-md) auto 0;
    padding: var(--space-md) 0 var(--space-md);
    text-align: center;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.875rem;
    color: var(--ink-light);
    border-top: 1px solid var(--border);
}

.site-footer a {
    color: var(--ink-light);
    display: inline-block;
    padding: 0.25rem 0;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.site-footer a:hover {
    color: var(--accent);
}

/* Main content spacing */
main {
    padding: var(--space-lg) 0;
}

/* Responsive */
@media (max-width: 768px) {
    .page {
        padding: 0 var(--space-sm);
    }

    h1 {
        font-size: 1.75rem;
    }

    .hero h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    /* Keep h3 (weight 600) below h2 (weight 500) when h2 shrinks to 20px */
    h3 {
        font-size: 1.125rem;
    }

    .hero {
        padding: var(--space-lg) 0 var(--space-md);
    }

    blockquote {
        padding-left: var(--space-sm);
    }
}

@media (max-width: 480px) {
    body {
        font-size: 1.0625rem;
    }

    .site-nav {
        flex-direction: column;
        gap: var(--space-xs);
        align-items: flex-start;
    }

    .nav-links {
        gap: var(--space-sm);
    }

    h1 {
        font-size: 1.5rem;
    }

    .hero {
        padding: var(--space-md) 0 var(--space-sm);
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    blockquote {
        font-size: 1.1875rem;
    }

    .citation {
        padding: var(--space-xs);
        font-size: 0.8125rem;
    }

    /* P5, phones only (LATIM-SITE_mobile-polish.md M1): section breaks 129px to 65px; page tops unchanged */
    .divider {
        margin: var(--space-md) 0;
    }

    h2 {
        margin-top: var(--space-md);
    }

    main {
        padding-bottom: var(--space-md);
    }
}

/* Framework figure: "The Missing Comparison" (DESIGN_DECISIONS.md D17). Static, no script, colors from tokens. */
.mirage-figure { margin: 0; }
.fig-panel { margin-bottom: var(--space-xs); }
.fig-label { font-family: 'Inter', system-ui, sans-serif; font-size: 0.875rem; color: var(--ink); margin-bottom: 0.25rem; }
.fig-num { display: inline-block; min-width: 1.25em; color: var(--accent); font-weight: 500; }
.fig-sub { color: var(--ink-light); margin-left: 0.5em; }
.fig-svg { display: block; width: 100%; max-width: 400px; height: auto; border-top: 1px solid var(--border); }
.fig-dot { fill: var(--ink); }
.fig-dot-out { fill: none; stroke: var(--ink-light); stroke-width: 1.25; }
.fig-bar { stroke: var(--accent); stroke-width: 2; }
.fig-bar-label { font-family: 'Inter', system-ui, sans-serif; font-size: 19px; fill: var(--accent); }
.fig-avg { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 3; }
.fig-avg-label { font-family: 'Inter', system-ui, sans-serif; font-size: 19px; fill: var(--accent); }
.fig-row { font-family: 'Newsreader', 'Newsreader Fallback', Georgia, serif; font-size: 22px; font-weight: 500; fill: var(--ink); }
.fig-axis { stroke: var(--ink-light); stroke-width: 1; }
.fig-axis-label { font-family: 'Inter', system-ui, sans-serif; font-size: 19px; fill: var(--ink-light); }
.fig-takeaway { font-style: italic; margin-top: var(--space-xs); }
.mirage-figure figcaption { font-family: 'Inter', system-ui, sans-serif; font-size: 0.8125rem; line-height: 1.6; color: var(--ink-light); margin-top: var(--space-xs); }
@media (max-width: 480px) {
    .fig-sub { display: block; margin-left: 1.25em; }
}
