/* Mubin Ul Islam Chowdhury — Portfolio
   Light Liquid Glass: frosted windows over a pale, softly lit field. */

:root {
    color-scheme: light;

    --ground: #f9f8f5;
    --ink: #1d1d1f;
    --ink-2: #515154;
    --hairline: rgba(15, 23, 42, 0.09);
    --blue: #0071e3;
    --blue-hover: #0062c4;
    --link: #0066cc;
    --live: #248a3d;
    --live-dot: #34c759;
    --selection: rgba(0, 113, 227, 0.18);

    /* White matte glass: frosted, flat, with a fine grain instead of a glossy sheen. */
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .045 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    --fill: rgba(255, 255, 255, 0.48);
    --rim: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.35) 38%, rgba(255, 255, 255, 0.2) 62%, rgba(255, 255, 255, 0.85));
    --glass: var(--grain) padding-box, linear-gradient(var(--fill), var(--fill)) padding-box, var(--rim) border-box;
    --glass-blur: blur(40px) saturate(140%);
    --glass-edge: inset 0 1px 1px rgba(255, 255, 255, 0.9), inset 0 -1px 1px rgba(15, 23, 42, 0.04);
    --glass-shadow: 0 0.5px 1px rgba(15, 23, 42, 0.05), 0 2px 6px -2px rgba(15, 23, 42, 0.05), 0 12px 28px -18px rgba(15, 23, 42, 0.14);
    --glass-shadow-lift: 0 0.5px 1px rgba(15, 23, 42, 0.05), 0 4px 10px -4px rgba(15, 23, 42, 0.07), 0 18px 36px -20px rgba(15, 23, 42, 0.18);
    --glass-solid: rgba(255, 255, 255, 0.96);
    --tint: rgba(15, 23, 42, 0.05);

    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;

    --wrap: 1120px;
    --gutter: max(20px, env(safe-area-inset-left, 0px));
    --r-window: 32px;
    --pad: clamp(1.5rem, 3vw, 2.5rem);
    --gap: clamp(16px, 2vw, 24px);
    --section: clamp(5.5rem, 10vw, 9rem);

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 699px) {
    :root {
        --r-window: 26px;
    }
}

/* ---------- Base ---------- */

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

html {
    scrollbar-color: rgba(15, 23, 42, 0.25) var(--ground);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: 24px;
}

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.47;
    letter-spacing: -0.022em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure {
    margin: 0;
}

ul, ol {
    padding: 0;
    list-style: none;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--link);
    text-decoration: none;
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
}

a:hover {
    text-decoration-line: underline;
}

::selection {
    background: var(--selection);
}

:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
    border-radius: 8px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    left: var(--gutter);
    top: -100px;
    z-index: 100;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.skip-link:focus {
    top: calc(env(safe-area-inset-top, 0px) + 12px);
}

.wrap {
    width: 100%;
    max-width: calc(var(--wrap) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* ---------- Ambient field ---------- */

.ambient {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(180deg, #fcfbf9 0%, #f9f8f5 50%, #f6f5f1 100%);
}

.light {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    transform: translate3d(0, var(--amb-y, 0px), 0);
}

.light-a {
    width: 60vmax;
    height: 60vmax;
    left: -18vmax;
    top: -22vmax;
    background: radial-gradient(circle, rgba(0, 113, 227, 0.09), rgba(0, 113, 227, 0) 65%);
}

.light-b {
    width: 52vmax;
    height: 52vmax;
    right: -16vmax;
    top: 18vh;
    background: radial-gradient(circle, rgba(94, 92, 230, 0.07), rgba(94, 92, 230, 0) 65%);
    transform: translate3d(0, calc(var(--amb-y, 0px) * -1.4), 0);
}

.light-d {
    width: 40vmax;
    height: 40vmax;
    left: 30vw;
    top: 35vh;
    background: radial-gradient(circle, rgba(255, 149, 0, 0.07), rgba(255, 149, 0, 0) 65%);
    transform: translate3d(0, calc(var(--amb-y, 0px) * -0.6), 0);
}

.light-c {
    width: 46vmax;
    height: 46vmax;
    left: 22vw;
    bottom: -26vmax;
    background: radial-gradient(circle, rgba(50, 173, 230, 0.06), rgba(50, 173, 230, 0) 65%);
    transform: translate3d(0, calc(var(--amb-y, 0px) * 0.8), 0);
}

/* ---------- Glass ---------- */

.window {
    position: relative;
    isolation: isolate;
    padding: var(--pad);
    border: 1px solid transparent;
    border-radius: var(--r-window);
    background: var(--glass);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-edge), var(--glass-shadow);
}

/* Pointer-tracked specular light: a soft fill plus a brighter rim. */
.window::before,
.window::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.window::before {
    z-index: -1;
    background: radial-gradient(480px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.55), transparent 55%);
}

.window::after {
    padding: 1px;
    background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 1), transparent 60%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

.window.is-lit::before,
.window.is-lit::after {
    opacity: 1;
}

/* Cards lift a hair under the pointer, like a window gaining focus. */
@media (hover: hover) and (pointer: fine) {
    .work,
    .fact,
    .research-card,
    .skill-card,
    .role {
        transition: box-shadow 0.5s var(--ease-out), translate 0.5s var(--ease-out);
    }
    .work:hover,
    .fact:hover,
    .research-card:hover,
    .skill-card:hover,
    .role:hover {
        translate: 0 -1px;
        box-shadow: var(--glass-edge), var(--glass-shadow-lift);
    }
}

/* visionOS window grabber, added by script to the main windows */
.grabber {
    position: absolute;
    left: 50%;
    bottom: -18px;
    width: 48px;
    height: 5px;
    border-radius: 3px;
    background: rgba(15, 23, 42, 0.16);
    transform: translateX(-50%);
    pointer-events: none;
}

.photo-window {
    padding: 0;
}

.photo-window img {
    width: 100%;
    border-radius: inherit;
}

.photo-window::after {
    padding: 0;
    background: none;
    -webkit-mask: none;
    mask: none;
    opacity: 1;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.photo-window::before {
    display: none;
}

.window-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.window-title + * {
    margin-top: 1rem;
}

/* ---------- Controls ---------- */

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 26px;
    border-radius: 999px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color 0.25s ease, transform 0.25s var(--ease-out);
}

.pill:hover {
    text-decoration: none;
}

.pill:active {
    transform: scale(0.97);
}

.pill-primary {
    background: var(--blue);
    color: #fff;
}

.pill-primary:hover {
    background: var(--blue-hover);
}

.pill-glass,
.dock-icon,
.round-button,
.ornament,
.segmented,
.tag {
    border: 1px solid transparent;
    background: var(--glass);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-edge), 0 8px 24px -12px rgba(15, 23, 42, 0.25);
    color: var(--ink);
}

