/* ==========================================================================
   site.css — shared styles for the home page and every case study.
   Layout: fixed left column (bio / case-study nav) + scrolling right column.
   ========================================================================== */

@font-face {
    font-family: "Google Sans";
    src: url("Fonts/GoogleSans-VariableFont_GRAD,opsz,wght.ttf") format("truetype");
    font-weight: 300 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Google Sans";
    src: url("Fonts/GoogleSans-Italic-VariableFont_GRAD,opsz,wght.ttf") format("truetype");
    font-weight: 300 800;
    font-style: italic;
    font-display: swap;
}

:root {
    --bg: #ffffff;
    --surface: #f2f2f2;
    --ink: #1a1a1a;
    --ink-2: #4a4a4a;
    --muted: #7a7a7a;
    --line: #e6e6e6;
    --line-strong: #d4d4d4;
    --accent: #1a1a1a;

    --font: "Google Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

    --gutter: clamp(20px, 3vw, 56px);
    --side-w: clamp(255px, 20.4vw, 382px);
    --col-gap: clamp(40px, 5vw, 104px);
    --header-h: 82px;
    --radius: 12px;
    --ease: cubic-bezier(.2, .7, .2, 1);

    color-scheme: light;
}

* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
    letter-spacing: .005em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

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

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

.u-link {
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    transition: text-decoration-color .2s;
}
.u-link:hover { text-decoration-color: var(--ink); }

/* Pixel icons (pixelarticons, MIT). Drawn as a mask so they take the text colour.
   Drawn at 24px (the set's native size) so every icon pixel stays crisp;
   negative margins stop the 24px box from pushing the line height. */
.px-icon,
.arrow-out::after,
.back-link::before,
.next-case span::after {
    content: "";
    display: inline-block;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-block: -6px;
    background-color: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

/* Link icons sit beside body-size text, so they are drawn at half size (12px).
   external-link is drawn on odd coordinates, so it is shifted half a pixel
   to keep its pixels on whole screen pixels. */
.arrow-out::after {
    --icon: url("icons/pixelarticons/external-link.svg");
    width: 12px;
    height: 12px;
    margin: 0 0 0 .4em;
    vertical-align: -1px;
    -webkit-mask-position: .5px .5px;
    mask-position: .5px .5px;
    transition: transform .25s var(--ease);
}
.arrow-out.is-mail::after {
    --icon: url("icons/pixelarticons/mail.svg");
    -webkit-mask-position: center;
    mask-position: center;
}
a:hover > .arrow-out::after,
a.arrow-out:hover::after { transform: translate(2px, -2px); }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 var(--gutter);
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
}

.site-name { font-size: 16px; font-weight: 450; }

.site-nav {
    display: flex;
    align-items: center;
    gap: clamp(17px, 2.21vw, 44px);
    font-size: 15px;
    color: var(--ink-2);
}
.site-nav a { transition: color .2s; }
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--ink); }

.site-clock {
    display: inline-flex;
    gap: 15px;
    font-size: 14px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    margin-left: clamp(0px, 1.36vw, 20px);
}
.site-clock time { color: var(--ink); }

/* --------------------------------------------------------------------------
   Two-column shell
   -------------------------------------------------------------------------- */

.shell {
    display: grid;
    grid-template-columns: var(--side-w) minmax(0, 1fr);
    gap: var(--col-gap);
    padding: 0 var(--gutter) 82px;
    align-items: start;
}

.side {
    position: sticky;
    top: calc(var(--header-h) + 7px);
    padding-bottom: 20px;
}

/* --------------------------------------------------------------------------
   Home — bio column
   -------------------------------------------------------------------------- */

.bio-title {
    margin: 0 0 clamp(32px, 5vh, 56px);
    font-size: clamp(37px, 3.65vw, 65px);
    font-weight: 450;
    letter-spacing: -.025em;
    line-height: 1;
}

.bio-copy {
    margin: 0;
    font-size: clamp(14px, 1.06vw, 19px);
    line-height: 1.7;
    color: var(--ink-2);
}

.bio-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    margin: clamp(36px, 7vh, 80px) 0 clamp(28px, 5vh, 48px);
    font-size: 15px;
    color: var(--ink-2);
}
.bio-links a { transition: color .2s; }
.bio-links a:hover { color: var(--ink); }

.bio-status {
    margin: 0 0 clamp(15px, 3vh, 31px);
    font-size: 14px;
    color: var(--ink-2);
}

