/* Carapace story — growth-ring language, unique to this case study */

.carapace-story {
    --accent: #c70039;
    --shell: #c4a06a;
    --peat: #2a1a12;
    --ink: #070707;
    background:
        radial-gradient(1200px 700px at 10% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 55%),
        #101010;
    /* No transform on <body> — it would break position:fixed for the gear + rail */
    animation: carapace-enter .55s ease forwards;
}

@keyframes carapace-enter {
    from { opacity: 0; }
    to { opacity: 1; }
}

.carapace-main {
    overflow-x: hidden;
}

.carapace-story .case-study,
.carapace-main {
    max-width: none;
    margin: 0;
    padding: 0 0 80px;
    position: relative;
    z-index: 1;
}

.shell-field {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: .22;
}

/* ---- season rail ---- */

.carapace-story #case-chrome-top {
    position: relative;
    z-index: 70;
}

.carapace-story .color-changer {
    position: fixed;
    right: -150px;
    top: 92px;
    z-index: 80;
}

.carapace-story .color-changer-active {
    right: 0;
}

.annuli {
    position: fixed;
    right: 18px;
    top: 220px;
    bottom: auto;
    transform: none;
    z-index: 55;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
}

.annuli a {
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: rgba(245, 245, 245, .45);
    font-family: poppins;
    font-size: 11px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    transition: color .3s ease;
}

.annuli a i {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(245, 245, 245, .2);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-style: normal;
    font-size: 9px;
    letter-spacing: 0;
}

.annuli a.is-active,
.annuli a:hover {
    color: whitesmoke;
}

.annuli a.is-active i {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
}

.annuli a span {
    opacity: 0;
    transform: translateX(8px);
    transition: opacity .3s ease, transform .3s ease;
    white-space: nowrap;
}

.annuli:hover a span,
.annuli a.is-active span {
    opacity: 1;
    transform: none;
}

/* ---- shared season frame ---- */

.season {
    position: relative;
    scroll-margin-top: 88px;
    padding: 110px 8vw 90px;
    max-width: 1480px;
    margin: 0 auto;
}

.season-index {
    grid-column: 1 / -1;
    position: relative;
    top: auto;
    left: auto;
    font-family: raleway;
    font-weight: 900;
    font-size: clamp(72px, 12vw, 148px);
    line-height: .82;
    color: rgba(245, 245, 245, .1);
    pointer-events: none;
    letter-spacing: -6px;
    margin: 0 0 6px;
}

.season-kicker {
    font-family: poppins;
    font-size: 12px;
    letter-spacing: 2.6px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}

.season h2 {
    font-family: raleway;
    font-size: clamp(28px, 4vw, 46px);
    font-weight: 900;
    line-height: 1.12;
    margin-bottom: 16px;
}

.season p {
    font-family: poppins;
    font-size: 16px;
    line-height: 1.75;
    opacity: .88;
    max-width: 62ch;
}

.season p + p { margin-top: 12px; }

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .8s ease, transform .8s ease;
}

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

/* ---- hero ---- */

.scute-hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 40px;
    align-items: center;
    padding: 120px 8vw 80px;
    position: relative;
}

.hero-copy {
    position: relative;
    z-index: 2;
    isolation: isolate;
}

.hero-scute {
    position: absolute;
    width: min(110%, 460px);
    height: auto;
    aspect-ratio: 1;
    left: 38%;
    top: 48%;
    transform: translate(-50%, -50%) perspective(900px) rotateX(18deg) rotateZ(-8deg);
    opacity: .9;
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: screen;
    filter: drop-shadow(0 18px 28px rgba(0, 0, 0, .35));
}

.hero-copy > :not(.hero-scute) {
    position: relative;
    z-index: 1;
}

.scute-hero h1 {
    font-family: raleway;
    font-size: clamp(56px, 10vw, 108px);
    font-weight: 900;
    line-height: .9;
    letter-spacing: -2px;
    margin: 4px 0 22px;
    text-shadow: 0 2px 28px rgba(0, 0, 0, .55);
}

.meta-hexes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 22px 0 0;
}

.meta-hexes li {
    font-family: poppins;
    font-size: 11px;
    letter-spacing: .8px;
    text-transform: uppercase;
    padding: 7px 12px;
    border: 1px solid color-mix(in srgb, var(--accent) 55%, whitesmoke);
    clip-path: polygon(12% 0, 88% 0, 100% 50%, 88% 100%, 12% 100%, 0 50%);
}

.hero-specimen { position: relative; z-index: 2; }

.specimen-mask {
    overflow: hidden;
    filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .45));
}

