/* ==========================================================================
   Jean Claude Hirwa — portfolio
   Plain CSS, no framework. Tokens first, then layout, then sections.
   ========================================================================== */

:root {
    --bg: #f6f5f1;
    --surface: #ffffff;
    --surface-2: #efede7;
    --ink: #14171a;
    --ink-2: #474c54;
    --ink-3: #767c84;
    --rule: #e0ddd5;
    --accent: #0d6b5b;
    --accent-ink: #ffffff;
    --accent-soft: rgba(13, 107, 91, 0.08);
    --live: #1f9d55;
    --shadow: 0 1px 2px rgba(20, 23, 26, 0.04), 0 8px 24px rgba(20, 23, 26, 0.06);
    --canvas-ink: 20, 23, 26;
    --canvas-accent: 13, 107, 91;
    --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
    --wrap: 1120px;
    --gutter: 24px;
    --header-h: 64px;
    --radius: 10px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
     :root:not([data-theme="light"]) {
        --bg: #0c0e0f;
        --surface: #131618;
        --surface-2: #1a1e20;
        --ink: #ecebe7;
        --ink-2: #a8adb3;
        --ink-3: #737981;
        --rule: #24292c;
        --accent: #4fc6aa;
        --accent-ink: #06201a;
        --accent-soft: rgba(79, 198, 170, 0.1);
        --live: #3ddc84;
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
        --canvas-ink: 236, 235, 231;
        --canvas-accent: 79, 198, 170;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0c0e0f;
    --surface: #131618;
    --surface-2: #1a1e20;
    --ink: #ecebe7;
    --ink-2: #a8adb3;
    --ink-3: #737981;
    --rule: #24292c;
    --accent: #4fc6aa;
    --accent-ink: #06201a;
    --accent-soft: rgba(79, 198, 170, 0.1);
    --live: #3ddc84;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --canvas-ink: 236, 235, 231;
    --canvas-accent: 79, 198, 170;
    color-scheme: dark;
}


/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

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

a {
    color: inherit;
    text-decoration: none;
}

p {
    margin: 0 0 1em;
}

h1,
h2,
h3,
h4 {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.15;
    margin: 0;
}

::selection {
    background: var(--accent);
    color: var(--accent-ink);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

section[id] {
    scroll-margin-top: calc(var(--header-h) + 16px);
}

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.mono {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.link {
    color: var(--accent);
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.25s ease;
}

.link:hover {
    background-size: 100% 1px;
}

.icon {
    width: 1em;
    height: 1em;
    flex: none;
    display: inline-block;
    vertical-align: -0.125em;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--accent);
    color: var(--accent-ink);
    border-radius: 6px;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 12px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}


/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 20px;
    border-radius: 999px;
    border: 1px solid transparent;
    font: 500 0.92rem/1 var(--sans);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.btn .icon {
    font-size: 1.05em;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--ink);
    color: var(--bg);
}

.btn-primary:hover {
    background: var(--accent);
    color: var(--accent-ink);
}

.btn-ghost {
    border-color: var(--rule);
    color: var(--ink);
    background: transparent;
}

.btn-ghost:hover {
    border-color: var(--ink);
}

.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}


/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    height: var(--header-h);
    transition: background 0.3s ease, border-color 0.3s ease;
    border-bottom: 1px solid transparent;
}

.site-header.scrolled {
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
    border-bottom-color: var(--rule);
}

.site-header .wrap {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    font-family: var(--serif);
    font-size: 1.25rem;
    letter-spacing: -0.01em;
    margin-right: auto;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}

.brand-mark {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--ink-3);
}