.bio-credit {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   Home — filter + project grid
   -------------------------------------------------------------------------- */

.work-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: clamp(36px, 6vh, 64px);
}

.filter {
    position: relative;
    display: inline-flex;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 849px;
    background: var(--bg);
}

.filter-thumb {
    position: absolute;
    top: 5px;
    left: 0;
    height: calc(100% - 8px);
    border-radius: 849px;
    background: var(--ink);
    transition: transform .35s var(--ease), width .35s var(--ease);
    pointer-events: none;
}

.filter button {
    position: relative;
    z-index: 1;
    appearance: none;
    border: 0;
    background: none;
    padding: 10px 19px;
    border-radius: 849px;
    font: inherit;
    font-size: 15px;
    color: var(--ink-2);
    cursor: pointer;
    transition: color .25s;
}
.filter button:hover { color: var(--ink); }
.filter button[aria-pressed="true"] { color: #fff; }

.work-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.project-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(48px, 8vh, 88px) clamp(24px, 2.4vw, 44px);
}

.project-grid > li { transition: opacity .3s var(--ease), transform .3s var(--ease); }
.project-grid > li[hidden] { display: none; }
.project-grid > li.is-entering { animation: card-in .45s var(--ease) both; }

@keyframes card-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.card { display: block; }

.card-media {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    display: grid;
    place-items: center;
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s var(--ease);
}
.card-media.is-contain img {
    width: 72%;
    height: 78%;
    object-fit: contain;
}
.card:hover .card-media img { transform: scale(1.035); }

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 8px;
    border-radius: 849px;
    background: rgba(255, 255, 255, .92);
    font-size: 11px;
    color: var(--ink-2);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .25s, transform .25s var(--ease);
}
.card:hover .card-badge,
.card:focus-visible .card-badge { opacity: 1; transform: none; }

.card-title {
    margin: 22px 0 14px;
    font-size: clamp(15px, 1.15vw, 20px);
    font-weight: 400;
    color: var(--ink);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.tags li {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 13px;
    color: var(--ink-2);
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Case study — sidebar
   -------------------------------------------------------------------------- */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 15px;
    color: var(--ink-2);
    transition: color .2s;
}
.back-link::before { --icon: url("icons/pixelarticons/arrow-left.svg"); transition: transform .25s var(--ease); }
.back-link:hover { color: var(--ink); }
.back-link:hover::before { transform: translateX(-3px); }

.case-side .tags { margin: 31px 0 26px; }

.case-title {
    margin: 0 0 clamp(20px, 4vh, 34px);
    font-size: clamp(36px, 3.4vw, 61px);
    font-weight: 450;
    letter-spacing: -.025em;
}

.case-lede {
    margin: 0 0 clamp(27px, 6vh, 54px);
    font-size: clamp(14px, 1.02vw, 18px);
    color: var(--ink-2);
}

.toc {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--line);
}
.toc a {
    display: block;
    margin-left: -2px;
    padding: 15px 0 15px 22px;
    border-left: 2px solid transparent;
    font-size: 16px;
    color: var(--muted);
    transition: color .2s, border-color .25s;
}
.toc a:hover { color: var(--ink-2); }
.toc a.is-active { color: var(--ink); border-left-color: var(--ink); }

/* --------------------------------------------------------------------------
   Case study — body
   -------------------------------------------------------------------------- */

.case-body { max-width: 952px; }

.case-section {
    padding-bottom: clamp(41px, 7vh, 68px);
    margin-bottom: clamp(41px, 7vh, 68px);
    border-bottom: 1px solid var(--line);
}
.case-section:last-child { border-bottom: 0; margin-bottom: 0; }

.case-body h2 {
    margin: 0 0 clamp(20px, 4vh, 37px);
    font-size: clamp(26px, 2.21vw, 39px);
    font-weight: 400;
    letter-spacing: -.015em;
}

.case-body h3 {
    margin: clamp(31px, 5vh, 48px) 0 19px;
    font-size: clamp(17px, 1.27vw, 22px);
    font-weight: 450;
}
.case-body h2 + h3 { margin-top: 0; }

.case-body p,
.case-body li {
    font-size: clamp(14px, 1.1vw, 20px);
    color: var(--ink-2);
}
.case-body p { margin: 0 0 1.15em; }
.case-body p:last-child { margin-bottom: 0; }
.case-body strong { color: var(--ink); font-weight: 500; }

