/* Vilma portfolio, v3 project pages. Loaded after preview-v3.css and reuses its tokens. */

/* ---------- Project hero ---------- */
.cs-hero { padding: clamp(2.5rem, 7vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.cs-back {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 44px;
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--forest);
    font-size: .9375rem;
    font-weight: 500;
    text-decoration: none;
}
.cs-back span[aria-hidden] { transition: transform var(--fast) ease; }
@media (hover: hover) and (pointer: fine) {
    .cs-back:hover { text-decoration: underline; text-underline-offset: .25em; }
    .cs-back:hover span[aria-hidden] { transform: translateX(-3px); }
}
.cs-eyebrow { font-size: .9375rem; color: var(--walnut-text); margin-bottom: .75rem; }
.cs-title {
    font-size: clamp(2.5rem, 8vw, 6.5rem);
    font-weight: 600;
    letter-spacing: -0.045em;
    line-height: 1;
    color: var(--forest);
    text-wrap: balance;
}
.cs-lede {
    margin-top: clamp(1.5rem, 3vw, 2rem);
    max-width: 44rem;
    font-size: clamp(1.0625rem, 1.6vw, 1.3rem);
    line-height: 1.6;
    color: var(--text-soft);
}
.cs-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 1.25rem 2rem;
    margin-top: clamp(2.5rem, 5vw, 3.5rem);
    padding-top: 1.5rem;
    border-top: 1px solid var(--linen);
}
.cs-meta dt { font-size: .875rem; color: var(--walnut-text); }
.cs-meta dd { margin: .2rem 0 0; font-weight: 500; color: var(--ink); }
.cs-hero .text-link { display: inline-flex; align-items: center; min-height: 44px; }
.cs-hero-link { margin-top: 1.25rem; color: var(--text-soft); }

/* ---------- Sections ---------- */
.cs-section { padding: clamp(3.5rem, 8vw, 7rem) 0; border-top: 1px solid var(--linen); }
.cs-section.is-deep { background: var(--paper-deep); border-top-color: transparent; }
.cs-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.cs-h2 {
    font-size: clamp(1.9rem, 4.2vw, 3.25rem);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.08;
    color: var(--forest);
    text-wrap: balance;
}
.cs-kicker { display: block; font-size: .9375rem; font-weight: 400; letter-spacing: 0; color: var(--walnut-text); margin-bottom: .5rem; }
.cs-intro { margin-top: 1rem; color: var(--text-soft); max-width: 42rem; }
.cs-h3 {
    font-size: clamp(1.15rem, 1.8vw, 1.4rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--forest);
}
.cs-text { color: var(--text-soft); max-width: 40rem; }
.cs-text + .cs-text { margin-top: 1rem; }

/* ---------- Figures ---------- */
.cs-figure { margin: 0; }
.cs-frame {
    overflow: hidden;
    border-radius: 6px;
    background: var(--paper);
    border: 1px solid var(--linen);
}
.is-deep .cs-frame { background: #fff; }
.cs-frame.is-bare { border: 0; background: none; border-radius: 0; }
.cs-frame img { width: 100%; }
.cs-figure figcaption {
    margin-top: .75rem;
    font-size: .9375rem;
    color: var(--walnut-text);
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.25rem;
    justify-content: space-between;
}
.cs-zoom {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-block: -.6rem;
    color: var(--forest);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .25em;
}
.cs-narrow { max-width: 40rem; margin-inline: auto; }

.cs-grid { display: grid; gap: clamp(1rem, 3vw, 2rem); }
.cs-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cs-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cs-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cs-grid .span-all { grid-column: 1 / -1; }

/* ---------- Media + copy split (E.I. stages) ---------- */
.cs-split {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(1.75rem, 4vw, 3.5rem);
    align-items: start;
}
.cs-split.is-reverse .cs-figure { order: 2; }
.cs-split .cs-h3 { margin-bottom: .6rem; }

.ps { margin-top: 1.5rem; display: grid; gap: 1.5rem; }
.ps-group { border-top: 1px solid var(--linen); padding-top: 1rem; }
.ps-label {
    font-size: .875rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--walnut-text);
    margin-bottom: .5rem;
}
.ps-group.is-solutions .ps-label { color: var(--forest); }
.ps ul, .cs-list { margin: 0; padding-left: 1.1rem; color: var(--text-soft); }
.ps li, .cs-list li { margin-bottom: .4rem; padding-left: .25rem; }
.ps li::marker, .cs-list li::marker { color: var(--walnut); }