.pill-glass:hover,
.round-button:hover:not(:disabled) {
    --fill: rgba(255, 255, 255, 0.9);
}

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

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    min-height: 36px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(0, 113, 227, 0.08);
    color: var(--link);
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.25s ease;
}

.chip:hover {
    background: rgba(0, 113, 227, 0.15);
    text-decoration: none;
}

.chip::after,
.row-link::after,
a.paper-title::after {
    content: "";
    display: inline-block;
    width: 0.6em;
    height: 0.6em;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 8 8 2M3.5 2H8v4.5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 8 8 2M3.5 2H8v4.5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

a.paper-title::after {
    margin-left: 0.3em;
    color: var(--link);
}

/* ---------- Dock: identity, sections, email, assistant ---------- */

.ornament {
    position: fixed;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: calc(100vw - 16px);
    padding: 6px;
    border-radius: 999px;
    transform: translateX(-50%);
}

.dock-me {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 14px 4px 4px;
    border-radius: 999px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.dock-me:hover {
    text-decoration: none;
    background: rgba(255, 255, 255, 0.6);
}

.dock-me img {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 2px 6px rgba(15, 23, 42, 0.15);
}

.dock-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: transparent;
    border-color: transparent;
    color: var(--ink-2);
}

.dock-icon:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.6);
}

.dock-icon .ico {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
}

@media (max-width: 1099px) {
    .dock-name { display: none; }
    .dock-me { padding: 4px; }
}

@media (max-width: 599px) {
    .dock-wide,
    .dock-icon { display: none; }
    .dock-me img {
        width: 34px;
        height: 34px;
    }
}

.ornament ul {
    position: relative;
    display: flex;
    gap: 2px;
    padding: 0 4px;
    border-inline: 1px solid var(--hairline);
}

.ornament ul a {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 64px;
    padding: 7px 12px 6px;
    border-radius: 999px;
    color: var(--ink-2);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    white-space: nowrap;
    transition: color 0.25s ease;
}

.ornament ul .ico {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
}

.ornament ul a:hover {
    color: var(--ink);
    text-decoration: none;
}

.ornament ul a[aria-current="true"] {
    color: var(--blue);
}

.ornament-indicator {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12), inset 0 0 0 1px rgba(15, 23, 42, 0.04);
    opacity: 0;
    transition: transform 0.5s var(--ease-out), opacity 0.3s ease;
}

@media (max-width: 459px) {
    .ornament ul a {
        min-width: 0;
        padding: 7px 8px 6px;
    }
    .ornament ul .ico {
        width: 20px;
        height: 20px;
    }
}

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

.hero {
    padding-block: calc(env(safe-area-inset-top, 0px) + clamp(2.5rem, 5vw, 4rem)) clamp(3rem, 6vw, 4.5rem);
}

.hero-stage {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
    min-height: min(680px, calc(100svh - 300px));
}

.hero-window {
    padding: clamp(1.75rem, 4vw, 3.25rem);
}

.hero-name {
    font-size: clamp(2.75rem, 3.9vw + 1rem, 4.5rem);
    font-weight: 700;
    line-height: 1.03;
    letter-spacing: -0.038em;
    text-wrap: balance;
}

.hero-title {
    margin-top: 0.9rem;
    color: var(--blue);
    font-size: clamp(1.375rem, 1.1vw + 1rem, 1.875rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.hero-lede {
    margin-top: 0.9rem;
    max-width: 30em;
    color: var(--ink-2);
    font-size: clamp(1.0625rem, 0.4vw + 1rem, 1.25rem);
    font-weight: 500;
    line-height: 1.22;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.hero-role {
    margin-top: 1rem;
    max-width: 34em;
    color: var(--ink-2);
    text-wrap: pretty;
}

.hero .actions {
    margin-top: 2rem;
}

.hero-visual {
    position: relative;
    padding: 8% 6%;
}

.hero-portrait {
    border-radius: 40px;
}

.hero-portrait img {
    aspect-ratio: 1;
    object-fit: cover;
}

/* Real facts float around the portrait, like the deployed badges. */
.tag {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px 10px 10px;
    border-radius: 18px;
    font-size: 13px;
    line-height: 1.3;
}

.tag-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.tag strong {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.tag-text > span {
    color: var(--ink-2);
}

.tag-1 { left: 0; top: 4%; }
.tag-2 { right: 0; top: 44%; }
.tag-3 { left: 2%; bottom: 2%; }

.worked-with {
    margin-top: clamp(2rem, 3vw, 2.5rem);
    text-align: center;
}

.worked-label {
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 600;
}

.orgs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 0.9rem;
}

.orgs li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 8px 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--glass);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-edge), 0 6px 18px -12px rgba(15, 23, 42, 0.3);
    font-size: 14px;
    font-weight: 500;
}

.orgs .ico {
    width: 17px;
    height: 17px;
    color: var(--ink-2);
}

.status {
    display: block;
    margin-top: 1.5rem;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 500;
}