.specimen-mask img {
    width: 100%;
    height: auto;
    display: block;
}

/* ---- document buttons ---- */

.doc-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.doc-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: poppins;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .7px;
    text-transform: uppercase;
    text-decoration: none;
    color: whitesmoke;
    padding: 12px 22px;
    border: 1px solid rgba(245, 245, 245, .3);
    background: transparent;
    clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
    overflow: hidden;
    transition: color .25s ease, border-color .25s ease;
}

.doc-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .35s cubic-bezier(.2, .8, .2, 1);
    z-index: -1;
}

.doc-btn:hover {
    color: #fff;
    border-color: var(--accent);
}

.doc-btn:hover::before {
    transform: scaleX(1);
}

.doc-close {
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 28px 8vw 8px;
    border-top: 1px solid rgba(245, 245, 245, .08);
}

.doc-close .doc-btns {
    margin-top: 0;
}

.hero-specimen figcaption,
.scute-tile figcaption,
.pack-stills figcaption,
.warp-stage figcaption,
.horizon-field figcaption {
    font-family: poppins;
    font-size: 12px;
    letter-spacing: .4px;
    opacity: .6;
    margin-top: 10px;
}

/* ---- 00 concept + inspiration ---- */

.season-origin { display: block; }

.origin-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    align-items: stretch;
    min-height: min(62vh, 560px);
}

.origin-split .look-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: none;
    height: 100%;
}

.origin-prose {
    display: flex;
    flex-direction: column;
    gap: 1.05em;
}

.origin-prose p {
    margin: 0;
    font-family: poppins;
    font-size: clamp(14.5px, 1.15vw, 16.5px);
    line-height: 1.75;
    opacity: .86;
}

.origin-prose p:first-child {
    font-size: clamp(16px, 1.35vw, 18.5px);
    line-height: 1.7;
    opacity: 1;
}

.origin-ask {
    font-family: raleway !important;
    font-size: clamp(18px, 1.8vw, 24px) !important;
    font-weight: 700;
    font-style: italic;
    line-height: 1.35 !important;
    letter-spacing: -.3px;
    color: color-mix(in srgb, var(--accent) 80%, whitesmoke);
    opacity: 1 !important;
    margin: .35em 0 !important;
}

.scute-mosaic {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    height: 100%;
    min-height: min(62vh, 560px);
}

.scute-tile {
    margin: 0;
    overflow: hidden;
    min-height: 0;
}

.scute-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* ---- shared carousel chrome ---- */

.orbit-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(245, 245, 245, .28);
    background: rgba(7, 7, 7, .55);
    color: whitesmoke;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: border-color .25s ease, background .25s ease, transform .25s ease;
}

.orbit-nav:hover {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 28%, #070707);
}

.orbit-prev { left: 10px; }
.orbit-next { right: 10px; }

.orbit-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.orbit-play {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(245, 245, 245, .28);
    background: transparent;
    color: whitesmoke;
    font-size: 12px;
    cursor: pointer;
    letter-spacing: 0;
}

.orbit-play.is-playing {
    border-color: var(--accent);
    color: var(--accent);
}

.orbit-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: center;
    max-width: 70%;
}

.orbit-dots button {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(245, 245, 245, .28);
    cursor: pointer;
    transition: transform .25s ease, background .25s ease, width .25s ease;
}

.orbit-dots button.is-active {
    background: var(--accent);
    width: 22px;
    border-radius: 999px;
}

/* ---- 01 final render · orbit carousel ---- */

.season-final { padding-bottom: 70px; }

.orbit-carousel { margin-top: 18px; perspective: 1400px; }

.orbit-stage {
    position: relative;
    height: min(68vh, 620px);
    overflow: hidden;
    border: 1px solid rgba(245, 245, 245, .08);
    background:
        radial-gradient(ellipse at 50% 110%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 55%),
        #0c0c0c;
}

.orbit-track {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
}

.orbit-slide {
    position: absolute;
    inset: 8% 14%;
    margin: 0;
    opacity: 0;
    transform: translateX(42%) rotateY(-28deg) scale(.78);
    transition:
        opacity .9s cubic-bezier(.22, .8, .25, 1),
        transform 1.1s cubic-bezier(.22, .8, .25, 1),
        filter .9s ease;
    filter: blur(2px) brightness(.55);
    pointer-events: none;
}

.orbit-slide.is-prev {
    opacity: .45;
    transform: translateX(-38%) rotateY(24deg) scale(.82);
    filter: blur(1px) brightness(.7);
}

.orbit-slide.is-next {
    opacity: .45;
    transform: translateX(38%) rotateY(-24deg) scale(.82);
    filter: blur(1px) brightness(.7);
}

