/* ============================================
   CASE STUDY — immersive project page template (first built for Flex Academy)
   Default palette below is Flex Academy's (deep green, cream, brass); each
   project page overrides the --fx-* tokens in a <style> block. Token roles:
   --fx-green = brand primary, --fx-brass = accent on light, --fx-brass-light =
   accent on dark, --fx-night = darkest background.
   Everything is scoped to .fx-page so the shared nav/footer from
   mainstyles.css stay untouched.
   Static layout is complete on its own; js/case-study.js adds html.fx-motion
   (desktop + motion allowed) to switch on pinned / horizontal stages.
   ============================================ */

.fx-page {
    --fx-bg: #FEFBF2;
    --fx-cream: #FEF8E8;
    --fx-surface: #FFFFFF;
    --fx-ink: #1E2B28;
    --fx-muted: #5F6B67;
    --fx-line: #E2DED0;
    --fx-green: #264A45;
    --fx-green-deep: #1D3A36;
    --fx-night: #0F1F1C;
    --fx-on-green: #FEF8E8;
    --fx-on-green-muted: #A9BDB6;
    --fx-brass: #A8761C;
    --fx-brass-light: #D9A548;

    /* Project accent: replaces the homepage peach for the nav, links, buttons,
       section dots and pitch player. Follows each page's own --fx-brass-light,
       so a project palette only has to set that one value. */
    --accent: var(--fx-brass-light);

    /* Same sans as the rest of the portfolio (mainstyles.css) */
    --fx-sans: var(--font-sans);
    --fx-serif: "Newsreader", Georgia, serif;
    --fx-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;

    --fx-pad: clamp(72px, 8vw, 120px);

    background: var(--fx-night);
}

/* Nav: same component and styling as index.html (all in mainstyles.css) */

.fx {
    font-family: var(--fx-sans);
    font-size: 17px;
    line-height: 1.6;
    color: var(--fx-ink);
    overflow-x: clip;
}

.fx h1,
.fx h2,
.fx h3 {
    font-family: var(--fx-sans);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.04;
    margin: 0;
    text-wrap: balance;
    /* Undo the site-wide outlined h1 / uppercase h2 from mainstyles.css */
    color: inherit;
    text-transform: none;
    -webkit-text-stroke: 0;
}

.fx h2 {
    font-size: clamp(1.75rem, 3.2vw, 2.6rem);
}

.fx h3 {
    font-size: 1.2rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.fx em {
    font-family: var(--fx-serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.fx p {
    margin: 0;
}

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

.fx a {
    color: inherit;
}

.fx :focus-visible {
    outline: 2px solid var(--fx-brass-light);
    outline-offset: 4px;
    border-radius: 4px;
}

.fx-wrap {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 48px);
}

.fx-label {
    font-family: var(--fx-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fx-muted);
    display: flex;
    align-items: center;
    gap: 12px;
}

.fx-num {
    font-family: var(--fx-mono);
    color: var(--fx-brass);
}

.fx-label .fx-num::after {
    content: "";
    display: inline-block;
    width: 1px;
    height: 1em;
    background: var(--fx-line);
    vertical-align: -0.15em;
    margin-left: 12px;
}

.fx-path--dark .fx-label .fx-num::after,
.fx-voices .fx-label .fx-num::after {
    background: color-mix(in srgb, var(--fx-on-green) 25%, transparent);
}

.fx-body {
    max-width: 58ch;
    color: var(--fx-muted);
    font-size: 1.1rem;
}

.fx-brass {
    color: var(--fx-brass-light);
}

/* Scroll progress */
.fx-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--fx-brass-light);
    transform-origin: 0 50%;
    transform: scaleX(0);
    z-index: 300;
    pointer-events: none;
}

/* ---------- Browser frame ---------- */
.fx-frame {
    background: var(--fx-surface);
    border: 1px solid var(--fx-line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 40px 80px -48px color-mix(in srgb, var(--fx-night) 60%, transparent);
}

.fx-frame__bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--fx-line);
}

.fx-frame__bar i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--fx-line);
}

.fx-frame__bar span {
    margin-left: 10px;
    font-family: var(--fx-mono);
    font-size: 0.72rem;
    color: var(--fx-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Lets a long label shrink to an ellipsis instead of stretching its frame */
    min-width: 0;
}

.fx-frame__img {
    overflow: hidden;
}

/* ============ HERO ============
   Name left, intro + one-line metadata right, then a glass panel
   holding the screens (bleeds into the next section). */
.fx-hero {
    position: relative;
    /* No bottom padding: the screens touch the next section */
    padding: 140px 0 0;
    background: var(--fx-night);
    color: var(--fx-on-green);
    isolation: isolate;
    overflow: hidden;
}

.fx-hero__glow {
    position: absolute;
    inset: -20%;
    z-index: -1;
    background:
        radial-gradient(40% 50% at 78% 30%, color-mix(in srgb, var(--fx-green) 55%, transparent), transparent 70%),
        radial-gradient(35% 40% at 15% 85%, color-mix(in srgb, var(--fx-brass-light) 18%, transparent), transparent 70%),
        radial-gradient(60% 60% at 50% 50%, var(--fx-green-deep), var(--fx-night) 80%);
}

.fx-pn {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-family: var(--fx-mono);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    /* One shared row height, so design system pages can line their pill up with it */
    min-height: var(--fx-pn-h);
    align-items: center;
    margin-bottom: clamp(40px, 5vw, 72px);
}

.fx {
    --fx-pn-h: 21px;
}

/* Empty nav row: same height as a row of links */
.fx-pn--spacer {
    min-height: var(--fx-pn-h);
}

.fx-pn a {
    text-decoration: none;
    color: var(--fx-on-green-muted);
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.fx-pn a:hover {
    color: var(--fx-on-green);
    border-color: var(--fx-brass-light);
}

.fx-hero__grid {
    display: grid;
    /* Title column fits the longest word of the project name */
    grid-template-columns: max-content minmax(0, 1fr);
    gap: clamp(24px, 4vw, 64px);
    align-items: start;
}

.fx-hero__title {
    font-size: clamp(3rem, 6.4vw, 5.6rem);
    line-height: 0.92;
    letter-spacing: -0.04em;
    display: grid;
}

.fx-hero__title em {
    color: var(--fx-brass-light);
}

.fx-line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.08em;
}

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

.fx-hero__intro {
    display: grid;
    gap: clamp(32px, 4vw, 56px);
    padding-top: 0.6em;
}

.fx-hero__lede {
    max-width: 52ch;
    font-size: clamp(1.1rem, 1.55vw, 1.4rem);
    line-height: 1.45;
    color: var(--fx-on-green);
}

.fx-hero__lede b {
    font-weight: 600;
    color: var(--fx-brass-light);
}

/* Label over value: four equal columns on one row, every value on one line */
.fx-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px clamp(16px, 2vw, 32px);
    margin: 0;
}