.status-dot {
    display: inline-block;
    margin-right: 8px;
    vertical-align: 1px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--live-dot);
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.18);
}

@media (max-width: 859px) {
    .hero-stage {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }
    .hero-visual {
        padding: 0;
        max-width: 440px;
    }
    .hero-visual {
        display: grid;
        width: 100%;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }
    .hero-visual[data-depth] {
        translate: none;
    }
    .hero-portrait {
        grid-column: 1 / -1;
        border-radius: 30px;
    }
    .hero-portrait .grabber {
        display: none;
    }
    .tag {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 4px 10px;
        padding: 11px 16px;
    }
    .hero .actions .pill {
        flex: 1 1 9rem;
    }
}

/* ---------- Sections ---------- */

.section {
    padding-block: var(--section);
}

.section-head {
    max-width: 44em;
    margin: 0 auto clamp(2.25rem, 4vw, 3.25rem);
    text-align: center;
}

.section-title {
    font-size: clamp(2.25rem, 3.4vw + 1rem, 3.75rem);
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -0.037em;
    text-wrap: balance;
}

.section-intro {
    margin-top: 0.9rem;
    color: var(--ink-2);
    font-size: 19px;
    line-height: 1.42;
    text-wrap: balance;
}

/* ---------- About ---------- */

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: var(--gap);
    align-items: stretch;
}

.about-bio p {
    font-size: 18px;
    line-height: 1.55;
    text-wrap: pretty;
}

.about-bio p + p {
    margin-top: 1rem;
}

.facts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gap);
}

.fact {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: clamp(1.25rem, 2.2vw, 1.75rem);
}

.fact strong {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.fact span {
    color: var(--ink-2);
    font-size: 15px;
    line-height: 1.4;
}

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

/* ---------- Work ---------- */

.work {
    display: flex;
    flex-direction: column;
}

.work h3 {
    font-size: clamp(1.5rem, 1vw + 1.2rem, 2rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.featured h3 {
    font-size: clamp(1.875rem, 1.5vw + 1.3rem, 2.625rem);
}

.work-claim {
    margin-top: 0.5rem;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.work-method {
    margin-top: 0.9rem;
    color: var(--ink-2);
    text-wrap: pretty;
}

.result {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 1.5rem;
}

.result strong {
    font-size: clamp(2.75rem, 3vw + 1.25rem, 4.25rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.045em;
    font-variant-numeric: tabular-nums;
    color: var(--blue);
}

.result strong.figure-one {
    margin-left: -0.06em;
}

.result span {
    max-width: 26em;
    color: var(--ink-2);
    font-size: 15px;
    line-height: 1.45;
}

.result-text strong {
    color: var(--ink);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

/* The spec row is the window's toolbar, pinned to the bottom edge. */
.work-spec {
    margin: auto calc(var(--pad) * -1) calc(var(--pad) * -1);
    padding: 14px var(--pad);
    border-top: 1px solid var(--hairline);
    border-radius: 0 0 var(--r-window) var(--r-window);
    background: rgba(255, 255, 255, 0.35);
    color: var(--ink-2);
    font-size: 13px;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
}

.work > .result,
.work > .work-method:last-of-type {
    margin-bottom: var(--pad);
}

.work-spec-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 20px;
}

.featured-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: center;
    margin-bottom: var(--pad);
}

.points li {
    position: relative;
    padding: 0.9rem 0 0.9rem 1.5rem;
    border-top: 1px solid var(--hairline);
    color: var(--ink);
    font-size: 16px;
    line-height: 1.4;
}

.points li:first-child {
    border-top: 0;
}

.points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1.35rem;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--blue);
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gap);
    margin-top: var(--gap);
}

.more-window {
    margin-top: var(--gap);
}

@media (max-width: 859px) {
    .featured-grid,
    .work-grid {
        grid-template-columns: 1fr;
    }
}

/* More work rows */

.rows li {
    display: grid;
    grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) auto;
    gap: 0.25rem 1.5rem;
    align-items: baseline;
    padding-block: 0.9rem;
    border-top: 1px solid var(--hairline);
}

.rows li:first-child {
    border-top: 0;
    padding-top: 0.2rem;
}

.row-name {
    font-weight: 600;
}

.row-desc {
    color: var(--ink-2);
}

.row-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    font-size: 15px;
    white-space: nowrap;
}

@media (max-width: 699px) {
    .rows li {
        grid-template-columns: minmax(0, 1fr) auto;
    }
    .rows .row-desc {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

/* ---------- Open source ---------- */

.oss-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gap);
}

.oss-weft {
    grid-column: 1 / -1;
}

.oss-weft .flow {
    margin-top: 0.5rem;
}

.chips-end {
    margin-top: auto;
    padding-top: 1.5rem;
}

.flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 24px;
    margin-bottom: var(--pad);
}

.flow li {
    position: relative;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--tint);
    font-size: 13px;
    font-weight: 600;
}

.flow li + li::before {
    content: "";
    position: absolute;
    left: -19px;
    top: 50%;
    width: 14px;
    height: 1.5px;
    background: rgba(15, 23, 42, 0.3);
}

.flow li:last-child {
    background: rgba(52, 199, 89, 0.14);
    color: var(--live);
}

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

@media (max-width: 599px) {
    .flow {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
    .flow li + li::before {
        left: 22px;
        top: -12px;
        width: 1.5px;
        height: 10px;
    }
}

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

.roles {
    display: grid;
    gap: var(--gap);
}

.role-when {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--ink-2);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.now {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px 2px 8px;
    border-radius: 999px;
    background: rgba(52, 199, 89, 0.14);
    color: var(--live);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
}

.now::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--live-dot);
}

.role-when {
    margin-top: 0.5rem;
}

.role h3 {
    font-size: clamp(1.25rem, 0.6vw + 1.1rem, 1.5rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.role-org {
    margin-top: 0.2rem;
    color: var(--ink-2);
}

.clusters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 2.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--hairline);
}

