/* Scoped extension of the portfolio's established type, themes and stage colours. */
.cosmo-page { max-width: 1120px; padding-top: 24px; padding-bottom: 48px; }
.cosmonauts-case-study .desktop-nav { min-width: 0; flex-wrap: wrap; justify-content: flex-end; row-gap: .5rem; }
.cosmo-skip { position: fixed; top: 8px; left: 16px; z-index: 1000; transform: translateY(-160%); padding: 12px 18px; background: var(--bg); color: var(--text); border: 1px solid var(--focus); }
.cosmo-skip:focus { transform: none; }
.cosmo-page [hidden] { display: none !important; }
.cosmo-page :focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; }
.cosmo-page ::selection { background: var(--accent); color: var(--bg); }
.cosmo-page a { text-underline-offset: .22em; }
.cosmo-page svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; flex-shrink: 0; }
.cosmo-page .review-notice { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font: .9375rem/1.5 var(--font-body); color: var(--soft-text); border-block: 1px solid var(--line); padding-block: 14px; margin: 20px 0 36px; }
.review-notice strong { color: var(--stage-discover-ink); font-weight: 700; }
#case-study { font: 1.125rem/1.555556 var(--font-body); }
#case-study h1, #case-study h2 { font-family: var(--font-display); font-weight: 700; text-wrap: balance; overflow-wrap: break-word; }
#case-study h1 { font-size: clamp(2.25rem, 4.2vw, 4rem); line-height: 1.05; max-width: 26ch; margin: 0 0 28px; }
#case-study h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.25; margin: 0 0 24px; }
#case-study h3 { font: 700 1.5rem/1.3 var(--font-heading); margin: 0 0 16px; }
#case-study p { max-width: 70ch; margin: 0 0 20px; }
#case-study .cosmo-lead { font-size: 1.25rem; line-height: 1.5; max-width: 65ch; }
#case-study .cosmo-meta, #case-study .cosmo-caption, #case-study figcaption { font-size: .9375rem; line-height: 1.5; color: var(--soft-text); }
.cosmo-intro { margin-bottom: 44px; }
.cosmo-contents { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 28px 0 0; padding-bottom: 16px; font: 600 .9375rem/1.5 var(--font-heading); }
.cosmo-contents a { display: inline-flex; align-items: center; min-height: 44px; }
.cosmo-chapter { --stage: var(--stage-discover-ink); --tint: var(--stage-discover-soft); border-top: 1px solid var(--line); padding: 48px 0 12px; margin-top: 40px; scroll-margin-top: 168px; }
.cosmo-chapter.define { --stage: var(--stage-define-ink); --tint: var(--stage-define-soft); }
.cosmo-chapter.develop { --stage: var(--stage-develop-ink); --tint: var(--stage-develop-soft); }
.chapter-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 64px; }
.chapter-intro h2 { max-width: 20ch; }
.method-note { margin-top: 28px; border-block: 1px solid var(--line); }
.method-note summary { position: relative; padding: 20px 44px 20px 0; font: 600 1.125rem/1.5 var(--font-heading); }
.method-note > div { padding: 8px 0 12px; }
.reasoning-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 28px 0 0; }
.reasoning-strip > div { padding-top: 18px; border-top: 1px solid var(--stage); }
.reasoning-strip dt { font: 700 1.125rem/1.4 var(--font-heading); margin-bottom: 12px; }
.reasoning-strip dd { color: var(--soft-text); margin: 0; }
.cosmo-closing { border-top: 1px solid var(--line); margin-top: 48px; padding: 48px 0 32px; scroll-margin-top: 168px; }
.cosmo-return { margin-top: 16px; }
.cosmo-return svg { transform: rotate(-90deg); }
.cosmo-page .case-study-project-nav { width: 100%; flex-wrap: wrap; }
@media (min-width: 960px) {
  .cosmonauts-case-study .site-header, .cosmonauts-case-study .header-inner { min-height: 144px; }
}
@media (max-width: 760px) {
  #case-study { font-size: 1rem; line-height: 1.5; }
  .chapter-intro { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (max-width: 560px) {
  .cosmo-page .review-notice { display: block; }
  .review-notice span { display: block; margin-top: 4px; }
  #case-study .cosmo-lead { font-size: 1.125rem; }
  .cosmo-intro { margin-bottom: 32px; }
  .cosmo-contents { gap: 0 20px; }
  .cosmo-chapter { margin-top: 28px; padding-top: 32px; scroll-margin-top: 120px; }
  .research-lens { grid-template-columns: minmax(0, 1fr); padding: 22px; gap: 20px; }
  .research-lens > svg { transform: rotate(90deg); }
  .cosmo-closing { margin-top: 32px; padding-top: 32px; scroll-margin-top: 120px; }
}
@media print {
  .cosmo-page .evidence-panel[hidden] { display: grid !important; }
  .workbench, .cosmo-chapter { break-inside: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .cosmonauts-case-study *, .cosmonauts-case-study *::before, .cosmonauts-case-study *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

/* The study walkthrough uses a light specimen surface, matching the original tools. */
.study-tour { margin: 36px 0 44px; scroll-margin-top: 168px; }
.study-tour-heading { display: flex; align-items: start; justify-content: space-between; gap: 24px; }
#case-study .study-tour-heading h3 { margin-bottom: 12px; }
#case-study .study-tour-heading p { max-width: 66ch; }
#case-study .study-tour > .tour-caption { max-width: 90ch; margin: 0 0 24px; }
.tour-play { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 10px; padding: 10px 16px; min-height: 48px; border: 1px solid var(--stage); background: transparent; color: var(--text); font: 600 1rem/1.4 var(--font-heading); cursor: pointer; }
.tour-play:hover { background: var(--tint); }
.tour-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); }
.tour-tabs button { display: flex; align-items: center; justify-content: flex-start; gap: 12px; min-height: 80px; padding: 16px; border: 0; color: var(--text); background: transparent; text-align: left; font: 600 1rem/1.4 var(--font-heading); cursor: pointer; }
.tour-tabs button + button { border-left: 1px solid var(--line); }
.tour-tabs button:hover { background: var(--tint); }
.tour-tabs button[aria-selected="true"] { background: var(--colour-amber-300); color: var(--colour-neutral-900); }
.tour-tabs button:focus-visible { outline-offset: -5px; }
.tour-panel { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); min-height: 460px; border: 1px solid var(--line); border-top: 0; }
.tour-panel + .tour-panel { border-top: 1px solid var(--line); }
.study-scene { --specimen-bg: var(--colour-neutral-50); --specimen-ink: var(--colour-neutral-900); --specimen-rule: var(--colour-neutral-300); margin: 24px; background: var(--specimen-bg); color: var(--specimen-ink); align-self: start; font: 1rem/1.5 var(--font-body); min-width: 0; }
.scene-bar { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 12px 18px; border-bottom: 1px solid var(--specimen-rule); font: 600 .875rem/1.4 var(--font-heading); }
.scene-bar > span:last-child { margin-left: auto; font-weight: 400; }
.scene-body { padding: 20px; }
#case-study .study-scene p { margin: 0; font-size: 1rem; }
.sample-prompt { padding-bottom: 20px; }
.sample-prompt > strong { display: block; margin-bottom: 6px; font-family: var(--font-heading); }
.sample-prototype { display: grid; grid-template-columns: 100px minmax(0, 1fr); border-top: 1px solid var(--specimen-rule); }
.prototype-sidebar { display: flex; flex-direction: column; gap: 16px; padding: 18px 12px 0 0; font-size: .875rem; border-right: 1px solid var(--specimen-rule); }
.prototype-mark { width: 24px; height: 24px; border: 2px solid var(--colour-teal-700); border-radius: 50%; margin-bottom: 4px; }
.prototype-sidebar .is-current { color: var(--colour-teal-700); font-weight: 700; }
.prototype-content { padding: 20px 0 0 20px; }
#case-study .study-scene h4 { font: 700 1.125rem/1.4 var(--font-heading); margin: 0 0 10px; }
#case-study .prototype-content > p { font-size: .9375rem; }
.sample-criteria { margin: 18px 0 0; }
.sample-criteria > div { display: flex; justify-content: space-between; gap: 16px; padding-block: 10px; border-top: 1px solid var(--specimen-rule); font-size: .9375rem; }
.sample-criteria dt { font-weight: 700; }
.sample-criteria dd { margin: 0; text-align: right; }
.sample-source { margin-top: 8px; border-block: 1px solid var(--specimen-rule); }
.sample-source summary { position: relative; padding: 12px 32px 12px 0; min-height: 48px; font: 600 .9375rem/1.5 var(--font-heading); color: var(--colour-teal-700); }
.cosmo-page .sample-source summary svg { top: 12px; }
#case-study .sample-source p { padding: 0 0 16px; font-size: .9375rem; }
.tour-explanation { align-self: center; padding: 32px 28px 32px 8px; }
#case-study .tour-explanation h4 { font: 700 1.5rem/1.3 var(--font-heading); text-wrap: balance; margin: 0 0 18px; }
#case-study .tour-explanation p { font-size: 1rem; }
.tour-explanation dl { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: .9375rem; }
.tour-explanation dt { color: var(--stage); font-family: var(--font-heading); font-weight: 700; margin-bottom: 8px; }
.tour-explanation dd { margin: 0; color: var(--soft-text); }
.sample-question + .sample-question { margin-top: 24px; }
.sample-answer { border: 1px solid var(--specimen-rule); padding: 12px 16px; background: var(--colour-neutral-0); }
.sample-rating { list-style: none; display: flex; gap: 10px; padding: 0; margin: 14px 0 6px; }
.sample-rating li { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--specimen-rule); font-weight: 700; font-variant-numeric: tabular-nums; }
.sample-rating .is-selected { color: var(--colour-neutral-0); background: var(--colour-teal-700); border-color: var(--colour-teal-700); }
.rating-labels { display: flex; justify-content: space-between; max-width: 260px; font-size: .8125rem; }
.sample-event { display: flex; gap: 14px; align-items: center; margin-top: 28px; padding: 18px 0 0; border-top: 1px solid var(--specimen-rule); }
.sample-event strong, .sample-event span { display: block; }
.sample-event strong { font: 700 .875rem/1.5 var(--font-heading); }
.session-package { text-align: center; }
.cosmo-page .session-package > svg { width: 52px; height: 52px; margin: 4px auto 12px; color: var(--colour-teal-700); }
.session-package ul { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 20px; padding: 0; font-size: .875rem; }
.sample-code { border-block: 1px solid var(--specimen-rule); padding: 16px 8px; }
.sample-code span, .sample-code code { display: block; }
.sample-code span { font: 600 .875rem/1.4 var(--font-heading); margin-bottom: 8px; }
.sample-code code { font-size: .875rem; overflow-wrap: anywhere; }
.handover-route { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 22px; font: 600 .9375rem/1.4 var(--font-heading); }
.handover-route span { flex: 1; }
#case-study .handover-note { margin-top: 20px; font-size: .875rem; }
.reader-header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 18px; }
#case-study .reader-header h4 { margin: 0; }
.reader-header > span { font-size: .8125rem; color: var(--colour-teal-700); }
.sample-reader { margin: 0; }
.sample-reader > div { display: grid; grid-template-columns: 1fr 1.25fr; gap: 18px; padding: 18px 0; border-top: 1px solid var(--specimen-rule); }
.sample-reader dt { font-weight: 700; font-size: .9375rem; }
.sample-reader dd { margin: 0; }
.reader-exports { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--specimen-rule); padding-top: 18px; font-size: .875rem; }
.tour-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; border: 1px solid var(--line); border-top: 0; }
#case-study .tour-footer p { font: 400 .9375rem/1.5 var(--font-body); margin: 0; }
.tour-footer > div { display: flex; gap: 12px; }
.tour-footer button { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; }
.tour-footer button:hover:enabled { background: var(--tint); border-color: var(--stage); }
.tour-footer button:disabled { opacity: .35; cursor: default; }
.tour-footer [data-tour-prev] svg { transform: rotate(180deg); }
@media (prefers-reduced-motion: no-preference) {
  .study-tour[data-tour-ready] .tour-panel:not([hidden]) .study-scene { animation: study-reveal 240ms cubic-bezier(.16, 1, .3, 1); }
  @keyframes study-reveal { from { clip-path: inset(0 5% 0 0); opacity: .75; } to { clip-path: inset(0); opacity: 1; } }
}
@media (max-width: 900px) {
  .tour-panel { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .study-scene { margin: 20px; }
  .tour-explanation { padding: 12px 24px 28px; }
  .tour-explanation dl { margin-top: 16px; padding-top: 16px; }
  .tour-tabs button { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; }
}
@media (max-width: 560px) {
  .study-tour { scroll-margin-top: 120px; }
  .study-tour-heading { flex-direction: column; gap: 0; }
  .tour-play { margin-bottom: 18px; }
  .tour-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tour-tabs button { flex-direction: row; align-items: center; min-height: 80px; padding: 12px; gap: 10px; }
  .tour-tabs button:nth-child(3) { border-left: 0; }
  .tour-tabs button:nth-child(n+3) { border-top: 1px solid var(--line); }
  .study-scene { margin: 14px; }
  .scene-body { padding: 16px; }
  .scene-bar { padding: 12px 14px; flex-wrap: wrap; gap: 6px 8px; }
  .scene-bar > span:last-child { margin-left: 32px; width: 100%; }
  .sample-prototype { grid-template-columns: minmax(0, 1fr); }
  .prototype-sidebar { display: none; }
  .prototype-content { padding: 16px 0 0; }
  .sample-criteria > div { flex-direction: column; gap: 4px; }
  .sample-criteria dd { text-align: left; }
  .sample-rating { gap: 6px; }
  .sample-rating li { width: 38px; height: 38px; }
  .rating-labels { max-width: 214px; }
  .handover-route { flex-direction: column; gap: 12px; text-align: center; }
  .handover-route svg { transform: rotate(90deg); }
  .sample-reader > div { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .tour-explanation { padding: 12px 20px 24px; }
  .tour-footer { padding: 12px; }
  .tour-footer > div { gap: 8px; }
}
@media print {
  .tour-tabs, .tour-play, .tour-footer { display: none !important; }
  .cosmo-page .tour-panel[hidden] { display: grid !important; }
  .study-scene { animation: none !important; }
}

.environment-chapter { margin-top: 12px; padding-top: 36px; }
#case-study .study-scope { max-width: none; padding: 18px 20px; background: var(--tint); font-size: .9375rem; line-height: 1.5; margin: 8px 0 28px; }
.study-scope strong { font-family: var(--font-heading); }
.next-enquiry { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--stage); }
#case-study .contribution-boundary { margin: 28px 0 0; }
#questions { scroll-margin-top: 168px; }
@media (max-width: 760px) {
  .reasoning-strip { gap: 20px; }
}
@media (max-width: 560px) {
  .reasoning-strip { grid-template-columns: minmax(0, 1fr); }
  .environment-chapter { margin-top: 8px; padding-top: 28px; }
  #questions { scroll-margin-top: 120px; }
}
/* Shared disclosure affordances remain visible after removing the old explorer. */
.cosmo-page summary { cursor: pointer; list-style: none; }
.cosmo-page summary::-webkit-details-marker { display: none; }
.cosmo-page summary svg { position: absolute; top: 22px; right: 0; }
.cosmo-page details[open] > summary svg { transform: rotate(45deg); }
.cosmo-page summary:hover { text-decoration: underline; text-underline-offset: .22em; }
.cosmo-page .sample-source summary svg { top: 12px; }
.cosmo-return { display: inline-flex; align-items: center; gap: 14px; min-height: 44px; font: 600 1rem/1.5 var(--font-heading); }
.cosmo-closing { --stage: var(--stage-outcome-ink); --tint: var(--stage-outcome-soft); }