/* ---------- Numbered steps (Scaly practice screen, Loyal phases) ---------- */
.cs-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.cs-step {
    counter-increment: step;
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: center;
    padding: clamp(2rem, 4vw, 3rem) 0;
    border-top: 1px solid var(--linen);
}
.cs-step:last-child { border-bottom: 1px solid var(--linen); }
.cs-step-num::before {
    content: counter(step, decimal-leading-zero);
    display: block;
    font-size: .9375rem;
    font-weight: 500;
    color: var(--walnut-text);
    font-variant-numeric: tabular-nums;
    margin-bottom: .5rem;
}
.cs-step .cs-h3 { margin-bottom: .75rem; }
.cs-step .cs-figure { max-width: 30rem; justify-self: end; width: 100%; }

/* ---------- Quote ---------- */
.cs-quote { margin: 0; max-width: 52rem; }
.cs-quote p {
    font-size: clamp(1.4rem, 3.2vw, 2.4rem);
    font-weight: 300;
    letter-spacing: -0.03em;
    line-height: 1.3;
    color: var(--forest);
    text-wrap: pretty;
}
.cs-quote footer { margin-top: 1.25rem; color: var(--walnut-text); }

/* ---------- Text details (two columns) ---------- */
.cs-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(2rem, 5vw, 5rem);
}
.cs-details .cs-h3 { margin: 2rem 0 .6rem; }
.cs-details > div > .cs-h3:first-child { margin-top: 0; }
.cs-list.is-rules { list-style: none; padding: 0; border-top: 1px solid var(--linen); }
.cs-list.is-rules li { margin: 0; padding: .8rem 0; border-bottom: 1px solid var(--linen); }