.cluster h4 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.cluster p {
    margin-top: 0.35rem;
    color: var(--ink-2);
    font-size: 15px;
    line-height: 1.5;
    text-wrap: pretty;
}

.role-points {
    margin-top: 1rem;
    max-width: 50em;
}

.role-points li {
    position: relative;
    padding-left: 1.1em;
    text-wrap: pretty;
}

.role-points li + li {
    margin-top: 0.5rem;
}

.role-points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.68em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ink-2);
}

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

/* ---------- Research ---------- */

.research-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--gap);
}

.research-card {
    display: flex;
    flex-direction: column;
}

.research-card h3 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    text-wrap: pretty;
}

.paper-title {
    color: var(--ink);
}

a.paper-title:hover {
    color: var(--link);
}

.research-card > p:not(.venue):not(.byline) {
    margin-top: 0.75rem;
    color: var(--ink-2);
    font-size: 15px;
    line-height: 1.5;
    text-wrap: pretty;
}

.byline {
    margin-top: auto;
    padding-top: 1.25rem;
    color: var(--ink-2);
    font-size: 13px;
}

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

/* ---------- Recognition and gallery ---------- */

.awards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 920px;
    margin-inline: auto;
}

.awards li {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 6px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--glass);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-edge), 0 6px 18px -10px rgba(15, 23, 42, 0.25);
    font-size: 14px;
    font-weight: 500;
}

.award-year {
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.segmented {
    display: flex;
    width: fit-content;
    gap: 2px;
    margin: 2rem auto 0;
    padding: 4px;
    border-radius: 999px;
}

.segmented button {
    min-height: 36px;
    padding: 7px 18px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-2);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s var(--ease-out), color 0.2s ease;
}

.segmented button:hover {
    color: var(--ink);
}

.segmented button[aria-pressed="true"] {
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
    color: var(--ink);
    font-weight: 600;
}

/* A bento wall: tiles span by the photo's shape. */
.wall {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 190px;
    grid-auto-flow: dense;
    gap: var(--gap);
    margin-top: clamp(2rem, 4vw, 2.75rem);
}

.tile-wide { grid-column: span 2; }
.tile-tall { grid-row: span 2; }
.tile-big { grid-column: span 2; grid-row: span 2; }

.wall-item {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 24px;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: zoom-in;
}

.wall .photo-window {
    display: block;
    height: 100%;
    border-radius: 24px;
    transition: opacity 0.9s var(--ease-out), transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}

.wall .photo-window img {
    height: 100%;
    object-fit: cover;
}

.wall-item:hover .photo-window {
    transform: scale(1.02);
    box-shadow: var(--glass-edge), 0 28px 60px -20px rgba(15, 23, 42, 0.45);
}

.wall .img-top {
    object-position: center top;
}

.wall-caption {
    position: absolute;
    left: 10px;
    bottom: 10px;
    max-width: calc(100% - 20px);
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    pointer-events: none;
}

@media (max-width: 859px) {
    .wall {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 150px;
    }
}

@media (max-width: 499px) {
    .wall {
        grid-auto-rows: 128px;
    }
    .wall-caption {
        left: 6px;
        bottom: 6px;
        max-width: calc(100% - 12px);
        padding: 4px 9px;
        font-size: 11px;
    }
    .wall-item,
    .wall .photo-window {
        border-radius: 18px;
    }
    .awards li {
        font-size: 13px;
    }
}

/* ---------- Skills ---------- */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--gap);
}

.skill-wide {
    grid-column: 1 / -1;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags li {
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--tint);
    font-size: 14px;
}

.plain li {
    color: var(--ink-2);
    font-size: 15px;
    text-wrap: pretty;
}

.plain li + li {
    margin-top: 0.6rem;
}

.edu {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem 2rem;
}

.edu dt {
    font-weight: 600;
}

.edu dd {
    margin-top: 0.2rem;
    color: var(--ink-2);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 959px) {
    .skills-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 699px) {
    .skills-grid,
    .edu {
        grid-template-columns: 1fr;
    }
}

/* ---------- Contact ---------- */

.contact-window {
    max-width: 820px;
    margin-inline: auto;
    padding-block: clamp(3rem, 7vw, 5rem);
    text-align: center;
}

.contact-title {
    font-size: clamp(2.5rem, 3.4vw + 1rem, 4rem);
    font-weight: 700;
    line-height: 1.03;
    letter-spacing: -0.038em;
}

.contact-lede {
    margin-top: 1rem;
    color: var(--ink-2);
    font-size: clamp(1.1875rem, 0.6vw + 1rem, 1.3125rem);
}

.actions-center {
    justify-content: center;
    margin-top: 2rem;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 2rem;
    margin-top: 2.5rem;
    color: var(--ink-2);
    font-size: 15px;
}

.contact-links li,
.contact-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
}

.glyph {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

@media (max-width: 499px) {
    .contact-links {
        flex-direction: column;
        align-items: center;
    }
}

.footer {
    padding-block: 0 calc(env(safe-area-inset-bottom, 0px) + 112px);
}

.footer-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 2rem;
    padding: 1.25rem 1.5rem;
}

.footer-me {
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-me img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 4px 12px rgba(15, 23, 42, 0.15);
}

.footer-name {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.footer-role {
    color: var(--ink-2);
    font-size: 14px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    font-size: 15px;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
}

.footer-copy {
    margin-top: 1.25rem;
    color: var(--ink-2);
    font-size: 12px;
    text-align: center;
}

.status a {
    font-weight: 600;
}

/* ---------- Round buttons and photo viewer ---------- */

.round-button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.25s ease, opacity 0.25s ease;
}

.round-button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.viewer {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: calc(env(safe-area-inset-top, 0px) + 72px) var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 96px);
    border: 0;
    background: transparent;
    color: var(--ink);
}