.nav ul {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav a {
    display: block;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.88rem;
    color: var(--ink-2);
    transition: color 0.2s ease, background 0.2s ease;
}

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

.nav a.active {
    color: var(--ink);
    background: var(--surface-2);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid var(--rule);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font-size: 17px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.icon-btn:hover {
    border-color: var(--ink-3);
}

.theme-toggle .i-sun {
    display: none;
}

:root[data-theme="dark"] .theme-toggle .i-sun {
    display: inline-block;
}

:root[data-theme="dark"] .theme-toggle .i-moon {
    display: none;
}

@media (prefers-color-scheme: dark) {
     :root:not([data-theme="light"]) .theme-toggle .i-sun {
        display: inline-block;
    }
     :root:not([data-theme="light"]) .theme-toggle .i-moon {
        display: none;
    }
}

.menu-toggle {
    display: none;
}

.menu-toggle .i-close {
    display: none;
}

.nav-open .menu-toggle .i-close {
    display: inline-block;
}

.nav-open .menu-toggle .i-menu {
    display: none;
}

@media (max-width: 899px) {
    .menu-toggle {
        display: inline-grid;
    }
    .nav {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--rule);
        padding: 8px var(--gutter) 20px;
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    }
    .nav ul {
        flex-direction: column;
        gap: 0;
    }
    .nav a {
        padding: 14px 0;
        border-radius: 0;
        font-family: var(--serif);
        font-size: 1.35rem;
        color: var(--ink);
        border-bottom: 1px solid var(--rule);
    }
    .nav a.active {
        background: none;
        color: var(--accent);
    }
    .nav-open .nav {
        opacity: 1;
        transform: none;
        visibility: visible;
    }
    .nav-open.site-header {
        background: var(--bg);
        border-bottom-color: var(--rule);
    }
}


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

.hero {
    position: relative;
    padding: calc(var(--header-h) + 72px) 0 72px;
    overflow: hidden;
    isolation: isolate;
}

.hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    -webkit-mask-image: linear-gradient(100deg, transparent 18%, #000 62%);
    mask-image: linear-gradient(100deg, transparent 18%, #000 62%);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.8fr);
    gap: 64px;
    align-items: end;
}

.hero-kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 28px;
    color: var(--ink-3);
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 10px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-2);
    font-family: var(--sans);
    font-size: 0.8rem;
    letter-spacing: 0;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--live);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 55%, transparent);
    animation: pulse 2.2s infinite;
}

@keyframes pulse {
    70% {
        box-shadow: 0 0 0 8px transparent;
    }
    100% {
        box-shadow: 0 0 0 0 transparent;
    }
}

.hero h1 {
    font-size: clamp(2.9rem, 7.4vw, 5.9rem);
    line-height: 0.98;
    letter-spacing: -0.035em;
    margin-bottom: 28px;
}

.hero h1 em {
    font-style: italic;
    color: var(--ink-3);
}

.hero-lede {
    font-family: var(--serif);
    font-size: clamp(1.25rem, 2.1vw, 1.6rem);
    line-height: 1.4;
    color: var(--ink-2);
    max-width: 34ch;
    margin-bottom: 28px;
}

.hero-lede strong {
    font-weight: 400;
    color: var(--ink);
}

.hero-affil {
    list-style: none;
    padding: 0;
    margin: 0 0 36px;
    display: grid;
    gap: 6px;
    color: var(--ink-2);
    font-size: 0.92rem;
}

.hero-affil li {
    display: flex;
    gap: 12px;
    align-items: baseline;
}

.hero-affil .mono {
    color: var(--ink-3);
    width: 56px;
    flex: none;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
}

.social {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.social a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-2);
    font-size: 0.88rem;
    padding: 4px 0;
    transition: color 0.2s ease;
}

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

.portrait {
    margin: 0;
    position: relative;
}

.portrait-frame {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-2);
    aspect-ratio: 4 / 5;
    box-shadow: var(--shadow);
}

.portrait-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 18%;
}

.portrait::before {
    content: "";
    position: absolute;
    inset: 14px -14px -14px 14px;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    z-index: -1;
}

.portrait figcaption {
    margin-top: 26px;
    color: var(--ink-3);
    display: flex;
    justify-content: space-between;
}