.orbit-slide.is-active {
    opacity: 1;
    transform: translateX(0) rotateY(0) scale(1);
    filter: none;
    z-index: 2;
    pointer-events: auto;
}

.orbit-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.orbit-ring {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    width: min(48%, 320px);
    height: 2px;
    background: rgba(245, 245, 245, .12);
    overflow: hidden;
    z-index: 4;
}

.orbit-progress {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, transparent, var(--accent), whitesmoke);
}

.orbit-carousel.is-playing .orbit-progress {
    animation: orbit-fill var(--orbit-ms, 4200ms) linear infinite;
}

@keyframes orbit-fill {
    from { width: 0; }
    to { width: 100%; }
}

/* ---- 02 development process · carousel ---- */

.season-process { padding-bottom: 70px; }

.process-carousel { margin-top: 18px; }

.process-rail {
    position: relative;
}

.process-viewport {
    overflow: hidden;
    border: 1px solid rgba(245, 245, 245, .08);
    background: #0c0c0c;
}

.process-track {
    display: flex;
    transition: transform .85s cubic-bezier(.22, .8, .25, 1);
    will-change: transform;
}

.process-slide {
    flex: 0 0 100%;
    margin: 0;
    padding: 18px 56px 22px;
    box-sizing: border-box;
}

.process-slide img {
    width: 100%;
    height: min(58vh, 520px);
    object-fit: contain;
    display: block;
    background: #101010;
    user-select: none;
    -webkit-user-drag: none;
}

.process-slide figcaption {
    margin-top: 16px;
    font-family: poppins;
    font-size: 14px;
    letter-spacing: .6px;
    text-align: center;
    color: color-mix(in srgb, var(--accent) 70%, whitesmoke);
}

.process-step {
    font-family: poppins;
    font-size: 12px;
    letter-spacing: 2px;
    opacity: .65;
    min-width: 64px;
    text-align: center;
}

.process-dots { max-width: 78%; }

.carapace-slice {
    height: min(62vh, 560px);
    border-radius: 0;
    clip-path: polygon(2% 0, 100% 3%, 98% 100%, 0 97%);
    border: 0;
    margin-top: 28px;
}

.carapace-slice .compare-overlay {
    border-right: 3px solid var(--accent);
}

.carapace-slice .compare-handle::before { background: var(--accent); }
.carapace-slice .compare-handle::after {
    background: var(--accent);
    content: "cut";
    font-family: poppins;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    width: 46px;
    height: 46px;
}

.slice-label {
    position: absolute;
    bottom: 16px;
    font-family: poppins;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 6px 12px;
    background: rgba(7, 7, 7, .6);
    pointer-events: none;
}

.slice-label-l { left: 16px; }
.slice-label-r { right: 16px; }

/* ---- pack ---- */

.season-pack {
    display: grid;
    grid-template-columns: .85fr 1.15fr;
    gap: 40px;
    align-items: start;
}

.pack-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 22px;
}

.scute-btn {
    font-family: poppins;
    font-size: 13px;
    letter-spacing: .6px;
    text-transform: uppercase;
    background: transparent;
    color: whitesmoke;
    border: 1px solid rgba(245, 245, 245, .28);
    padding: 10px 16px;
    cursor: pointer;
    clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
}

.scute-btn-accent {
    background: var(--accent);
    border-color: var(--accent);
}

.pass-readout {
    font-family: poppins;
    font-size: 12px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--accent);
}

#relax-canvas {
    width: 100%;
    height: auto;
    display: block;
    background: #080808;
    border: 1px solid rgba(245, 245, 245, .08);
}

.pack-stage {
    position: sticky;
    top: 100px;
}

/* ---- stack ---- */

.season-stack {
    display: grid;
    grid-template-columns: .85fr 1.15fr;
    gap: 40px;
}

.stack-controls {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 360px;
}

.season-slider span {
    display: flex;
    justify-content: space-between;
    font-family: poppins;
    font-size: 13px;
    letter-spacing: .4px;
    margin-bottom: 8px;
}

.season-slider input,
.pigment-rig input {
    width: 100%;
    accent-color: var(--accent);
}

.extrude-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: poppins;
    font-size: 14px;
    cursor: pointer;
}

.growth-viewport {
    height: 480px;
    perspective: 980px;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
        #080808;
}

.growth-scute {
    width: 280px;
    height: 280px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform .8s cubic-bezier(.2, .8, .2, 1);
}

.growth-scute.is-extruded {
    transform: rotateX(58deg) rotateZ(18deg) translateY(-28px);
}