.viewer::backdrop {
    background: rgba(238, 242, 248, 0.7);
    -webkit-backdrop-filter: blur(30px) saturate(160%);
    backdrop-filter: blur(30px) saturate(160%);
}

.viewer[open] {
    display: grid;
    place-items: center;
}

.viewer-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 100%;
    max-height: 100%;
}

.viewer-frame {
    display: contents;
}

.viewer-stage img {
    max-width: min(100%, 1400px);
    max-height: calc(100dvh - 240px);
    width: auto;
    height: auto;
    border-radius: 28px;
    box-shadow: 0 40px 100px -30px rgba(15, 23, 42, 0.45);
}

.viewer-meta {
    display: flex;
    gap: 14px;
    align-items: baseline;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--glass);
    box-shadow: var(--glass-edge), 0 8px 24px -12px rgba(15, 23, 42, 0.25);
    font-size: 14px;
    font-weight: 600;
}

.viewer-count {
    color: var(--ink-2);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.viewer .round-button {
    position: fixed;
}

.viewer-close {
    top: calc(env(safe-area-inset-top, 0px) + 16px);
    right: var(--gutter);
}

.viewer-prev,
.viewer-next {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 28px);
}

.viewer-prev {
    left: calc(50% - 56px);
}

.viewer-next {
    left: calc(50% + 12px);
}

@media (prefers-reduced-motion: no-preference) {
    .viewer[open] .viewer-stage {
        animation: viewer-in 0.5s var(--ease-out);
    }
}

@keyframes viewer-in {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

/* ---------- Motion: windows materialise from depth ---------- */

[data-depth] {
    translate: 0 var(--depth-y, 0px);
}

@media (prefers-reduced-motion: no-preference) {
    .motion .reveal:not(.is-in) {
        opacity: 0.35;
        transform: translateY(28px) scale(0.97);
    }

    .motion .reveal {
        transition:
            opacity 0.9s var(--ease-out),
            transform 1.1s var(--ease-out);
    }
}

/* ---------- Reduced transparency and no-blur fallbacks ---------- */

@media (prefers-reduced-transparency: reduce) {
    .window,
    .pill-glass,
    .round-button,
    .ornament,
    .segmented,
    .tag,
    .awards li {
        background: var(--glass-solid);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .window,
    .pill-glass,
    .round-button,
    .ornament,
    .segmented,
    .tag,
    .awards li {
        background: var(--glass-solid);
    }
}

/* ---------- Icons ---------- */

.sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.ico {
    width: 1em;
    height: 1em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Settings-style app icons: a system colour, a soft top light, a white glyph. */
.app-icon {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--c1), var(--c2));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -1px 0 rgba(0, 0, 0, 0.08), 0 8px 16px -8px var(--c2);
    color: #fff;
}

.app-icon .ico {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.app-icon.sm {
    width: 34px;
    height: 34px;
    border-radius: 9px;
}

.app-icon.sm .ico {
    width: 18px;
    height: 18px;
}

.ai-blue { --c1: #47a1ff; --c2: #0071e3; }
.ai-green { --c1: #4cd26f; --c2: #1f9d45; }
.ai-orange { --c1: #ffb13d; --c2: #f57c00; }
.ai-purple { --c1: #c778f5; --c2: #9437cf; }
.ai-teal { --c1: #4fc3dc; --c2: #1891ad; }
.ai-indigo { --c1: #7f7cff; --c2: #4b47d6; }
.ai-red { --c1: #ff6a5e; --c2: #e0342a; }
.ai-pink { --c1: #ff6b8e; --c2: #df2b58; }
.ai-gray { --c1: #9b9ba3; --c2: #636369; }

.title-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.title-row h3 {
    margin-top: 0;
}

.fact > .app-icon {
    margin-bottom: 0.25rem;
}

.card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-head + * {
    margin-top: 1rem;
}

/* AI Kit highlights carry their own glyph instead of a dot. */
.points li {
    display: flex;
    gap: 12px;
    padding-left: 0;
}

.points li::before {
    display: none;
}

.points .ico {
    width: 20px;
    height: 20px;
    margin-top: 1px;
    color: var(--blue);
}

.cluster h4 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cluster h4 .ico {
    width: 20px;
    height: 20px;
    color: var(--blue);
}

.topics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 1rem;
}

.topics li {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--tint);
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 500;
}

.awards .ico {
    width: 16px;
    height: 16px;
    color: var(--blue);
}

.contact-links .ico {
    width: 1.05em;
    height: 1.05em;
}

/* Long paper titles read better with the icon above them. */
.research-card .title-row {
    flex-direction: column;
    align-items: flex-start;
}

/* Masonry wall: the script sizes each tile from its photo's own aspect ratio,
   so portraits stay portrait and landscapes stay landscape. */
.wall.is-masonry {
    grid-auto-rows: 8px;
    row-gap: 0;
}

.wall.is-masonry li {
    padding-bottom: var(--gap);
}

.wall.is-masonry .tile-tall,
.wall.is-masonry .tile-big {
    grid-row: auto;
}

/* Small phone tiles: the photo speaks; the caption opens with the viewer. */
@media (max-width: 599px) {
    .wall-caption {
        display: none;
    }
}

/* ---------- Portrait: a circle in a glass ring, like every other photo of him ---------- */

.hero-visual::before {
    content: "";
    position: absolute;
    inset: 4% 2%;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, rgba(71, 161, 255, 0.35), rgba(127, 124, 255, 0.18) 45%, rgba(127, 124, 255, 0) 70%);
    filter: blur(30px);
    z-index: -1;
}

.hero-portrait {
    aspect-ratio: 1;
    padding: clamp(10px, 1.2vw, 16px);
    border-radius: 50%;
}

.hero-portrait img {
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 30%;
}

.hero-portrait .grabber {
    display: none;
}

.tag-1 { left: -2%; top: 10%; }
.tag-2 { right: -4%; top: 46%; }
.tag-3 { left: 4%; bottom: 4%; }

@media (max-width: 859px) {
    .hero-visual {
        justify-items: center;
        max-width: none;
    }
    .hero-visual::before {
        inset: 0 10% 40%;
    }
    .hero-portrait {
        width: min(100%, 320px);
        border-radius: 50%;
    }
    .tag {
        width: 100%;
    }
}





/* Engineer, researcher, trainer: three pillars, each with its proof. */
.pillars {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 1.5rem;
}

.pillars li {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8), 0 2px 8px -4px rgba(15, 23, 42, 0.12);
    color: var(--ink-2);
    font-size: 13px;
    line-height: 1.4;
}

.pillars strong {
    display: block;
    margin-bottom: 2px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
}

@media (max-width: 599px) {
    .pillars {
        grid-template-columns: minmax(0, 1fr);
    }
    .pillars li {
        flex-direction: row;
        align-items: center;
    }
}

/* Facts sit on a shelf under the portrait, so nothing covers the photo. */
.hero-visual {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
    padding: 0;
}

.hero-portrait {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(100%, 390px);
    margin-bottom: 8px;
}

.tag,
.tag-1,
.tag-2,
.tag-3 {
    position: static;
    inset: auto;
}

.tag {
    gap: 10px;
    padding: 10px 12px 10px 10px;
    border-radius: 16px;
}

.tag strong {
    font-size: 14px;
}

.tag-text > span {
    font-size: 12px;
}

@media (max-width: 859px) {
    .hero-visual {
        grid-template-columns: minmax(0, 1fr);
    }
    .hero-portrait {
        width: min(100%, 320px);
    }
}

@media (min-width: 860px) {
    .hero-visual .tag {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 14px;
    }
    .tag-text > span {
        white-space: nowrap;
    }
}

/* ---------- Technology stacks: small grey logos in the window toolbar ---------- */

.stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.stack li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-2);
    font-size: 13px;
}

.logo {
    width: 14px;
    height: 14px;
    flex: none;
    fill: #8e8e93;
}

.work-spec {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 20px;
}

.spec-meta {
    color: var(--ink-2);
    font-size: 13px;
}

.tags li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tags .logo {
    width: 13px;
    height: 13px;
}

.weft-window {
    margin-top: var(--gap);
}

.weft-window .flow {
    margin-top: 0.5rem;
}

/* ---------- Buttons: tactile, lit from above ---------- */

.pill {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    gap: 8px;
    letter-spacing: -0.015em;
    transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), background-color 0.25s ease;
}

.pill:hover {
    transform: translateY(-1px);
}

.pill:active {
    transform: translateY(0) scale(0.97);
    transition-duration: 0.1s;
}

/* Primary: a lit blue lens with a soft coloured shadow. */
.pill-primary {
    background: linear-gradient(180deg, #3a95ff 0%, #0a74e6 55%, #0066d6 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 40, 110, 0.25),
        0 1px 2px rgba(0, 60, 150, 0.25),
        0 8px 20px -8px rgba(0, 113, 227, 0.6);
}

.pill-primary:hover {
    background: linear-gradient(180deg, #4a9fff 0%, #1479ea 55%, #006ad9 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        inset 0 -1px 0 rgba(0, 40, 110, 0.25),
        0 2px 4px rgba(0, 60, 150, 0.2),
        0 14px 28px -10px rgba(0, 113, 227, 0.65);
}

/* A slow band of light crosses the primary button on hover. */
.pill-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.28) 48%, transparent 66%);
    transform: translateX(-120%);
    pointer-events: none;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .pill-primary:hover::after {
        transform: translateX(120%);
        transition: transform 0.9s var(--ease-out);
    }
}

/* Glass: a frosted pill with a bright rim that lifts on hover. */
.pill-glass {
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.95),
        0 1px 2px rgba(15, 23, 42, 0.06),
        0 8px 20px -10px rgba(15, 23, 42, 0.22);
}

.pill-glass:hover {
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 1),
        0 2px 4px rgba(15, 23, 42, 0.06),
        0 14px 28px -12px rgba(15, 23, 42, 0.28);
}

.pill:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
}

