:root {
    --bg: #f7f5f1;
    --surface: #fffdfa;
    --surface-strong: #ffffff;
    --surface-soft: #efebe4;
    --text: #24211d;
    --muted: #6d675f;
    --faint: #918a80;
    --border: rgba(48, 42, 35, 0.12);
    --border-strong: rgba(48, 42, 35, 0.2);
    --accent: #e64b35;
    --accent-deep: #c93a27;
    --accent-soft: #ffe5df;
    --nav: rgba(247, 245, 241, 0.86);
    --panel: #27231f;
    --panel-text: #fffaf3;
    --shadow-sm: 0 1px 2px rgba(31, 26, 21, 0.04), 0 8px 24px rgba(31, 26, 21, 0.05);
    --shadow-lg: 0 18px 60px rgba(31, 26, 21, 0.12);
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
    --content: 1120px;
    --prose: 740px;
}

html[data-theme="dark"] {
    --bg: #171512;
    --surface: #1e1b18;
    --surface-strong: #24201c;
    --surface-soft: #2a2621;
    --text: #f4f0e8;
    --muted: #b4aca1;
    --faint: #8f877e;
    --border: rgba(244, 240, 232, 0.12);
    --border-strong: rgba(244, 240, 232, 0.2);
    --accent: #ff806a;
    --accent-deep: #ff9b89;
    --accent-soft: rgba(255, 128, 106, 0.14);
    --nav: rgba(23, 21, 18, 0.86);
    --panel: #f0e9df;
    --panel-text: #201d19;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.18), 0 12px 28px rgba(0, 0, 0, 0.16);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.32);
}

* {
    box-sizing: border-box;
}

html {
    scroll-padding-top: 6rem;
}