/* At-a-glance strip */

.glance {
    margin-top: 80px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-top: 1px solid var(--rule);
}

.glance div {
    padding: 22px 20px 0 0;
}

.glance div+div {
    padding-left: 20px;
    border-left: 1px solid var(--rule);
}

.glance strong {
    display: block;
    font-family: var(--serif);
    font-weight: 400;
    font-size: 2rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.glance span {
    color: var(--ink-3);
    font-size: 0.85rem;
    line-height: 1.4;
    display: block;
    margin-top: 6px;
}

@media (max-width: 899px) {
    .hero {
        padding-top: calc(var(--header-h) + 40px);
    }
    .hero-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 48px;
    }
    .portrait {
        max-width: 340px;
        order: -1;
    }
    .portrait figcaption {
        display: none;
    }
    .hero-canvas {
        -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 55%);
        mask-image: linear-gradient(180deg, #000 0%, transparent 55%);
    }
    .glance {
        grid-template-columns: repeat(2, 1fr);
        margin-top: 56px;
    }
    .glance div:nth-child(3) {
        padding-left: 0;
        border-left: 0;
    }
    .glance div:nth-child(n + 3) {
        border-top: 1px solid var(--rule);
        margin-top: 22px;
    }
}

@media (max-width: 520px) {
    .portrait {
        max-width: 220px;
    }
    .portrait::before {
        inset: 10px -10px -10px 10px;
    }
    .glance strong {
        font-size: 1.6rem;
    }
}


/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section {
    padding: 96px 0;
    border-top: 1px solid var(--rule);
}

.section-grid {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 48px;
}

.section-head {
    align-self: start;
    position: sticky;
    top: calc(var(--header-h) + 32px);
}

.section-num {
    display: block;
    color: var(--accent);
    margin-bottom: 10px;
}

.section-head h2 {
    font-size: 2rem;
    letter-spacing: -0.02em;
}

.section-head p {
    margin: 12px 0 0;
    color: var(--ink-3);
    font-size: 0.88rem;
    line-height: 1.5;
}

.subhead {
    font-family: var(--mono);
    font-size: 0.74rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin: 0 0 20px;
    font-weight: 400;
}

@media (max-width: 899px) {
    .section {
        padding: 72px 0;
    }
    .section-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }
    .section-head {
        position: static;
    }
}


/* About */

.prose {
    font-family: var(--serif);
    font-size: 1.28rem;
    line-height: 1.6;
    color: var(--ink-2);
    max-width: 40em;
}

.prose strong {
    font-weight: 500;
    color: var(--ink);
}

.interests {
    margin-top: 56px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--rule);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    overflow: hidden;
}

.interest {
    background: var(--bg);
    padding: 28px;
    transition: background 0.25s ease;
}

.interest:hover {
    background: var(--surface);
}

.interest .mono {
    color: var(--accent);
}

.interest h3 {
    font-size: 1.4rem;
    margin: 10px 0 10px;
}

.interest p {
    margin: 0;
    color: var(--ink-2);
    font-size: 0.94rem;
}

@media (max-width: 640px) {
    .prose {
        font-size: 1.15rem;
    }
    .interests {
        grid-template-columns: 1fr;
    }
    .interest {
        padding: 22px;
    }
}


/* News */

.news {
    list-style: none;
    margin: 0;
    padding: 0;
}

.news li {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 24px;
    padding: 18px 0;
    border-bottom: 1px solid var(--rule);
}

.news li:first-child {
    padding-top: 0;
}

.news time {
    color: var(--ink-3);
    padding-top: 3px;
}

.news p {
    margin: 0;
    color: var(--ink-2);
}

.news p strong {
    color: var(--ink);
    font-weight: 500;
}