/* Same button language for the small controls. */
.chip,
.round-button,
.dock-icon,
.segmented button {
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), background-color 0.2s ease, color 0.2s ease;
}

.chip {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 0 0 1px rgba(0, 113, 227, 0.1);
}

.chip:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 0 0 1px rgba(0, 113, 227, 0.18), 0 6px 14px -8px rgba(0, 113, 227, 0.45);
}

.round-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.chip:active,
.round-button:active,
.dock-icon:active,
.segmented button:active {
    transform: scale(0.95);
    transition-duration: 0.1s;
}

.segmented button[aria-pressed="true"] {
    box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(15, 23, 42, 0.1), 0 4px 10px -6px rgba(15, 23, 42, 0.25);
}

/* ---------- Portrait: stepping out of a glass card ----------
   The photo keeps its natural size. A rounded glass card holds its lower part: inside
   the card you see the original photo, and a cut-out of the same photo, aligned pixel
   for pixel, lets the head rise above the card's top edge. */

.hero-portrait.pop {
    --top: 22%;                     /* where the card starts, down the photo */
    --ring: clamp(8px, 1vw, 12px);  /* glass edge around the photo */
    --r: 30px;                      /* inner corner radius */
    position: relative;
    width: min(100%, 380px);
    aspect-ratio: 1;
    padding: 0;
    margin: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

.pop-card {
    position: absolute;
    top: calc(var(--top) - var(--ring));
    left: calc(var(--ring) * -1);
    right: calc(var(--ring) * -1);
    bottom: calc(var(--ring) * -1);
    padding: 0;
    border-radius: calc(var(--r) + var(--ring));
    translate: calc(var(--px, 0) * 2px) calc(var(--py, 0) * 1.5px);
    transition: translate 0.6s var(--ease-out);
}

.pop-inside,
.pop-stage {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.pop-inside img,
.pop-stage img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
}

/* The original photo, seen through the card. */
.pop-inside {
    clip-path: inset(var(--top) 0 0 0 round var(--r));
}

/* The cut-out rises freely above the card; below, it keeps the card's corners. */
.pop-stage {
    clip-path: inset(-20% 0 0 0 round 0 0 var(--r) var(--r));
    filter: drop-shadow(0 -2px 8px rgba(15, 23, 42, 0.08));
}

.pop-person {
    -webkit-mask-image: url("profile-photo/portrait-mask.png");
    mask-image: url("profile-photo/portrait-mask.png");
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    transform-origin: 50% 100%;
    translate: calc(var(--px, 0) * 4px) calc(var(--py, 0) * 2px);
    transition: translate 0.6s var(--ease-out);
}

@media (prefers-reduced-motion: no-preference) {
    .pop-person {
        animation:
            pop-rise 1.4s var(--ease-out) 0.25s both,
            pop-float 7s ease-in-out 1.7s infinite alternate;
    }
}

@keyframes pop-rise {
    from { transform: translateY(9%); }
    to { transform: translateY(0); }
}

@keyframes pop-float {
    from { transform: translateY(0); }
    to { transform: translateY(-1%); }
}

@media (max-width: 859px) {
    .hero-portrait.pop {
        width: min(calc(100% - 24px), 320px);
    }
}

/* The card replaces the old round portrait: undo its circle and padding on the photos. */
.hero-portrait.pop img {
    border-radius: 0;
    object-fit: fill;
    aspect-ratio: auto;
}

.hero-portrait.pop::before,
.hero-portrait.pop::after {
    display: none;
}

.hero-portrait.pop {
    margin-bottom: 18px;
}

/* The name, in a weighted brush script: the one handwritten touch on the page. */
.hero-name {
    font-family: "Satisfy", "Snell Roundhand", "Segoe Script", cursive;
    font-weight: 400;
    font-size: clamp(3.25rem, 4.6vw + 1rem, 5.25rem);
    line-height: 1.08;
    letter-spacing: 0;
    -webkit-text-stroke: 0.9px currentColor;
    paint-order: stroke fill;
}

/* ---------- Flowing ink: the name, title and paragraph in the hero card ----------
   Deep theme colours drift slowly through the lettering; flow.js bleeds the same
   colours, pale, into the card's glass behind the name. Every stop keeps 4.5:1 or
   better against the card, so the text stays readable. */

.hero-window.has-bleed .bleed {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    filter: blur(8px);
    pointer-events: none;
}

.hero-name,
.hero-title,
.hero-lede {
    background-image: linear-gradient(100deg, var(--ink-stops));
    background-size: 300% 100%;
    background-position: 0% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--ink);
}

