:root {
    --paper: #f5f5f2;
    --paper-deep: #eeeee8;
    --ink: #292824;
    --muted: #62625e;
    --line: #d9d9d3;
    --accent: #3f5948;
    --serif: Georgia, "Times New Roman", serif;
    --sans: Arial, Helvetica, sans-serif;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: inherit;
}

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

section {
    scroll-margin-top: 75px;
}

/* ---------- Navigation ---------- */

.navbar {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.navbar-brand {
    color: var(--ink) !important;
    font-family: var(--serif);
    font-size: 1.45rem;
    letter-spacing: -0.035em;
}

.navbar .nav-link {
    color: var(--muted);
    font-size: 0.83rem;
    transition: color 180ms ease;
}

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

/* ---------- Section headings ---------- */

.eyebrow {
    margin: 0 0 1.2rem;
    color: var(--accent);
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    line-height: 1.5;
    text-transform: uppercase;
}

.section-heading,
.work-heading,
.contact-inner {
    color: var(--ink);
}

.section-heading {
    max-width: 620px;
    margin: 0 auto 3.5rem;
    text-align: center;
}

.section-heading h2,
.work-heading h2,
.contact-inner h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(2.2rem, 4.5vw, 3.6rem);
    font-weight: 400;
    letter-spacing: -0.045em;
    line-height: 1.08;
}

.section-heading > p:last-child {
    max-width: 440px;
    margin: 1rem auto 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.8;
}

/* ---------- Buttons and text links ---------- */

.button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 48px;
    padding: 0.8rem 1.15rem;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--paper);
    font-size: 0.83rem;
    text-decoration: none;
    transition: background 180ms ease, color 180ms ease,
        border-color 180ms ease;
}

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

.button-text {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    width: fit-content;
    padding: 0 0 0.3rem;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 0.85rem;
    text-decoration: none;
    transition: border-color 180ms ease, color 180ms ease;
}

.button-text:hover {
    border-color: var(--accent);
    color: var(--accent);
}

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

.hero-section {
    position: relative;
    overflow: hidden;
    padding: clamp(4rem, 8vw, 7.5rem) 0 6rem;
    background: var(--paper);
}

.hero-section .container {
    max-width: 1180px;
}

.hero-image-column {
    position: relative;
}

.hero-image-wrap {
    position: relative;
    max-width: 470px;
    margin: 0 auto;
}

.hero-section .hero-image {
    display: block;
    width: 100%;
    height: clamp(350px, 48vw, 570px);
    object-fit: cover;
    object-position: center;
}

.hero-image-caption {
    display: block;
    padding-top: 0.85rem;
    color: var(--muted);
    font-size: 0.67rem;
    letter-spacing: 0.07em;
    line-height: 1.5;
    text-transform: uppercase;
}

.hero-section .hero-copy {
    max-width: 540px;
    margin-left: auto;
    padding: 1rem 0;
}

.hero-section .hero-title {
    max-width: 620px;
    margin: 0 0 1.6rem;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(2.9rem, 5.2vw, 5.2rem);
    font-weight: 400;
    letter-spacing: -0.06em;
    line-height: 0.99;
}

.hero-section .hero-description {
    max-width: 450px;
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.9;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.6rem;
    margin-top: 2rem;
}

.hero-bottom-note {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.7rem;
    margin-top: 4rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
}

.scroll-cue {
    position: absolute;
    right: max(24px, calc((100% - 1140px) / 2));
    bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.7rem;
    text-decoration: none;
}

.scroll-cue-arrow {
    display: inline-block;
    color: var(--accent);
    font-size: 1.2rem;
    transition: transform 180ms ease;
}

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

/* ---------- Alternate homepage hero classes ---------- */

.home-hero {
    padding: 5rem 0 2rem;
    background: var(--paper);
}

.home-hero .hero-image {
    display: block;
    width: 380px;
    max-width: 100%;
    height: 480px;
    object-fit: cover;
}

.home-hero .hero-copy {
    max-width: 35rem;
    font-family: var(--serif);
}

.hero-kicker {
    color: var(--muted);
    font-family: var(--sans);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.home-hero .hero-title {
    color: var(--ink);
    font-size: clamp(2.8rem, 5vw, 4.5rem);
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.home-hero .hero-description {
    max-width: 31rem;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.8;
}

.hero-button {
    border-color: var(--ink);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 0.85rem;
    transition: background-color 200ms ease, color 200ms ease;
}

.hero-button:hover {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--paper);
}

/* ---------- Bouncing arrow animation ---------- */

@keyframes bounce-down {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(9px);
    }
}

/* ---------- Experience section ---------- */

.experience-section {
    border-top: none !important;
    border-bottom: none !important;
}

.experience-section > .container {
    max-width: 1100px;
}

.experience-heading {
    margin: 0;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 400;
    letter-spacing: -0.04em;
}

