/* ---------- Tokens ---------- */

:root {
    --bg: #fbfaf8;
    --surface: #ffffff;
    --ink: #1b1a18;
    --muted: #5c5852;
    --faint: #8a857d;
    --line: #e4e0d9;
    --accent: #c0520c;
    --accent-ink: #ffffff;
    --highlight: #f28c28;
    --selection: rgba(242, 140, 40, 0.3);
    --tag-bg: #f4f1ec;
    --icon-bg: transparent;

    --scene-sky: #fdf1e3;
    --scene-hill: #d9e7c9;
    --scene-grass: #a7c98c;
    --scene-tree: #6e9f58;
    --scene-tree-2: #4f8543;
    --scene-trunk: #8b5e3c;
    --scene-water: #a9d3e7;
    --scene-water-line: #eaf6fc;
    --scene-rod: #3a2f28;

    --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

    --max: 60rem;
    --gutter: 1.25rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #141311;
        --surface: #1c1b18;
        --ink: #ece8e1;
        --muted: #aaa49a;
        --faint: #7d786f;
        --line: #2e2c28;
        --accent: #f5a05a;
        --accent-ink: #141311;
        --highlight: #f28c28;
        --selection: rgba(242, 140, 40, 0.35);
        --tag-bg: #22211d;
        --icon-bg: #efece6;

        --scene-sky: #24201b;
        --scene-hill: #2e3827;
        --scene-grass: #3c4c31;
        --scene-tree: #5b8a4b;
        --scene-tree-2: #44703b;
        --scene-trunk: #6e4a30;
        --scene-water: #2e4b5b;
        --scene-water-line: #6d93a8;
        --scene-rod: #c9a878;
    }
}

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

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

* {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 4.5rem;
    caret-color: var(--highlight);
    accent-color: var(--highlight);
}

@media (pointer: fine) {
    html {
        cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Cpath d='M3 2l14.5 8.6-6.3 1.4 3.7 6.9-2.5 1.3-3.7-6.9L3.9 18z' fill='%23f28c28' stroke='%231b1a18' stroke-width='1.3' stroke-linejoin='round'/%3E%3C/svg%3E") 3 2, auto;
    }
}

body {
    font-family: var(--sans);
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: inherit;
    text-decoration-color: var(--line);
    text-underline-offset: 0.2em;
    transition: color 150ms ease, text-decoration-color 150ms ease;
}

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

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

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--highlight);
    outline-offset: 3px;
    border-radius: 2px;
}

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

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

/* ---------- Icons ---------- */

.ui {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    vertical-align: -0.125em;
}

.ti {
    width: 0.95rem;
    height: 0.95rem;
    flex-shrink: 0;
    border-radius: 3px;
    background: var(--icon-bg);
    padding: 1px;
}

.ext {
    width: 0.8em;
    height: 0.8em;
    margin-left: 0.3rem;
    color: var(--faint);
    vertical-align: 0;
    transition: color 150ms ease;
}

a:hover .ext {
    color: var(--highlight);
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3.5rem;
}

.logo {
    font-weight: 600;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.site-nav {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
}

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

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

.site-nav a.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.35rem;
    height: 2px;
    border-radius: 2px;
    background: var(--highlight);
}

.site-nav .nav-resume {
    color: var(--accent);
    font-weight: 500;
}

.menu-toggle {
    display: none;
    background: none;
    border: 0;
    width: 2.25rem;
    height: 2.25rem;
    cursor: pointer;
    position: relative;
}

.menu-toggle .bar {
    position: absolute;
    left: 0.4rem;
    right: 0.4rem;
    height: 2px;
    background: var(--ink);
    transition: transform 200ms ease;
}

.menu-toggle .bar:nth-of-type(2) { top: 0.8rem; }
.menu-toggle .bar:nth-of-type(3) { top: 1.3rem; }