.growth-ring {
    position: absolute;
    inset: var(--inset);
    background: var(--fill);
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 70%, #000);
    transition: transform .7s cubic-bezier(.2, .8, .2, 1), inset .3s ease;
}

.growth-scute.is-extruded .growth-ring {
    transform: translateZ(var(--z));
}

.stack-stills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.stack-stills img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

/* ---- pigment ---- */

.season-pigment {
    display: grid;
    grid-template-columns: .7fr 1.3fr;
    gap: 36px;
    align-items: center;
}

.pigment-rig {
    display: grid;
    gap: 14px;
}

.z-chip {
    justify-self: end;
    font-family: poppins;
    font-size: 12px;
    letter-spacing: 1px;
    background: rgba(7, 7, 7, .7);
    padding: 6px 10px;
}

.swatch-run {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    height: 10px;
    gap: 4px;
}

.swatch-run i {
    display: block;
    background: var(--s);
    opacity: .35;
    transition: opacity .25s ease, background .25s ease;
}

.swatch-run i.is-lit { opacity: 1; }

.swatch-run i:nth-child(1) { --s: #6a6a6a; }
.swatch-run i:nth-child(2) { --s: #5c3a24; }
.swatch-run i:nth-child(3) { --s: #7a4e2c; }
.swatch-run i:nth-child(4) { --s: #a56b38; }
.swatch-run i:nth-child(5) { --s: #c48a42; }
.swatch-run i:nth-child(6) { --s: #e0b15a; }
.swatch-run i:nth-child(7) { --s: #f0d56a; }
.swatch-run i:nth-child(8) { --s: #fff3a0; }

.pigment-still {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    opacity: .88;
}

/* ---- warp ---- */

.season-warp {
    display: grid;
    grid-template-columns: .85fr 1.15fr;
    gap: 36px;
}

#warp-canvas {
    width: 100%;
    height: auto;
    display: block;
    background: #080808;
    clip-path: polygon(0 0, 100% 5%, 100% 100%, 0 96%);
}

.warp-stage figure {
    margin: 12px 0 0;
}

.warp-stage img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    opacity: .9;
}

/* ---- horizon ---- */

.season-horizon {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: 36px;
    align-items: center;
}

.horizon-field {
    margin: 0;
    position: relative;
}

.horizon-photo {
    position: relative;
    overflow: hidden;
    clip-path: polygon(4% 0, 100% 6%, 96% 100%, 0 94%);
}

.horizon-field img {
    width: 100%;
    height: 460px;
    object-fit: cover;
    display: block;
}

.horizon-lens {
    position: absolute;
    width: 168px;
    height: 168px;
    margin: -84px 0 0 -84px;
    left: 50%;
    top: 50%;
    pointer-events: none;
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    box-shadow:
        0 0 0 2px var(--accent),
        0 16px 40px rgba(0, 0, 0, .45);
    overflow: hidden;
    opacity: 0;
    transform: scale(.86);
    transition: opacity .25s ease, transform .25s ease;
}

.horizon-photo:hover .horizon-lens {
    opacity: 1;
    transform: scale(1);
}

.horizon-lens img {
    position: absolute;
    width: var(--w, 800px);
    height: var(--h, 460px);
    max-width: none;
    left: var(--lx, 0px);
    top: var(--ly, 0px);
    object-fit: cover;
}

.carapace-story .case-pager {
    --pager-accent: var(--accent);
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 0 8vw;
}

/* ---- motion / small screens ---- */

@media (max-width: 980px) {
    .annuli { display: none; }
    .scute-hero,
    .origin-split,
    .season-pack,
    .season-stack,
    .season-pigment {
        grid-template-columns: 1fr;
        padding-left: 22px;
        padding-right: 22px;
    }
    .hero-scute {
        width: min(96%, 360px);
        left: 50%;
        opacity: .75;
        transform: translate(-50%, -50%) perspective(900px) rotateX(14deg) rotateZ(-6deg);
    }
    .doc-close {
        padding-left: 22px;
        padding-right: 22px;
    }
    .pack-stage { position: static; }
    .origin-split {
        min-height: 0;
        gap: 22px;
    }
    .scute-mosaic {
        min-height: 360px;
        height: 360px;
    }
    .orbit-stage { height: min(52vh, 420px); }
    .orbit-slide { inset: 10% 8%; }
    .orbit-slide.is-prev,
    .orbit-slide.is-next { display: none; }
    .process-slide { padding: 12px 44px 16px; }
    .process-slide img { height: min(42vh, 360px); }
    .pigment-rig { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
    }
    .orbit-carousel.is-playing .orbit-progress { animation: none; }
    .orbit-slide,
    .process-track { transition: none; }
}