.experience-intro {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* Scrolling area that controls the drawing animation */
.experience-scroll {
    position: relative;
    height: 220vh;
}

/* Keep the tree in view while the user scrolls */
.experience-sticky {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

/* Tree layout */
.experience-tree-layout {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 680px;
    margin: 0 auto;
}

/* SVG tree */
.experience-tree-svg {
    position: absolute;
    top: 0;
    left: 50%;
    display: block;
    width: 300px;
    height: 680px;
    overflow: visible;
    transform: translateX(-50%);
}

/* Tree trunk and branches */
.tree-stroke {
    fill: none;
    stroke: #7e927e;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Branch connection points */
.tree-node {
    fill: var(--accent);
    opacity: 0;
    transition: opacity 350ms ease;
}

.tree-node.is-visible {
    opacity: 1;
}

/* Experience labels */
.tree-label {
    position: absolute;
    top: var(--tree-top);
    width: 255px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 450ms ease, transform 450ms ease;
}

.tree-label.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.tree-label--left {
    left: calc(50% - 420px);
    text-align: right;
}

.tree-label--right {
    left: calc(50% + 165px);
    text-align: left;
}

.tree-label-type {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--accent);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    line-height: 1.5;
    text-transform: uppercase;
}

.tree-label h3 {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.35rem;
    font-weight: 400;
    letter-spacing: -0.025em;
    line-height: 1.25;
}

.tree-label-place {
    margin: 0.5rem 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.6;
}

.experience-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.experience-footer p {
    margin: 0;
    color: var(--muted);
    font-size: 0.83rem;
    line-height: 1.7;
}

.work-section {
    padding: clamp(5rem, 9vw, 8rem) 0;
    background: var(--paper);
}

.work-section > .container {
    max-width: 1200px;
}

#work {
    padding-top: 5rem !important;
    padding-bottom: 6rem !important;
    background: var(--paper);
}

.work-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}

.work-heading .eyebrow {
    margin-bottom: 0.8rem;
}

.work-heading h2 {
    font-size: clamp(2.5rem, 5vw, 4.3rem);
}

.work-heading-note {
    max-width: 270px;
    margin: 0 0 0.35rem;
    color: var(--muted);
    font-size: 0.83rem;
    line-height: 1.8;
}

.work-intro {
    max-width: 650px;
    margin-right: auto;
    margin-left: auto;
}

.work-intro .work-title {
    display: block;
    width: 100%;
    margin: 0 0 1rem;
    padding: 0;
    border: 0;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 400;
    letter-spacing: -0.04em;
    line-height: 1.1;
    text-align: center;
}

.work-description {
    max-width: 36rem;
    margin: 0 auto;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Featured article */
.featured-work {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
    margin-bottom: 5.5rem;
}

.featured-image {
    display: block;
    overflow: hidden;
    background: var(--paper-deep);
}

.featured-image img {
    display: block;
    width: 100%;
    aspect-ratio: 5 / 4;
    object-fit: cover;
    transition: transform 450ms ease;
}

.featured-image:hover img {
    transform: scale(1.025);
}

.featured-copy {
    max-width: 470px;
    padding: 1rem 0;
}

.featured-copy > .eyebrow {
    margin-bottom: 1.2rem;
}

.work-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.8rem;
    margin-bottom: 1.1rem;
}

.work-publication {
    color: var(--ink);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.5;
}

.work-category {
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.5;
}

.work-category::before {
    margin-right: 0.8rem;
    color: #a6a69f;
    content: "/";
}

.featured-title {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(2rem, 3.5vw, 3.25rem);
    font-weight: 400;
    letter-spacing: -0.045em;
    line-height: 1.1;
}

.featured-title a,
.work-card-title a {
    color: inherit;
    text-decoration: none;
    text-decoration-color: var(--accent);
    text-underline-offset: 4px;
}

.featured-title a:hover,
.work-card-title a:hover {
    text-decoration: underline;
}

.featured-deck {
    margin: 1.3rem 0 1.6rem;
    color: var(--muted);
    font-family: var(--serif);
    font-size: 1.05rem;
    line-height: 1.75;
}

/* Article grid heading */
.work-grid-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.work-grid-heading h3 {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.8rem;
    font-weight: 400;
    letter-spacing: -0.03em;
}

.work-grid-heading > span {
    color: var(--muted);
    font-size: 0.75rem;
}

/* Article cards */
.work-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    transition: border-color 200ms ease;
}

.work-card:hover {
    border-bottom-color: var(--ink);
}

.work-card-link-wrapper {
    display: flex;
    height: 100%;
    flex-direction: column;
    color: var(--ink);
    text-decoration: none;
}

.work-card-image {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: var(--paper-deep);
    transition: opacity 200ms ease, transform 400ms ease;
}

.work-card-link-wrapper:hover .work-card-image {
    opacity: 0.85;
}

.work-card-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.3rem 0.1rem 1.5rem;
}

.work-card-content .work-card-meta {
    margin-bottom: 0.9rem;
}

.publication-name {
    display: inline-block;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.5;
    text-transform: uppercase;
}

.work-card h3,
.work-card-title {
    margin-top: 0.65rem;
    margin-bottom: 0.75rem;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.35;
}

