/* Case ("episode") pages. Loaded after site.css. */
.case-hero { background: var(--paper); color: var(--paper-ink); }
.case-hero a:hover { color: var(--blue); }
.case-hero :focus-visible { outline-color: var(--blue); }
.case-hero .label { color: var(--paper-muted); }
.case-hero__inner { padding-block: 20px clamp(2.5rem, 6vw, 5rem); }
.case-hero__kicker { display: flex; gap: 12px; margin-top: clamp(3rem, 9vw, 7rem); }
.case-hero .case-hero__kicker b { font-weight: 500; color: var(--pink); }
.case-hero__title { margin-top: 12px; font: 400 clamp(4rem, 15vw, 14rem)/0.86 var(--font-display); text-transform: uppercase; text-shadow: 5px 3px 0 var(--misprint-a), -4px -2px 0 var(--misprint-b); }
.case-hero__lede { max-width: 30ch; margin-top: clamp(1.25rem, 3vw, 2.25rem); font: 400 var(--step-2)/1.08 var(--font-display); text-transform: uppercase; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); margin-top: clamp(2rem, 5vw, 3.5rem); padding-top: 18px; border-top: 1px solid rgba(23, 19, 44, 0.18); }
.facts div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.facts dd { font-weight: 400; }

.case-cover { margin-top: calc(-1 * clamp(1.5rem, 4vw, 3rem)); }
.shot {
  display: grid; place-items: center; aspect-ratio: 16 / 9; padding: 16px; text-align: center;
  background: #0f1115; border: 1px dashed var(--ghost); color: var(--muted);
  font: 400 var(--step--1)/1.5 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase;
}
.shot--tall { aspect-ratio: 4 / 3; }
.shot img { width: 100%; height: 100%; object-fit: cover; }

.case-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--space-4); padding-block: clamp(3rem, 7vw, 6rem); border-bottom: 1px solid var(--line); }
.case-section__title { font: 400 var(--step-3)/1 var(--font-display); text-transform: uppercase; }
.case-section__body > * + * { margin-top: 1em; }
.case-section__body p { max-width: 62ch; font-size: 1.0625rem; }
.todo { padding: 12px 14px; border-left: 3px solid var(--accent-2); background: #0f1115; color: var(--muted); }

.decisions { display: grid; gap: clamp(2.5rem, 6vw, 4.5rem); counter-reset: decision; }
.decision { display: grid; grid-template-columns: 1fr 1.3fr; gap: var(--space-4); align-items: center; counter-increment: decision; }
.decision:nth-child(even) .decision__text { order: 2; }
.decision__name { font: 400 var(--step-2)/1 var(--font-display); text-transform: uppercase; }
.decision__name::before { content: counter(decision, decimal-leading-zero); display: block; margin-bottom: 8px; font-size: 3.5rem; color: var(--ghost); }
.decision__text p { margin-top: 10px; max-width: 46ch; color: var(--muted); }

.results { display: flex; flex-wrap: wrap; gap: clamp(2rem, 6vw, 5rem); }
.results div { display: flex; flex-direction: column-reverse; }
.results dd { font: 400 var(--step-4)/0.95 var(--font-display); color: var(--accent); }
.results dt { margin-top: 8px; }

.next { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-3); padding-block: clamp(3rem, 8vw, 6rem); }
.next__title { font: 400 var(--step-4)/0.95 var(--font-display); text-transform: uppercase; color: var(--ghost); }

