/* Case study pages: overview.html and delivery/3d-playstructure/. Extends concepts.css (Horizons tokens). */
html { scroll-padding-top: calc(var(--header) + 28px); }
body { --sec: clamp(76px, 10vw, 150px); }
.wrap { padding-inline: var(--gutter); }
.case h2, .case h3 { margin: 0; }
.case .mono.label { color: var(--accent); }

/* intro */
.intro { padding: calc(var(--header) + clamp(56px, 9vh, 116px)) var(--gutter) 0; }
.intro h1 { margin: 26px 0 0; max-width: 11.5ch; font-size: clamp(3.1rem, 8.6vw, 8.6rem); font-weight: 500; font-stretch: 88%; line-height: .9; letter-spacing: -.065em; }
.intro h1 em { font-style: normal; color: var(--accent); }
.intro__row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px clamp(40px, 6vw, 110px); align-items: end; margin-top: clamp(32px, 4.5vw, 60px); }
.intro__lead { max-width: 37em; font-size: clamp(1.08rem, 1.45vw, 1.36rem); line-height: 1.5; letter-spacing: -.012em; }
.intro__links { display: flex; flex-wrap: wrap; gap: 14px 36px; justify-content: flex-end; }
.ln { display: inline-flex; align-items: center; gap: 22px; min-height: 44px; border-bottom: 1px solid var(--ink); font-size: .95rem; }
.ln span { font-size: 1.2rem; }
.ln:hover { color: var(--accent); border-color: var(--accent); }
.facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: clamp(48px, 6vw, 84px) 0 0; border-top: 1px solid var(--ink); }
.facts div { padding: 16px 20px 0 0; }
.facts dt { color: var(--muted); margin-bottom: 8px; }
.facts dd { margin: 0; font-size: .95rem; line-height: 1.45; }

/* sections */
.sec { padding: var(--sec) var(--gutter) 0; }
.sec__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: 18px clamp(32px, 5vw, 90px); margin-bottom: clamp(36px, 5vw, 64px); }
.sec__head h2 { font-size: clamp(2.3rem, 4.8vw, 4.6rem); font-weight: 500; line-height: .98; letter-spacing: -.058em; max-width: 14ch; }
.sec__head > div > p { max-width: 40em; color: var(--muted); font-size: clamp(1rem, 1.2vw, 1.12rem); line-height: 1.6; margin-top: 10px; }
.sec__head .mono { padding-top: 12px; border-top: 1px solid var(--line); align-self: start; }
.sec__body { display: grid; gap: 22px; }

/* work grid (kept from the review index) */
.ov__group + .ov__group { margin-top: clamp(48px, 6vw, 80px); }
.ov__bar { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 18px; padding-bottom: 14px; margin-bottom: 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ov__bar h3 { font-size: 1.16rem; font-weight: 600; letter-spacing: -.028em; }
.ov__bar p { color: var(--muted); }
.cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: clamp(14px, 1.6vw, 22px); }
.cell { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; transition: transform .3s, box-shadow .3s, border-color .3s; }
.cell:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 16px 40px -20px rgba(19,35,56,.45); }
.cell__shot { aspect-ratio: 16/10; background: var(--scene); overflow: hidden; border-bottom: 1px solid var(--line); }
.cell__shot img { transition: transform 1s; }
.cell:hover .cell__shot img { transform: scale(1.03); }
.cell__shot--clay { background: #f4f3ef; }
.cell__shot--clay img { object-position: 50% 62%; }
.cell__body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.cell__kicker { color: var(--accent); }
.cell__body h4 { font-size: 1.22rem; font-weight: 600; letter-spacing: -.032em; margin: 0; }
.cell__body p { color: var(--muted); font-size: .92rem; }
.cell__foot { margin-top: auto; padding-top: 12px; display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.cell__foot span { font-size: 1.1rem; }

/* context */
.ctx { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(36px, 5vw, 90px); }
.ctx h3 { font-size: 1.35rem; font-weight: 600; letter-spacing: -.03em; margin-bottom: 14px; }
.ctx p { color: var(--muted); line-height: 1.6; }
.ctx p + p { margin-top: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding: 0; list-style: none; }
.chips li { padding: 7px 12px; border: 1px solid var(--line); background: #fff; font-size: .85rem; }
.steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.steps li { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 6px 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.steps .mono { color: var(--accent); padding-top: 3px; }
.steps p { color: var(--ink); line-height: 1.55; }

/* build */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); margin-bottom: clamp(40px, 5vw, 64px); }
.stats div { padding: 22px 20px 24px 0; }
.stats div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.stats b { display: block; font-size: clamp(2rem, 3.6vw, 3.4rem); font-weight: 500; font-stretch: 88%; letter-spacing: -.05em; line-height: 1; }
.stats span { display: block; margin-top: 10px; color: var(--muted); font-size: .9rem; }
.feats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(30px, 3.4vw, 52px) clamp(24px, 3vw, 48px); }
.feat h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -.025em; margin: 10px 0 8px; }
.feat p:not(.mono) { color: var(--muted); font-size: .95rem; line-height: 1.6; }
.feat .mono { color: var(--accent); }
code { font-family: 'Martian Mono', monospace; font-size: .8em; letter-spacing: 0; }