.fx-meta dd {
    white-space: nowrap;
}

.fx-meta dt {
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--fx-on-green-muted);
}

.fx-meta dd {
    margin: 4px 0 0;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
}

/* Glass showcase: a wide glass panel sits behind the top of the screens;
   the screens are taller than it, overflow its bottom edge and run
   straight into the next section. */
.fx-showcase-wrap {
    max-width: 1680px;
    margin: clamp(56px, 7vw, 96px) auto 0;
    padding: 0 clamp(16px, 3vw, 48px);
}

.fx-showcase {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 1fr 1.45fr 1fr;
    gap: clamp(16px, 2.4vw, 40px);
    align-items: end;
    padding: clamp(40px, 5vw, 80px) clamp(20px, 4vw, 72px) 0;
}

.fx-showcase::before {
    content: "";
    position: absolute;
    inset: 0 0 clamp(48px, 4.6vw, 90px) 0;
    z-index: -1;
    border-radius: 32px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--fx-on-green) 10%, transparent), color-mix(in srgb, var(--fx-on-green) 3%, transparent));
    border: 1px solid color-mix(in srgb, var(--fx-on-green) 12%, transparent);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.fx-shot {
    margin: 0;
}

.fx-shot .fx-frame {
    border-radius: 14px 14px 0 0;
    border-bottom: 0;
}

.fx-shot--side {
    padding-top: clamp(40px, 5vw, 90px);
}

.fx-hero .fx-frame {
    border-color: color-mix(in srgb, var(--fx-on-green) 16%, transparent);
}

/* Hero performance: the glow, the title block and the screens all move while you
   scroll (case-study.js scrubs them). Without their own GPU layers the browser
   repaints the big gradient, the glass blur and the screen shadows on every frame,
   which made heroes lag (Nexos went from ~54ms to ~9ms per frame with this). */
.fx-hero__glow,
.fx-showcase,
.fx-shot,
.fx-showcase__art {
    will-change: transform;
}

.fx-hero__top {
    will-change: transform, opacity;
}

/* Hero screens have no window chrome: no title bar, panel or border. The window
   frame is only for images in the page body. The shadow follows the image's own
   shape, so transparent artwork doesn't get a rectangular shadow. */
.fx-showcase .fx-frame__bar {
    display: none;
}

.fx-showcase .fx-frame {
    background: transparent;
    border: 0;
    box-shadow: none;
    filter: drop-shadow(0 30px 40px color-mix(in srgb, var(--fx-night) 45%, transparent));
}

/* ============ WALKTHROUGH ============ */
.fx-walk {
    background: var(--fx-night);
    color: var(--fx-on-green);
}

/* Pinned: the heading floats over the stage so the laptop can take
   nearly the whole viewport height as it grows */
html.fx-motion .fx-walk__stage {
    position: relative;
    min-height: 100svh;
    padding-top: 96px;
    padding-bottom: 16px;
}

html.fx-motion .fx-walk__copy {
    position: absolute;
    top: 120px;
    left: 0;
    right: 0;
    z-index: 1;
}

.fx-walk__stage {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: clamp(24px, 4vw, 48px);
    padding: 112px clamp(16px, 4vw, 48px) 48px;
    text-align: center;
}

.fx-walk__copy {
    display: grid;
    gap: 16px;
    justify-items: center;
}

.fx-walk__copy .fx-label {
    color: var(--fx-on-green-muted);
}

.fx-walk h2 em {
    color: var(--fx-brass-light);
}

.fx-laptop {
    margin: 0;
    width: min(100%, 1100px);
    filter: drop-shadow(0 50px 60px rgba(0, 0, 0, 0.55));
}

.fx-laptop img {
    width: 100%;
}

/* As big as the viewport allows (GIF is 800 × 496) */
html.fx-motion .fx-laptop {
    width: min(100%, 1600px, calc((100vh - 110px) * 1.613));
}

/* ============ PROBLEM ============ */
.fx-problem {
    background: var(--fx-bg);
    padding: var(--fx-pad) 0;
}

.fx-problem .fx-wrap {
    display: grid;
    gap: 28px;
}

.fx-problem__title em {
    color: var(--fx-brass);
}

.fx-flags {
    list-style: none;
    margin: 24px 0 0;
    padding: 0;
    display: grid;
    border-top: 1px solid var(--fx-line);
}

.fx-flags li {
    border-bottom: 1px solid var(--fx-line);
    padding: clamp(16px, 2.4vw, 28px) 0;
    font-size: clamp(1.15rem, 2.4vw, 1.9rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--fx-ink);
}

.fx-flags span {
    position: relative;
    display: inline-block;
    color: color-mix(in srgb, var(--fx-ink) calc(100% - var(--fade, 80%)), var(--fx-muted));
}

/* The strike sits on top of the letters so it reads clearly */
.fx-flags span::after {
    content: "";
    position: absolute;
    left: 0;
    top: 52%;
    width: var(--strike, 100%);
    height: 0.14em;
    border-radius: 0.07em;
    background: var(--fx-brass);
    transform: translateY(-50%);
}

/* ============ FORK ============ */
.fx-fork {
    background: var(--fx-cream);
    padding: var(--fx-pad) 0;
    display: grid;
    /* Without this the column grows to its widest child and pushes text off phones */
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(32px, 4vw, 56px);
}

.fx-fork .fx-wrap:first-child {
    display: grid;
    gap: 24px;
}

.fx-fork h2 {
    max-width: 22ch;
}

.fx-fork h2 em {
    color: var(--fx-green);
}

.fx-fork__shot {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 48px);
}

.fx-doors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.fx-door {
    display: grid;
    gap: 6px;
    padding: clamp(20px, 3vw, 32px);
    border-radius: 16px;
    border: 1.5px solid var(--fx-green);
    text-decoration: none;
    color: var(--fx-ink) !important;
    background: var(--fx-bg);
    /* The hover lift uses `translate`, not `transform`: case-study.js animates
       `transform` when the doors arrive, and a CSS transition on the same
       property stopped that animation finishing (cards stuck 40px low) */
    transition: translate 0.35s cubic-bezier(.2, .7, .2, 1), box-shadow 0.35s;
}