@media (max-width: 860px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .case-section, .decision { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
  .decision:nth-child(even) .decision__text { order: 0; }
}

/* real images */
.shot--art { aspect-ratio: auto; padding: 0; border: 0; background: var(--art-bg, #0f1115); max-height: 78vh; overflow: hidden; }
.shot--art img { width: 100%; height: 100%; max-height: 78vh; object-fit: contain; }
.case-section--stack .plate { grid-column: 1 / -1; }
.plate { margin: 0; }
.plate__scroll { overflow-x: auto; background: #f4f2ee; border-radius: 4px; }
.plate img { display: block; width: 100%; min-width: 760px; height: auto; }
.plate figcaption { margin-top: 10px; }
.plate + .plate { margin-top: var(--space-3); }

/* clickable prototype */
.proto { grid-column: 1 / -1; display: grid; grid-template-columns: 316px minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: center; padding: clamp(1.25rem, 3vw, 2.5rem); background: #0f1115; border: 1px solid var(--line); }
.proto__phone { position: relative; width: 300px; height: 650px; flex: none; border-radius: 34px; overflow: hidden; background: #fff; box-shadow: 0 0 0 8px #1b1e24, 0 30px 60px rgba(0, 0, 0, 0.5); margin: 8px; }
.proto__screen { display: block; width: 300px; height: 650px; max-width: none; object-fit: cover; }
.proto__screen.is-in { animation: proto-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes proto-in { from { opacity: 0; transform: translateX(6%); } to { opacity: 1; transform: none; } }
.proto__tap { position: absolute; inset: 0; border: 0; padding: 0; background: transparent; cursor: pointer; }
.proto__roles { position: absolute; inset: 0; }
.proto__roles button { position: absolute; left: 6.4%; width: 87.2%; height: 5.9%; border: 0; padding: 0; border-radius: 999px; background: transparent; cursor: pointer; }
.proto__roles button:hover, .proto__roles button:focus-visible { background: rgba(0, 190, 164, 0.14); }
.proto__roles button:nth-child(1) { top: 44.1%; } .proto__roles button:nth-child(2) { top: 52%; }
.proto__roles button:nth-child(3) { top: 59.9%; } .proto__roles button:nth-child(4) { top: 67.7%; }
.proto__roles button:nth-child(5) { top: 75.6%; } .proto__roles button:nth-child(6) { top: 83.5%; }
.proto__step { margin-top: 10px; font: 400 var(--step-2)/1.05 var(--font-display); text-transform: uppercase; min-height: 2.2em; }
.proto__hint { margin-top: 12px; max-width: 44ch; color: var(--muted); }
.proto__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
@media (max-width: 860px) { .proto { grid-template-columns: minmax(0, 1fr); justify-items: center; } .proto__side { justify-self: stretch; } }

/* prototype details: the place animation, typed name, bottom sheet */
.proto__anim { position: absolute; left: 41px; top: 251px; width: 218px; height: 218px; border-radius: 50%; }
.proto__typed { position: absolute; left: 6.2%; top: 41.9%; width: 70%; height: 3.6%; display: flex; align-items: center; background: #fff; color: #333; font: 400 14px/1 system-ui, -apple-system, 'Segoe UI', sans-serif; }
.proto__typed span::after { content: ''; display: inline-block; width: 1px; height: 1.1em; margin-left: 1px; vertical-align: -0.15em; background: #333; animation: blink 1s steps(1) infinite; }
.proto__dim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.22); animation: proto-fade 0.25s both; }
.proto__sheet { position: absolute; left: 0; right: 0; bottom: 0; height: 36.6%; background-size: 100% auto; background-position: center bottom; background-repeat: no-repeat; animation: proto-sheet 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.proto__sheet button { position: absolute; left: 2.1%; width: 95.8%; height: 16%; border: 0; padding: 0; background: transparent; cursor: pointer; }
.proto__sheet button:hover, .proto__sheet button:focus-visible { background: rgba(0, 190, 164, 0.12); }
.proto__sheet button:nth-child(1) { top: 1.7%; } .proto__sheet button:nth-child(2) { top: 17.8%; }
.proto__sheet button:nth-child(3) { top: 33.9%; } .proto__sheet button:nth-child(4) { top: 50%; }
.proto__sheet button:nth-child(5) { top: 69%; height: 19%; border-radius: 14px; }
@keyframes proto-sheet { from { transform: translateY(100%); } to { transform: none; } }
@keyframes proto-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .proto__sheet, .proto__dim, .proto__screen.is-in { animation: none; } }

.case-hero__cta { margin-top: 22px; }
.case-hero .button { background: var(--paper-ink); color: var(--paper); }
.case-hero a.button:hover { background: var(--blue); color: #fff; }
.proto { scroll-margin-top: 24px; }

/* lists inside case sections */
.case-list { max-width: 62ch; padding-left: 1.25em; font-size: 1.0625rem; list-style: disc; }
ol.case-list { list-style: decimal; }
.plate--wide img { min-width: 1500px; }
.case-list li { margin-top: 0.6em; padding-left: 0.2em; }
.case-list li::marker { color: var(--accent); }
.case-section__body .results + p { margin-top: 1.5em; }

/* back arrow on the "All episodes" link */
.case-hero .topbar > a.label[href$="#work"]::before { content: "\2190"; display: inline-block; margin-right: 0.7em; }

/* Lucky Trails prototype: dissolve between screens instead of sliding */
.proto__ghost { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity 0.36s cubic-bezier(0.3, 0, 0.2, 1); }
.proto__ghost.is-on { opacity: 1; }
.proto__phone .proto__tap { z-index: 2; }
@media (prefers-reduced-motion: reduce) { .proto__ghost { transition: none; } }

.case-section > *, .decision > * { min-width: 0; }

/* a plate that should always fit the screen width instead of scrolling sideways (tap opens the full-size viewer) */
.plate--fit img { min-width: 0; }

/* phones: the main picture of each case runs edge to edge, so it is as large as it can be */
@media (max-width: 700px) {
  .case-cover { padding-inline: 0; }
  .case-cover .shot--art { margin-inline: 0; max-height: none; }
  .case-cover .shot--art img { max-height: none; height: auto; }
}
