:root {
    --background: #f7f7f5;
    --text: #111111;
    --muted: #6f7274;
    --line: #d9d9d5;
    --accent: #1f5366;
    --accent-soft: #e7eff1;

    --content-width: 1400px;
    --page-padding: 48px;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}


/* RESET */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        "Helvetica Neue",
        Helvetica,
        Arial,
        sans-serif;

    background: var(--background);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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


/* HEADER */

.site-header {
    position: relative;
    z-index: 10;

    max-width: var(--content-width);
    margin: 0 auto;
    padding: 30px var(--page-padding);

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: inline-flex;
    align-items: center;
}

.logo-mark,
.footer-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    border: 1px solid var(--line);
    border-radius: 11px;

    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.04em;

    transition:
        background 0.3s ease,
        color 0.3s ease,
        border-color 0.3s ease,
        transform 0.3s var(--ease-out);
}

.logo-mark:hover,
.footer-mark:hover {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    transform: translateY(-2px);
}

nav {
    display: flex;
    gap: 32px;
}

nav a {
    position: relative;
    padding: 6px 0;

    font-size: 14px;
    color: var(--muted);

    transition: color 0.25s ease;
}

nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;

    width: 100%;
    height: 1px;

    background: var(--accent);

    transform: scaleX(0);
    transform-origin: right;

    transition: transform 0.35s var(--ease-out);
}

nav a:hover,
nav a[aria-current="page"] {
    color: var(--text);
}

nav a:hover::after,
nav a[aria-current="page"]::after {
    transform: scaleX(1);
    transform-origin: left;
}


/* MAIN */

main {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 var(--page-padding);
}


/* HERO */

.hero {
    min-height: calc(100vh - 102px);
    padding: 7vh 0 10vh;

    display: flex;
    flex-direction: column;
    justify-content: center;
}

.eyebrow {
    margin-bottom: 28px;

    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.hero h1,
.page-title {
    max-width: 1160px;

    font-size: clamp(54px, 7vw, 108px);
    line-height: 0.97;
    letter-spacing: -0.058em;
    font-weight: 500;
}

.hero-line {
    display: block;
}

.hero h1 .accent {
    color: var(--accent);
}

.hero-intro,
.page-lede {
    max-width: 650px;
    margin-top: 44px;

    font-size: clamp(17px, 1.4vw, 20px);
    line-height: 1.55;
    letter-spacing: -0.01em;
    color: #4f5355;
}

.scroll-cue {
    width: fit-content;
    margin-top: 44px;

    display: inline-flex;
    align-items: center;
    gap: 10px;

    font-size: 13px;
    color: var(--muted);

    transition: color 0.25s ease;
}

.scroll-cue span {
    display: inline-block;
    transition: transform 0.35s var(--ease-out);
}

.scroll-cue:hover {
    color: var(--accent);
}

.scroll-cue:hover span {
    transform: translateY(4px);
}


/* SECONDARY PAGE HERO */

.page-hero {
    min-height: 68vh;
    padding: 10vh 0 11vh;

    display: flex;
    flex-direction: column;
    justify-content: center;
}

.page-hero-compact {
    min-height: 62vh;
}

.page-title {
    max-width: 1050px;
}

.page-lede {
    max-width: 720px;
}

.cv-hero-row {
    margin-top: 44px;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 56px;
}

.cv-hero-row .page-lede {
    margin-top: 0;
}

.cv-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.button {
    min-height: 44px;
    padding: 0 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    border: 1px solid var(--line);
    border-radius: 999px;

    font-size: 13px;

    transition:
        transform 0.3s var(--ease-out),
        border-color 0.3s ease,
        background 0.3s ease,
        color 0.3s ease;
}

.button:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.button-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}


/* HERO LOAD ANIMATION */

.hero-line,
.hero-fade {
    opacity: 0;
    transform: translateY(22px);

    animation: hero-in 0.9s var(--ease-out) forwards;
}

.hero-delay-1 { animation-delay: 0.05s; }
.hero-delay-2 { animation-delay: 0.12s; }
.hero-delay-3 { animation-delay: 0.20s; }
.hero-delay-4 { animation-delay: 0.28s; }
.hero-delay-5 { animation-delay: 0.42s; }

@keyframes hero-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* SECTIONS */

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

.section-heading {
    margin-bottom: 68px;

    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 32px;
}

.section-heading-label {
    display: flex;
    align-items: baseline;
    gap: 24px;
}

.section-heading-label > span,
.section-heading > span {
    font-size: 12px;
    color: #96999b;
}

.section-heading h2 {
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.section-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    font-size: 13px;
    color: var(--muted);

    transition: color 0.25s ease;
}

.section-more span {
    transition: transform 0.35s var(--ease-out);
}

.section-more:hover {
    color: var(--accent);
}

.section-more:hover span {
    transform: translateX(5px);
}


/* PROJECTS */

.project {
    position: relative;

    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 64px;

    padding: 58px 0;

    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);

    /* Overlap neighbouring borders so there is only one 1px line */
    margin-bottom: -1px;

    transition:
        border-color 0.35s ease,
        transform 0.45s var(--ease-out);
}