.fx-door b {
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.fx-door small {
    color: var(--fx-muted);
    font-size: 0.95rem;
}

.fx-door:hover {
    translate: 0 -4px;
    box-shadow: 0 24px 40px -28px color-mix(in srgb, var(--fx-night) 60%, transparent);
}

.fx-door--dark {
    background: var(--fx-green);
    color: var(--fx-on-green) !important;
}

.fx-door--dark .fx-label,
.fx-door--dark small {
    color: var(--fx-on-green-muted);
}

/* ============ PATHS ============ */
.fx-path {
    background: var(--fx-bg);
    padding: var(--fx-pad) 0;
}

.fx-path--dark {
    background: var(--fx-green-deep);
    color: var(--fx-on-green);
}

.fx-path--dark .fx-label,
.fx-path--dark .fx-panel__cap p,
.fx-path--dark .fx-path__count {
    color: var(--fx-on-green-muted);
}

.fx-path--dark .fx-frame {
    border-color: color-mix(in srgb, var(--fx-on-green) 14%, transparent);
}

.fx-path__head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
    margin-bottom: clamp(20px, 2.4vw, 32px);
}

.fx-path__head>div {
    display: grid;
    gap: 10px;
}

.fx-path__count {
    font-family: var(--fx-mono);
    font-size: 0.9rem;
    color: var(--fx-muted);
    white-space: nowrap;
}

.fx-path__cur {
    font-size: 1.6rem;
    color: var(--fx-brass);
    font-weight: 500;
    vertical-align: -0.15em;
}

.fx-path--dark .fx-path__cur {
    color: var(--fx-brass-light);
}

/* Static: panels stack vertically */
.fx-track {
    display: grid;
    gap: clamp(48px, 6vw, 72px);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 48px);
}

.fx-panel {
    display: grid;
    gap: 16px;
    /* Panels match the tallest one in the track; keep content at its natural
       height instead of stretching the frame and chips to fill */
    align-content: start;
}

.fx-panel__cap {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 16px;
    row-gap: 6px;
    max-width: 60ch;
}

.fx-panel__cap .fx-num {
    grid-row: span 2;
    padding-top: 3px;
}

.fx-panel__cap p {
    color: var(--fx-muted);
    font-size: 0.95rem;
}

/* Motion: horizontal track pinned to the viewport */
html.fx-motion .fx-path {
    padding: 0;
}

html.fx-motion .fx-path__pin {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 112px 0 28px;
    overflow: hidden;
}

html.fx-motion .fx-track {
    display: flex;
    flex-wrap: nowrap;
    gap: clamp(32px, 4vw, 64px);
    max-width: none;
    margin: 0;
    padding: 0 clamp(16px, 4vw, 48px) 0 max(clamp(16px, 4vw, 48px), calc((100vw - 1200px) / 2 + 48px));
    width: max-content;
    will-change: transform;
}

html.fx-motion .fx-panel {
    flex: 0 0 auto;
    width: min(58vw, calc((100vh - 400px) * 1.7));
}

/* ============ VOICES ============ */
.fx-voices {
    background: var(--fx-night);
    color: var(--fx-on-green);
    padding: var(--fx-pad) 0;
}

.fx-voices .fx-wrap {
    display: grid;
    gap: 24px;
}

.fx-voices .fx-label {
    color: var(--fx-on-green-muted);
}

.fx-voices h2 {
    max-width: 18ch;
    margin-bottom: clamp(16px, 3vw, 40px);
}

.fx-voice {
    display: grid;
    gap: 18px;
    padding: clamp(24px, 3.6vw, 48px) 0;
    border-top: 1px solid color-mix(in srgb, var(--fx-on-green) 12%, transparent);
}

.fx-voice blockquote {
    margin: 0;
    font-family: var(--fx-serif);
    font-size: clamp(1.75rem, 4vw, 3.3rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
    max-width: 20ch;
}

.fx-voice:nth-child(even) blockquote,
.fx-voice:nth-child(even) .fx-voice__ans {
    justify-self: end;
    text-align: right;
}

.fx-reveal .w {
    display: inline;
}

.fx-voice__ans {
    font-size: 1.05rem;
    color: var(--fx-brass-light);
    max-width: 44ch;
}

/* Chevron lead-in, drawn with borders so it matches the inline SVG chevrons */
.fx-voice__ans::before {
    content: "";
    display: inline-block;
    width: 0.42em;
    height: 0.42em;
    margin: 0 0.55em 0.12em 0;
    border-top: 0.11em solid currentColor;
    border-right: 0.11em solid currentColor;
    border-radius: 0.05em;
    transform: rotate(45deg);
}

/* ============ DECISIONS ============ */
.fx-decisions {
    background: var(--fx-bg);
    padding: var(--fx-pad) 0;
}

.fx-decisions .fx-wrap {
    display: grid;
    gap: 24px;
}

.fx-decisions h2 {
    max-width: 22ch;
}

.fx-decisions h2 em {
    color: var(--fx-green);
}

.fx-stack {
    display: grid;
    gap: 24px;
    margin: clamp(24px, 4vw, 48px) 0;
}

.fx-card {
    position: sticky;
    top: calc(110px + var(--i, 0) * 22px);
    display: grid;
    grid-template-columns: clamp(64px, 10vw, 140px) 1fr;
    gap: clamp(16px, 3vw, 40px);
    padding: clamp(24px, 4vw, 48px);
    border-radius: 20px;
    background: var(--fx-cream);
    border: 1px solid var(--fx-line);
    box-shadow: 0 -12px 40px -30px color-mix(in srgb, var(--fx-night) 45%, transparent);
    min-height: 220px;
}

.fx-card:nth-child(even) { background: color-mix(in srgb, var(--fx-cream), var(--fx-brass) 9%); }
.fx-card:last-child { background: var(--fx-green); color: var(--fx-on-green); border-color: var(--fx-green); }

.fx-card__n {
    font-family: var(--fx-serif);
    font-size: clamp(2.2rem, 4.4vw, 3.6rem);
    line-height: 0.9;
    color: var(--fx-brass);
}

.fx-card:last-child .fx-card__n {
    color: var(--fx-brass-light);
}

.fx-card>div {
    display: grid;
    gap: 14px;
    align-content: start;
}

.fx-card h3 {
    font-size: clamp(1.3rem, 2.4vw, 1.9rem);
}

.fx-card p {
    color: var(--fx-muted);
    max-width: 56ch;
}

.fx-card:last-child p {
    color: var(--fx-on-green-muted);
}

.fx-trade {
    color: var(--fx-ink) !important;
    font-size: 0.95rem;
}

.fx-card:last-child .fx-trade {
    color: var(--fx-on-green) !important;
}

.fx-trade b {
    font-family: var(--fx-mono);
    font-weight: 500;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fx-brass);
    margin-right: 8px;
}

