@font-face {
    font-family: "Geist";
    src: url("fonts/Geist-Variable.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "Geist Mono";
    src: url("fonts/GeistMono-Variable.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

/* Shape rule: interactive controls are full pills, containers use --radius.
   Z-index scale: story stage 0, story copy 1, header 100, skip link 300. */
:root {
    --bg: #f3f4f8;
    --bg-raised: #ffffff;
    --ink: #0d1018;
    --ink-2: #474e60;
    --ink-3: #626a7c;
    --line: rgba(13, 16, 24, 0.09);
    --line-strong: rgba(13, 16, 24, 0.16);
    --accent: #2448ff;
    --accent-hover: #1a37d6;
    --accent-text: #2040ee;
    --on-accent: #ffffff;
    --accent-soft: rgba(36, 72, 255, 0.08);
    --header-bg: rgba(243, 244, 248, 0.8);

    --radius: 1.25rem;
    --page: clamp(1.25rem, 4vw, 4rem);
    --max: 1440px;
    --header-height: 4.25rem;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);

    color-scheme: light;
    font-family: "Geist", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #090b11;
        --bg-raised: #10131b;
        --ink: #eef0f6;
        --ink-2: #b2b8c8;
        --ink-3: #8d95a8;
        --line: rgba(238, 240, 246, 0.08);
        --line-strong: rgba(238, 240, 246, 0.16);
        --accent: #3d5cff;
        --accent-hover: #5371ff;
        --accent-text: #93a6ff;
        --on-accent: #ffffff;
        --accent-soft: rgba(91, 120, 255, 0.12);
        --header-bg: rgba(9, 11, 17, 0.74);
        color-scheme: dark;
    }
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
}

body.menu-open {
    overflow: hidden;
}

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

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

button {
    color: inherit;
    font: inherit;
}

h1, h2, h3, p {
    margin: 0;
}

svg {
    display: block;
}

:focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 4px;
    border-radius: 0.25rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 300;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 0.875rem;
    transform: translateY(-160%);
    transition: transform 200ms var(--ease);
}

.skip-link:focus {
    transform: none;
}

.scroll-sentinel {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 24px;
    pointer-events: none;
}

.eyebrow {
    color: var(--accent-text);
    font-family: "Geist Mono", ui-monospace, Menlo, monospace;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* Header */

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 100;
    border-bottom: 1px solid transparent;
    transition: background 300ms ease, border-color 300ms ease;
}

.site-header.is-scrolled,
.site-header.menu-active {
    border-color: var(--line);
    background: var(--header-bg);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

.header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: min(100%, var(--max));
    height: var(--header-height);
    margin: 0 auto;
    padding-inline: var(--page);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    justify-self: start;
    font-size: 1.25rem;
    font-weight: 650;
    letter-spacing: -0.06em;
    line-height: 1;
}

.brand-mark {
    width: 0.38rem;
    height: 0.38rem;
    margin-top: 0.38rem;
    border-radius: 50%;
    background: var(--accent);
}

.primary-nav {
    display: flex;
    gap: 2rem;
}

.primary-nav a {
    color: var(--ink-2);
    font-size: 0.875rem;
    transition: color 200ms ease;
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
    color: var(--ink);
}

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

.language-switcher {
    display: flex;
    padding: 0.2rem;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.language-switcher button {
    min-width: 2.25rem;
    padding: 0.3rem 0.5rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-3);
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 200ms ease, color 200ms ease;
}

.language-switcher button[aria-pressed="true"] {
    background: var(--ink);
    color: var(--bg);
}

/* Buttons */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 3.25rem;
    padding: 0 1.5rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.9375rem;
    font-weight: 550;
    white-space: nowrap;
    transition: transform 300ms var(--ease), background 200ms ease, border-color 200ms ease, color 200ms ease;
}

.button svg {
    width: 1.05rem;
    height: 1.05rem;
    fill: currentColor;
    transition: transform 300ms var(--ease);
}

.button:hover svg,
.button:focus-visible svg {
    transform: translateX(4px);
}

.button:active {
    transform: scale(0.98);
}

.button-primary {
    background: var(--accent);
    color: var(--on-accent);
}

.button-primary:hover,
.button-primary:focus-visible {
    background: var(--accent-hover);
}

.button-ghost {
    border-color: var(--line-strong);
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    color: var(--ink);
}

.button-ghost:hover,
.button-ghost:focus-visible {
    border-color: var(--ink);
}

