@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,520;9..144,640&family=Outfit:wght@400;500;600&display=swap");

:root {
    --bg: #f3efe6;
    --bg-2: #e7e1d4;
    --surface: #fffdf8;
    --ink: #1c1915;
    --muted: #6f675d;
    --line: rgba(28, 25, 21, 0.12);
    --accent: #9c4320;
    --accent-soft: rgba(156, 67, 32, 0.12);
    --media: #e8e2d6;
    --shadow: 0 18px 40px rgba(60, 40, 20, 0.08);
    --radius: 18px;
}

html.dark {
    --bg: #12110e;
    --bg-2: #1c1a16;
    --surface: #1b1916;
    --ink: #f4efe6;
    --muted: #b1a79b;
    --line: rgba(244, 239, 230, 0.12);
    --accent: #e7a27a;
    --accent-soft: rgba(231, 162, 122, 0.14);
    --media: #0c0b09;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(1200px 500px at 80% -10%, var(--accent-soft), transparent 55%),
        var(--bg);
    color: var(--ink);
    font-family: Outfit, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.55;
    transition: background 0.2s, color 0.2s;
}

a {
    color: inherit;
}

img,
video {
    max-width: 100%;
}

.bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 16px 28px;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
}

.brand {
    font-family: Fraunces, Georgia, serif;
    font-weight: 640;
    font-size: 18px;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.bar-nav {
    display: flex;
    gap: 16px;
}

.bar-nav a {
    text-decoration: none;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
}

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

.bar-end {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-link,
#theme-toggle {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
}

.icon-link:hover,
#theme-toggle:hover {
    color: var(--ink);
    background: var(--surface);
    border-color: var(--line);
}

.icon-link svg,
#theme-toggle svg {
    width: 16px;
    height: 16px;
}

#theme-toggle {
    position: relative;
}

.icon-sun,
.icon-moon {
    position: absolute;
    transition: opacity 0.2s, transform 0.2s;
}

.icon-moon {
    opacity: 0;
    transform: rotate(-20deg) scale(0.8);
}

html.dark .icon-sun {
    opacity: 0;
    transform: rotate(20deg) scale(0.8);
}

html.dark .icon-moon {
    opacity: 1;
    transform: none;
}

.home {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto 80px;
}

.hero {
    padding: 54px 0 28px;
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0;
    font-family: Fraunces, Georgia, serif;
    font-weight: 640;
    font-size: clamp(52px, 8vw, 92px);
    letter-spacing: -0.045em;
    line-height: 0.92;
}

.lede {
    max-width: 640px;
    margin: 22px 0 0;
    font-size: 18px;
    line-height: 1.55;
    color: var(--ink);
}

.hero-meta {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.section-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 36px 0 16px;
}

.section-label h2 {
    margin: 0;
    font-family: Fraunces, Georgia, serif;
    font-size: 32px;
    font-weight: 640;
    letter-spacing: -0.03em;
}

.section-label p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.mosaic {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 16px;
}