.fx-card:last-child .fx-trade b {
    color: var(--fx-brass-light);
}

.fx-figure {
    margin: clamp(24px, 4vw, 48px) 0 0;
    display: grid;
    gap: 14px;
}

.fx-figure figcaption {
    font-size: 0.9rem;
    color: var(--fx-muted);
}

/* ============ MOBILE ============ */
.fx-mobile {
    background: var(--fx-cream);
    padding: var(--fx-pad) 0;
}

.fx-mobile__pin {
    display: grid;
    grid-template-columns: 1fr minmax(0, 340px);
    gap: clamp(32px, 6vw, 96px);
    align-items: center;
}

.fx-mobile__copy {
    display: grid;
    gap: 24px;
}

.fx-mobile__list {
    list-style: none;
    counter-reset: fx;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    gap: 4px;
}

.fx-mobile__list li {
    counter-increment: fx;
    display: grid;
    grid-template-columns: 40px 1fr;
    padding: 14px 0;
    border-top: 1px solid var(--fx-line);
    font-size: 1.05rem;
    color: var(--fx-ink);
    transition: color 0.4s, opacity 0.4s;
}

.fx-mobile__list li::before {
    content: "0" counter(fx);
    font-family: var(--fx-mono);
    font-size: 0.8rem;
    color: var(--fx-brass);
    padding-top: 4px;
}

html.fx-motion .fx-mobile__list li {
    opacity: 0.35;
}

html.fx-motion .fx-mobile__list li.is-on {
    opacity: 1;
}

.fx-phone {
    justify-self: center;
    width: 100%;
    max-width: 320px;
    border: 11px solid var(--fx-ink);
    border-radius: 42px;
    overflow: hidden;
    background: var(--fx-surface);
    box-shadow: 0 50px 80px -50px color-mix(in srgb, var(--fx-night) 70%, transparent);
}

.fx-phone__screen {
    height: min(620px, 70vh);
    overflow-y: auto;
    scrollbar-width: thin;
    overscroll-behavior: contain;
}

.fx-phone__screen img {
    width: 100%;
}

html.fx-motion .fx-mobile {
    padding: 0;
}

html.fx-motion .fx-mobile__pin {
    min-height: 100vh;
    padding-top: 112px;
    padding-bottom: 32px;
}

html.fx-motion .fx-phone__screen {
    overflow: hidden;
}

/* ============ MEASURE ============ */
.fx-measure {
    background: var(--fx-bg);
    padding: var(--fx-pad) 0;
}

.fx-measure .fx-wrap {
    display: grid;
    gap: 24px;
}

.fx-targets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.fx-target {
    display: grid;
    gap: 14px;
    align-content: start;
    padding: 24px;
    border-radius: 14px;
    background: var(--fx-surface);
    border: 1px solid var(--fx-line);
}

.fx-target__num {
    font-size: clamp(2.2rem, 3.4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.fx-target__num small {
    font-size: 1rem;
    font-weight: 600;
    color: var(--fx-muted);
    margin-right: 2px;
}

.fx-meter {
    height: 6px;
    border-radius: 3px;
    background: var(--fx-line);
    overflow: hidden;
}

.fx-meter i {
    display: block;
    height: 100%;
    width: var(--w);
    background: var(--fx-green);
    transform-origin: 0 50%;
}

.fx-target p {
    font-size: 0.92rem;
    color: var(--fx-muted);
}

/* ============ PROJECT LINKS ============
   Small strip before "Keep exploring", so these links read as part of this
   project, not the next one */
.fx-links {
    background: var(--fx-bg);
    padding: clamp(36px, 4vw, 56px) 0;
    border-top: 1px solid var(--fx-line);
}

.fx-links .fx-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
}

.fx-links__row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.fx-links__row a {
    padding: 0.6rem 1.2rem;
    border: 1.5px solid var(--fx-ink);
    border-radius: 30px;
    color: var(--fx-ink);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-decoration: none;
    transition: all 0.3s ease;
}

.fx-links__row a:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

/* ============ OUTRO ============
   Site-level navigation, not part of the Flex story: uses the portfolio's
   own tokens (mainstyles.css --bg / --text / --accent) and the outlined
   Roboto title + pill buttons from the other project pages. */
.fx-outro {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    padding: var(--fx-pad) 0 clamp(56px, 6vw, 80px);
}

.fx-outro .fx-wrap {
    display: grid;
    gap: 32px;
}

.fx-outro .fx-label {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    color: #696969;
}

.fx-outro__next {
    display: grid;
    gap: 12px;
    padding: clamp(28px, 4vw, 48px) 0;
    border-top: 1px solid rgba(222, 222, 222, 0.15);
    border-bottom: 1px solid rgba(222, 222, 222, 0.15);
    text-decoration: none;
}

/* Same type as .project-title, but filled instead of outlined */
.fx-outro__title {
    font-family: var(--font-sans);
    font-size: clamp(2.4rem, 6vw, 5rem);
    font-weight: 900;
    letter-spacing: 0.05em;
    line-height: 1.1;
    text-transform: uppercase;
    color: var(--text);
    transition: color 0.3s;
}

.fx-outro__title span,
.fx-outro__title .chev {
    display: inline-block;
    transition: transform 0.4s cubic-bezier(.2, .7, .2, 1);
}

.fx-outro__next:hover .fx-outro__title {
    color: var(--accent);
}

.fx-outro__next:hover .fx-outro__title span,
.fx-outro__next:hover .fx-outro__title .chev {
    transform: translateX(16px);
}

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

/* Matches .nav-btn in work.css */
.fx-outro__links a {
    background-color: var(--bg);
    border: 2px solid var(--text);
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.fx-outro__links a:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
    transform: translateY(-2px);
}

/* ============ GENERIC BLOCKS (project pages) ============ */
/* A plain content section; data-nav-theme picks light or dark */
.fx-sec {
    padding: var(--fx-pad) 0;
    background: var(--fx-bg);
}

.fx-sec--cream {
    background: var(--fx-cream);
}

.fx-sec--dark {
    background: var(--fx-night);
    color: var(--fx-on-green);
}

.fx-sec--dark .fx-label,
.fx-sec--dark .fx-body {
    color: var(--fx-on-green-muted);
}

.fx-sec .fx-wrap {
    display: grid;
    gap: 24px;
}

.fx-sec h2 {
    max-width: 24ch;
}

.fx-sec h2 em {
    color: var(--fx-brass);
}

.fx-sec--dark h2 em {
    color: var(--fx-brass-light);
}

/* Numbered findings list */
.fx-list {
    list-style: none;
    counter-reset: fxl;
    margin: 16px 0 0;
    padding: 0;
    border-top: 1px solid var(--fx-line);
}

.fx-list li {
    counter-increment: fxl;
    display: grid;
    grid-template-columns: clamp(40px, 6vw, 72px) 1fr;
    gap: 12px;
    padding: clamp(18px, 2.4vw, 28px) 0;
    border-bottom: 1px solid var(--fx-line);
    font-size: clamp(1.05rem, 1.6vw, 1.35rem);
    line-height: 1.45;
    max-width: 980px;
}

.fx-list li::before {
    content: counter(fxl, decimal-leading-zero);
    font-family: var(--fx-mono);
    font-size: 0.8rem;
    color: var(--fx-brass);
    padding-top: 0.35em;
}

/* Research / context figures: first one full width, the rest in pairs */
.fx-figs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(16px, 2.4vw, 32px);
    margin-top: clamp(16px, 3vw, 40px);
}