.button-small {
    min-height: 2.5rem;
    padding: 0 1.1rem;
    font-size: 0.875rem;
}

.menu-toggle {
    position: relative;
    display: none;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.menu-toggle > span:not(.sr-only) {
    position: absolute;
    width: 1rem;
    height: 1.5px;
    background: var(--ink);
    transition: transform 300ms var(--ease);
}

.menu-toggle > span:nth-of-type(2) { transform: translateY(-3px); }
.menu-toggle > span:nth-of-type(3) { transform: translateY(3px); }
.menu-toggle[aria-expanded="true"] > span:nth-of-type(2) { transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] > span:nth-of-type(3) { transform: rotate(-45deg); }

.mobile-nav {
    display: none;
}

/* Story: one sticky field under the hero and the three principles */

.story {
    position: relative;
    overflow: clip;
}

.stage {
    position: sticky;
    top: 0;
    z-index: 0;
    height: 100dvh;
    margin-bottom: -100dvh;
    --f-dust: var(--ink-3);
    --f-accent: var(--accent);
    --f-guide: var(--accent-text);
    --f-ink: var(--ink);
    --f-muted: var(--ink-3);
    --f-bg: var(--bg);
}

.stage canvas,
.panel-visual canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.chapter {
    position: relative;
    z-index: 1;
    width: min(100%, var(--max));
    min-height: 190dvh;
    margin: 0 auto;
    padding-inline: var(--page);
    pointer-events: none;
}

.chapter-hero {
    min-height: 100dvh;
}

.chapter-copy {
    position: sticky;
    top: 0;
    display: grid;
    align-content: center;
    max-width: 34rem;
    min-height: 100dvh;
    padding-block: calc(var(--header-height) + 1rem) 2rem;
    pointer-events: auto;
}

/* Only the chapter at the middle of the viewport owns the field. */
.js .chapter .chapter-copy {
    transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}

.js .chapter:not(.is-active) .chapter-copy {
    opacity: 0.1;
    transform: translateY(1.5rem);
}

.hero-title {
    margin-top: 1.75rem;
    font-size: clamp(3.75rem, 8vw, 8rem);
    font-weight: 640;
    letter-spacing: -0.065em;
    line-height: 0.9;
}

.hero-title .line {
    display: block;
    padding-bottom: 0.06em;
    overflow: hidden;
}

.hero-title .line > span {
    display: inline-block;
}

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

.hero-lead {
    max-width: 27rem;
    margin-top: 2rem;
    color: var(--ink-2);
    font-size: clamp(1.0625rem, 1.3vw, 1.1875rem);
    line-height: 1.6;
}

.hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2.5rem;
}

.kicker {
    margin-bottom: 1.5rem;
    color: var(--accent-text);
    font-size: 1.125rem;
    font-weight: 550;
    letter-spacing: -0.02em;
}

.chapter h2 {
    font-size: clamp(3rem, 6.2vw, 6.25rem);
    font-weight: 620;
    letter-spacing: -0.06em;
    line-height: 0.95;
}

.chapter-body {
    max-width: 25rem;
    margin-top: 1.75rem;
    color: var(--ink-2);
    font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
    line-height: 1.55;
}

@media (prefers-reduced-motion: no-preference) {
    .hero-enter {
        animation: rise 1s var(--ease) both;
        animation-delay: calc(var(--i) * 110ms + 150ms);
    }

    .hero-title .line > span {
        animation: line-up 1.2s var(--ease) both;
        animation-delay: calc(var(--i) * 110ms + 150ms);
    }

    .stage {
        animation: fade 1.6s ease 300ms both;
    }
}

/* Expertise */

.expertise {
    width: min(100%, var(--max));
    margin: 0 auto;
    padding: clamp(6rem, 11vw, 10rem) var(--page) clamp(5rem, 9vw, 8rem);
}

.expertise-heading h2 {
    max-width: 18ch;
    font-size: clamp(2.5rem, 5vw, 4.75rem);
    font-weight: 600;
    letter-spacing: -0.055em;
    line-height: 1;
}

.experience {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 2.5rem;
}

.experience strong {
    color: var(--accent-text);
    font-size: clamp(2.75rem, 4vw, 3.75rem);
    font-weight: 600;
    letter-spacing: -0.06em;
    line-height: 1;
}

.experience span {
    max-width: 19rem;
    color: var(--ink-2);
    font-size: 1rem;
    line-height: 1.5;
}