/* ---------- Image-as-text alternatives (1.1.1) ---------- */
.text-alt { margin-top: 1rem; }
.text-alt > summary {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 44px;
    color: var(--forest);
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .25em;
}
.text-alt > summary::-webkit-details-marker { display: none; }
.text-alt > summary::before {
    content: "";
    width: .5rem; height: .5rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform var(--fast) ease;
}
.text-alt[open] > summary::before { transform: rotate(45deg); }
.text-alt-body {
    margin-top: .75rem;
    padding: 1.25rem 1.5rem;
    background: var(--paper);
    border: 1px solid var(--linen);
    border-radius: 6px;
    color: var(--text-soft);
    font-size: .975rem;
}
.is-deep .text-alt-body { background: #fff; }
.text-alt-body h3 { margin: 1rem 0 .25rem; font-size: 1rem; color: var(--forest); }
.text-alt-body h3:first-child { margin-top: 0; }
.text-alt-body ul { margin: 0; padding-left: 1.1rem; }
.text-alt-body dl { display: grid; grid-template-columns: max-content 1fr; gap: .15rem 1rem; }
.text-alt-body dt { color: var(--walnut-text); }
.text-alt-body dd { margin: 0; }

/* ---------- More work ---------- */
.more { padding: clamp(3.5rem, 8vw, 6rem) 0; background: var(--paper-deep); }
.more .cs-h2 { margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.more-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--linen); }
.more-list a {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    min-height: 64px;
    padding: 1rem 0;
    border-bottom: 1px solid var(--linen);
    text-decoration: none;
    transition: padding var(--med) var(--ease);
}
.more-title { font-size: clamp(1.15rem, 2.2vw, 1.6rem); font-weight: 600; letter-spacing: -0.02em; color: var(--forest); }
.more-tag { display: block; font-size: .9375rem; color: var(--walnut-text); font-weight: 400; letter-spacing: 0; }
.more-arrow { color: var(--forest); font-size: 1.25rem; transition: transform var(--med) var(--ease); }
.more-list a:active { padding-left: .5rem; }
@media (hover: hover) and (pointer: fine) {
    .more-list a:hover .more-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
    .more-list a:hover .more-arrow { transform: translateX(4px); }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .cs-split, .cs-step { grid-template-columns: 1fr; }
    .cs-split.is-reverse .cs-figure { order: 0; }
    .cs-step .cs-figure { justify-self: start; }
    .cs-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cs-details { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .cs-grid-2, .cs-grid-3 { grid-template-columns: 1fr; }
    .cs-grid-3.keep-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
    .text-alt-body { padding: 1rem; }
    .text-alt-body dl { grid-template-columns: 1fr; }
    .text-alt-body dd { margin-bottom: .4rem; }
}
.cs-narrow.is-studies { max-width: 30rem; }

/* Single persona */
.cs-persona { max-width: 52rem; }

/* Fashion studies: one long sheet shown as four panels side by side */
.studies-grid .cs-frame { aspect-ratio: 600 / 1256; background: #fff; }
.studies-grid .cs-frame img { height: 100%; object-fit: contain; object-position: top; }
@media (max-width: 960px) { .studies-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- White sections: wherever work is shown, so white-background images blend in ---------- */
.cs-section.is-white { background: #fff; }
.is-white .cs-frame { background: transparent; border: 0; border-radius: 0; }
.is-white .cs-frame.is-outlined { border: 1px solid var(--linen); border-radius: 6px; }  /* UI screenshots keep a hairline edge */
.is-white .text-alt-body { background: var(--paper); }
.is-white .studies-grid .cs-frame { border: 1px solid var(--linen); }
.cs-section.is-white + .cs-section.is-white { border-top-color: var(--linen); }

/* ---------- E.I. stages: big screen, notes underneath ---------- */
.cs-stage-copy { max-width: 42rem; margin-bottom: clamp(1.5rem, 3vw, 2rem); }
.cs-stage-copy .cs-h3 { margin-bottom: .5rem; }
.cs-stage .cs-figure { max-width: 64rem; }
.ps.is-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem clamp(2rem, 5vw, 4rem);
    max-width: 64rem;
    margin-top: clamp(1.75rem, 3vw, 2.5rem);
}
@media (max-width: 640px) { .ps.is-cols { grid-template-columns: 1fr; } }

/* ---------- E.I. stages: smaller screen, simple Problems | Solutions columns ---------- */
.cs-stage .cs-figure { max-width: 40rem; }
.ps.is-cols .ps-group { border-top: 2px solid var(--linen); padding-top: 1.1rem; }
.ps.is-cols .ps-group.is-solutions { border-top-color: var(--forest); }
.ps-title {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--forest);
    margin: 0 0 .8rem;
}

/* ---------- At a glance: quick-scan project summary ---------- */
.glance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
}
.glance-card {
    background: var(--paper);
    border: 1px solid var(--linen);
    border-radius: 10px;
    padding: 1.25rem 1.35rem;
}
.glance-label {
    font-size: .9375rem;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--forest);
    margin-bottom: .4rem;
}
.glance-card p { color: var(--ink); line-height: 1.55; }
.glance-card .glance-meta { margin-top: .6rem; font-size: .875rem; color: var(--walnut-text); }
.glance-row { margin-top: clamp(1.75rem, 3vw, 2.25rem); }
.glance-row .glance-label { margin-bottom: .75rem; }
.glance-steps, .glance-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.glance-steps { counter-reset: g; }
.glance-steps li {
    counter-increment: g;
    display: inline-flex; align-items: center; gap: .55rem;
    padding: .5rem .9rem .5rem .5rem;
    background: var(--paper);
    border: 1px solid var(--linen);
    border-radius: 999px;
    color: var(--ink);
    font-size: .9375rem;
}
.glance-steps li::before {
    content: counter(g);
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.6rem; height: 1.6rem; border-radius: 50%;
    background: var(--forest); color: var(--paper);
    font-size: .8125rem; font-weight: 600;
}
.glance-tags li {
    padding: .4rem .85rem;
    border: 1px solid var(--forest);
    border-radius: 999px;
    color: var(--forest);
    font-size: .9375rem;
}

.more { border-top: 1px solid var(--linen); }

/* ---------- Image viewer: magnifier button + zoomable popup ---------- */
.cs-frame { position: relative; }
.cs-frame img[data-zoomable] { cursor: zoom-in; }
.zoom-btn {
    position: absolute;
    top: .6rem;
    right: .6rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--linen);
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: var(--forest);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(44, 62, 80, .12);
    transition: background-color var(--fast) ease, color var(--fast) ease, transform var(--fast) ease;
}
.zoom-btn svg { width: 20px; height: 20px; }
.zoom-btn:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { .zoom-btn:hover { background: var(--forest); color: var(--paper); border-color: var(--forest); } }