.fx-figs .fx-figure {
    margin: 0;
}

.fx-figs .fx-figure:first-child,
.fx-figs .fx-figure:only-child {
    grid-column: 1 / -1;
}

/* A full-sentence heading (the project's one-line summary) */
.fx-sec h2.fx-h2--statement {
    font-size: clamp(1.45rem, 2.6vw, 2.15rem);
    line-height: 1.2;
    max-width: 34ch;
    letter-spacing: -0.015em;
}

/* Generic carousels and hero screens: frames are fixed 16:9 so tall images
   can't stretch the stage; tall images show their top */
.fx-path--generic .fx-frame__img,
.fx-shot .fx-frame__img {
    aspect-ratio: 16 / 9;
}

.fx-path--generic .fx-frame__img img,
.fx-shot .fx-frame__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

/* Long outcome statements: smaller than the Flex quotes, all left-aligned */
.fx-voices--long .fx-voice:nth-child(even) blockquote {
    justify-self: start;
    text-align: left;
}

.fx-voices--long .fx-voice blockquote {
    font-size: clamp(1.35rem, 2.6vw, 2.15rem);
    line-height: 1.25;
    max-width: 34ch;
}

/* Card without its own heading (generic pages) */
.fx-card--plain p {
    color: var(--fx-ink);
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    line-height: 1.5;
}

.fx-card--plain:last-child p {
    color: var(--fx-on-green);
}

/* Hero showcase with only one image (no screens available) */
.fx-showcase--single {
    grid-template-columns: minmax(0, 0.7fr);
    justify-content: center;
}

/* ============ RICHER BLOCKS (used when a project has the content) ============ */
/* Footnote under a block */
.fx-foot {
    font-size: 0.88rem;
    color: var(--fx-muted);
    max-width: 80ch;
}

.fx-sec--dark .fx-foot {
    color: var(--fx-on-green-muted);
}

/* Tape-measure strip (My Tailor brand detail) */
.fx-tape {
    height: 22px;
    max-width: 640px;
    border-radius: 3px;
    background:
        repeating-linear-gradient(90deg, var(--fx-night) 0 1px, transparent 1px 10px) bottom / 100% 6px no-repeat,
        repeating-linear-gradient(90deg, var(--fx-night) 0 1px, transparent 1px 50px) bottom / 100% 12px no-repeat,
        var(--fx-brass-light);
    opacity: 0.9;
}

/* Outcome cards: big number, sentence, before/after bars */
.fx-outs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.fx-out {
    display: grid;
    gap: 14px;
    align-content: start;
    padding: 24px;
    border-radius: 14px;
    background: var(--fx-surface);
    border: 1px solid var(--fx-line);
}

.fx-out__num {
    font-size: clamp(2.2rem, 3.4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.fx-out__num small {
    font-size: 1rem;
    font-weight: 600;
    color: var(--fx-muted);
    margin-left: 2px;
}

.fx-out p {
    font-size: 0.95rem;
    color: var(--fx-muted);
}

.fx-bars {
    display: grid;
    gap: 6px;
}

.fx-bar {
    display: grid;
    grid-template-columns: 52px 1fr;
    align-items: center;
    gap: 8px;
    font-family: var(--fx-mono);
    font-size: 0.7rem;
    color: var(--fx-muted);
}

.fx-bar i {
    display: block;
    height: 8px;
    border-radius: 4px;
    width: max(var(--w), 2px);
    transform-origin: 0 50%;
    background: var(--fx-line);
}

.fx-bar--now i {
    background: var(--fx-green);
}

html.fx-motion .fx-bar i {
    transform: scaleX(0);
    transition: transform 1s cubic-bezier(.3, .7, .2, 1);
}

html.fx-motion .fx-outs.on .fx-bar i {
    transform: scaleX(1);
}

html.fx-motion .fx-outs.on .fx-bar--now i {
    transition-delay: 0.35s;
}

/* Carousel panel with a before/fix caption, and screens shown whole */
.fx-path--contain .fx-frame__img {
    aspect-ratio: 16 / 10;
    background: #F4F5F4;
}

.fx-path--contain .fx-frame__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.fx-stage-cap {
    display: grid;
    gap: 10px;
}

/* Panels with a two-column caption leave room for the text under the screen */
html.fx-motion .fx-path--contain .fx-panel {
    width: min(50vw, calc((100vh - 480px) * 1.6));
}

.fx-stage-cap h3 {
    font-size: clamp(1.1rem, 1.6vw, 1.35rem);
}

.fx-stage-cap__cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.fx-stage-cap__cols p {
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--fx-on-green-muted);
}

.fx-stage-cap__cols b {
    display: block;
    font-family: var(--fx-mono);
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
    color: var(--fx-brass-light);
}

.fx-stage-cap__cols .fx-was b {
    color: var(--fx-on-green-muted);
}

/* Figures in an even grid (no full-width first figure) */
.fx-figs--even .fx-figure:first-child {
    grid-column: auto;
}

.fx-figs--even {
    align-items: start;
}

/* Usability rounds: dot slides from round 1 score to round 2 score */
.fx-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-family: var(--fx-mono);
    font-size: 0.75rem;
    color: var(--fx-on-green-muted);
}