/* Name: the richest ink, thickened with a hairline dilate (the SVG filter in the page). */
.hero-name {
    --ink-stops: #1d1d1f 0%, #2b2a78 20%, #003f84 36%, #0e4f5f 52%, #54206f 68%, #2b2a78 84%, #1d1d1f 100%;
    -webkit-text-stroke: 0;
    filter: url("#ink-weight");
}

/* Title: its own line, a clean readable sans, in the same ink. */
.hero-title {
    --ink-stops: #0058b3 0%, #3b37a8 30%, #0f6479 55%, #6b2a93 78%, #0058b3 100%;
    display: block;
    margin-top: 1rem;
    font-size: clamp(1.375rem, 1.1vw + 1rem, 1.875rem);
    font-weight: 700;
    letter-spacing: -0.022em;
}

/* Paragraph: mostly ink, with the colour only passing through. */
.hero-lede {
    --ink-stops: #3a3a40 0%, #3a3a40 30%, #2f3b72 45%, #1f4d5a 58%, #4b2e66 70%, #3a3a40 85%, #3a3a40 100%;
    margin-top: 0.75rem;
}

@media (prefers-reduced-motion: no-preference) {
    .hero-name,
    .hero-title,
    .hero-lede {
        animation: ink-flow 22s ease-in-out infinite alternate;
    }
    .hero-title {
        animation-duration: 26s;
        animation-delay: -6s;
    }
    .hero-lede {
        animation-duration: 30s;
        animation-delay: -12s;
    }
}

@keyframes ink-flow {
    from { background-position: 0% 50%; }
    to { background-position: 100% 50%; }
}

/* Script swashes overhang the text box; give the ink fill room so nothing is clipped. */
.hero-name {
    padding: 0.06em 0.18em 0.12em;
    margin: -0.06em -0.18em -0.12em;
}

/* Shared layer that tints every glass card (flow.js). */
.card-flow {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    filter: blur(3px) saturate(115%);
    pointer-events: none;
}

/* Title and paragraph, paired with the script name: an italic serif that echoes its slant,
   and a warm humanist sans for easy reading. */
.hero-title {
    font-family: "Zodiak", "New York", "Iowan Old Style", Georgia, serif;
    font-style: italic;
    font-weight: 600;
    font-size: clamp(1.3125rem, 0.9vw + 1rem, 1.75rem);
    letter-spacing: -0.005em;
    line-height: 1.2;
}

.hero-lede {
    font-family: "Switzer", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.5;
}

/* Ink over the glass (flow.js): masked to the cards in the shader, blended like ink on paper. */
.ink {
    position: fixed;
    inset: 0;
    z-index: 30;
    width: 100vw;
    height: 100vh;
    mix-blend-mode: multiply;
    pointer-events: none;
}

/* Card colour and ink step aside while the page scrolls, then return. */
.card-flow,
.ink {
    transition: opacity 0.6s ease;
}

.is-scrolling .card-flow,
.is-scrolling .ink {
    opacity: 0;
    transition: opacity 0.12s ease;
}