.expertise-index {
    display: grid;
    grid-template-columns: 7fr 5fr;
    gap: clamp(2rem, 6vw, 6rem);
    margin-top: clamp(3.5rem, 6vw, 5rem);
}

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

.expertise-list button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    width: 100%;
    padding: 1.5rem 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: none;
    color: var(--ink-3);
    font-size: clamp(1.625rem, 3vw, 2.75rem);
    font-weight: 560;
    letter-spacing: -0.045em;
    line-height: 1.1;
    text-align: left;
    cursor: pointer;
    transition: color 300ms ease, padding 500ms var(--ease);
}

/* Unselected items hint that they open something: the arrow slides in at half strength on hover. */
.expertise-list button:hover {
    color: var(--ink-2);
}

.expertise-list button:hover svg {
    opacity: 0.45;
    transform: translateX(-0.35rem);
}

/* Inline description: the mobile accordion body. Hidden on desktop, where the side panel shows it. */
.expertise-detail {
    display: none;
}

.expertise-list button svg {
    flex: none;
    width: 1.75rem;
    height: 1.75rem;
    fill: currentColor;
    opacity: 0;
    transform: translateX(-0.75rem);
    transition: opacity 300ms ease, transform 500ms var(--ease);
}

.expertise-list button[aria-selected="true"] {
    padding-left: 1.25rem;
    color: var(--ink);
}

.expertise-list button[aria-selected="true"] svg {
    color: var(--accent-text);
    opacity: 1;
    transform: none;
}

.expertise-panel {
    position: sticky;
    top: calc(var(--header-height) + 3rem);
    align-self: start;
}

.panel-visual {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius);
    background: radial-gradient(80% 90% at 85% 10%, rgba(255, 255, 255, 0.16), transparent 60%), var(--accent);
    --f-dust: rgba(255, 255, 255, 0.55);
    --f-accent: #ffffff;
    --f-guide: rgba(255, 255, 255, 0.72);
    --f-ink: #ffffff;
    --f-muted: rgba(255, 255, 255, 0.7);
    --f-bg: var(--accent);
}

.expertise-panel h3 {
    margin-top: 2rem;
    font-size: 1.5rem;
    font-weight: 580;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.expertise-panel p {
    max-width: 32rem;
    margin-top: 0.85rem;
    color: var(--ink-2);
    font-size: 1.0625rem;
    line-height: 1.6;
}

/* Swapped panel copy settles in rather than snapping. */
@media (prefers-reduced-motion: no-preference) {
    .expertise-panel.is-swapping h3,
    .expertise-panel.is-swapping p {
        animation: rise 500ms var(--ease) both;
    }

    .expertise-panel.is-swapping p {
        animation-delay: 60ms;
    }
}

/* Contact */

.contact {
    width: min(100%, var(--max));
    margin: 0 auto;
    padding: clamp(6rem, 10vw, 9rem) var(--page) clamp(7rem, 12vw, 11rem);
    border-top: 1px solid var(--line);
}

.contact h2 {
    max-width: 14ch;
    font-size: clamp(3rem, 7vw, 7rem);
    font-weight: 620;
    letter-spacing: -0.06em;
    line-height: 0.95;
}

.contact-content > p {
    max-width: 30rem;
    margin-top: 2rem;
    color: var(--ink-2);
    font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
    line-height: 1.6;
}

.contact-mail {
    display: inline-flex;
    align-items: center;
    gap: clamp(0.75rem, 1.5vw, 1.25rem);
    margin-top: clamp(2.5rem, 5vw, 3.5rem);
    padding-bottom: 0.4rem;
    background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
    color: var(--accent-text);
    font-size: clamp(1.75rem, 5vw, 4.5rem);
    font-weight: 560;
    letter-spacing: -0.045em;
    line-height: 1.1;
    transition: background-size 500ms var(--ease);
}

.contact-mail svg {
    width: 0.7em;
    height: 0.7em;
    fill: currentColor;
    transition: transform 500ms var(--ease);
}

.contact-mail:hover,
.contact-mail:focus-visible {
    background-size: 100% 2px;
}

.contact-mail:hover svg,
.contact-mail:focus-visible svg {
    transform: translate(0.12em, -0.12em);
}

/* Footer */

.site-footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1.5rem;
    width: min(100%, var(--max));
    margin: 0 auto;
    padding: 2rem var(--page) 2.5rem;
    border-top: 1px solid var(--line);
}