.meta-list { margin: 31px 0 0; }
.meta-list dt {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 6px;
}
.meta-list dd {
    margin: 0 0 24px;
    font-size: clamp(14px, 1.1vw, 20px);
    color: var(--ink-2);
}

.case-cta {
    display: inline-flex;
    font-size: clamp(14px, 1.1vw, 20px);
    color: var(--ink-2);
    transition: color .2s;
}
.case-cta:hover { color: var(--ink); }

.case-figure { margin: clamp(27px, 5vh, 44px) 0; }
.case-figure img {
    width: 100%;
    border-radius: var(--radius);
    background: var(--surface);
}
.case-figure figcaption {
    margin-top: 12px;
    font-size: 13px;
    color: var(--muted);
}

.image-stack { display: grid; gap: clamp(14px, 1.7vw, 24px); margin-top: clamp(24px, 4vh, 37px); }
.image-stack img { width: 100%; border-radius: var(--radius); background: var(--surface); }

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 27px 0 0;
}
.metric {
    padding: 20px;
    border-radius: var(--radius);
    background: var(--surface);
}
.metric .n {
    display: block;
    font-size: clamp(24px, 2.04vw, 34px);
    color: var(--ink);
    letter-spacing: -.02em;
}
.metric .d { display: block; margin-top: 8px; font-size: 13px; color: var(--ink-2); }

.note {
    margin-top: 31px;
    padding: 20px 24px;
    border-left: 2px solid var(--ink);
    background: var(--surface);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: clamp(14px, 1.02vw, 17px);
    color: var(--ink);
}