.fx-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: -1px;
}

.fx-rounds {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.fx-round {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) 2fr;
    gap: 24px;
    align-items: center;
    padding: 22px 0;
    border-top: 1px solid color-mix(in srgb, var(--fx-on-green) 12%, transparent);
}

.fx-round p {
    font-size: 1.1rem;
}

.fx-round small {
    display: block;
    font-size: 0.85rem;
    color: var(--fx-on-green-muted);
    margin-top: 4px;
}

.fx-scale {
    position: relative;
    height: 30px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--fx-on-green) 10%, transparent);
}

.fx-scale .r1,
.fx-scale .r2 {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.fx-scale .r1 {
    left: var(--x1);
    background: var(--fx-on-green-muted);
}

.fx-scale .r2 {
    left: var(--x2);
    background: var(--fx-brass-light);
}

.fx-scale .link {
    position: absolute;
    top: 50%;
    height: 2px;
    left: var(--x1);
    width: calc(var(--x2) - var(--x1));
    background: var(--fx-brass-light);
    transform: translateY(-50%);
    transform-origin: 0 50%;
}

html.fx-motion .fx-scale .r2 {
    left: var(--x1);
    transition: left 1.1s cubic-bezier(.3, .7, .2, 1) 0.2s;
}

html.fx-motion .fx-scale .link {
    transform: translateY(-50%) scaleX(0);
    transition: transform 1.1s cubic-bezier(.3, .7, .2, 1) 0.2s;
}

html.fx-motion .fx-rounds.on .fx-scale .r2 {
    left: var(--x2);
}

html.fx-motion .fx-rounds.on .fx-scale .link {
    transform: translateY(-50%) scaleX(1);
}

/* Stat tiles without meters */
.fx-targets--plain .fx-target span.fx-target__txt {
    font-size: 0.92rem;
    color: var(--fx-muted);
}

.fx-target code {
    font-family: var(--fx-mono);
    font-size: 0.85em;
    color: var(--fx-ink);
}

@media (max-width: 900px) {
    .fx-outs {
        grid-template-columns: 1fr 1fr;
    }

    .fx-round {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .fx-stage-cap__cols {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .fx-outs {
        grid-template-columns: 1fr;
    }

    .fx-figs {
        grid-template-columns: 1fr;
    }
}

/* Who said a quote (above the quote) */
.fx-voice__who {
    font-family: var(--fx-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fx-on-green-muted);
}

.fx-voice:nth-child(even) .fx-voice__who {
    justify-self: end;
}

/* A met target */
.fx-met {
    font-family: var(--fx-mono);
    font-size: 0.75rem;
    color: var(--fx-green);
}

.fx-met::before {
    content: "✓ ";
}

.fx-targets--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
    .fx-targets--three {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .fx-targets--three {
        grid-template-columns: 1fr;
    }
}

/* Scrolling screen in a browser-style frame instead of a phone */
.fx-phone--frame {
    max-width: 380px;
    border: 1px solid var(--fx-line);
    border-radius: 14px;
    background: var(--fx-surface);
}

.fx-mobile__list code,
.fx-target code {
    font-family: var(--fx-mono);
    font-size: 0.88em;
    color: inherit;
}

/* Design system teaser: copy beside a tall link card (phone-mockup sized) */
.fx-ds {
    grid-template-columns: 1fr minmax(0, 360px);
    align-items: center;
    column-gap: clamp(32px, 6vw, 96px);
}

.fx-ds__copy {
    display: grid;
    gap: 24px;
}

/* The card itself is the homepage .project-card (mainstyles.css); only its
   size is set here: phone-mockup width, portrait */
.fx .fx-ds-card {
    width: 100%;
    max-width: 360px;
    aspect-ratio: 3 / 4;
    justify-self: center;
}

/* Undo the case-study heading/paragraph defaults inside the card */
.fx .project-card h3.project-card-title {
    color: var(--text);
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: normal;
    line-height: 1.2;
    margin: 0 0 0.4rem;
}

@media (max-width: 900px) {
    .fx-ds {
        grid-template-columns: 1fr;
        row-gap: 40px;
    }
}

/* ============ DESIGN SYSTEM PAGES (body.fx-page--ds) ============
   Same system as the case studies, with a few cues that say "design system":
   a type tag, a blueprint grid behind dark sections, and specimen canvases. */
/* .fx scoping beats the `.fx p { margin: 0 }` reset */
.fx .fx-kind {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    margin: 0 0 clamp(36px, 4vw, 56px);
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--fx-brass-light) 55%, transparent);
    background: color-mix(in srgb, var(--fx-brass-light) 10%, transparent);
    color: var(--fx-brass-light);
    font-family: var(--fx-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.fx-hero__name {
    display: grid;
    align-content: start;
}

/* Blueprint grid, like a Figma canvas */
.fx-page--ds .fx-hero,
.fx-page--ds .fx-sec--dark,
.fx-page--ds .fx-path--dark {
    background-image:
        linear-gradient(color-mix(in srgb, var(--fx-on-green) 5%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--fx-on-green) 5%, transparent) 1px, transparent 1px);
    background-size: 32px 32px;
}

.fx-page--ds .fx-path--dark {
    background-color: var(--fx-green-deep);
}

.fx-page--ds .fx-hero,
.fx-page--ds .fx-sec--dark {
    background-color: var(--fx-night);
}

/* Specimens sit on a light canvas and are shown whole */
.fx-canvas,
.fx-showcase--canvas .fx-frame__img {
    background: #F5F5F5;
}

.fx-showcase--canvas .fx-frame__img img,
.fx-canvas img {
    object-fit: contain;
}

.fx-canvas {
    padding: clamp(12px, 2vw, 28px);
}

/* Hero artwork with a transparent background: sits straight on the glass
   panel (no browser frame) and runs past its bottom edge */
.fx-showcase--art {
    display: block;
    padding-bottom: 0;
}

.fx-showcase__art {
    display: block;
    width: min(100%, 1240px);
    margin: 0 auto;
    filter: drop-shadow(0 40px 60px color-mix(in srgb, var(--fx-night) 55%, transparent));
}

/* Foundations: three tiles */
.fx-trio {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.fx-trio figure {
    margin: 0;
    display: grid;
    gap: 12px;
    align-content: start;
}

.fx-tile {
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    border: 1px solid var(--fx-line);
    overflow: hidden;
    background: #F5F5F5;
}

.fx-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
}

.fx-tile--type {
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 24px;
    color: #1C2524;
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

.fx-tile__aa {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

.fx-tile__row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.fx-tile__row .w4 { font-weight: 400; }
.fx-tile__row .w6 { font-weight: 600; }
.fx-tile__row .w7 { font-weight: 700; }

.fx-tile__mono {
    font-family: "Roboto Mono", ui-monospace, monospace;
    font-size: 0.85rem;
    color: #5D6866;
}

.fx-trio figcaption {
    display: grid;
    gap: 2px;
}

.fx-trio figcaption b {
    font-weight: 600;
}

.fx-trio figcaption span {
    font-size: 0.92rem;
    color: var(--fx-muted);
}

.fx .fx-sec code,
.fx .fx-comp-cap code,
.fx .fx-trio code {
    font-family: var(--fx-mono);
    font-size: 0.88em;
    color: inherit;
}

/* Copy beside a scrollable frame (.fx-sec scoping beats the generic
   .fx-sec .fx-wrap gap, which was squeezing the columns together) */
.fx-sec .fx-split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
    column-gap: clamp(56px, 8vw, 128px);
    align-items: start;
}

.fx-split__copy {
    display: grid;
    gap: 24px;
}

.fx-scroller {
    margin: 0;
    display: grid;
    gap: 12px;
}

.fx-scroller figcaption {
    font-size: 0.88rem;
    color: var(--fx-muted);
}

.fx-scroller__screen {
    height: min(560px, 70vh);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.fx-scroller__screen img {
    width: 100%;
}

.fx-list--compact li {
    font-size: 1rem;
    padding: 12px 0;
}

/* Token diagram: color / grey / 4 */
.fx-token {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
    font-family: var(--fx-mono);
}

.fx-token__part {
    display: grid;
    gap: 6px;
    justify-items: center;
}

.fx-token__seg {
    font-size: clamp(1.3rem, 3vw, 2rem);
    padding: 8px 16px;
    border-radius: 10px;
    border: 1.5px solid var(--fx-brass);
    color: var(--fx-brass);
    background: var(--fx-surface);
}

.fx-token__slash {
    font-size: clamp(1.3rem, 3vw, 2rem);
    padding: 8px 2px;
    color: var(--fx-muted);
}

.fx-token__what {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fx-muted);
}

/* Type specimen */
.fx-specimen {
    display: grid;
    margin-top: 16px;
    border: 1px solid var(--fx-line);
    border-radius: 14px;
    overflow: hidden;
    background: var(--fx-surface);
}

.fx-spec {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr);
    gap: 16px;
    align-items: baseline;
    padding: 18px 24px;
    border-top: 1px solid var(--fx-line);
}

.fx-spec:first-child {
    border-top: 0;
}

.fx-spec__meta {
    display: grid;
    gap: 2px;
}

.fx .fx-spec__meta code {
    font-family: var(--fx-mono);
    font-size: 0.85rem;
    color: var(--fx-ink);
}

.fx-spec__meta small {
    font-family: var(--fx-mono);
    font-size: 0.72rem;
    color: var(--fx-muted);
}

.fx-spec__sample {
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
    line-height: 1.15;
    color: var(--fx-ink);
    overflow-wrap: anywhere;
}

.fx-spec__sample--mono {
    font-family: "Roboto Mono", ui-monospace, monospace;
    font-variant-numeric: tabular-nums;
    white-space: pre;
}

/* Component carousel captions */
.fx-comp-cap {
    display: grid;
    gap: 8px;
    align-content: start;
}

.fx-comp-cap h3 {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: 1.25rem;
}

.fx-comp-cap__stat {
    font-family: var(--fx-mono);
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--fx-brass-light);
}

.fx-comp-cap p {
    font-size: 0.92rem;
    color: var(--fx-on-green-muted);
}

.fx-props {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
}

.fx .fx-props code {
    font-size: 0.72rem;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--fx-on-green) 22%, transparent);
    color: var(--fx-on-green-muted);
}