.work-card-deck,
.work-card-description {
    margin-bottom: 0;
    color: var(--muted);
    font-family: var(--serif);
    font-size: 0.95rem;
    line-height: 1.6;
}

.work-card-deck {
    margin-top: 0.85rem;
    margin-bottom: 1.2rem;
}

.work-card-link,
.work-card-read-more {
    margin-top: auto;
    padding-top: 1.25rem;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
}

.work-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.work-card-link:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.work-card-read-more {
    margin-bottom: 0;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 0.75rem;
}

.contact-section {
    border-top: none !important;
}

.contact-inner {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}

.contact-inner h2 {
    font-size: clamp(2.3rem, 5vw, 4rem);
}

.contact-inner > p:not(.eyebrow) {
    max-width: 490px;
    margin: 1.25rem auto 1.75rem;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.8;
}

/* ---------- Tablet layouts ---------- */

@media (max-width: 991px) {
    .hero-section .hero-title {
        font-size: clamp(2.8rem, 6vw, 4rem);
    }

    .experience-tree-layout {
        max-width: 760px;
    }

    .tree-label {
        width: 220px;
    }

    .tree-label--left {
        left: calc(50% - 350px);
    }

    .tree-label--right {
        left: calc(50% + 135px);
    }

    .tree-label h3 {
        font-size: 1.2rem;
    }

    .featured-work {
        gap: 2.5rem;
    }
}

/* ---------- Mobile layouts ---------- */

@media (max-width: 767px) {
    html {
        scroll-padding-top: 72px;
    }

    .hero-section {
        padding: 2.5rem 0 4.5rem;
    }

    .hero-section .row {
        row-gap: 2rem !important;
    }

    .hero-image-wrap {
        max-width: none;
    }

    .hero-section .hero-image {
        height: clamp(260px, 75vw, 430px);
    }

    .hero-section .hero-copy {
        max-width: none;
        margin: 0;
        padding-top: 0.5rem;
    }

    .hero-section .hero-title {
        max-width: 580px;
        font-size: clamp(2.9rem, 12vw, 4.4rem);
    }

    .hero-section .hero-description {
        font-size: 0.95rem;
    }

    .hero-bottom-note {
        margin-top: 2.5rem;
    }

    .scroll-cue {
        right: 1.25rem;
        bottom: 1rem;
    }

    .home-hero {
        padding-top: 3rem;
    }

    .home-hero .hero-image {
        width: 100%;
        max-width: 380px;
        height: 340px;
    }

    .home-hero .hero-title {
        font-size: 2.8rem;
    }

    .experience-section {
        padding-top: 3.5rem !important;
        padding-bottom: 2rem !important;
    }

    .section-heading {
        margin-bottom: 2.5rem;
        text-align: left;
    }

    .section-heading > p:last-child {
        margin-left: 0;
    }

    /* Disable the pinned tree animation on small screens. */
    .experience-scroll {
        height: auto;
    }

    .experience-sticky {
        position: static;
        display: block;
        height: auto;
    }

    .experience-tree-layout {
        display: flex;
        flex-direction: column;
        gap: 0;
        height: auto;
        padding-left: 1.3rem;
        border-left: 1px solid #aeb9ab;
    }

    .experience-tree-svg {
        display: none;
    }

    .tree-label,
    .tree-label--left,
    .tree-label--right {
        position: relative;
        top: auto;
        left: auto;
        width: auto;
        padding: 0 0 2rem 1.2rem;
        opacity: 1;
        text-align: left;
        transform: none;
    }

    .tree-label::before {
        position: absolute;
        top: 0.28rem;
        left: -1.65rem;
        width: 8px;
        height: 8px;
        border: 1px solid var(--accent);
        border-radius: 50%;
        background: var(--paper-deep);
        content: "";
    }

    .tree-label h3 {
        font-size: 1.45rem;
    }

    .experience-footer {
        align-items: flex-start;
        flex-direction: column;
        margin-top: 0.5rem;
    }

    #work,
    .work-section {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }

    .work-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.8rem;
        margin-bottom: 2rem;
    }

    .work-heading-note {
        max-width: 360px;
    }

    .featured-work {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 3.5rem;
    }

    .featured-image img {
        aspect-ratio: 4 / 3;
    }

    .featured-copy {
        max-width: none;
        padding: 0;
    }

    .featured-title {
        font-size: clamp(2.2rem, 9vw, 3.1rem);
    }

    .work-grid-heading {
        margin-bottom: 1rem;
    }

    .work-card-title,
    .work-card h3 {
        font-size: 1.5rem;
    }

    .work-card-image {
        height: 240px;
    }

    .contact-section {
        padding: 4rem 0;
    }
}

/* ---------- Accessibility: reduced motion ---------- */

@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;
        scroll-behavior: auto !important;
    }

    .tree-stroke {
        stroke-dashoffset: 0 !important;
    }

    .tree-label,
    .tree-label.is-visible {
        opacity: 1;
        transform: none;
    }

    .tree-node {
        opacity: 1;
    }

    .scroll-cue {
        animation: none;
    }
}

@keyframes bounce-down {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(7px);
    }
}