.lb {
    width: 100vw; height: 100vh; height: 100dvh;
    max-width: none; max-height: none;
    margin: 0; padding: 0; border: 0;
    background: rgba(24, 38, 28, .94);
    color: var(--paper);
    overflow: hidden;
}
.lb::backdrop { background: transparent; }
.lb-stage {
    position: absolute; inset: 0 0 5.5rem;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    touch-action: none;
    cursor: zoom-in;
}
.lb.is-zoomed .lb-stage { cursor: grab; }
.lb.is-dragging .lb-stage { cursor: grabbing; }
.lb-img {
    max-width: calc(100vw - 2rem);
    max-height: calc(100% - 2rem);
    width: auto; height: auto;
    background: #fff;
    transform-origin: 0 0;
    user-select: none;
    -webkit-user-drag: none;
}
.lb-bar {
    position: absolute; left: 50%; bottom: 1rem;
    transform: translateX(-50%);
    display: flex; align-items: center; gap: .25rem;
    padding: .3rem;
    background: var(--paper);
    border-radius: 999px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .25);
}
.lb-bar button {
    min-width: 44px; height: 44px; padding: 0 .9rem;
    border: 0; border-radius: 999px;
    background: none; color: var(--forest);
    font-size: 1.35rem; font-weight: 500; line-height: 1;
    cursor: pointer;
}
.lb-bar .lb-fit { font-size: .9rem; }
.lb-bar .lb-close { background: var(--forest); color: var(--paper); font-size: 1.5rem; margin-left: .25rem; }
@media (hover: hover) and (pointer: fine) { .lb-bar button:not(.lb-close):hover { background: var(--paper-deep); } }
.lb-bar button:disabled { opacity: .35; cursor: default; }
.lb-level { min-width: 3.5rem; text-align: center; font-size: .9rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.lb :focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
.lb .lb-close:focus-visible { outline-color: var(--paper); box-shadow: 0 0 0 5px var(--forest); }
.lb-hint { position: absolute; top: 1rem; left: 50%; transform: translateX(-50%); font-size: .85rem; color: var(--linen); white-space: nowrap; }
@media (max-width: 480px) { .lb-hint { display: none; } }

/* ---------- Consistent image sizes ---------- */
/* Single landscape images: 48rem (768px). Tall single images: 32rem. Grids use the full content width. */
.cs-figure.is-single, .cs-stage .cs-figure { max-width: 48rem; }
.cs-figure.is-tall { max-width: 32rem; }

/* ---------- Scaly persona: picture left, text right ---------- */
.persona-split {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}
.persona-split .cs-head { margin-bottom: 0; }
@media (max-width: 860px) { .persona-split { grid-template-columns: 1fr; } }

/* ===== Round 6 ===== */

/* At a glance: its own cool mist tint so it separates from the cream title block */
/* At a glance: soft sage green drawn from the forest colour (forest text 6.3:1, ink 9.6:1) */
.cs-section.is-glance { background: #E6EEE7; border-top: 0; }
.is-glance + .cs-section { border-top: 0; }          /* no stray tan line under it */
.is-glance .glance-card, .is-glance .glance-steps li { background: #fff; border-color: #CFDDD1; }

/* Magnifier sits below the image, quiet, never on top of the artwork */
.cs-figtools { display: flex; justify-content: flex-end; margin-top: .25rem; }
.cs-figtools + figcaption { margin-top: -.25rem; }
.zoom-btn {
    position: static;
    width: 40px; height: 40px;
    border: 0; border-radius: 50%;
    background: transparent;
    color: var(--walnut-text);
    box-shadow: none;
}
.zoom-btn svg { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) {
    .zoom-btn:hover { background: var(--paper-deep); color: var(--forest); border-color: transparent; }
}

/* Scaly persona: text left, image right */
.persona-split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; }

/* Text on one side, media on the other */
.text-media-split {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}
@media (max-width: 860px) { .text-media-split { grid-template-columns: 1fr; } }

/* Bigger single image (Scaly final screens) */
.cs-figure.is-wide { max-width: none; }

/* ---------- Carousel (Scaly ideation sketches) ---------- */
.carousel { max-width: 28rem; width: 100%; justify-self: center; }
.carousel-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    list-style: none; margin: 0; padding: 0;
    overscroll-behavior-x: contain;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide { scroll-snap-align: start; min-width: 0; }
.carousel-slide .cs-frame { aspect-ratio: 770 / 1024; background: #fff; }
.carousel-slide .cs-frame img { height: 100%; object-fit: contain; }
.carousel-slide figcaption { font-size: .9375rem; color: var(--walnut-text); }
.carousel-controls { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: .75rem; }
.carousel-btn {
    width: 44px; height: 44px;
    border: 1px solid var(--forest); border-radius: 50%;
    background: none; color: var(--forest);
    font-size: 1.1rem; cursor: pointer;
    transition: background-color var(--fast) ease, color var(--fast) ease, transform var(--fast) ease;
}
.carousel-btn:active { transform: scale(.94); }
.carousel-btn:disabled { opacity: .35; cursor: default; }
@media (hover: hover) and (pointer: fine) { .carousel-btn:not(:disabled):hover { background: var(--forest); color: var(--paper); } }
.carousel-status { min-width: 3.5rem; text-align: center; font-size: .9375rem; color: var(--text-soft); font-variant-numeric: tabular-nums; }

/* ---------- Fashion studies & character design gallery ---------- */
.cs-head.is-row {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem clamp(2rem, 5vw, 4rem);
    align-items: end;
}
.cs-head.is-row .cs-intro { margin-top: 0; }
@media (max-width: 760px) { .cs-head.is-row { grid-template-columns: 1fr; } }
.fashion-gallery { display: grid; gap: clamp(1.5rem, 4vw, 3rem); }
.fg-pair {
    display: grid;
    grid-template-columns: minmax(0, 0.917fr) minmax(0, 0.714fr);   /* widths match the images' shapes so both are the same height */
    gap: clamp(1rem, 3vw, 2rem);
    align-items: start;
}
@media (max-width: 640px) { .fg-pair { grid-template-columns: 1fr; } }


/* ===== Round 7 ===== */

/* ---------- E.I. stages: white section for the screen, then an edge-to-edge tan band for Problems | Solutions ---------- */
.cs-section.is-stage { padding-bottom: 0; border-top: 0; }
.ps-band {
    background: var(--paper-deep);
    margin-top: clamp(2rem, 4vw, 3rem);
    padding: clamp(2rem, 4vw, 3rem) 0 clamp(2.25rem, 4.5vw, 3.25rem);
}
.ps-band .ps.is-cols { margin-top: 0; }
.ps-band .ps.is-cols .ps-group { border-top: 3px solid var(--walnut); }               /* Problems: walnut rule (3.6:1 on tan) */
.ps-band .ps.is-cols .ps-group.is-solutions { border-top-color: var(--forest); }     /* Solutions: forest rule */
.ps-band .cs-list { color: var(--ink); }

/* ---------- Side-by-side layouts: everything aligns from the top ---------- */
.persona-split, .text-media-split, .media-text-split { align-items: start; }
.media-text-split {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);   /* image left, text right */
    gap: clamp(2rem, 5vw, 4rem);
}
@media (max-width: 860px) { .media-text-split { grid-template-columns: 1fr; } }
.cs-step { align-items: start; }
.cs-step .cs-figure { align-self: start; }

/* ---------- Freelance ---------- */
.cs-text.is-full { max-width: none; margin-top: 1.5rem; }
.tee-pair {
    display: grid;
    grid-template-columns: minmax(0, 1.768fr) minmax(0, 0.931fr);  /* matches the two images' shapes so they're equal height */
    gap: clamp(1rem, 3vw, 2rem);
    align-items: start;
}
.lcm-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1rem, 2.5vw, 1.75rem);
    align-items: start;
}
.lcm-gallery .g-full { grid-column: 1 / -1; }
@media (max-width: 760px) {
    .tee-pair, .lcm-gallery { grid-template-columns: 1fr; }
}