.footer-meta {
    color: var(--ink-3);
    font-size: 0.875rem;
}

.back-to-top {
    display: inline-flex;
    align-items: center;
    justify-self: end;
    gap: 0.6rem;
    color: var(--ink-2);
    font-size: 0.875rem;
    transition: color 200ms ease;
}

.back-to-top svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
    transition: transform 300ms var(--ease);
}

.back-to-top:hover,
.back-to-top:focus-visible {
    color: var(--ink);
}

.back-to-top:hover svg {
    transform: translateY(-3px);
}

/* Scroll reveal */

@media (prefers-reduced-motion: no-preference) {
    .js .reveal {
        opacity: 0;
        transform: translateY(2rem);
        transition: opacity 900ms var(--ease), transform 900ms var(--ease);
    }

    .js .reveal.is-visible {
        opacity: 1;
        transform: none;
    }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(1.25rem); }
}

@keyframes line-up {
    from { transform: translateY(105%); }
}

@keyframes fade {
    from { opacity: 0; }
}

/* Responsive */

@media (max-width: 1100px) {
    .primary-nav {
        display: none;
    }

    .header-inner {
        grid-template-columns: 1fr auto;
    }
}

@media (max-width: 899px) {
    /* The field takes the lower part of the screen; copy sits above it. */
    .chapter-copy {
        align-content: start;
        padding-top: calc(var(--header-height) + 2rem);
    }

    .chapter {
        min-height: 140dvh;
    }

    .chapter-hero {
        min-height: 100dvh;
    }

    .expertise-index {
        grid-template-columns: 1fr;
    }

    .expertise-panel {
        position: static;
        order: -1;
    }

    .panel-visual {
        aspect-ratio: 16 / 9;
    }

    /* On narrow screens the list is an accordion: the description opens under its own title,
       so the panel keeps only the visual and the title is not shown twice. */
    /* Visually hidden but still read: the tabpanel stays the accessible source of the description. */
    .expertise-panel h3,
    .expertise-panel p {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .expertise-detail {
        display: block;
        overflow: hidden;
        max-height: 0;
        color: var(--ink-2);
        font-size: 1rem;
        line-height: 1.6;
        transition: max-height 500ms var(--ease), padding 500ms var(--ease);
    }

    .expertise-list button[aria-selected="true"] + .expertise-detail {
        max-height: 14rem;
        padding: 0 0 1.5rem 1.25rem;
        border-bottom: 1px solid var(--line);
    }

    .expertise-list button[aria-selected="true"] {
        border-bottom-color: transparent;
    }

    .expertise {
        padding-top: 3rem;
    }
}

@media (max-width: 760px) {
    :root {
        --header-height: 4rem;
    }

    .header-cta {
        display: none;
    }

    .menu-toggle {
        display: grid;
    }

    /* The open header has backdrop-filter, which makes it the containing block for this fixed panel,
       so the height must be explicit; "bottom: 0" would end the panel at the header's own bottom edge. */
    .mobile-nav {
        position: fixed;
        top: var(--header-height);
        right: 0;
        left: 0;
        height: calc(100dvh - var(--header-height));
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        padding: 2rem var(--page);
        background: var(--bg);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-0.75rem);
        transition: opacity 250ms ease, visibility 250ms ease, transform 250ms var(--ease);
    }

    .site-header.menu-active .mobile-nav {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .mobile-nav a:not(.button) {
        padding: 1rem 0;
        border-bottom: 1px solid var(--line);
        font-size: clamp(2rem, 9vw, 3rem);
        font-weight: 580;
        letter-spacing: -0.05em;
    }

    .mobile-nav .button {
        margin-top: 2rem;
    }

    .hero-title {
        margin-top: 1.25rem;
        font-size: clamp(3.4rem, 16vw, 5.5rem);
    }

    .hero-lead {
        margin-top: 1.25rem;
        font-size: 1rem;
    }

    .hero-ctas {
        margin-top: 1.5rem;
    }

    .hero-ctas .button {
        min-height: 3rem;
        padding: 0 1.2rem;
    }

    .kicker {
        margin-bottom: 1rem;
        font-size: 1rem;
    }

    .chapter h2 {
        font-size: clamp(2.5rem, 12vw, 3.5rem);
    }

    .chapter-body {
        margin-top: 1rem;
        font-size: 1rem;
    }

    .expertise-list button {
        padding: 1.15rem 0;
    }

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

    .footer-meta {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

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

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