.menu-toggle[aria-expanded="true"] .bar:nth-of-type(2) {
    transform: translateY(0.25rem) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .bar:nth-of-type(3) {
    transform: translateY(-0.25rem) rotate(-45deg);
}

/* ---------- Intro ---------- */

.intro {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 2.5rem;
    padding-block: 2.5rem 2rem;
}

.intro-main {
    min-width: 0;
}

.intro .scene {
    width: 19rem;
}

.scene-figure {
    width: 19rem;
}

.scene-figure figcaption {
    margin-top: 0.5rem;
    text-wrap: balance;
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
}

.intro-top {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    margin-bottom: 1rem;
}

.intro-photo {
    width: 4.75rem;
    height: 4.75rem;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 1px var(--line);
}

h1 {
    font-size: clamp(1.9rem, 4vw, 2.5rem);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.eyebrow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.3rem;
    font-size: 0.925rem;
    color: var(--muted);
}

.eyebrow .ui {
    color: var(--highlight);
}

.dot {
    color: var(--faint);
}

.lede {
    max-width: 44rem;
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: 1.25rem;
}

.intro-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
}

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
}

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

.btn:hover .ui {
    color: var(--highlight);
}

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

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

.btn-primary:hover .ui {
    color: inherit;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--highlight);
    box-shadow: 0 0 0 3px var(--selection);
}

/* ---------- Fishing scene ---------- */

.scene {
    display: block;
    width: 100%;
    max-width: 20rem;
    height: auto;
    border-radius: 14px;
    box-shadow: 0 0 0 1px var(--line);
}

.s-sky { fill: var(--scene-sky); }
.s-hill { fill: var(--scene-hill); }
.s-grass { fill: var(--scene-grass); }
.s-tree { fill: var(--scene-tree); }
.s-tree-2 { fill: var(--scene-tree-2); }
.s-trunk { fill: var(--scene-trunk); }
.s-water { fill: var(--scene-water); }

.s-sun circle { fill: var(--highlight); }

.s-rays {
    stroke: var(--highlight);
    stroke-width: 3;
    stroke-linecap: round;
    transform-box: fill-box;
    transform-origin: center;
    animation: s-spin 40s linear infinite;
}

.s-bird {
    fill: none;
    stroke: var(--faint);
    stroke-width: 1.3;
    stroke-linecap: round;
}

.s-water-line {
    stroke: var(--scene-water-line);
    stroke-width: 1.5;
    stroke-linecap: round;
}