/* =================================================================
   Phones: an iOS-style glass tab bar with the assistant beside it,
   and a type scale and spacing sized for a hand, not a desk.
   ================================================================= */

@media (max-width: 699px) {
    :root {
        --gutter: max(16px, env(safe-area-inset-left, 0px));
        --pad: 1.25rem;
        --gap: 14px;
        --section: 4rem;
        --r-window: 24px;
    }

    body {
        font-size: 16px;
        line-height: 1.5;
    }

    /* Tab bar: full width minus room for the round assistant button. */
    .ornament {
        left: max(12px, env(safe-area-inset-left, 0px));
        right: calc(max(12px, env(safe-area-inset-right, 0px)) + 70px);
        bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
        max-width: none;
        padding: 5px;
        transform: none;
    }

    .dock-me,
    .dock-icon,
    .dock-wide {
        display: none;
    }

    .ornament ul {
        flex: 1;
        justify-content: space-between;
        gap: 0;
        padding: 0;
        border: 0;
    }

    .ornament ul li {
        flex: 1;
        min-width: 0;
    }

    .ornament ul a {
        min-width: 0;
        width: 100%;
        padding: 6px 0 5px;
        font-size: 11px;
    }

    .ornament ul .ico {
        width: 21px;
        height: 21px;
    }

    /* Headings and text. */
    .section-head {
        margin-bottom: 1.75rem;
    }

    .section-title {
        font-size: 2rem;
        letter-spacing: -0.03em;
    }

    .section-intro {
        font-size: 16px;
        line-height: 1.45;
    }

    .hero {
        padding-block: calc(env(safe-area-inset-top, 0px) + 1.25rem) 2.5rem;
    }

    .hero-window {
        padding: 1.5rem 1.25rem;
    }

    .hero-name {
        font-size: 2.9rem;
    }

    .hero-title {
        margin-top: 0.6rem;
        font-size: 1.2rem;
    }

    .hero-lede {
        font-size: 16px;
        line-height: 1.5;
    }

    /* Engineer / Researcher / Trainer: slim rows instead of cards. */
    .pillars {
        gap: 8px;
        margin-top: 1.25rem;
    }

    .pillars li {
        gap: 12px;
        padding: 10px 12px;
        border-radius: 14px;
        font-size: 13px;
    }

    .pillars strong {
        font-size: 14px;
    }

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

    .pill {
        min-height: 46px;
        font-size: 16px;
    }

    .status {
        font-size: 13px;
    }

    /* Facts under the portrait: three compact tiles in a row. */
    .hero-visual {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .hero-visual .tag {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px;
        border-radius: 14px;
    }

    .hero-visual .tag strong {
        font-size: 13px;
        line-height: 1.2;
    }

    .hero-visual .tag-text > span {
        font-size: 11px;
        line-height: 1.3;
        white-space: normal;
    }

    .hero-visual .tag .app-icon.sm {
        width: 28px;
        height: 28px;
        border-radius: 8px;
    }

    .hero-visual .tag .app-icon.sm .ico {
        width: 15px;
        height: 15px;
    }

    /* App icons and card titles. */
    .app-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .app-icon .ico {
        width: 20px;
        height: 20px;
    }

    .title-row {
        gap: 12px;
    }

    .work h3,
    .featured h3 {
        font-size: 1.45rem;
    }

    .work-claim {
        font-size: 16px;
    }

    .work-method,
    .result span,
    .cluster p,
    .research-card > p:not(.byline) {
        font-size: 15px;
        line-height: 1.5;
    }

    .result strong {
        font-size: 2.75rem;
    }

    .result-text strong {
        font-size: 17px;
    }

    .points li {
        padding-block: 0.7rem;
        font-size: 15px;
    }

    .work-spec,
    .stack li,
    .spec-meta {
        font-size: 12px;
    }

    .role h3 {
        font-size: 1.15rem;
    }

    .role-org,
    .role-when {
        font-size: 14px;
    }

    .role-points li {
        font-size: 15px;
    }

    .cluster h4 {
        font-size: 17px;
        gap: 8px;
    }

    .cluster h4 .ico {
        width: 17px;
        height: 17px;
    }

    .clusters {
        gap: 1.25rem;
    }

    .research-card h3 {
        font-size: 18px;
        line-height: 1.3;
    }

    .window-title {
        font-size: 18px;
    }

    .tags {
        gap: 6px;
    }

    .tags li,
    .topics li {
        font-size: 13px;
        padding: 4px 10px;
    }

    .fact strong {
        font-size: 18px;
    }

    .fact span {
        font-size: 14px;
    }

    .about-bio p {
        font-size: 16px;
    }

    .rows li {
        padding-block: 0.75rem;
        font-size: 15px;
    }

    /* Awards: a tidy left-aligned list rather than ragged centred pills. */
    .awards {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .awards li {
        border-radius: 14px;
        padding: 8px 12px 8px 8px;
        font-size: 14px;
        line-height: 1.3;
    }

    /* Photo filters scroll sideways if they don't fit. */
    .segmented {
        max-width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .segmented::-webkit-scrollbar {
        display: none;
    }

    .segmented button {
        flex: none;
        padding: 7px 14px;
    }

    .contact-title {
        font-size: 2.5rem;
    }

    .contact-lede {
        font-size: 16px;
    }

    .footer {
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
    }

    .footer-name {
        font-size: 16px;
    }

    .footer-links {
        gap: 0.5rem 1.25rem;
        font-size: 14px;
    }
}

@media (max-width: 699px) {
    .worked-with {
        margin-top: 1.75rem;
    }
    .worked-label {
        font-size: 13px;
    }
    .orgs {
        gap: 6px;
        margin-top: 0.7rem;
    }
    .orgs li {
        gap: 6px;
        padding: 6px 12px 6px 10px;
        font-size: 13px;
    }
    .orgs .ico {
        width: 14px;
        height: 14px;
    }
}
