@font-face {
    font-family: "Roboto Condensed";
    src: url("/assets/fonts/Roboto-Condensed-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --paper: #f6f0e6;
    --paper-soft: #fbf8f1;
    --paper-deep: #eee4d5;

    --ink: #14120f;
    --ink-soft: #514a40;
    --ink-muted: #777064;

    --accent: #6b4f32;
    --rule: rgba(20, 18, 15, 0.16);

    --container: 1120px;
    --narrow: 760px;
    --header-height: 72px;

    --font-serif: Georgia, "Times New Roman", Times, serif;
    --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-cond: "Roboto Condensed", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    text-size-adjust: 100%;
}

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

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper-soft);
    font-family: var(--font-sans);
    font-size: 15.5px;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: inherit;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

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

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

.skip-link {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    transform: translateY(-160%);
    padding: 0.65rem 0.85rem;
    color: var(--paper-soft);
    background: var(--ink);
    text-decoration: none;
}

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

.container {
    width: min(100% - 48px, var(--container));
    margin-inline: auto;
}

.container.narrow {
    width: min(100% - 48px, var(--narrow));
}

/* Header / navigation */

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 0 32px;
    background: rgba(251, 248, 241, 0.84);
    border-bottom: 1px solid rgba(20, 18, 15, 0.08);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.site-brand {
    flex: 0 0 auto;
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 0.98rem;
    letter-spacing: 0.035em;
    text-decoration: none;
    white-space: nowrap;
}

.site-nav {
    flex: 0 1 auto;
}

.site-nav ul {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav li {
    margin: 0;
    padding: 0;
}

.site-nav a {
    color: var(--ink);
    font-family: var(--font-cond);
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.105em;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

/* Hero */

.hero {
    position: relative;
    min-height: 100svh;
    display: grid;
    align-items: center;
    overflow: hidden;
    background: var(--paper);
}

.hero-image {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 66% 50%;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(
            90deg,
            rgba(246, 240, 230, 0.95) 0%,
            rgba(246, 240, 230, 0.78) 30%,
            rgba(246, 240, 230, 0.30) 58%,
            rgba(246, 240, 230, 0.08) 100%
        );
}

.hero-copy {
    position: relative;
    z-index: 2;
    width: min(100% - 48px, 640px);
    margin-left: max(24px, calc((100vw - var(--container)) / 2));
    padding-top: var(--header-height);
}

.kicker {
    margin: 0 0 0.85rem;
    color: var(--accent);
    font-family: var(--font-cond);
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.16em;
    line-height: 1.2;
    text-transform: uppercase;
}

.hero h1,
.page-hero h1,
.section h2 {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-serif);
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 1.05;
}

.hero h1 {
    max-width: 12ch;
    font-size: clamp(2.35rem, 5.2vw, 5.1rem);
}

.hero p:last-child {
    max-width: 34rem;
    margin: 1.25rem 0 0;
    color: var(--ink-soft);
    font-size: clamp(0.98rem, 1.35vw, 1.15rem);
    line-height: 1.5;
}

/* Sections */

.section {
    padding: clamp(72px, 10vw, 140px) 0;
    border-top: 1px solid var(--rule);
}

.intro-section,
.works-section,
.contact-section {
    background: var(--paper-soft);
}

.research-section,
.statement-section {
    background: var(--paper-deep);
}

.section-heading {
    max-width: 760px;
    margin-bottom: 3rem;
}

.intro-section h2,
.research-section h2,
.works-section h2,
.statement-section h2,
.contact-section h2 {
    font-size: clamp(1.75rem, 3.4vw, 3.45rem);
}

.section p {
    color: var(--ink-soft);
}

.section p:last-child {
    margin-bottom: 0;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    margin-top: 3rem;
    background: var(--rule);
    border: 1px solid var(--rule);
}

.theme-grid article {
    min-height: 260px;
    padding: clamp(24px, 3vw, 40px);
    background: #f8f3eb;
}

.theme-grid h3 {
    margin: 0 0 0.75rem;
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 1.22rem;
    font-weight: 500;
    line-height: 1.18;
}

.theme-grid p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.9rem;
    line-height: 1.55;
}