.mosaic-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.piece {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.piece:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.piece-hit {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.piece-media {
    aspect-ratio: 16 / 10;
    background: var(--media);
    overflow: hidden;
}

.piece-media img,
.piece-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.piece:hover .piece-media img,
.piece:hover .piece-media video {
    transform: scale(1.035);
}

.piece-media.fit img,
.piece-media.fit video {
    object-fit: contain;
}

.piece-copy {
    padding: 16px 16px 18px;
}

.piece-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.piece h3 {
    margin: 0;
    font-family: Fraunces, Georgia, serif;
    font-size: 26px;
    font-weight: 640;
    letter-spacing: -0.03em;
}

.year {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

.stack,
.blurb {
    margin: 6px 0 0;
}

.stack {
    color: var(--muted);
    font-size: 13px;
}

.blurb {
    font-size: 15px;
    line-height: 1.45;
}

.more {
    display: inline-block;
    margin-top: 10px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
}

.ext {
    position: relative;
    z-index: 2;
    flex: none;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: var(--muted);
    border: 1px solid var(--line);
    background: var(--surface);
}

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

.ext svg {
    width: 15px;
    height: 15px;
}

.archive-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 42px 0 14px;
}

.archive-head h2 {
    margin: 0;
    font-family: Fraunces, Georgia, serif;
    font-size: 28px;
    letter-spacing: -0.03em;
}

#project-sort {
    font-family: inherit;
    font-size: 13px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
}

.archive {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.archive .piece {
    box-shadow: none;
}

.archive .piece-copy {
    padding: 16px 18px 18px;
}

.archive h3 {
    font-size: 22px;
}

.about {
    margin-top: 56px;
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 18px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 22px 8px;
}

.panel h2 {
    margin: 0 0 6px;
    font-family: Fraunces, Georgia, serif;
    font-size: 28px;
    letter-spacing: -0.03em;
}

.org {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-top: 8px;
}

.org strong {
    font-size: 16px;
}

.org span,
.role-line {
    color: var(--muted);
    font-size: 13px;
}

.role-stack {
    position: relative;
    margin: 14px 0 18px;
    padding-left: 18px;
}

.role-stack::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: var(--line);
}

.role {
    position: relative;
    margin-bottom: 16px;
}

.role::before {
    content: "";
    position: absolute;
    left: -17px;
    top: 6px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bg);
    border: 1.5px solid var(--accent);
}

.role-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
}

.role-top strong {
    font-size: 15px;
}

.role ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

.role li {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: 14px;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 18px;
}

.skills span {
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--ink);
}

.side h2 {
    margin-bottom: 12px;
}

.edu p {
    margin: 0 0 8px;
}

.edu .when {
    color: var(--muted);
    font-size: 13px;
}

.foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 28px;
    color: var(--muted);
    font-size: 13px;
}

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

/* Case studies */
body.study {
    background: var(--bg);
}

body.study .page {
    width: min(760px, calc(100% - 40px));
    margin: 28px auto 80px;
}

body.study .back {
    display: inline-flex;
    margin-bottom: 18px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

body.study .back:hover {
    color: var(--ink);
}

body.study .resume-name {
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(40px, 6vw, 64px);
    font-weight: 640;
    letter-spacing: -0.04em;
    line-height: 0.98;
    margin-bottom: 10px;
}

body.study .resume-contact {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 15px;
}

body.study .resume-contact a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}

body.study .meta {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 8px;
}

body.study .section-heading {
    margin: 40px 0 10px;
    font-family: Fraunces, Georgia, serif;
    font-size: 28px;
    font-weight: 640;
    letter-spacing: -0.03em;
}

body.study .section-heading::before {
    content: "";
    display: block;
    width: 28px;
    height: 2px;
    margin-bottom: 10px;
    background: var(--accent);
}

body.study .text-block,
body.study li {
    font-size: 16.5px;
    line-height: 1.65;
}

body.study .text-block {
    margin: 0 0 12px;
}

body.study ul {
    margin: 4px 0 14px;
    padding-left: 1.15em;
}

body.study li {
    margin-bottom: 6px;
}

body.study a {
    color: var(--accent);
}

body.study code {
    font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.88em;
    background: var(--bg-2);
    padding: 0.1em 0.35em;
    border-radius: 5px;
}

body.study .italic {
    color: var(--muted);
    font-size: 14.5px;
}

body.study .image-center {
    margin: 18px 0 10px;
}

body.study .image-center img,
body.study video,
body.study .page > img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--media);
}

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

@media (max-width: 860px) {
    .mosaic,
    .mosaic-row,
    .archive,
    .about {
        grid-template-columns: 1fr;
    }

    .bar {
        padding: 12px 16px;
        gap: 12px;
    }

    .hero {
        padding-top: 32px;
    }

    .home,
    body.study .page {
        width: min(100% - 32px, 1120px);
    }
}

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

    .piece,
    .piece-media img,
    .piece-media video {
        transition: none;
    }
}