.project:last-child {
    margin-bottom: 0;
}

.project:hover {
    z-index: 1;
    border-color: var(--accent);
}

.project-meta {
    margin-bottom: 20px;

    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #84888a;
}

.project h3 {
    font-size: clamp(30px, 4vw, 52px);
    line-height: 1.04;
    letter-spacing: -0.04em;
    font-weight: 500;

    transition:
        transform 0.45s var(--ease-out),
        color 0.35s ease;
}

.project:hover h3 {
    transform: translateX(8px);
}

.project-description {
    max-width: 570px;
    margin-top: 24px;

    font-size: 16px;
    color: #626668;
}

.project-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    gap: 36px;
}

.project-link,
.text-link,
.cv-entry-link {
    width: fit-content;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    font-size: 14px;

    transition: color 0.25s ease;
}

.project-link span,
.text-link span,
.cv-entry-link span {
    display: inline-block;
    transition: transform 0.35s var(--ease-out);
}

.project-link:hover,
.text-link:hover,
.cv-entry-link:hover {
    color: var(--accent);
}

.project:hover .project-link span,
.project-link:hover span,
.text-link:hover span,
.cv-entry-link:hover span {
    transform: translateX(5px);
}


/* SMALL EDITORIAL VISUALS */

.mini-chart {
    width: 100%;
    height: 96px;

    display: flex;
    align-items: center;

    opacity: 0.65;

    transition:
        opacity 0.35s ease,
        transform 0.45s var(--ease-out);
}

.mini-chart svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.chart-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
}

.project:hover .mini-chart,
.project:hover .metric-preview {
    opacity: 1;
    transform: translateY(-3px);
}

.mini-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 4px;
}

.mini-chart-bars span {
    flex: 1;
    height: var(--height);

    border-radius: 3px 3px 0 0;
    background: var(--accent);

    opacity: 0.75;
}

.metric-preview {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;

    opacity: 0.65;

    transition:
        opacity 0.35s ease,
        transform 0.45s var(--ease-out);
}

.metric-preview span {
    padding: 8px 10px;

    border: 1px solid var(--line);
    border-radius: 999px;

    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--muted);
}


/* ABOUT ON HOMEPAGE */

.about-content {
    display: grid;
    grid-template-columns: minmax(0, 900px) auto;
    gap: 60px;
    align-items: end;
}

.about-text {
    max-width: 900px;

    font-size: clamp(30px, 4vw, 52px);
    line-height: 1.13;
    letter-spacing: -0.035em;
    font-weight: 400;
}


/* ABOUT PAGE */

.profile-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
    gap: clamp(48px, 8vw, 120px);
    align-items: start;
}

.portrait-frame {
    position: sticky;
    top: 42px;
}

.portrait-image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 24px;
}

.portrait-note {
    margin-top: 12px;

    font-size: 11px;
    line-height: 1.4;
    color: #999c9e;
}

.profile-copy {
    padding-top: 2px;
}

.profile-large {
    max-width: 800px;

    font-size: clamp(34px, 4.3vw, 60px);
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.profile-body {
    max-width: 660px;
    margin-top: 56px;

    display: grid;
    gap: 24px;

    font-size: 18px;
    line-height: 1.6;
    color: #55595b;
}

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

.interest-card {
    min-height: 320px;
    padding: 28px;

    display: flex;
    flex-direction: column;

    border: 1px solid var(--line);
    border-radius: 20px;

    transition:
        transform 0.4s var(--ease-out),
        border-color 0.3s ease,
        background 0.3s ease;
}

.interest-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.interest-number {
    margin-bottom: auto;

    font-size: 11px;
    color: #9a9d9e;
}

.interest-card h3 {
    margin-top: 60px;

    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.03em;
}

.interest-card p {
    margin-top: 18px;

    max-width: 360px;

    font-size: 15px;
    color: #65696a;
}

.about-closing-copy {
    display: grid;
    grid-template-columns: minmax(0, 900px) auto;
    gap: 56px;
    align-items: end;
}

.about-quote {
    font-size: clamp(36px, 5vw, 68px);
    line-height: 1.05;
    letter-spacing: -0.05em;
    color: var(--accent);
}

.about-actions {
    display: grid;
    gap: 12px;
}


/* HOBBIES */

.hobbies-intro {
    max-width: 620px;
    margin-bottom: 34px;
}

.hobbies-intro p {
    font-size: 17px;
    line-height: 1.6;
    color: #5a5e60;
}

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

.hobby-card {
    min-height: 210px;
    padding: 24px;

    border: 1px solid var(--line);
    border-radius: 18px;
    background: transparent;

    transition:
        transform 0.35s var(--ease-out),
        border-color 0.3s ease,
        background 0.3s ease;
}

.hobby-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.hobby-icon {
    width: 34px;
    height: 34px;
    margin-bottom: 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;
    background: rgba(31, 83, 102, 0.08);
    color: var(--accent);
}

.hobby-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.7;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hobby-card h3 {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.hobby-card p {
    margin-top: 10px;

    font-size: 14px;
    line-height: 1.55;
    color: #65696a;
}


/* RESEARCH / PROJECT INDEX */

/* RESEARCH / PROJECT INDEX */

.work-index {
    padding-top: 0;
    border-top: 0;
}

.index-project {
    position: relative;

    scroll-margin-top: 32px;

    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) auto;
    gap: 36px;

    padding: 58px 0;

    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);

    /* overlap neighbouring borders */
    margin-bottom: -1px;

    transition: border-color 0.3s ease;
}