.selected-works {
    margin: 2.25rem 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--rule);
}

.selected-works li {
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--rule);
}

.selected-works span {
    display: block;
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 1.12rem;
    line-height: 1.25;
}

.selected-works em {
    display: block;
    margin-top: 0.25rem;
    color: var(--ink-soft);
    font-size: 0.9rem;
    font-style: normal;
    line-height: 1.45;
}

.text-link-row {
    margin-top: 2rem;
    font-weight: 700;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.4rem;
    margin-top: 2rem;
    font-weight: 700;
}

/* Generic page hero */

.page-main {
    padding-top: var(--header-height);
}

.page-hero {
    padding: clamp(72px, 9vw, 128px) 0 clamp(48px, 6vw, 96px);
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
}

.page-hero h1 {
    font-size: clamp(2.2rem, 5vw, 4.35rem);
}

.page-hero p {
    max-width: 40rem;
    margin: 1rem 0 0;
    color: var(--ink-soft);
    font-size: 0.98rem;
}

/* Publications */

.publications-section {
    background: var(--paper-soft);
}

.publication-year {
    margin-bottom: 4rem;
}

.publication-year:last-child {
    margin-bottom: 0;
}

.publication-year h2 {
    margin: 0 0 1.2rem;
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 500;
    line-height: 1.15;
}

.publication-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--rule);
}

.publication-list li {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--rule);
}

.publication-list cite {
    display: block;
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 1.03rem;
    font-style: normal;
    line-height: 1.35;
}

.publication-meta {
    display: block;
    margin-top: 0.32rem;
    color: var(--ink-soft);
    line-height: 1.45;
    font-family: var(--font-cond);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Legal / policy text pages */

.prose {
    max-width: var(--narrow);
    font-size: 0.94rem;
}

.prose h2 {
    margin-top: 2.4rem;
    margin-bottom: 0.75rem;
    font-size: clamp(1.35rem, 2.3vw, 1.85rem);
}

.prose h3 {
    margin-top: 1.8rem;
    margin-bottom: 0.55rem;
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.25;
}

.prose p,
.prose li {
    color: var(--ink-soft);
}

.prose ul,
.prose ol {
    padding-left: 1.4rem;
}

.prose li + li {
    margin-top: 0.45rem;
}

/* Footer */

.site-footer {
    padding: 26px 0;
    color: var(--ink-soft);
    background: #e9dfd0;
    border-top: 1px solid var(--rule);
    font-family: var(--font-cond);
    font-size: 0.76rem;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: 0.015em;
}

.footer-line + .footer-line {
    margin-top: 0.35rem;
}

.footer-line--company {
    color: var(--ink);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
    align-items: center;
}

.footer-nav a {
    color: var(--ink-soft);
    font-family: var(--font-cond);
    font-weight: 400;
    letter-spacing: 0.025em;
}

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

.sep {
    color: var(--ink-muted);
}

/* Menu toggle */

.site-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    margin: 0;
    padding: 0.45rem 0.55rem;
    color: var(--ink);
    background: transparent;
    border: 1px solid rgba(20, 18, 15, 0.22);
    border-radius: 999px;
    font: inherit;
    cursor: pointer;
}

.site-menu-toggle__label {
    font-family: var(--font-cond);
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.11em;
    line-height: 1;
    text-transform: uppercase;
}

.site-menu-toggle__icon {
    display: grid;
    gap: 4px;
    width: 18px;
}

.site-menu-toggle__icon span {
    display: block;
    width: 18px;
    height: 1.5px;
    background: var(--ink);
    transition:
        transform 180ms ease,
        opacity 180ms ease;
}

.site-header--menu-open .site-menu-toggle__icon span:nth-child(1) {
    transform: translateY(5.5px) rotate(45deg);
}

.site-header--menu-open .site-menu-toggle__icon span:nth-child(2) {
    opacity: 0;
}

.site-header--menu-open .site-menu-toggle__icon span:nth-child(3) {
    transform: translateY(-5.5px) rotate(-45deg);
}