@media (max-width: 520px) {
    .news li {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}


/* Timeline (experience + education) */

.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tl-item {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 24px;
    padding: 0 0 44px;
}

.tl-item:last-child {
    padding-bottom: 0;
}

.tl-when {
    color: var(--ink-3);
    padding-top: 8px;
}

.tl-org {
    font-size: 1.6rem;
    margin-bottom: 4px;
}

.tl-org-meta {
    color: var(--ink-3);
    font-size: 0.88rem;
    margin: 0 0 16px;
}

.roles {
    list-style: none;
    margin: 0;
    padding: 0 0 0 22px;
    border-left: 1px solid var(--rule);
}

.role {
    position: relative;
    padding-bottom: 20px;
}

.role:last-child {
    padding-bottom: 0;
}

.role::before {
    content: "";
    position: absolute;
    left: -26px;
    top: 9px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--ink-3);
}

.role:first-child::before {
    background: var(--accent);
    border-color: var(--accent);
}

.role-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2px 16px;
    margin-bottom: 6px;
}

.role-title {
    font-weight: 500;
}

.role-date {
    color: var(--ink-3);
}

.role p {
    margin: 0;
    color: var(--ink-2);
    font-size: 0.95rem;
    max-width: 62ch;
}

.edu-desc {
    margin: 0;
    color: var(--ink-2);
    font-size: 0.95rem;
    max-width: 62ch;
}

.edu-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.chip {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--rule);
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--ink-2);
    white-space: nowrap;
}

@media (max-width: 520px) {
    .tl-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .tl-when {
        padding-top: 0;
    }
}


/* Projects */

.project-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter {
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--rule);
    background: transparent;
    color: var(--ink-2);
    font: 500 0.82rem/1 var(--sans);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter:hover {
    color: var(--ink);
    border-color: var(--ink-3);
}

.filter[aria-pressed="true"] {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg);
}

.search {
    position: relative;
    flex: 0 1 240px;
}

.search .icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-3);
    pointer-events: none;
}

.search input {
    width: 100%;
    height: 34px;
    padding: 0 12px 0 34px;
    border-radius: 999px;
    border: 1px solid var(--rule);
    background: transparent;
    color: var(--ink);
    font: 0.85rem var(--sans);
    outline: none;
    transition: border-color 0.2s ease;
}

.search input:focus {
    border-color: var(--accent);
}

.search input::placeholder {
    color: var(--ink-3);
}

.projects {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.project {
    display: flex;
    flex-direction: column;
    padding: 26px;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.project[hidden] {
    display: none;
}

@media (hover: hover) {
    .project:hover {
        border-color: color-mix(in srgb, var(--accent) 45%, var(--rule));
        transform: translateY(-3px);
        box-shadow: var(--shadow);
    }
}

.project-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--ink-3);
    margin-bottom: 18px;
}

.project h3 {
    font-size: 1.45rem;
    margin-bottom: 10px;
}

.project p {
    color: var(--ink-2);
    font-size: 0.94rem;
    margin-bottom: 20px;
}

.project-foot {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent);
}

.project-link .icon {
    transition: transform 0.2s ease;
}

.project-link:hover .icon {
    transform: translateX(3px);
}

.project.featured {
    grid-column: 1 / -1;
    background: radial-gradient(120% 140% at 100% 0%, var(--accent-soft), transparent 55%), var(--surface);
}

.project.featured h3 {
    font-size: 1.85rem;
}

.project.featured p {
    max-width: 62ch;
    font-size: 1rem;
}

.empty {
    color: var(--ink-3);
    padding: 24px 0;
}

.section-note {
    margin: 24px 0 0;
    color: var(--ink-3);
    font-size: 0.88rem;
}

@media (max-width: 720px) {
    .projects {
        grid-template-columns: 1fr;
    }
    .search {
        flex-basis: 100%;
    }
    .project {
        padding: 22px;
    }
}


/* Toolkit */

.toolkit {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 48px;
    margin: 0;
}

.toolkit>div {
    padding: 20px 0;
    border-bottom: 1px solid var(--rule);
}