.index-project:last-child {
    margin-bottom: 0;
}

.index-project:hover {
    z-index: 1;
    border-color: var(--accent);
}

.index-project-number {
    padding-top: 6px;

    font-size: 12px;
    color: #96999b;
}

.index-project h2 {
    max-width: 900px;

    font-size: clamp(34px, 4.4vw, 60px);
    line-height: 1.05;
    letter-spacing: -0.045em;
    font-weight: 500;
}

.index-project p:not(.project-meta) {
    max-width: 650px;
    margin-top: 20px;

    font-size: 16px;
    color: #626668;
}

.index-project-status {
    align-self: end;

    font-size: 12px;
    color: #989b9d;
}

/* Research / project keyword pills */

.project-keywords {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.55rem;
}

.project-keywords span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 2.75rem;
    padding: 0 1rem;

    border: 1px solid var(--line);
    border-radius: 999px;

    font-size: 0.82rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;

    color: var(--muted);
    background: transparent;
}

/* CV */

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

.cv-label {
    padding-top: 5px;

    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8c9092;
}

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

.cv-entry {
    min-height: 124px;
    padding: 28px 0;

    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 32px;

    border-bottom: 1px solid var(--line);
}

.cv-entry-main h2 {
    font-size: clamp(24px, 2.4vw, 34px);
    line-height: 1.1;
    letter-spacing: -0.035em;
    font-weight: 500;
}

.cv-entry-main p {
    margin-top: 8px;
    color: #65696b;
}

.cv-entry-meta,
.cv-entry-link {
    text-align: right;
    font-size: 13px;
    color: #777b7d;
}

.cv-bottom-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.cv-bottom-grid > div {
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.cv-small-label {
    margin-bottom: 8px;

    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #96999b;
}


/* FOOTER */

footer {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 46px var(--page-padding);

    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 28px;

    border-top: 1px solid var(--line);

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

.footer-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 11px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    transition: color 0.25s ease;
}

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


/* SCROLL REVEAL */

.reveal {
    opacity: 0;
    transform: translateY(24px);

    transition:
        opacity 0.8s var(--ease-out),
        transform 0.8s var(--ease-out);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}


/* RESPONSIVE */

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

    .portrait-frame {
        position: static;
        max-width: 520px;
    }

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

    .interest-card {
        min-height: 240px;
    }

    .hobbies-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .cv-section {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .cv-bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 800px) {
    :root {
        --page-padding: 22px;
    }

    .site-header {
        padding-top: 22px;
        padding-bottom: 22px;
    }

    nav {
        gap: 16px;
    }

    nav a {
        font-size: 13px;
    }

    nav a:nth-child(3) {
        display: none;
    }

    .hero {
        min-height: calc(100vh - 86px);
        padding-top: 5vh;
    }

    .hero h1,
    .page-title {
        font-size: clamp(46px, 12vw, 72px);
    }

    .hero-intro,
    .page-lede {
        margin-top: 34px;
    }

    .page-hero {
        min-height: 58vh;
        padding-top: 7vh;
        padding-bottom: 9vh;
    }

    .cv-hero-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 28px;
    }

    .section {
        padding: 88px 0;
    }

    .section-heading {
        margin-bottom: 48px;
    }

    .project {
        grid-template-columns: 1fr;
        gap: 34px;
        padding: 48px 0;
    }

    .project:hover h3 {
        transform: none;
    }

    .project-side {
        gap: 24px;
    }

    .mini-chart,
    .metric-preview {
        max-width: 280px;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 34px;
    }

    .index-project {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .index-project-status {
        grid-column: 2;
        justify-self: start;
    }

    .cv-entry {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 14px;
    }

    .cv-entry-meta,
    .cv-entry-link {
        text-align: left;
    }

    footer {
        grid-template-columns: auto 1fr;
    }

    .footer-links {
        grid-column: 1 / -1;
    }
}

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

@media (max-width: 540px) {
    nav a:nth-child(2) {
        display: none;
    }

    .hero h1,
    .page-title {
        font-size: clamp(43px, 13vw, 62px);
    }

    .hero-intro,
    .page-lede {
        font-size: 17px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .section-heading-label {
        gap: 16px;
    }
}


/* ACCESSIBILITY: REDUCED MOTION */

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

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
    }

    .hero-line,
    .hero-fade,
    .reveal {
        opacity: 1;
        transform: none;
    }
}