.s-reed,
.s-tuft {
    fill: none;
    stroke: var(--scene-tree-2);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.s-cattail { fill: var(--scene-trunk); }

.s-rod {
    fill: none;
    stroke: var(--scene-rod);
    stroke-width: 2.2;
    stroke-linecap: round;
}

.s-line {
    fill: none;
    stroke: var(--ink);
    stroke-width: 0.7;
    opacity: 0.45;
}

.s-bobber {
    animation: s-bob 2.6s ease-in-out infinite;
}

.s-ripple {
    fill: none;
    stroke: var(--scene-water-line);
    stroke-width: 1.2;
    transform-box: fill-box;
    transform-origin: center;
    animation: s-ripple 2.6s ease-out infinite;
}

.s-ripple-2 {
    animation-delay: 1.3s;
}

.s-bass-body { fill: #6b8e3d; }
.s-bass-fin { fill: #4d6b2b; }
.s-bass-belly { fill: #dfe8bf; }

.s-bass-stripe {
    fill: none;
    stroke: #33481d;
    stroke-width: 1.6;
    stroke-dasharray: 3 1.4;
    opacity: 0.7;
}

.s-bass-mouth {
    stroke: #33481d;
    stroke-width: 0.9;
    stroke-linecap: round;
}

.s-bass {
    transform: translate(-8px, 30px);
    animation: s-jump 9s ease-in-out infinite;
}

.s-splash ellipse {
    fill: none;
    stroke: var(--scene-water-line);
    stroke-width: 1.4;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: s-splash 9s ease-out infinite;
}

.s-splash-2 ellipse {
    animation-name: s-splash-2;
}

@keyframes s-spin {
    to { transform: rotate(360deg); }
}

@keyframes s-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(1.6px); }
}

@keyframes s-ripple {
    0% { transform: scale(0.4); opacity: 0.9; }
    100% { transform: scale(1.6); opacity: 0; }
}

@keyframes s-jump {
    0%, 62% { transform: translate(-8px, 30px) rotate(-50deg); }
    68% { transform: translate(-5px, -22px) rotate(-40deg); }
    75% { transform: translate(3px, -44px) rotate(0deg); }
    82% { transform: translate(12px, -22px) rotate(40deg); }
    88%, 100% { transform: translate(16px, 30px) rotate(55deg); }
}

@keyframes s-splash {
    0%, 64% { transform: scale(0.3); opacity: 0; }
    66% { transform: scale(0.5); opacity: 1; }
    76% { transform: scale(1.8); opacity: 0; }
    100% { opacity: 0; }
}

@keyframes s-splash-2 {
    0%, 84% { transform: scale(0.3); opacity: 0; }
    86% { transform: scale(0.5); opacity: 1; }
    96% { transform: scale(1.8); opacity: 0; }
    100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .s-rays,
    .s-bobber,
    .s-ripple,
    .s-splash ellipse {
        animation: none;
    }

    .s-bass {
        animation: none;
        transform: translate(3px, -44px);
    }
}

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

.section {
    display: grid;
    grid-template-columns: 8.5rem 1fr;
    gap: 1.5rem;
    padding-block: 1.75rem;
    border-top: 1px solid var(--line);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    align-self: start;
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--faint);
    padding-top: 0.2rem;
}

.section-title .ui {
    width: 0.95rem;
    height: 0.95rem;
    color: var(--highlight);
}

.section-body {
    min-width: 0;
}

/* ---------- Entries ---------- */

.entry + .entry {
    margin-top: 1.25rem;
}

.entry-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.25rem 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.3rem;
}

.entry h3,
.mini h3 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.entry h3 a,
.mini h3 a {
    text-decoration: none;
}

.at {
    font-weight: 400;
    color: var(--muted);
}

.entry-date {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--faint);
    white-space: nowrap;
}

.award {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.05rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--accent);
    background: var(--selection);
    border-radius: 999px;
    vertical-align: 0.1rem;
}

.entry-text {
    color: var(--muted);
}

.bullets {
    padding-left: 1rem;
    color: var(--muted);
}

.entry-text + .bullets {
    margin-top: 0.3rem;
}

.bullets li + li {
    margin-top: 0.15rem;
}

.bullets li::marker {
    color: var(--highlight);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    list-style: none;
    margin-top: 0.6rem;
}

.tags li {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--muted);
    background: var(--tag-bg);
    border: 1px solid var(--line);
    padding: 0.12rem 0.45rem;
    border-radius: 4px;
}

/* ---------- Projects ---------- */

.project-pair {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1.1rem;
}

.mini {
    display: flex;
    flex-direction: column;
    padding: 0.8rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    transition: border-color 150ms ease;
}

.mini:hover {
    border-color: var(--highlight);
}

.mini .entry-text {
    font-size: 0.875rem;
}

.mini .tags {
    margin-top: auto;
    padding-top: 0.6rem;
}

/* ---------- More projects (moving slideshow) ---------- */

.marquee {
    margin-top: 1.5rem;
}

.marquee-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.6rem;
}

.subhead {
    font-size: 0.9rem;
    font-weight: 600;
}

.marquee-controls {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.marquee-hint {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--faint);
    margin-right: 0.4rem;
}

.marquee-btn {
    display: grid;
    place-items: center;
    width: 1.85rem;
    height: 1.85rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
    transition: color 150ms ease, border-color 150ms ease;
}

.marquee-btn:hover {
    color: var(--highlight);
    border-color: var(--highlight);
}