.fx .fx-props code.v {
    border-color: var(--fx-brass-light);
    color: var(--fx-brass-light);
}

/* State labels under the Input matrix */
.fx-states {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    text-align: center;
}

.fx .fx-states code {
    font-size: 0.75rem;
    color: var(--fx-muted);
}

/* Before / after naming table */
.fx-names {
    overflow-x: auto;
    margin-top: 16px;
    border: 1px solid color-mix(in srgb, var(--fx-on-green) 14%, transparent);
    border-radius: 14px;
}

.fx-names table {
    border-collapse: collapse;
    width: 100%;
    min-width: 640px;
}

.fx-names th,
.fx-names td {
    text-align: left;
    padding: 14px 18px;
    border-top: 1px solid color-mix(in srgb, var(--fx-on-green) 10%, transparent);
    font-size: 0.95rem;
    vertical-align: top;
}

.fx-names thead th {
    border-top: 0;
    font-family: var(--fx-mono);
    font-weight: 500;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fx-on-green-muted);
}

.fx-names td.old,
.fx-names td.new {
    font-family: var(--fx-mono);
    font-size: 0.85rem;
}

.fx-names td.old {
    color: var(--fx-on-green-muted);
}

.fx-names td.old s {
    text-decoration-color: var(--fx-brass-light);
    text-decoration-thickness: 2px;
}

.fx-names td.new {
    color: var(--fx-brass-light);
}

.fx-names td:last-child {
    color: var(--fx-on-green-muted);
}

/* Mono flags for code-like problems */
.fx-flags--mono li {
    font-family: var(--fx-mono);
    font-size: clamp(1rem, 2vw, 1.5rem);
    letter-spacing: -0.01em;
}