/* ---------- Spacing pass: calmer, more even rhythm ---------- */
.cs-hero { padding-bottom: clamp(2.5rem, 5vw, 3.75rem); }
.cs-section { padding: clamp(3rem, 6.5vw, 5.5rem) 0; }
.cs-head { margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }
.cs-head.is-row { margin-bottom: clamp(1.75rem, 3.5vw, 2.5rem); }
.cs-intro { margin-top: .75rem; }
.cs-grid { gap: clamp(1rem, 2.5vw, 1.75rem); }
.fashion-gallery { gap: clamp(1rem, 2.5vw, 1.75rem); }
.fg-pair { gap: clamp(1rem, 2.5vw, 1.75rem); }
.cs-figtools { margin-top: .1rem; min-height: 36px; }
.zoom-btn { width: 36px; height: 36px; }
.cs-step { padding: clamp(1.75rem, 3.5vw, 2.5rem) 0; }
.cs-stage-copy { margin-bottom: clamp(1.25rem, 2.5vw, 1.75rem); }
.glance-row { margin-top: clamp(1.5rem, 3vw, 2rem); }
.more { padding: clamp(3rem, 6.5vw, 5rem) 0; }
.text-alt { margin-top: .75rem; }

/* ===== Round 8 ===== */
/* Illustration pages: title, then the description underneath, running the width of the images */
.cs-head.is-stacked { max-width: none; }
.cs-head.is-stacked .cs-intro { max-width: none; margin-top: .9rem; }

