@import url("https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&family=Space+Grotesk:wght@500;700&display=swap");

:root {
    --bg: #f7f3e9;
    --surface: #fffdf7;
    --ink: #0f0f0f;
    --muted: #5d584f;
    --line: #0f0f0f;
    --accent: #fff200;
    --accent-ink: #0f0f0f;
}

body.dark {
    --bg: #0f0f0f;
    --surface: #181818;
    --ink: #f2eee3;
    --muted: #c4bca9;
    --line: #f2eee3;
    --accent: #fff200;
    --accent-ink: #0f0f0f;
}

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

body {
    background: var(--bg);
    color: var(--ink);
    font-family: "Libre Baskerville", Georgia, serif;
    line-height: 1.45;
    transition: background 0.25s ease, color 0.25s ease;
    opacity: 0;
    transform: translateY(10px);
}

body.page-ready {
    opacity: 1;
    transform: translateY(0);
    transition:
        background 0.25s ease,
        color 0.25s ease,
        opacity 0.32s ease,
        transform 0.32s ease;
}

body.page-exit {
    opacity: 0;
    transform: translateY(12px);
}

.masthead {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
    border-bottom: 3px solid var(--line);
    padding: 16px 28px;
    background: var(--surface);
}

.brand-block {
    background: var(--accent);
    color: var(--accent-ink);
    padding: 10px 16px;
    border: 2px solid var(--line);
    box-shadow: 0 0 0 rgba(255, 242, 0, 0);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.home-link {
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
}

.home-link:hover {
    transform: translate(-1px, -1px);
}

.home-link:hover .brand-block,
.home-link:focus-visible .brand-block {
    box-shadow: 0 0 0 3px rgba(255, 242, 0, 0.35), 0 0 22px rgba(255, 242, 0, 0.6);
}

.home-link:focus-visible {
    outline: none;
}

.eyebrow {
    font-family: "Space Grotesk", Arial, sans-serif;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.brand-block h1 {
    font-family: "Space Grotesk", Arial, sans-serif;
    font-size: 26px;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.section-nav {
    display: flex;
    gap: 18px;
}

.section-nav a {
    color: var(--ink);
    text-decoration: none;
    font-family: "Space Grotesk", Arial, sans-serif;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-nav a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.top-bar {
    display: flex;
    gap: 10px;
}

.dark-toggle,
.menu-toggle {
    width: 42px;
    height: 40px;
    border: 2px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font-size: 18px;
    cursor: pointer;
}

.menu-toggle {
    display: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 26px 28px 36px;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 26px;
}

.sidebar {
    display: grid;
    gap: 12px;
    align-self: start;
    position: sticky;
    top: 16px;
}

.profile {
    text-align: left;
    background: var(--surface);
    border: 3px solid var(--line);
    padding: 22px;
}

.profile-img {
    width: 96px;
    border-radius: 2px;
    border: 2px solid var(--line);
    margin-bottom: 12px;
}

.profile h2 {
    font-family: "Space Grotesk", Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.profile p {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.tools-box {
    border: 3px solid var(--line);
    background: var(--surface);
    padding: 12px;
}

.tools-title {
    font-family: "Space Grotesk", Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 11px;
    margin-bottom: 8px;
    color: var(--muted);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
}

.tool-filter {
    --tool-color: var(--ink);
    border: 2px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    padding: 6px 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 56px;
    box-shadow: 3px 3px 0 var(--line);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.tool-filter.active {
    background: var(--accent);
    color: var(--accent-ink);
}

.tool-icon {
    width: 17px;
    height: 17px;
    display: block;
    color: var(--tool-color);
}

.tool-name {
    display: block;
    font-family: "Space Grotesk", Arial, sans-serif;
    text-transform: uppercase;
    font-size: 9px;
    letter-spacing: 0.05em;
    line-height: 1;
}

.tool-filter:hover {
    background: var(--accent);
    color: var(--accent-ink);
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--line);
}

.tool-all {
    --tool-color: #111111;
}

.tool-python {
    --tool-color: #3776ab;
}

.tool-sql {
    --tool-color: #0f766e;
}

.tool-spark {
    --tool-color: #e25a1c;
}

.tool-azure {
    --tool-color: #0078d4;
}

.tool-llm {
    --tool-color: #b45309;
}

.media-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: 168px;
    margin-bottom: 14px;
}

.media-link {
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 2px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    box-shadow: 3px 3px 0 var(--line);
    padding: 0;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.media-link:hover {
    background: var(--accent);
    color: var(--accent-ink);
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--line);
}

.media-icon {
    width: 15px;
    height: 15px;
    display: block;
}

.resume-btn {
    display: inline-block;
    text-decoration: none;
    font-family: "Space Grotesk", Arial, sans-serif;
    color: var(--accent-ink);
    background: var(--accent);
    border: 2px solid var(--line);
    padding: 8px 12px;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.06em;
}

.content {
    min-width: 0;
}

.lead-story {
    border-top: 4px solid var(--line);
    border-bottom: 2px solid var(--line);
    padding: 14px 0 18px;
    margin-bottom: 20px;
}

.kicker {
    font-family: "Space Grotesk", Arial, sans-serif;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
}

.lead-story h2 {
    font-size: clamp(26px, 4vw, 42px);
    line-height: 1.1;
    max-width: 900px;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.filter {
    border: 2px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    padding: 7px 12px;
    font-family: "Space Grotesk", Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 12px;
    cursor: pointer;
}

.filter.active {
    background: var(--accent);
    color: var(--accent-ink);
}

.project-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.project-card {
    border: 3px solid var(--line);
    background: var(--surface);
    padding: 14px;
    min-height: 185px;
    box-shadow: 6px 6px 0 var(--line);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0 var(--line);
}

.card-tag {
    display: inline-block;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    padding: 2px 7px;
    font-family: "Space Grotesk", Arial, sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.project-card a {
    display: block;
    color: var(--ink);
    text-decoration: none;
    font-family: "Space Grotesk", Arial, sans-serif;
    font-size: 26px;
    line-height: 1.05;
    margin-bottom: 10px;
}

.card-desc {
    color: var(--muted);
    font-size: 14px;
}

.container.single-column {
    max-width: 920px;
    grid-template-columns: 1fr;
}

.topic-intro {
    border-top: 4px solid var(--line);
    border-bottom: 2px solid var(--line);
    padding: 12px 0 16px;
    margin-bottom: 18px;
}

.topic-intro h2 {
    font-size: clamp(24px, 3.5vw, 36px);
    line-height: 1.12;
}

.story-page {
    background: var(--surface);
    border: 3px solid var(--line);
    box-shadow: 7px 7px 0 var(--line);
    padding: 20px 22px;
}

.back-link {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--ink);
    text-decoration: none;
    font-family: "Space Grotesk", Arial, sans-serif;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.08em;
}

.story-header .card-tag {
    margin-bottom: 10px;
}

.story-header h2 {
    font-family: "Space Grotesk", Arial, sans-serif;
    font-size: clamp(28px, 4.2vw, 46px);
    line-height: 1.03;
    margin-bottom: 10px;
}

.story-meta {
    color: var(--muted);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
    margin-bottom: 16px;
    font-size: 14px;
}

.story-content p {
    margin-bottom: 14px;
}

.story-content h3 {
    font-family: "Space Grotesk", Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 18px;
    margin: 20px 0 8px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 10px 0 6px;
}

.metric-card {
    border: 2px solid var(--line);
    background: var(--surface);
    padding: 10px;
}

.metric-value {
    display: block;
    font-family: "Space Grotesk", Arial, sans-serif;
    font-size: 24px;
    line-height: 1;
    margin-bottom: 6px;
}

.metric-label {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.case-figure {
    margin: 12px 0 10px;
    border: 2px solid var(--line);
    background: var(--surface);
    padding: 8px;
}

.case-figure img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--line);
}

.case-figure figcaption {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 920px) {
    .masthead {
        grid-template-columns: 1fr auto;
    }

    .section-nav {
        display: none;
    }

    .menu-toggle {
        display: inline-block;
    }

    .container {
        grid-template-columns: 1fr;
        padding: 20px 16px 26px;
    }

    .sidebar {
        position: fixed;
        left: -330px;
        top: 72px;
        bottom: 16px;
        width: min(300px, calc(100vw - 32px));
        overflow: auto;
        z-index: 1000;
        transition: left 0.25s ease;
    }

    .sidebar.active {
        left: 16px;
    }

    .project-list {
        grid-template-columns: 1fr;
    }

    .story-page {
        padding: 16px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    body,
    body.page-ready,
    body.page-exit {
        transition: none;
        transform: none;
        opacity: 1;
    }
}