.page-updated {
    font-family: var(--font-cond);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.015em;
}

/* Responsive */

@media (max-width: 980px) {
    .theme-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .theme-grid article {
        min-height: 220px;
    }

    .hero-image img {
        object-position: 72% 50%;
    }
}

@media (max-width: 720px) {
    :root {
        --header-height: 64px;
    }

    body {
        font-size: 15px;
    }

    .container,
    .container.narrow {
        width: min(100% - 40px, var(--container));
    }

    .site-header {
        min-height: var(--header-height);
        padding: 0 20px;
        gap: 1rem;
    }

    .site-brand {
        font-size: 0.95rem;
    }

    .site-menu-toggle {
        display: inline-flex;
    }

    .site-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        z-index: 90;
        display: none;
        padding: 0.85rem 20px 1rem;
        background: rgba(251, 248, 241, 0.97);
        border-bottom: 1px solid rgba(20, 18, 15, 0.12);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    .site-header--menu-open .site-nav {
        display: block;
    }

    .site-nav ul {
        display: grid;
        gap: 0.2rem;
        justify-content: stretch;
    }

    .site-nav li {
        width: 100%;
    }

    .site-nav a {
        display: block;
        padding: 0.75rem 0;
        font-size: 0.78rem;
        letter-spacing: 0.105em;
        border-top: 1px solid rgba(20, 18, 15, 0.10);
    }

    .site-nav li:first-child a {
        border-top: 0;
    }

    .hero {
        align-items: end;
        min-height: 100svh;
    }

    .hero-image img {
        object-position: 74% 50%;
    }

    .hero::after {
        background:
            linear-gradient(
                0deg,
                rgba(246, 240, 230, 0.97) 0%,
                rgba(246, 240, 230, 0.90) 42%,
                rgba(246, 240, 230, 0.22) 100%
            );
    }

    .hero-copy {
        width: min(100% - 40px, 540px);
        margin: 0 auto;
        padding: 0 0 56px;
    }

    .hero h1 {
        max-width: 10.5ch;
        font-size: clamp(2.15rem, 10vw, 3.45rem);
    }

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

    .theme-grid article {
        min-height: auto;
    }

    .contact-links {
        display: block;
    }

    .contact-links a {
        display: block;
        width: max-content;
        margin-top: 0.7rem;
    }
}

@media (max-width: 460px) {
    .site-header {
        padding-right: 16px;
        padding-left: 16px;
    }

    .site-menu-toggle__label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .site-menu-toggle {
        width: 42px;
        height: 38px;
        padding: 0;
    }

    .hero-copy {
        padding-bottom: 44px;
    }

    .hero h1 {
        font-size: clamp(2rem, 11vw, 3.05rem);
    }

    .section {
        padding: 56px 0;
    }

    .page-hero {
        padding-top: 64px;
    }
}

/* --------------------------------------------------------------------------
   Typography normalisation layer
   Keeps newer views and older templates on the same type scale.
   Place this at the END of the stylesheet so it wins the cascade.
   -------------------------------------------------------------------------- */

/* Fine-print / eyebrow / kicker styles across all page generations */
.kicker,
.page-kicker,
.section-kicker,
.eyebrow,
.label,
.meta-label,
.overline,
.supertitle,
.pretitle {
    font-family: var(--font-cond);
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    line-height: 1.2;
    text-transform: uppercase;
}

.page-updated,
.publication-meta,
.cv-meta,
.framework-meta {
    font-family: var(--font-cond);
    font-size: 0.76rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.45;
    text-transform: none;
}

.footer-line,
.footer-nav,
.footer-nav a,
.site-footer {
    font-family: var(--font-cond);
    font-size: 0.76rem;
    font-weight: 400;
    letter-spacing: 0.015em;
    line-height: 1.45;
    text-transform: none;
}

/* The footer and metadata should be smaller than content text, not equal to it. */
.site-footer,
.site-footer p,
.site-footer li,
.footer-line,
.footer-nav,
.footer-nav a {
    font-family: var(--font-cond);
    font-size: 0.76rem;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: 0.015em;
}