/* Character sketches pair: widths match the two images so they line up at equal height */
.fg-pair.is-sketches { grid-template-columns: minmax(0, 1.545fr) minmax(0, 1.422fr); }

/* Fashion Sketches: 2 x 2, centred, at a size where the tall sheets stay readable without endless scrolling */
.studies-grid.cs-grid-2 { max-width: 64rem; margin-inline: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- Animations carousel (Freelance › Live Current Media) ---------- */
.anim-block { margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: clamp(2rem, 4vw, 2.75rem); border-top: 1px solid var(--linen); }
.anim-block .cs-text { margin-top: .5rem; max-width: none; }
.anim-carousel { margin-top: clamp(1.5rem, 3vw, 2rem); }
.anim-viewport { position: relative; overflow: hidden; padding: .5rem 0; touch-action: pan-y; }
.anim-track {
    display: flex;
    gap: clamp(1rem, 2.5vw, 1.75rem);
    list-style: none; margin: 0; padding: 0;
    transition: transform .45s var(--ease);
    will-change: transform;
}
.anim-slide {
    flex: 0 0 clamp(16rem, 42%, 30rem);
    opacity: .4;
    transform: scale(.9);
    transition: opacity .35s ease, transform .45s var(--ease);
    cursor: pointer;
}
.anim-slide.is-active { opacity: 1; transform: none; cursor: default; }
.anim-video { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; border-radius: 6px; background: var(--paper-deep); }
.anim-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--forest); border-radius: 50%;
    background: rgba(255, 255, 255, .92); color: var(--forest);
    font-size: 1.6rem; line-height: 1; cursor: pointer;
    box-shadow: 0 2px 8px rgba(44, 62, 80, .12);
    transition: background-color var(--fast) ease, color var(--fast) ease;
}
.anim-prev { left: clamp(.5rem, 6%, 5rem); }
.anim-next { right: clamp(.5rem, 6%, 5rem); }
.anim-btn:disabled { opacity: .35; cursor: default; }
@media (hover: hover) and (pointer: fine) { .anim-btn:not(:disabled):hover { background: var(--forest); color: var(--paper); } }
.anim-controls { display: flex; justify-content: center; align-items: center; gap: 1.25rem; margin-top: 1rem; }
.anim-toggle {
    min-height: 44px; padding: 0 1.1rem;
    border: 1px solid var(--forest); border-radius: 999px;
    background: none; color: var(--forest); font-size: .9375rem; font-weight: 500; cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .anim-toggle:hover { background: var(--forest); color: var(--paper); } }
.anim-status { font-size: .9375rem; color: var(--text-soft); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .anim-slide { flex-basis: 72%; } .anim-prev { left: .25rem; } .anim-next { right: .25rem; } }
@media (prefers-reduced-motion: reduce) { .anim-track, .anim-slide { transition: none; } }

/* Mobile stacking: these come last so the desktop column rules above can't override them */
@media (max-width: 860px) {
    .persona-split, .text-media-split, .media-text-split { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .fg-pair, .fg-pair.is-sketches, .studies-grid.cs-grid-2 { grid-template-columns: 1fr; }
}
/* Flow: text comes first in the page (title, text, image on mobile); on wider screens the image sits on the left */
@media (min-width: 861px) { .media-text-split > .cs-figure { order: -1; } }