@media (max-width: 900px) {
    .fx-trio,
    .fx-split {
        grid-template-columns: 1fr;
    }

    .fx-split {
        row-gap: 40px;
    }

    .fx-spec {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .fx-states {
        display: none;
    }
}

/* Details: two columns on small phones */
@media (max-width: 560px) {
    .fx .fx-meta {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    /* Long values (e.g. "Tokens, components, ERP patterns") must wrap here:
       unwrapped, they push the page wider than the phone and Chrome then lays
       the whole page out wider, cutting text off on the right */
    .fx .fx-meta dd {
        white-space: normal;
    }
}

/* ============ SECTION PROGRESS ============
   section-progress.css is built for dark pages; over cream sections the
   outline dots and tooltip switch to the dark ink (js/flex.js adds .is-light) */
.section-progress-nav.is-light .progress-dot:not(.active):not(:hover) {
    border-color: var(--fx-ink);
}

.section-progress-nav.is-light .progress-dot::after {
    background-color: var(--fx-bg);
    color: var(--fx-ink);
    border-color: var(--fx-line);
}

/* ============ RESPONSIVE ============ */
/* Design system pages on phones and tablets: the hero row above the title holds
   the prev/next design system links, so the "Design system" pill sits just under
   it with a tight gap, keeping the title close to where case study titles start. */
@media (max-width: 900px) {
    .fx-page--ds .fx .fx-kind {
        margin-bottom: 20px;
    }
}

@media (max-width: 900px) {
    .fx-hero__grid {
        grid-template-columns: 1fr;
    }

    .fx-showcase {
        /* minmax(0, ...) so a wide screenshot or label can't stretch the column past the pane */
        grid-template-columns: minmax(0, 1fr);
    }

    .fx-shot--side {
        display: none;
    }

    .fx-targets,
    .fx-targets--three {
        grid-template-columns: 1fr 1fr;
    }

    .fx-mobile__pin {
        grid-template-columns: 1fr;
    }

    .fx-voice:nth-child(even) blockquote,
    .fx-voice:nth-child(even) .fx-voice__ans {
        justify-self: start;
        text-align: left;
    }
}

@media (max-width: 560px) {
    .fx-doors,
    .fx-targets {
        grid-template-columns: 1fr;
    }

    .fx-card {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .fx-path__head {
        flex-direction: column;
        align-items: start;
    }

    .fx-path__count {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fx-card {
        position: static;
    }
}

/* ============================================
   PROJECT PITCH PLAYER (case studies with body[data-pitch])
   Round glass button, bottom left (same size as back-to-top); progress ring while playing; a circular
   text marquee (PLAY ME / PAUSE ME) spins around it on hover only
   ============================================ */
.pitch {
    position: fixed;
    left: clamp(16px, 3vw, 40px);
    bottom: clamp(16px, 3vw, 40px);
    z-index: 140;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    transition: transform 0.5s cubic-bezier(.65, 0, .25, 1);
}

.pitch__core {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #f2f2ee;
    background: rgba(242, 242, 238, 0.1);
    border: 1px solid rgba(242, 242, 238, 0.24);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
    transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}

.pitch:hover .pitch__core,
.pitch:focus-visible .pitch__core {
    background: var(--accent);
    border-color: var(--accent);
    color: #1d1d1d;
}

.pitch:focus-visible {
    outline: none;
}

.pitch__icon {
    width: 18px;
    height: 18px;
}

.pitch__icon--pause,
.pitch.is-playing .pitch__icon--play {
    display: none;
}

.pitch.is-playing .pitch__icon--pause {
    display: block;
}

/* Progress ring hugging the button */
.pitch__ring {
    position: absolute;
    inset: -4px;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    transform: rotate(-90deg);
    pointer-events: none;
}

.pitch__ring circle {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: calc(100 - var(--progress, 0));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pitch.is-playing .pitch__ring circle,
.pitch.has-progress .pitch__ring circle {
    opacity: 1;
}

/* Circular marquee: hidden until hover/focus, then spins */
.pitch__orbit {
    position: absolute;
    inset: -30px;
    width: calc(100% + 60px);
    height: calc(100% + 60px);
    pointer-events: none;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.35s ease, transform 0.5s cubic-bezier(.65, 0, .25, 1);
}

.pitch__orbit text {
    font-family: var(--font-sans);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    fill: #f2f2ee;
}

.pitch__orbit g {
    transform-origin: 50% 50%;
    animation: pitch-spin 9s linear infinite;
    animation-play-state: paused;
}

.pitch:hover .pitch__orbit,
.pitch:focus-visible .pitch__orbit {
    opacity: 1;
    transform: none;
}

.pitch:hover .pitch__orbit g,
.pitch:focus-visible .pitch__orbit g {
    animation-play-state: running;
}

.pitch__orbit .pitch__say-pause,
.pitch.is-playing .pitch__orbit .pitch__say-play {
    display: none;
}

.pitch.is-playing .pitch__orbit .pitch__say-pause {
    display: inline;
}

@keyframes pitch-spin {
    to { transform: rotate(360deg); }
}

/* Light sections: dark ink, like the nav and back-to-top */
.pitch.on-light:not(:hover) .pitch__core {
    color: #1d1d1d;
    border-color: rgba(29, 29, 29, 0.3);
    background: rgba(255, 255, 255, 0.35);
}

.pitch.on-light .pitch__orbit text {
    fill: #1d1d1d;
}

/* At the very bottom, lift clear of the footer's copyright line */
.pitch.at-end {
    transform: translateY(-56px);
}

@media (prefers-reduced-motion: reduce) {
    .pitch__orbit g {
        animation: none;
    }

    .pitch,
    .pitch__orbit {
        transition: opacity 0.2s ease;
    }
}

/* ============================================
   IMAGE LIGHTBOX (built by case-study.js)
   Spotlights one clicked image; click to zoom, drag to pan.
   The close button is the same round glass button as the pitch player and back-to-top.
   ============================================ */
.fx img.lb-target {
    cursor: zoom-in;
}

.fx img.lb-target:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

html.lb-lock,
html.lb-lock body {
    overflow: hidden;
}

.lb {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    background: rgba(10, 10, 12, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.lb[hidden] {
    display: none;
}

.lb.is-open {
    opacity: 1;
}

.lb__stage {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    touch-action: none;
    cursor: zoom-out;
}

.lb__img {
    display: block;
    max-width: 92vw;
    max-height: 86vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
    transform-origin: center center;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
}

.lb__img.is-anim {
    transition: transform 0.3s cubic-bezier(.2, .7, .2, 1);
}

.lb.is-zoomed .lb__img {
    cursor: grab;
}

.lb.is-zoomed .lb__img:active {
    cursor: grabbing;
}

.lb__close {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + clamp(16px, 3vw, 32px));
    right: clamp(16px, 3vw, 32px);
    z-index: 1;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    color: #f2f2ee;
    background: rgba(242, 242, 238, 0.1);
    border: 1px solid rgba(242, 242, 238, 0.24);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}

.lb__close:hover,
.lb__close:focus-visible {
    background: var(--accent);
    border-color: var(--accent);
    color: #1d1d1d;
    outline: none;
}

.lb__close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.lb__hint {
    position: absolute;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
    transform: translateX(-50%);
    margin: 0;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: rgba(242, 242, 238, 0.6);
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lb.is-zoomed .lb__hint {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .lb,
    .lb__img,
    .lb__img.is-anim {
        transition: none !important;
    }
}