/* Stage selector (interactive pipeline) */
.stages {
    margin: 0 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.stage-tabs {
    display: flex;
    gap: 4px;
    padding: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}
.stage-tabs::-webkit-scrollbar { display: none; }
.stage-tab {
    flex: 0 0 auto;
    appearance: none;
    border: 0;
    background: none;
    padding: 8px 12px;
    border-radius: 7px;
    font: inherit;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    transition: background .2s, color .2s;
}
.stage-tab:hover { color: var(--ink); }
.stage-tab[aria-selected="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.stage-panel { padding: 20px 24px 24px; }
.stage-panel h4 { margin: 0 0 7px; font-size: 16px; font-weight: 500; }
.case-body .stage-panel p { font-size: 14px; }
.stage-panel.is-entering { animation: card-in .35s var(--ease) both; }

/* Next case study */
.next-case {
    display: block;
    margin-top: clamp(48px, 8vh, 82px);
    padding-top: 24px;
    border-top: 1px solid var(--line);
}
.next-case small { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.next-case span { font-size: clamp(19px, 1.7vw, 29px); letter-spacing: -.01em; }
.next-case span::after {
    --icon: url("icons/pixelarticons/arrow-right.svg");
    margin-left: .2em;
    vertical-align: 0;
    transition: transform .25s var(--ease);
}
.next-case:hover span::after { transform: translateX(4px); }

/* About page */
.about {
    max-width: 1440px;
    margin: 0 auto;
    padding: clamp(24px, 5vh, 61px) var(--gutter) 40px;
}

.about-hero {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(28px, 8vw, 120px);
    align-items: start;
}
.about-portrait {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 24px;
    background: var(--surface);
}
.about-carousel {
    position: relative;
    overflow: hidden;
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}
.about-carousel.is-dragging { cursor: grabbing; }
.about-carousel-track {
    display: flex;
    height: 100%;
    transition: transform .6s var(--ease);
}
.about-carousel.is-dragging .about-carousel-track { transition: none; }
.about-carousel-track img {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}
.about-carousel-dots {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
}
.about-carousel-dots span {
    width: 18px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .4);
    transition: background .3s;
}
.about-carousel-dots span.is-active { background: #fff; }

.about-intro {
    margin: clamp(0px, 3vw, 40px) 0 0;
    font-size: clamp(20px, 2vw, 32px);
    line-height: 1.45;
    letter-spacing: -.01em;
    color: var(--ink);
}
.about-intro strong { font-weight: 600; }

.about-logos {
    margin: clamp(48px, 9vh, 96px) 0 clamp(40px, 7vh, 72px);
    overflow: hidden;
}
.about-logos img {
    width: 100%;
    height: auto;
    opacity: .45;
    filter: grayscale(1);
}

.about-section { margin-bottom: clamp(40px, 7vh, 72px); }
.about-heading {
    margin: 0 0 clamp(24px, 4vh, 40px);
    padding-bottom: 16px;
    border-bottom: 1.5px solid var(--ink);
    font-size: clamp(16px, 1.2vw, 20px);
    font-weight: 600;
}
.about-section .exp-list li { font-size: clamp(14px, 1.1vw, 18px); }

.about-copy p {
    margin: 0 0 1.4em;
    max-width: 68ch;
    font-size: clamp(16px, 1.4vw, 22px);
    line-height: 1.55;
    color: var(--ink);
}
.about-copy p:last-child { margin-bottom: 0; }
.about-copy strong { font-weight: 600; }

.about-photos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(14px, 2vw, 32px);
    margin: clamp(48px, 9vh, 96px) 0;
}
.about-photo {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 24px;
    background: var(--surface);
}
.about-photo.is-placeholder {
    display: grid;
    place-items: center;
    font-size: 13px;
    color: var(--muted);
}

.about-connect {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    padding-bottom: clamp(40px, 7vh, 72px);
    border-bottom: 1px solid var(--line);
}
.connect-title {
    margin: 0 0 18px;
    font-size: clamp(32px, 3.6vw, 56px);
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1.1;
}
.connect-title span { font-weight: 400; color: var(--muted); }
.connect-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 15px;
    color: var(--ink-2);
}
.btn-dark {
    display: inline-flex;
    align-items: center;
    padding: 14px 26px;
    border-radius: 849px;
    background: var(--ink);
    color: #fff;
    font-size: 15px;
    transition: background .2s;
}
.btn-dark:hover { background: #000; }

.about-footer {
    padding-top: 28px;
    font-size: 14px;
    color: var(--ink);
}
.about-footer span { color: var(--muted); }

@media (max-width: 760px) {
    .about-hero { grid-template-columns: minmax(0, 1fr); }
    .about-portrait { max-width: 420px; }
    .about-intro { margin-top: 0; }
    .about-photos { grid-template-columns: minmax(0, 1fr); }
}

/* About page bits */
.exp-list { list-style: none; margin: 0; padding: 0; }
.exp-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 20px;
    padding: 19px 0;
    border-bottom: 1px solid var(--line);
}
.exp-list li:first-child { padding-top: 0; }
.exp-role { color: var(--ink); }
.exp-org { grid-column: 1; color: var(--muted); font-size: .85em; }
.exp-date { grid-row: 1; grid-column: 2; color: var(--muted); font-size: .85em; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

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

@media (max-width: 900px) {
    :root { --header-h: 58px; }

    .shell { grid-template-columns: minmax(0, 1fr); gap: 48px; }
    .side { position: static; padding-bottom: 0; }

    .site-clock span { display: none; }
    .site-nav { font-size: 14px; gap: 17px; }

    .case-side .toc { display: none; }
    .case-lede { margin-bottom: 0; }
}

@media (max-width: 600px) {
    .project-grid { grid-template-columns: minmax(0, 1fr); }
    .metric-grid { grid-template-columns: minmax(0, 1fr); }
    .filter button { padding: 8px 14px; font-size: 14px; }
    .work-count { display: none; }
    .site-clock { display: none; }
    .exp-list li { grid-template-columns: minmax(0, 1fr); }
    .exp-date { grid-row: auto; grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
}

/* Figma-style corner smoothing.
   Figma's smoothing stretches each corner past its radius, so the radius is
   scaled up by --smooth-scale and the curve is set with corner-shape.
   Browsers without corner-shape keep the plain radii above. */
@supports (corner-shape: superellipse(2)) {
    :root {
        --smooth-shape: superellipse(1.6);
        --smooth-scale: 1.6;
        --radius-smooth: calc(var(--radius) * var(--smooth-scale));
    }
    .card-media,
    .case-figure img,
    .image-stack img,
    .metric,
    .stages {
        border-radius: var(--radius-smooth);
        corner-shape: var(--smooth-shape);
    }
    .note {
        border-radius: 0 var(--radius-smooth) var(--radius-smooth) 0;
        corner-shape: var(--smooth-shape);
    }
    .tags li {
        border-radius: calc(6px * var(--smooth-scale));
        corner-shape: var(--smooth-shape);
    }
    .about-portrait,
    .about-photo {
        border-radius: calc(24px * var(--smooth-scale));
        corner-shape: var(--smooth-shape);
    }
    .stage-tab {
        border-radius: calc(7px * var(--smooth-scale));
        corner-shape: var(--smooth-shape);
    }
}