/* pipeline */
.pipe { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.2vw, 32px); counter-reset: step; list-style: none; margin: 0; padding: 0; }
.pipe li { display: flex; flex-direction: column; gap: 10px; }
.pipe figure { margin: 0 0 8px; aspect-ratio: 1; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.pipe figure img { object-fit: contain; }
.pipe h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -.03em; }
.pipe p:not(.mono) { color: var(--muted); font-size: .95rem; line-height: 1.6; }
.pipe .mono { color: var(--accent); }
.pipe__foot { display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 20px 40px; align-items: end; margin-top: clamp(32px, 4vw, 52px); padding-top: 20px; border-top: 1px solid var(--line); }
.pipe__foot p { color: var(--muted); max-width: 52em; line-height: 1.6; font-size: .95rem; }

/* notes */
.notes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(32px, 5vw, 80px); }
.notes li { padding: 20px 0 22px 22px; border-top: 1px solid var(--line); position: relative; line-height: 1.6; }
.notes li::before { content: ''; position: absolute; left: 0; top: 29px; width: 8px; height: 8px; background: var(--accent); }

.foot { margin-top: var(--sec); padding: 34px var(--gutter) 84px; border-top: 1px solid var(--ink); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 40px; color: var(--muted); font-size: .9rem; }
.foot a { color: var(--ink); border-bottom: 1px solid var(--line); }
.foot a:hover { color: var(--accent); border-color: var(--accent); }
.foot p:last-child { display: flex; gap: 24px; }

@media (max-width: 1100px) {
 .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 18px; }
 .feats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .stats div:nth-child(3) { padding-left: 0; border-left: 0; }
 .stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 800px) {
 .intro__row, .sec__head, .ctx, .notes, .pipe__foot { grid-template-columns: minmax(0, 1fr); }
 .intro__links { justify-content: flex-start; }
 .sec__head .mono { justify-self: start; }
 .pipe { grid-template-columns: minmax(0, 1fr); }
 .pipe li { display: grid; grid-template-columns: 38% minmax(0, 1fr); column-gap: 18px; align-items: start; }
 .pipe figure { grid-row: span 3; margin: 0; }
}
@media (max-width: 560px) {
 .intro h1 { font-size: clamp(2.9rem, 14.4vw, 4.4rem); }
 .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .facts div:last-child { grid-column: 1 / -1; }
 .feats { grid-template-columns: minmax(0, 1fr); }
 .steps li { grid-template-columns: minmax(0, 1fr); }
 .stats b { font-size: 2rem; }
 .pipe li { grid-template-columns: minmax(0, 1fr); }
 .pipe figure { grid-row: auto; margin-bottom: 6px; }
 .foot { flex-direction: column; }
}

/* 3D pipeline page */
.viewer { position: relative; height: clamp(360px, 68vh, 760px); background: radial-gradient(120% 90% at 50% 6%, #fff 0%, #f3f6f9 46%, #e2e8ef 100%); border: 1px solid var(--line); overflow: hidden; }
.viewer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
.viewer canvas.grab { cursor: grabbing; }
.viewer__load { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; gap: 12px; justify-items: center; color: var(--muted); text-align: center; transition: opacity .4s; }
.viewer__load.done { opacity: 0; pointer-events: none; }
.viewer__fallback { position: absolute; inset: 0; background: #f4f3ef; }
.viewer__fallback img { object-fit: contain; }
.viewer__hint { position: absolute; left: 16px; bottom: 14px; color: var(--muted); pointer-events: none; transition: opacity .3s; }
.vctl { display: flex; flex-wrap: wrap; gap: 14px 30px; margin-top: 18px; }
.vctl__row { display: flex; align-items: center; gap: 12px; }
.vctl__row > .mono { color: var(--muted); }
.tablewrap { overflow-x: auto; margin-top: clamp(32px, 4vw, 52px); }
.spec { width: 100%; min-width: 520px; border-collapse: collapse; font-size: .95rem; }
.spec caption { text-align: left; color: var(--muted); padding-bottom: 12px; }
.spec th, .spec td { text-align: left; padding: 13px 18px 13px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec thead th { border-bottom-color: var(--ink); color: var(--muted); font-weight: 400; }
.spec tbody th { font-weight: 400; color: var(--muted); }
.spec .is-key { color: var(--accent); font-weight: 600; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: clamp(14px, 1.6vw, 22px); }
.shots figure { margin: 0; }
.shots img { aspect-ratio: 1; height: auto; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.shots figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; margin-top: 10px; font-size: .92rem; }
.shots figcaption .mono { color: var(--muted); }
.shots figcaption .mono.is-used { color: var(--accent); }
.callout { max-width: 60em; margin-top: clamp(32px, 4vw, 52px); padding: 4px 0 4px 20px; border-left: 2px solid var(--accent); line-height: 1.6; }
.callout q { font-style: italic; }
.code { margin: 22px 0 0; padding: 20px 22px; overflow-x: auto; background: var(--ink); color: #e6edf6; font: 400 .78rem/1.75 'Martian Mono', monospace; }
.code + p { margin-top: 12px; color: var(--muted); font-size: .92rem; }
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list li { padding: 14px 0; border-bottom: 1px solid var(--line); line-height: 1.55; }
@media (max-width: 560px) {
 .viewer { height: auto; aspect-ratio: 1; }
 .vctl { gap: 12px; }
 .vctl__row { width: 100%; justify-content: space-between; }
 .vctl .seg button { padding-inline: 10px; font-size: .8rem; }
}
