/* MCY's wide architectural captures need more room than portrait recordings. */
.mcy-showcase .demo { max-width: 72rem; }
@media (min-width: 761px) {
  .mcy-showcase .storyboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Contribution summary (Brief): three labelled roles, then the MCY credit. */
.mcy-contrib { margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--edge-mid); max-width: 72rem; }
.mcy-contrib h3 { font-size: 1.05rem; color: var(--ink); margin-bottom: var(--s-4); }
.mcy-contrib dl { display: grid; gap: var(--s-4); margin: 0; }
@media (min-width: 900px) { .mcy-contrib dl { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); } }
.mcy-contrib dt, .mcy-annot dt { color: var(--flow); font: 400 .82rem/1.5 Mono, monospace; letter-spacing: .06em; text-transform: uppercase; }
.mcy-contrib dd { margin: var(--s-1) 0 0; color: var(--ink-2); font-size: 1rem; line-height: 1.55; }
.mcy-contrib .mcy-credit { margin-top: var(--s-4); color: var(--ink-2); font-size: 1rem; }

/* Demonstrations: a heading, the recording, then its written description. */
.mcy-demos { display: grid; gap: var(--s-7); margin-top: var(--s-6); }
.mcy-demos-intro { max-width: 46rem; color: var(--ink-2); font-size: 1rem; line-height: 1.55; }
.mcy-demo h3 { font-size: 1.15rem; color: var(--ink); margin-bottom: var(--s-3); }
.mcy-demo .demo { margin-top: 0; max-width: 56rem; }
/* Keep each recording, with its controls, inside a desktop viewport (aspect ratios 960:820 and 960:660). */
#interior-demo-title + .demo { max-width: 48rem; }
.mcy-demo figcaption p { max-width: 46rem; }
.mcy-steps { margin: var(--s-3) 0 0; padding-left: 1.4em; display: grid; gap: var(--s-1); max-width: 46rem; color: var(--ink-2); font-size: 1rem; line-height: 1.55; }

/* Annotated design decisions. */
.mcy-decision .mcy-decision-num { color: var(--flow); font: 400 .82rem/1.5 Mono, monospace; letter-spacing: .06em; text-transform: uppercase; margin-bottom: var(--s-1); }
.mcy-decision h3 { margin-bottom: var(--s-3); }
.mcy-annot { display: grid; gap: var(--s-3); margin: 0; }
.mcy-annot dd { margin: var(--s-1) 0 0; color: var(--ink-2); font-size: 1rem; line-height: 1.55; }
.mcy-annot div:last-child { padding-left: var(--s-3); border-left: 2px solid var(--flow); }

/* Section navigation. Desktop (> 900px) keeps the shared sticky header and strip: the wrapper is layout-neutral
   and the toggle never shows. Up to 900px without JavaScript, nothing here applies: the shared static header and
   static grid stay (every link visible). Up to 900px with the page script (body.mcy-nav-js, nav[data-enhanced]):
   the site header (wordmark + Menu) sticks at the top, and the compact "On this page" bar sticks directly
   beneath it once the case-study navigation reaches it. Both are position: sticky, so document flow is kept.
   The script measures both rows into --mcy-header-h / --mcy-bar-h; the fallbacks are the expected heights.
   No animation; ordinary section jumps scroll smoothly (instantly with reduced motion). */
.mcy-showcase .mcy-nav-links { display: contents; }
.mcy-showcase .mcy-nav-toggle { display: none; }
@media (max-width: 900px) {
  .mcy-showcase.mcy-nav-js .site-header {
    position: sticky; top: 0; z-index: 30;
    padding: var(--s-2) max(var(--gut), env(safe-area-inset-right)) var(--s-2) max(var(--gut), env(safe-area-inset-left));
  }
  /* the shared Menu panel scrolls within the space left below the header (short landscape, browser bars) */
  .mcy-showcase.mcy-nav-js .site-nav[data-open] {
    max-height: calc(100vh - var(--mcy-header-h, 61px) - 12px); max-height: calc(100dvh - var(--mcy-header-h, 61px) - 12px);
    overflow-y: auto; flex-wrap: nowrap; justify-content: flex-start;
    /* one scrolling column from the top: the shared flex-end alignment would push overflowing links above the
       panel, out of reach of scrolling, and wrapping would split them into columns */
  }
  .mcy-showcase .case-nav[data-enhanced] {
    position: sticky; top: var(--mcy-header-h, 61px); z-index: 25; display: block; overflow: visible;
    padding: 6px max(var(--gut), env(safe-area-inset-right)) 6px max(var(--gut), env(safe-area-inset-left));
  }
  .mcy-showcase .case-nav[data-enhanced] .mcy-nav-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
    width: 100%; min-height: 44px; padding: 0 var(--s-3);
    border: 1px solid var(--edge-mid); border-radius: var(--r-sm); background: var(--srf-solid);
    color: var(--ink); font: 400 .85rem/1.2 Mono, monospace; letter-spacing: .06em; cursor: pointer;
  }
  /* open/closed state shown by a chevron drawn with borders, as well as by aria-expanded */
  .mcy-showcase .case-nav[data-enhanced] .mcy-nav-toggle::after {
    content: ''; width: .5rem; height: .5rem; flex: none; margin-top: -.25rem;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
  }
  .mcy-showcase .case-nav[data-open] .mcy-nav-toggle { border-color: var(--flow); }
  .mcy-showcase .case-nav[data-open] .mcy-nav-toggle::after { margin-top: .25rem; transform: rotate(-135deg); }
  .mcy-showcase .case-nav[data-enhanced] .mcy-nav-links { display: none; }
  /* Expanded: the list scrolls inside the height left below both rows (short landscape, browser bars); the page
     itself still scrolls and Tab continues past the last link (nothing is trapped). The 6px padding keeps the
     2px + 3px-offset focus ring inside the scroll box, so it is never clipped. */
  .mcy-showcase .case-nav[data-open] .mcy-nav-links {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: var(--s-1);
    margin-top: 6px; padding: 6px; overflow-y: auto;
    max-height: calc(100vh - var(--mcy-header-h, 61px) - var(--mcy-bar-h, 58px) - 12px);
    max-height: calc(100dvh - var(--mcy-header-h, 61px) - var(--mcy-bar-h, 58px) - 12px);
  }
  /* Anything scrolled into view (section jumps, and keyboard focus moving into content) lands below both sticky
     rows: the page's scroll padding reserves their height (html.mcy-nav-root is set by the page script). */
  html.mcy-nav-root { scroll-padding-top: calc(var(--mcy-header-h, 61px) + var(--mcy-bar-h, 58px) + 12px); }
}