.marquee-viewport {
    overflow: hidden;
    cursor: grab;
    touch-action: pan-y;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 2rem, #000 calc(100% - 2rem), transparent);
    mask-image: linear-gradient(to right, transparent, #000 2rem, #000 calc(100% - 2rem), transparent);
}

.marquee-viewport.dragging {
    cursor: grabbing;
    user-select: none;
}

.marquee-viewport.dragging a {
    pointer-events: none;
}

.marquee-track {
    position: relative;
    display: flex;
    gap: 0.75rem;
    width: max-content;
    padding-block: 0.15rem;
    will-change: transform;
}

.card {
    display: flex;
    flex-direction: column;
    width: 14.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 150ms ease;
}

.card:hover {
    border-color: var(--highlight);
}

.card-media {
    aspect-ratio: 2 / 1;
    overflow: hidden;
    background: var(--tag-bg);
    border-bottom: 1px solid var(--line);
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
    -webkit-user-drag: none;
    pointer-events: none;
}

.card-media--code {
    display: flex;
    align-items: center;
    background: #15171c;
    border-bottom: 0;
    box-shadow: inset 0 3px 0 var(--highlight);
}

.card-media--code pre {
    margin: 0;
    padding: 0.5rem 0.8rem 0.4rem;
    font-family: var(--mono);
    font-size: 0.6rem;
    line-height: 1.45;
    color: #d6d3cc;
    white-space: pre;
    overflow: hidden;
}

.card-media--code .t-in {
    color: #f5a55a;
}

.card-media--code .t-dim {
    color: #7f7b73;
}

.card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 0.6rem 0.75rem 0.7rem;
}

.card-body h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.card-body h4 a {
    text-decoration: none;
}

.card-body > p:not(.card-tech) {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.card-tech {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: auto;
    padding-top: 0.5rem;
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--faint);
}

.card-tech .ti:last-of-type {
    margin-right: 0.2rem;
}

/* ---------- Skills ---------- */

.skill-row {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 0.75rem;
    align-items: baseline;
}

.skill-row + .skill-row {
    margin-top: 0.55rem;
}

.skill-row h3 {
    font-size: 0.85rem;
    font-weight: 500;
}

.skill-row .tags {
    margin-top: 0;
}

.skills-also {
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: var(--muted);
}

/* ---------- Footer / contact ---------- */

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    padding-block: 1.5rem;
}

.footer-cta {
    color: var(--muted);
}

.footer-cta a {
    color: var(--ink);
    font-weight: 500;
    text-decoration-color: var(--highlight);
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.footer-links a {
    display: grid;
    place-items: center;
    color: var(--muted);
}

.footer-links a:hover {
    color: var(--highlight);
}

.footer-links .ui {
    width: 1.1rem;
    height: 1.1rem;
}

.copyright {
    margin-left: 0.5rem;
    font-size: 0.8rem;
    color: var(--faint);
}

/* ---------- Responsive ---------- */

@media (max-width: 800px) {
    .menu-toggle {
        display: block;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        padding: 0.5rem var(--gutter) 1rem;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
    }

    .site-nav.open {
        display: flex;
    }

    .site-nav a {
        padding: 0.55rem 0;
        font-size: 1rem;
    }

    .site-nav a.active::after {
        display: none;
    }

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

    .intro {
        display: block;
        padding-block: 1.75rem 1.5rem;
    }

    .scene-figure {
        width: 100%;
        max-width: 24rem;
        margin: 1.5rem auto 0;
    }

    .intro .scene {
        width: 100%;
        max-width: none;
    }

    .section {
        grid-template-columns: 1fr;
        gap: 0.9rem;
        padding-block: 1.5rem;
    }

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

    .card {
        width: 13.5rem;
    }
}

@media (max-width: 480px) {
    .intro-photo {
        width: 4rem;
        height: 4rem;
    }

    .marquee-hint {
        display: none;
    }

    .skill-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .skill-row + .skill-row {
        margin-top: 0.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