.toolkit dt {
    font-family: var(--mono);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: 8px;
}

.toolkit dd {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.15rem;
    line-height: 1.5;
    color: var(--ink);
}

@media (max-width: 720px) {
    .toolkit {
        grid-template-columns: 1fr;
    }
}


/* Writing */

.posts {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--rule);
}

.post a {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) 112px;
    gap: 24px;
    align-items: start;
    padding: 24px 0;
    border-bottom: 1px solid var(--rule);
}

.post time {
    color: var(--ink-3);
    padding-top: 6px;
}

.post h3 {
    font-size: 1.35rem;
    margin-bottom: 6px;
    transition: color 0.2s ease;
}

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

.post p {
    margin: 0;
    color: var(--ink-2);
    font-size: 0.92rem;
}

.post img {
    width: 112px;
    height: 76px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--surface-2);
}

.posts-status {
    color: var(--ink-3);
    padding: 24px 0;
    margin: 0;
}

.skeleton {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--surface-2), var(--rule), var(--surface-2));
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

@media (max-width: 640px) {
    .post a {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .post img {
        display: none;
    }
    .post time {
        padding-top: 0;
    }
}


/* Contact */

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 56px;
}

.contact-lede {
    font-family: var(--serif);
    font-size: clamp(2rem, 4vw, 2.9rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 18px;
}

.contact-intro p {
    color: var(--ink-2);
}

.email-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 28px 0 22px;
}

.email-big {
    font-family: var(--serif);
    font-size: 1.4rem;
    color: var(--accent);
    border-bottom: 1px solid currentColor;
    overflow-wrap: anywhere;
}

.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
    color: var(--ink-2);
    font-size: 0.92rem;
}

.contact-list li {
    display: flex;
    gap: 14px;
}

.contact-list .mono {
    color: var(--ink-3);
    width: 76px;
    flex: none;
    padding-top: 2px;
}

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

.form {
    display: grid;
    gap: 14px;
    padding: 28px;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--surface);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.field label {
    display: block;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: 6px;
}

.field input,
.field textarea {
    width: 100%;
    padding: 11px 14px;
    border-radius: 8px;
    border: 1px solid var(--rule);
    background: var(--bg);
    color: var(--ink);
    font: 0.95rem/1.5 var(--sans);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
    resize: vertical;
    min-height: 140px;
}

.field input:focus,
.field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.form-status {
    margin: 0;
    font-size: 0.88rem;
}

.form-status.success {
    color: var(--live);
}

.form-status.error {
    color: #d6453d;
}

@media (max-width: 899px) {
    .contact-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }
}

@media (max-width: 520px) {
    .form {
        padding: 20px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}


/* Footer */

.site-footer {
    border-top: 1px solid var(--rule);
    padding: 32px 0 40px;
    color: var(--ink-3);
    font-size: 0.85rem;
}

.site-footer .wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 24px;
}

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


/* Back to top */

.to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 40;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--ink);
    color: var(--bg);
    font-size: 18px;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
}

.to-top.show {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.to-top:hover {
    background: var(--accent);
    color: var(--accent-ink);
}


/* Reveal on scroll (only when JS is running) */

.js .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .reveal.in {
    opacity: 1;
    transform: none;
}

.hero .rise {
    animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero .rise:nth-child(2) {
    animation-delay: 0.06s;
}

.hero .rise:nth-child(3) {
    animation-delay: 0.12s;
}

.hero .rise:nth-child(4) {
    animation-delay: 0.18s;
}

.hero .rise:nth-child(5) {
    animation-delay: 0.24s;
}

.hero .rise:nth-child(6) {
    animation-delay: 0.3s;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .js .reveal {
        opacity: 1;
        transform: none;
    }
}

@media print {
    .site-header,
    .hero-canvas,
    .to-top,
    .form,
    .project-tools {
        display: none !important;
    }
    .section {
        padding: 24px 0;
    }
    .section-head {
        position: static;
    }
}