/* Page hero normalisation for all non-home pages */
.page-hero .kicker,
.page-hero .page-kicker,
.page-hero .eyebrow,
.page-hero .overline {
    margin: 0 0 0.75rem;
    font-size: 0.68rem;
}

.page-hero h1,
.page-title,
.cv-title,
.frameworks-title {
    font-family: var(--font-serif);
    font-size: clamp(2.1rem, 4.8vw, 4.05rem);
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 1.05;
}

.page-hero p,
.page-lead,
.lead,
.cv-lead,
.frameworks-lead {
    max-width: 40rem;
    color: var(--ink-soft);
    font-size: 0.95rem;
    line-height: 1.55;
}

/* Generic section heading normalisation, including newer view-specific classes */
.section h2,
.prose h2,
.cv-section h2,
.framework-section h2,
.framework-card h2,
.framework-card h3,
.cv-block h2,
.content-block h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.3rem, 2.15vw, 1.75rem);
    font-weight: 500;
    letter-spacing: -0.015em;
    line-height: 1.16;
}

.section h3,
.prose h3,
.cv-section h3,
.framework-section h3,
.cv-block h3,
.content-block h3 {
    font-family: var(--font-serif);
    font-size: 1.08rem;
    font-weight: 500;
    line-height: 1.22;
}

/* Normal content text across new pages */
.prose,
.prose p,
.prose li,
.cv-section,
.cv-section p,
.cv-section li,
.framework-section,
.framework-section p,
.framework-section li,
.framework-card,
.framework-card p,
.framework-card li,
.content-block,
.content-block p,
.content-block li {
    font-size: 0.92rem;
    line-height: 1.58;
}

/* Link rows were too visually loud after type-scale reduction. */
.text-link-row,
.text-link-row a,
.contact-links,
.contact-links a {
    font-size: 0.92rem;
    font-weight: 600;
}

/* Home hero remains large, but no longer behaves like a magazine splash. */
.hero h1 {
    font-size: clamp(2.25rem, 4.9vw, 4.75rem);
}

.hero p:last-child {
    font-size: clamp(0.95rem, 1.2vw, 1.08rem);
}

/* Cards/lists used by newer framework and CV pages. */
.framework-grid,
.cv-grid,
.card-grid {
    font-size: 0.92rem;
}

.framework-card,
.cv-card,
.info-card {
    font-size: 0.92rem;
    line-height: 1.55;
}

/* Mobile final pass */
@media (max-width: 720px) {
    body {
        font-size: 14.75px;
    }

    .kicker,
    .page-kicker,
    .section-kicker,
    .eyebrow,
    .label,
    .meta-label,
    .overline,
    .supertitle,
    .pretitle,
    .page-updated {
        font-size: 0.64rem;
        letter-spacing: 0.14em;
    }

    .page-hero h1,
    .page-title,
    .cv-title,
    .frameworks-title {
        font-size: clamp(1.95rem, 8.5vw, 3.15rem);
    }

    .page-hero p,
    .page-lead,
    .lead,
    .cv-lead,
    .frameworks-lead {
        font-size: 0.92rem;
    }

    .hero h1 {
        font-size: clamp(2rem, 9.4vw, 3.25rem);
    }

    .hero p:last-child {
        font-size: 0.94rem;
    }

    .site-nav a {
        font-size: 0.74rem;
    }

    .section h2,
    .prose h2,
    .cv-section h2,
    .framework-section h2,
    .framework-card h2,
    .framework-card h3,
    .cv-block h2,
    .content-block h2 {
        font-size: clamp(1.22rem, 5.2vw, 1.58rem);
    }
}

@media (max-width: 460px) {
    .hero h1 {
        font-size: clamp(1.92rem, 10vw, 2.85rem);
    }

    .page-hero h1,
    .page-title,
    .cv-title,
    .frameworks-title {
        font-size: clamp(1.85rem, 9vw, 2.75rem);
    }

    .site-footer,
    .site-footer p,
    .site-footer li,
    .footer-line,
    .footer-nav,
    .footer-nav a {
        font-size: 0.72rem;
    }
}