body {
    min-width: 320px;
    margin: 0;
    background:
        radial-gradient(circle at 75% 0%, rgba(230, 75, 53, 0.055), transparent 26rem),
        var(--bg) !important;
    color: var(--text) !important;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body.theme-transitioning,
body.theme-transitioning *,
body.theme-transitioning *::before,
body.theme-transitioning *::after {
    transition-property: color, background-color, border-color, box-shadow !important;
    transition-duration: 220ms !important;
    transition-timing-function: var(--ease-out) !important;
}

body.menu-open {
    overflow: hidden;
}

a {
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

img,
svg {
    display: block;
}

[hidden] {
    display: none !important;
}

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

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 4px;
    border-radius: 5px;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 100;
    padding: 0.65rem 0.9rem;
    border-radius: 0.6rem;
    background: var(--text);
    color: var(--bg);
    font-size: 0.85rem;
    font-weight: 700;
    transform: translateY(-160%);
    transition: transform 160ms var(--ease-out);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    width: min(100% - 3rem, var(--content));
    margin: 0 auto;
    flex: 1;
}

.eyebrow {
    margin: 0 0 0.85rem;
    color: var(--accent);
    font-family: Inter, ui-sans-serif, sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.4;
    text-transform: uppercase;
}

.status-dot {
    display: inline-block;
    width: 0.48rem;
    height: 0.48rem;
    margin-right: 0.45rem;
    border-radius: 999px;
    background: #35a66f;
    box-shadow: 0 0 0 4px rgba(53, 166, 111, 0.12);
    vertical-align: 0.02em;
}

h1,
h2,
h3,
h4 {
    color: var(--text) !important;
    font-family: "Plus Jakarta Sans", ui-sans-serif, sans-serif;
    letter-spacing: -0.035em;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.7rem 1.05rem;
    border: 1px solid transparent;
    border-radius: 0.75rem;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none !important;
    transition: transform 140ms var(--ease-out), background-color 180ms var(--ease-out), border-color 180ms var(--ease-out), color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.button svg {
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.button:active,
.icon-button:active,
.nav-resume:active,
.project-card:active {
    transform: scale(0.97);
}

.button--primary {
    background: var(--text);
    color: var(--bg);
    box-shadow: var(--shadow-sm);
}

.button--secondary {
    border-color: var(--border-strong);
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    color: var(--text);
}

.button--light {
    background: var(--panel-text);
    color: var(--panel);
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration-color: color-mix(in srgb, var(--muted) 35%, transparent);
    text-underline-offset: 0.28rem;
    transition: color 160ms var(--ease-out);
}

/* Navigation */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
    background: var(--nav);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.nav-inner {
    width: min(100% - 3rem, var(--content));
    height: 76px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 2rem;
}

.brand {
    width: max-content;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text);
    font-family: "Plus Jakarta Sans", ui-sans-serif, sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.brand__mark {
    width: 2rem;
    height: 2rem;
    display: block;
    flex: 0 0 auto;
    border-radius: 0.58rem;
    object-fit: contain;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.26rem;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: color-mix(in srgb, var(--surface) 58%, transparent);
}

.desktop-nav a {
    position: relative;
    padding: 0.43rem 0.75rem;
    border-radius: 0.58rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}

.desktop-nav a.is-active {
    background: var(--surface-strong);
    color: var(--text);
    box-shadow: 0 1px 4px rgba(31, 26, 21, 0.07);
}

.nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
}

.nav-resume {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--border-strong);
    border-radius: 0.65rem;
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 140ms var(--ease-out), background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.icon-button {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 0.65rem;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: transform 140ms var(--ease-out), background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}

.icon-button svg {
    width: 1.2rem;
    height: 1.2rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.theme-icon--sun,
html[data-theme="dark"] .theme-icon--moon {
    display: none;
}

html[data-theme="dark"] .theme-icon--sun {
    display: block;
}

.menu-button {
    display: none;
}

.mobile-menu {
    position: fixed;
    inset: 76px 0 0;
    z-index: 45;
    padding: 2.2rem 1.5rem;
    background: var(--bg);
    overflow-y: auto;
}

.mobile-menu > a {
    display: grid;
    grid-template-columns: 2rem 1fr;
    align-items: baseline;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-family: "Plus Jakarta Sans", ui-sans-serif, sans-serif;
    font-size: clamp(1.8rem, 9vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    text-decoration: none;
}

.mobile-menu > a > span {
    color: var(--accent);
    font-family: Inter, ui-sans-serif, sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
}

.mobile-menu__footer {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.text-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 0.25rem;
}

/* Home */
.home-hero {
    min-height: min(760px, calc(100vh - 76px));
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    align-items: center;
    gap: clamp(3rem, 8vw, 7rem);
    padding: clamp(5rem, 10vw, 8rem) 0;
}

.home-hero__copy h1 {
    max-width: 14ch;
    margin: 0;
    font-size: clamp(3rem, 6.2vw, 5.15rem);
    font-weight: 800;
    line-height: 0.99;
}

.home-hero__lead {
    max-width: 34rem;
    margin: 1.8rem 0 2rem;
    color: var(--muted);
    font-size: clamp(1.08rem, 1.7vw, 1.28rem);
    line-height: 1.65;
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.1rem;
    margin-top: 2rem;
}

.hero-links a {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 650;
    text-decoration: none;
    transition: color 160ms var(--ease-out);
}

.portrait-card {
    position: relative;
    width: min(100%, 360px);
    justify-self: end;
}

.portrait-card__frame {
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 1.6rem;
    background: var(--surface-soft);
    box-shadow: var(--shadow-lg);
    transform: rotate(1.5deg);
}

.portrait-card__frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 38%;
}

.portrait-card__note {
    position: absolute;
    right: -1.25rem;
    bottom: 1.6rem;
    width: min(14rem, 74%);
    padding: 0.9rem 1rem;
    border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    border-radius: 0.85rem;
    background: color-mix(in srgb, var(--surface-strong) 90%, transparent);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}

.portrait-card__note span {
    color: var(--accent);
    font-size: 0.63rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.portrait-card__note p {
    margin: 0.2rem 0 0;
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.4;
}

.signal-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-block: 1px solid var(--border);
}

.signal-strip > div {
    min-height: 125px;
    display: grid;
    align-content: center;
    gap: 0.15rem;
    padding: 1.5rem 2rem;
    border-right: 1px solid var(--border);
}

.signal-strip > div:first-child {
    padding-left: 0;
}

.signal-strip > div:last-child {
    border-right: 0;
}

.signal-strip strong {
    color: var(--text);
    font-family: "Plus Jakarta Sans", ui-sans-serif, sans-serif;
    font-size: 1.45rem;
    letter-spacing: -0.04em;
}

.signal-strip span {
    color: var(--muted);
    font-size: 0.78rem;
}

.section-block {
    padding: clamp(5.5rem, 10vw, 8rem) 0 0;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3rem;
    margin-bottom: 2.4rem;
}

.section-heading h2 {
    max-width: 19ch;
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 750;
    line-height: 1.12;
}

/* Project cards and index */
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.4rem;
}

.project-card {
    min-width: 0;
    display: block;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 1.35rem;
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(31, 26, 21, 0.025);
    color: var(--text);
    text-decoration: none;
    transition: transform 180ms var(--ease-out), border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.project-card__media {
    position: relative;
    height: 255px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.project-card__media img {
    width: 88%;
    height: 82%;
    margin: 0;
    border-radius: 0.72rem;
    object-fit: cover;
    box-shadow: 0 12px 34px rgba(25, 22, 19, 0.18);
    transition: transform 240ms var(--ease-out);
}

.project-card__media--indigo { background: #dde3f5; }
.project-card__media--sunset { background: #f8d7ce; }
.project-card__media--sky { background: #dbe9ec; }
.project-card__media--mint { background: #dcebe2; }
.project-card__media--rose { background: #f1dddd; }
.project-card__media--everpacket { background: #e5f0ed; }

.project-card__media--mint img,
.project-card__media--rose img {
    object-fit: contain;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.9);
}

.project-card__media--sunset img {
    object-fit: contain;
}

.project-card__media--everpacket img {
    object-fit: contain;
}

.project-card__index {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.3rem 0.52rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    color: #312d28;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    backdrop-filter: blur(8px);
}

.project-card__arrow {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.45rem;
    height: 2.45rem;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.64);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: #312d28;
    backdrop-filter: blur(8px);
    transition: transform 180ms var(--ease-out), background-color 180ms var(--ease-out);
}

.project-card__arrow svg {
    width: 1.15rem;
    height: 1.15rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.project-card__body {
    padding: 1.6rem;
}

.project-card__body .eyebrow {
    margin-bottom: 0.55rem;
}

.project-card__body h3 {
    margin: 0;
    font-size: 1.28rem;
    font-weight: 750;
    line-height: 1.25;
}

.project-card__description {
    min-height: 3.1rem;
    margin: 0.7rem 0 1.2rem;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.6;
}

.project-card__tags,
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.project-card__tags span,
.tag-list span {
    padding: 0.27rem 0.56rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 600;
    line-height: 1.2;
}

.page-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(16rem, 0.72fr);
    align-items: end;
    gap: clamp(3rem, 8vw, 8rem);
    padding: clamp(5.5rem, 10vw, 8rem) 0 clamp(4.5rem, 8vw, 6.5rem);
}

.page-hero h1 {
    max-width: 15ch;
    margin: 0;
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 800;
    line-height: 1.01;
}

.page-hero > p {
    margin: 0 0 0.4rem;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.75;
}

.project-grid--index {
    padding-bottom: 1rem;
}

.project-grid--index .project-card--featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
}

.project-grid--index .project-card--featured .project-card__media {
    height: 100%;
    min-height: 390px;
    border-right: 1px solid var(--border);
    border-bottom: 0;
}

.project-grid--index .project-card--featured .project-card__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem;
}

.project-grid--index .project-card--featured .project-card__body h3 {
    font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.project-grid--index .project-card--featured .project-card__description {
    min-height: 0;
}

/* Publication and experience */
.publication-card {
    display: grid;
    grid-template-columns: 7rem 1fr;
    gap: 2rem;
    padding: clamp(1.5rem, 4vw, 2.4rem);
    border: 1px solid var(--border);
    border-radius: 1.35rem;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.publication-card__year {
    color: var(--accent);
    font-family: "Plus Jakarta Sans", ui-sans-serif, sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.publication-card__content h3 {
    max-width: 28ch;
    margin: 0;
    font-size: clamp(1.35rem, 2.8vw, 2.15rem);
    line-height: 1.25;
}

.publication-card__content > p:not(.eyebrow) {
    margin: 1rem 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.publication-card__links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.publication-card__links a {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    text-underline-offset: 0.26rem;
}

.experience-list {
    border-top: 1px solid var(--border);
}

.experience-list article {
    display: grid;
    grid-template-columns: 9rem 1fr auto;
    align-items: center;
    gap: 1.5rem;
    min-height: 105px;
    border-bottom: 1px solid var(--border);
}

.experience-list__date,
.experience-list__type {
    color: var(--faint);
    font-size: 0.74rem;
    font-weight: 650;
}

.experience-list__type {
    padding: 0.28rem 0.58rem;
    border: 1px solid var(--border);
    border-radius: 999px;
}

.experience-list h3 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.experience-list p {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.contact-panel {
    margin: clamp(6rem, 12vw, 10rem) 0 0;
    padding: clamp(2.2rem, 6vw, 4.4rem);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3rem;
    border-radius: 1.5rem;
    background: var(--panel);
    color: var(--panel-text);
}

.contact-panel .eyebrow {
    color: color-mix(in srgb, var(--panel-text) 68%, var(--accent));
}

.contact-panel h2 {
    margin: 0;
    color: var(--panel-text) !important;
    font-size: clamp(2rem, 4vw, 3.2rem);
}

.contact-panel p:not(.eyebrow) {
    max-width: 38rem;
    margin: 0.8rem 0 0;
    color: color-mix(in srgb, var(--panel-text) 70%, transparent);
}

.contact-panel--compact {
    margin-top: clamp(5rem, 10vw, 8rem);
    padding: clamp(2rem, 5vw, 3.2rem);
}

/* About */
.about-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
    align-items: center;
    gap: clamp(3rem, 10vw, 9rem);
    padding: clamp(5.5rem, 10vw, 8rem) 0 clamp(5rem, 9vw, 7rem);
    border-bottom: 1px solid var(--border);
}

.about-hero h1 {
    margin: 0;
    font-size: clamp(3.1rem, 7vw, 5.5rem);
    font-weight: 800;
    line-height: 0.98;
}

.about-hero__copy > p:last-child {
    max-width: 34rem;
    margin: 1.8rem 0 0;
    color: var(--muted);
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
}

.about-portrait {
    margin: 0;
}

.about-portrait img {
    width: 100%;
    aspect-ratio: 4 / 5;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 1.4rem;
    object-fit: cover;
    object-position: center 38%;
    box-shadow: var(--shadow-lg);
}

.about-portrait figcaption {
    margin-top: 0.7rem;
    color: var(--faint);
    font-size: 0.7rem;
    text-align: right;
}

.about-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 17rem;
    gap: clamp(3rem, 9vw, 7rem);
    padding-top: clamp(4.5rem, 8vw, 7rem);
}

.about-story {
    max-width: var(--prose);
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.85;
}

.about-story p {
    margin: 0 0 1.5rem;
}

.about-story__lead {
    color: var(--text);
    font-family: "Plus Jakarta Sans", ui-sans-serif, sans-serif;
    font-size: clamp(1.45rem, 3vw, 2.1rem);
    font-weight: 650;
    letter-spacing: -0.035em;
    line-height: 1.4;
}

.about-story a {
    color: var(--text);
    font-weight: 600;
    text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.2rem;
}

.about-sidebar {
    align-self: start;
    position: sticky;
    top: 7rem;
    display: grid;
    gap: 2.4rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 1.2rem;
    background: var(--surface);
}

.focus-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.focus-list li {
    padding: 0.36rem 0.58rem;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 650;
}

.sidebar-links {
    display: grid;
}

.sidebar-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 650;
    text-decoration: none;
}

.sidebar-links a:last-child {
    border-bottom: 0;
}

.sidebar-links span {
    color: var(--faint);
}

/* Project detail */
.project-shell {
    width: min(100%, 1000px);
    margin: 0 auto;
}

.project-header {
    padding: clamp(4.2rem, 9vw, 7rem) 0 3rem;
    border-bottom: 1px solid var(--border);
}

.back-link {
    width: max-content;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 3rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 650;
    text-decoration: none;
    transition: color 160ms var(--ease-out);
}

.back-link svg {
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.project-header__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.5fr);
    align-items: end;
    gap: clamp(3rem, 8vw, 7rem);
}

.project-header h1 {
    max-width: 16ch;
    margin: 0;
    font-size: clamp(2.8rem, 6vw, 4.8rem);
    font-weight: 800;
    line-height: 1;
}

.project-header__description {
    max-width: 42rem;
    margin: 1.3rem 0 0;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.7;
}

.project-header__outcome {
    padding-left: 1.3rem;
    border-left: 2px solid var(--accent);
}

.project-header__outcome span,
.project-header__meta > div > span {
    color: var(--faint);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.project-header__outcome p {
    margin: 0.35rem 0 0;
    color: var(--text);
    font-size: 0.83rem;
    font-weight: 650;
    line-height: 1.55;
}

.project-header__meta {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 3rem;
    margin-top: 3.5rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--border);
}

.project-header__meta p {
    margin: 0.4rem 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.project-header__meta .tag-list {
    margin-top: 0.5rem;
}

.project-summary {
    max-width: 860px;
    margin: clamp(3.5rem, 7vw, 5.5rem) auto;
    padding: 1.4rem 1.6rem;
    display: grid;
    grid-template-columns: 5rem 1fr;
    gap: 1.5rem;
    border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
    border-radius: 1rem;
    background: var(--accent-soft);
}

.project-summary__label {
    color: var(--accent);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.project-summary p {
    margin: 0;
    color: var(--text);
    font-size: 0.94rem;
    line-height: 1.7;
}

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

.prose-custom {
    color: var(--text) !important;
    font-size: 1rem;
    line-height: 1.78;
}

.prose-custom p {
    margin: 0 0 1.25rem;
}

.prose-custom ul,
.prose-custom ol {
    margin: 0 0 1.25rem;
    padding-left: 1.5rem;
}

.prose-custom ul { list-style: disc; }
.prose-custom ol { list-style: decimal; }

.prose-custom li {
    margin-bottom: 0.55rem;
}

.prose-custom strong {
    font-weight: 650;
}

.prose-custom h2,
.prose-custom h3,
.prose-custom h4 {
    scroll-margin-top: 6rem;
}

.prose-custom h2 {
    margin: 3.8rem 0 1.2rem !important;
    font-size: clamp(1.8rem, 3.5vw, 2.5rem) !important;
    line-height: 1.2;
}

.prose-custom h3 {
    margin: 2.6rem 0 1rem !important;
    font-size: 1.25rem !important;
}

.prose-custom a:not(.button):not(.btn-link):not(.for-contact-btn):not(.for-primary-cta) {
    color: var(--accent) !important;
    text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent) !important;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.2rem;
}

.prose-custom hr {
    margin: 3rem 0;
    border: 0;
    border-top: 1px solid var(--border);
}

.prose-custom figure {
    margin: 2rem 0;
}

.prose-custom img {
    border-radius: 1rem !important;
}

.prose-custom figcaption {
    color: var(--faint) !important;
    font-size: 0.73rem !important;
}

.prose-custom code {
    padding: 0.15rem 0.35rem;
    border-radius: 0.35rem;
    background: var(--surface-soft);
    font-size: 0.85em;
}

.prose-custom pre {
    margin: 1.5rem 0;
    padding: 1rem;
    overflow-x: auto;
    border-radius: 0.8rem;
    background: #1d1a17;
    color: #f4f0e8;
}

.prose-custom pre code {
    padding: 0;
    background: transparent;
}

.prose-custom blockquote {
    margin: 1.5rem 0;
    padding-left: 1rem;
    border-left: 3px solid var(--accent);
    color: var(--muted);
    font-style: italic;
}

.prose-custom table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
}

.prose-custom th,
.prose-custom td {
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    text-align: left;
}

.prose-custom th {
    background: var(--surface-soft);
    font-weight: 650;
}

.prose-custom li::marker {
    color: var(--accent);
}

.btn.btn-link,
a.btn-link {
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0.6rem 0.5rem 0 0 !important;
    padding: 0.65rem 1rem !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: 0.72rem !important;
    background: var(--surface) !important;
    color: var(--text) !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    transition: transform 140ms var(--ease-out), border-color 180ms var(--ease-out), background-color 180ms var(--ease-out) !important;
}

.btn.btn-link:active,
a.btn-link:active {
    transform: scale(0.97);
}

.image-wrap {
    margin: 1.8rem 0;
}

.image-wrap img {
    width: 100%;
    height: auto;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
}

.image-wrap figcaption {
    margin-top: 0.65rem;
}

.carousel {
    position: relative;
    margin: 2rem 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 1.15rem;
    background: var(--surface-soft);
    box-shadow: var(--shadow-sm);
}

.carousel-track {
    position: relative;
    display: flex;
    overflow: hidden;
    transition: transform 240ms var(--ease-in-out);
    touch-action: pan-y;
}

.carousel-slide {
    flex: 0 0 100%;
    display: grid;
    place-items: center;
    padding: 1.2rem;
}

.carousel-slide img {
    width: 100%;
    max-height: 590px;
    margin: 0;
    border-radius: 0.75rem !important;
    object-fit: contain;
    box-shadow: 0 9px 28px rgba(24, 21, 18, 0.14);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(47, 42, 36, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: #29251f;
    box-shadow: 0 4px 14px rgba(31, 27, 22, 0.12);
    cursor: pointer;
    opacity: 0.72;
    transform: translateY(-50%);
    transition: transform 140ms var(--ease-out), opacity 160ms var(--ease-out), background-color 160ms var(--ease-out);
    backdrop-filter: blur(8px);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-btn--prev { left: 0.75rem; }
.carousel-btn--next { right: 0.75rem; }

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    padding: 0 0 1.15rem;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--border-strong);
    cursor: pointer;
    transition: width 180ms var(--ease-out), background-color 180ms var(--ease-out), transform 140ms var(--ease-out);
}

.carousel-dot.active {
    width: 24px;
    background: var(--accent);
}

.carousel-dot:active {
    transform: scale(0.9);
}

.project-end {
    max-width: 860px;
    margin: clamp(5rem, 10vw, 8rem) auto 0;
    padding-top: 2.2rem;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    border-top: 1px solid var(--border);
}

.project-end h2 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.narrow-shell {
    width: min(100%, var(--prose));
    margin: 0 auto;
    padding-top: clamp(4rem, 8vw, 6rem);
}

.page-header,
.article-header {
    margin-bottom: 2.5rem;
}

.page-header h1,
.article-header h1 {
    margin: 0;
    font-size: clamp(2.5rem, 5vw, 4.25rem);
    line-height: 1.05;
}

.article-meta {
    color: var(--faint);
    font-size: 0.78rem;
}

/* File Order Randomizer custom content integration */
.project-content .for-hero,
.project-content .for-section,
.project-content .for-contact,
.project-content .for-faq details {
    border-color: var(--border);
}

html[data-theme="dark"] .project-content .for-section,
html[data-theme="dark"] .project-content .for-section-warm,
html[data-theme="dark"] .project-content .for-contact,
html[data-theme="dark"] .project-content .for-faq details {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

html[data-theme="dark"] .project-content .for-section h3,
html[data-theme="dark"] .project-content .for-contact h3,
html[data-theme="dark"] .project-content .for-faq h3 {
    color: var(--text) !important;
}

.prose-custom .for-hero h2 {
    margin: 0 0 0.5rem !important;
    font-size: 1.5rem !important;
}

.prose-custom .for-section h3,
.prose-custom .for-faq h3,
.prose-custom .for-contact h3 {
    margin: 0 0 0.8rem !important;
    font-size: 1.15rem !important;
}

.project-content .for-faq summary:focus-visible {
    outline-offset: -4px;
}

.prose-custom .for-contact-btn {
    color: #fff !important;
}

/* 404 */
.not-found {
    min-height: max(580px, calc(100vh - 300px));
    display: grid;
    place-content: center;
    justify-items: center;
    padding: 5rem 0;
    text-align: center;
}

.not-found__number {
    margin-bottom: -1.4rem;
    color: color-mix(in srgb, var(--accent) 12%, transparent);
    font-family: "Plus Jakarta Sans", ui-sans-serif, sans-serif;
    font-size: clamp(8rem, 22vw, 15rem);
    font-weight: 800;
    letter-spacing: -0.1em;
    line-height: 0.72;
    user-select: none;
}

.not-found h1 {
    max-width: 12ch;
    margin: 0;
    font-size: clamp(2.4rem, 6vw, 4.5rem);
    line-height: 1.03;
}

.not-found > p:not(.eyebrow) {
    max-width: 31rem;
    margin: 1.2rem 0 1.8rem;
    color: var(--muted);
}

/* Footer */
.site-footer {
    width: min(100% - 3rem, var(--content));
    margin: clamp(6rem, 11vw, 9rem) auto 0;
    padding: 2.5rem 0 2rem;
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
}

.footer-name {
    color: var(--text);
    font-family: "Plus Jakarta Sans", ui-sans-serif, sans-serif;
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
}

.footer-inner p {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

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

.footer-links a,
.footer-bottom a {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 650;
    text-decoration: none;
    transition: color 160ms var(--ease-out);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 2.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border);
    color: var(--faint);
    font-size: 0.68rem;
}

@media (hover: hover) and (pointer: fine) {
    .button--primary:hover {
        background: var(--accent);
        box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 20%, transparent);
    }

    .button--secondary:hover,
    .nav-resume:hover,
    .btn.btn-link:hover,
    a.btn-link:hover {
        border-color: var(--accent) !important;
        background: var(--surface-strong) !important;
    }

    .desktop-nav a:hover,
    .icon-button:hover {
        background: var(--surface-soft);
        color: var(--text);
    }

    .text-link:hover,
    .hero-links a:hover,
    .back-link:hover,
    .footer-links a:hover,
    .footer-bottom a:hover {
        color: var(--accent);
    }

    .project-card:hover {
        border-color: var(--border-strong);
        box-shadow: var(--shadow-lg);
        transform: translateY(-3px);
    }

    .project-card:hover .project-card__media img {
        transform: scale(1.018);
    }

    .project-card:hover .project-card__arrow {
        background: #fff;
        transform: translate(2px, -2px);
    }

    .carousel:hover .carousel-btn,
    .carousel:focus-within .carousel-btn {
        opacity: 1;
    }

    .carousel-btn:hover {
        background: #fff;
    }
}

@media (min-width: 700px) {
    .image-wrap--right {
        float: right;
        width: 46%;
        margin: 0.4rem 0 1.4rem 1.6rem;
    }
}

@media (max-width: 900px) {
    .home-hero {
        grid-template-columns: minmax(0, 1.2fr) minmax(230px, 0.65fr);
        gap: 3rem;
    }

    .portrait-card__note {
        right: -0.5rem;
    }

    .page-hero,
    .about-hero {
        gap: 3rem;
    }

    .about-layout {
        grid-template-columns: minmax(0, 1fr) 15rem;
        gap: 3rem;
    }

    .project-grid--index .project-card--featured {
        grid-template-columns: 1fr 0.78fr;
    }
}

@media (max-width: 760px) {
    .site-main,
    .nav-inner,
    .site-footer {
        width: min(100% - 2rem, var(--content));
    }

    .nav-inner {
        height: 68px;
        display: flex;
        justify-content: space-between;
    }

    .desktop-nav,
    .nav-resume,
    #mode {
        display: none;
    }

    .menu-button {
        display: inline-grid;
    }

    .mobile-menu {
        inset: 68px 0 0;
    }

    .home-hero {
        min-height: 0;
        grid-template-columns: 1fr;
        gap: 3.5rem;
        padding: 4.5rem 0 5.5rem;
    }

    .home-hero__copy h1 {
        max-width: 12ch;
        font-size: clamp(2.75rem, 12vw, 4.2rem);
    }

    .portrait-card {
        width: min(88%, 330px);
        justify-self: center;
    }

    .portrait-card__frame {
        transform: rotate(1deg);
    }

    .signal-strip {
        grid-template-columns: 1fr;
    }

    .signal-strip > div,
    .signal-strip > div:first-child {
        min-height: 96px;
        padding: 1.25rem 0;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .signal-strip > div:last-child {
        border-bottom: 0;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 1.2rem;
        margin-bottom: 1.7rem;
    }

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

    .project-card__media {
        height: 230px;
    }

    .project-grid--index .project-card--featured {
        grid-column: auto;
        display: block;
    }

    .project-grid--index .project-card--featured .project-card__media {
        min-height: 0;
        height: 250px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .project-grid--index .project-card--featured .project-card__body {
        display: block;
        padding: 1.6rem;
    }

    .project-grid--index .project-card--featured .project-card__body h3 {
        font-size: 1.28rem;
    }

    .page-hero,
    .about-hero {
        grid-template-columns: 1fr;
        gap: 2.6rem;
        padding: 4.2rem 0 3.7rem;
    }

    .page-hero > p {
        max-width: 34rem;
    }

    .about-portrait {
        width: min(82%, 320px);
    }

    .about-layout {
        grid-template-columns: 1fr;
    }

    .about-sidebar {
        position: static;
    }

    .publication-card {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .experience-list article {
        grid-template-columns: 6.6rem 1fr;
        padding: 1.3rem 0;
    }

    .experience-list__type {
        display: none;
    }

    .contact-panel {
        align-items: flex-start;
        flex-direction: column;
        gap: 1.8rem;
    }

    .project-header {
        padding-top: 3.2rem;
    }

    .back-link {
        margin-bottom: 2.2rem;
    }

    .project-header__grid,
    .project-header__meta {
        grid-template-columns: 1fr;
        gap: 1.8rem;
    }

    .project-header__outcome {
        max-width: 30rem;
    }

    .project-summary {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .project-end {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-inner,
    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
        gap: 1.2rem;
    }
}

@media (max-width: 480px) {
    .home-hero__copy h1,
    .page-hero h1,
    .about-hero h1,
    .project-header h1 {
        overflow-wrap: anywhere;
    }

    .button-row .button {
        width: 100%;
    }

    .portrait-card {
        width: 90%;
        margin-right: 0.8rem;
    }

    .project-card__media {
        height: 205px;
    }

    .project-card__body,
    .project-grid--index .project-card--featured .project-card__body {
        padding: 1.3rem;
    }

    .project-card__description {
        min-height: 0;
    }

    .experience-list article {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .contact-panel {
        border-radius: 1.15rem;
    }

    .carousel-slide {
        padding: 0.85rem;
    }

    .carousel-btn {
        width: 38px;
        height: 38px;
    }

    .project-summary,
    .about-sidebar {
        padding: 1.2rem;
    }
}

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

    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: 120ms !important;
    }

    .project-card:hover,
    .project-card:hover .project-card__media img,
    .project-card:hover .project-card__arrow,
    .portrait-card__frame {
        transform: none !important;
    }
}
