/* Ember Lounge — page layout
   Same information architecture as the reference shell, rebuilt with a warm,
   soft-edged material language: rounded panes, lantern glow, paper grain. */

/* ============================== top bar ============================== */

/*
 * The bar scrolls with the page. Keeping it in normal flow means no page needs
 * a top padding offset, and the hero can be sized against the full viewport
 * height without subtracting a fixed header.
 */
.em-bar {
  position: relative;
  z-index: 50;
  background: rgba(23, 16, 13, 0.72);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--em-line);
}

.em-bar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px var(--em-pad);
  min-height: 50px;
}

.em-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--em-ink);
  font-family: var(--em-font-display);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
  min-width: 0;
}

.em-logo__mark {
  width: 30px;
  height: 30px;
  border-radius: var(--em-r-sm);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--em-on-ember);
  background: radial-gradient(circle at 32% 28%, var(--em-gold), var(--em-ember) 62%, var(--em-ember-deep));
  box-shadow: var(--em-glow-soft);
}

.em-logo__word {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.em-bar__tools {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.em-round {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--em-r-pill);
  background: transparent;
  color: var(--em-ink-dim);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, transform 0.15s;
}
.em-round:hover {
  color: var(--em-gold);
  background: rgba(255, 145, 66, 0.1);
}
.em-round:active { transform: scale(0.94); }
.em-round.is-on { color: var(--em-ember); }

/* ============================== home ============================== */

.em-home {
  position: relative;
  isolation: isolate;
  padding-bottom: var(--em-space-md);
  display: flex;
  flex-direction: column;
}

/*
 * First screen height.
 *
 * The hero and intro together fill `--em-fold-share` of the viewport minus the
 * bar. Setting an explicit height (not max-height) makes the measurement
 * deterministic: the first ad slot always starts at that offset, so its top
 * edge sits in the 40–45% band at any viewport size.
 */
/*
 * First screen — the hero alone owns the fold budget.
 *
 * DOM order is: hero → ad slot 0 → intro → shelves. So the first ad slot's top
 * edge equals (head-macro strip + bar + hero + gap). Pinning the hero's height
 * to `42vh - 90px` lands that edge at 42% of the viewport on every screen.
 */
.em-home > .em-showcase {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.em-home > .em-showcase > .em-showcase__stage {
  /* Full column width; the artwork is cropped (never stretched) to fit. */
  width: 100%;
  aspect-ratio: auto;
  height: calc(44.5vh - 108px);
  max-height: none;
}

.em-home > .em-showcase > .em-showcase__pips {
  margin-top: 8px;
}

/* The first ad slot sits directly under the hero, at the fold line. */
.em-home > .em-ad:first-of-type {
  flex-shrink: 0;
  margin-top: var(--em-space-md);
}

/* Ambient hearth backdrop: fixed, never part of the flow. */
.em-hearth {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.em-hearth img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.2;
  filter: saturate(1.15) sepia(0.25);
}

.em-hearth::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(23, 16, 13, 0.35) 0%, var(--em-bg) 72%);
}

.em-home > :not(.em-hearth) {
  position: relative;
  z-index: 1;
}

/* ============================== content blocks ============================== */

.em-block {
  margin-bottom: var(--em-space-lg);
  padding-inline: var(--em-pad);
}

.em-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--em-space-sm);
  margin-bottom: var(--em-space-md);
}

.em-block__title {
  margin: 0;
  font-family: var(--em-font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--em-ink);
  letter-spacing: 0.01em;
}

.em-block__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--em-font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--em-ember);
}

/* ============================== template code strips ============================== */

/*
 * Head macros ship as plain text in <head> with no styling of their own — they
 * are template code for the deploy renderer, not UI.
 *
 * This strip is only for the body-level `$...OtherAdContent` loop, which sits
 * between page sections and stays readable as a quiet code block.
 */
.em-tpl-code {
  display: block;
  margin: 0 auto var(--em-space-md);
  padding: 8px 12px;
  width: min(100% - 32px, 480px);
  max-width: 100%;
  overflow-x: auto;
  border: 1px dashed var(--em-line-strong);
  border-radius: var(--em-r-sm);
  background: rgba(13, 8, 7, 0.45);
  font-family: ui-monospace, SFMono-Regular, 'Cascadia Mono', Consolas, monospace;
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--em-ember-soft);
  white-space: pre;
  tab-size: 2;
}

/* ============================== ad slots ============================== */

.em-ad {
  margin-block: var(--em-space-md);
}

/* A visible label keeps an unreserved slot readable in preview while the
   deploy renderer is what actually fills it. */
.em-ad__label {
  margin: 0 0 6px;
  font-family: var(--em-font-display);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  color: var(--em-ink-faint);
  opacity: 0.75;
}

.em-ad__unit {
  width: 100%;
  min-height: 0;
}

/*
 * Template code is shown, not executed. The ad directives sit in the markup as
 * plain text so the deploy step can be inspected and replaced verbatim; this
 * block renders them as a readable code strip instead of letting them collapse
 * into one wrapped line.
 */
.em-ad__unit--flow {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  overflow-x: auto;
  padding: 10px 12px;
  border: 1px dashed var(--em-line-strong);
  border-radius: var(--em-r-sm);
  background: rgba(13, 8, 7, 0.5);
}

.em-ad__unit--flow,
.em-ad__unit--flow * {
  font-family: ui-monospace, SFMono-Regular, 'Cascadia Mono', Consolas, monospace;
  font-size: 11px;
  line-height: 1.6;
  color: var(--em-ember-soft);
  white-space: pre;
  tab-size: 2;
  margin: 0;
}

.em-ad--inline {
  margin-block: var(--em-space-sm);
}

/* ============================== home intro ============================== */

.em-intro {
  margin-bottom: var(--em-space-lg);
  padding-inline: var(--em-pad);
}

.em-intro__art {
  position: relative;
  border-radius: var(--em-r-lg);
  overflow: hidden;
  border: 1px solid var(--em-line-strong);
  box-shadow: var(--em-glow);
  background: var(--em-surface-low);
}

.em-intro__art img {
  width: 100%;
  height: auto;
  display: block;
}

.em-intro__text {
  padding: var(--em-space-md) 2px 0;
}

.em-intro__title {
  margin: 0 0 6px;
  font-family: var(--em-font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--em-ink);
}

.em-intro__sub {
  margin: 0 0 var(--em-space-md);
  font-size: 13px;
  line-height: 1.6;
  color: var(--em-ink-dim);
}

/* ============================== hero carousel ============================== */

.em-showcase {
  position: relative;
  margin-bottom: var(--em-space-lg);
  padding-inline: var(--em-pad);
}

.em-showcase__stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--em-r-lg);
  overflow: hidden;
  border: 1px solid var(--em-line-strong);
  box-shadow: var(--em-glow);
  background: var(--em-surface-low);
}

.em-showcase__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.55s ease;
  pointer-events: none;
}
.em-showcase__slide.is-live {
  opacity: 1;
  pointer-events: auto;
}

.em-showcase__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.em-showcase__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--em-bg) 2%, rgba(23, 16, 13, 0.15) 58%, transparent 100%);
  pointer-events: none;
}

.em-showcase__warm {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(80% 60% at 80% 100%, rgba(255, 145, 66, 0.22), transparent 65%);
}

.em-showcase__dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: var(--em-pad);
  z-index: 2;
}

.em-showcase__card {
  background: rgba(36, 26, 21, 0.66);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--em-line-strong);
  border-radius: var(--em-r-md);
  padding: var(--em-space-md);
}

.em-showcase__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--em-space-md);
}

.em-showcase__tag {
  display: inline-block;
  padding: 3px 9px;
  margin-bottom: 7px;
  background: var(--em-ember);
  color: var(--em-on-ember);
  font-family: var(--em-font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  border-radius: var(--em-r-pill);
}

.em-showcase__name {
  margin: 0 0 4px;
  font-family: var(--em-font-display);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.12;
  color: var(--em-ink);
}

.em-showcase__blurb {
  margin: 0;
  font-size: 12.5px;
  color: var(--em-ink-dim);
}

.em-showcase__pips {
  display: flex;
  justify-content: center;
  gap: var(--em-space-xs);
  margin-top: var(--em-space-md);
}

.em-showcase__pip {
  height: 5px;
  width: 5px;
  padding: 0;
  border: none;
  border-radius: var(--em-r-pill);
  background: var(--em-surface-top);
  cursor: pointer;
  transition: width 0.22s, background 0.22s;
}
.em-showcase__pip.is-live {
  width: 26px;
  background: var(--em-ember);
}

/* ============================== wings hub (categories) ============================== */

.em-wings {
  padding-bottom: var(--em-space-lg);
}

.em-wings__intro {
  padding: 0 var(--em-pad) var(--em-space-lg);
}

.em-wings__title {
  margin: 0 0 var(--em-space-sm);
  font-family: var(--em-font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--em-ink);
}

.em-wings__sub {
  margin: 0;
  color: var(--em-ink-dim);
  font-size: 13.5px;
  max-width: 300px;
}

.em-sortrow {
  display: flex;
  gap: var(--em-space-sm);
  padding: 0 var(--em-pad) var(--em-space-lg);
  overflow-x: auto;
  scrollbar-width: none;
}
.em-sortrow::-webkit-scrollbar { display: none; }

.em-mosaic {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--em-gap);
  padding: 0 var(--em-pad);
}

.em-pulse {
  padding: var(--em-space-lg) var(--em-pad) 0;
}

.em-pulse__head {
  display: flex;
  align-items: center;
  gap: var(--em-space-md);
  margin-bottom: var(--em-space-md);
}

.em-pulse__rule {
  flex: 1;
  height: 1px;
  background: var(--em-line);
}

/* ============================== detail ============================== */

.em-detail-hero {
  position: relative;
  min-height: 430px;
  display: flex;
  align-items: flex-end;
  padding-bottom: var(--em-space-lg);
  overflow: hidden;
}

.em-detail-hero__art {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.em-detail-hero__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
}

.em-detail-hero__wash {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, var(--em-bg) 0%, rgba(23, 16, 13, 0.38) 52%, transparent 100%);
}

.em-detail-hero__grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.4;
  background-image: radial-gradient(rgba(255, 233, 214, 0.14) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
}

.em-detail-hero__body {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: var(--em-space-md) var(--em-pad) 0;
}

.em-detail {
  padding: 0 var(--em-pad) var(--em-space-lg);
  margin-top: calc(-1 * var(--em-space-lg));
  position: relative;
  z-index: 4;
}

.em-frames {
  display: flex;
  gap: var(--em-space-md);
  overflow-x: auto;
  padding-bottom: 8px;
  margin: 0 calc(-1 * var(--em-pad));
  padding-inline: var(--em-pad);
  scrollbar-width: none;
}
.em-frames::-webkit-scrollbar { display: none; }

.em-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--em-space-md);
}

/* ============================== play surface ============================== */

body[data-page="play"] {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.em-play {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--em-bg-deep);
  padding-top: 50px;
}

.em-play__bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--em-space-md);
  padding: 8px var(--em-pad);
  background: rgba(13, 8, 7, 0.96);
  border-bottom: 1px solid var(--em-line);
}

.em-play__title {
  font-family: var(--em-font-display);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.em-play__stage { flex: 1; min-height: 0; }

.em-play__frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ============================== footer ============================== */

.em-foot {
  /* The home page paints a fixed ambient layer at z-index 0, which sits above
     any static sibling. Lift the footer into the same stacking level as the
     page content so it is never painted underneath the backdrop. */
  position: relative;
  z-index: 1;
  margin-top: var(--em-space-lg);
  padding: var(--em-space-lg) var(--em-pad) var(--em-space-md);
  border-top: 1px solid var(--em-line);
  background: linear-gradient(to bottom, transparent, rgba(13, 8, 7, 0.55));
  text-align: center;
}

.em-foot__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-bottom: 10px;
}

.em-foot__mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: var(--em-r-sm);
  display: grid;
  place-items: center;
  font-family: var(--em-font-display);
  font-size: 12px;
  font-weight: 800;
  color: var(--em-on-ember);
  background: radial-gradient(circle at 32% 28%, var(--em-gold), var(--em-ember) 62%, var(--em-ember-deep));
}

.em-foot__name {
  font-family: var(--em-font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--em-ink);
  letter-spacing: -0.01em;
}

.em-foot__blurb {
  margin: 0 auto var(--em-space-md);
  max-width: 34ch;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--em-ink-dim);
}

.em-foot__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  margin-bottom: var(--em-space-md);
  padding-bottom: var(--em-space-md);
  border-bottom: 1px solid var(--em-line);
}
.em-foot__nav a {
  color: var(--em-ink-dim);
  font-size: 13px;
}
.em-foot__nav a:hover { color: var(--em-gold); }

.em-foot__mail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--em-space-sm);
  font-family: var(--em-font-display);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--em-ember-soft);
  overflow-wrap: anywhere;
}
.em-foot__mail:hover { color: var(--em-gold); }
.em-foot__mail svg { flex-shrink: 0; }

.em-foot__fine {
  font-size: 11.5px;
  color: var(--em-ink-faint);
  margin: 0;
  line-height: 1.6;
}

/* ============================== prose pages ============================== */

.em-prose {
  padding: var(--em-space-lg) var(--em-pad) var(--em-space-lg);
  max-width: var(--em-shell);
  margin-inline: auto;
}
.em-prose h1 {
  font-family: var(--em-font-display);
  font-size: 1.7rem;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  color: var(--em-ink);
}
.em-prose h2 {
  font-family: var(--em-font-display);
  font-size: 1.06rem;
  margin: 26px 0 8px;
  color: var(--em-gold);
}
.em-prose p, .em-prose li {
  color: var(--em-ink-dim);
  overflow-wrap: anywhere;
}
.em-prose strong { color: var(--em-ink); }

/* ============================== overlays ============================== */

.em-finder {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--em-bg);
  padding: var(--em-pad);
  padding-top: 62px;
  overflow-y: auto;
}

.em-finder__row {
  display: flex;
  gap: 10px;
  margin-bottom: var(--em-space-md);
}

.em-finder__row input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--em-outline);
  border-radius: var(--em-r-md);
  background: var(--em-surface);
  color: var(--em-ink);
}

.em-finder__hint {
  text-align: center;
  color: var(--em-ink-faint);
  padding: 32px;
}

.em-sheet-scrim {
  position: fixed;
  inset: 0;
  background: rgba(8, 4, 3, 0.68);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.em-sheet-scrim.is-shown {
  opacity: 1;
  pointer-events: auto;
}

.em-shelf {
  position: fixed;
  top: 0;
  right: 0;
  width: min(100%, 366px);
  height: 100%;
  background: var(--em-surface);
  z-index: 160;
  transform: translateX(100%);
  transition: transform 0.26s ease;
  overflow-y: auto;
  padding: 20px;
  border-left: 1px solid var(--em-line);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
}
.em-shelf.is-open { transform: translateX(0); }

.em-shelf__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.em-shelf__top h2 {
  margin: 0;
  font-family: var(--em-font-display);
  font-size: 1.15rem;
}

.em-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(322px, 88vw);
  background: var(--em-surface);
  z-index: 160;
  transform: translateX(100%);
  transition: transform 0.26s ease;
  overflow-y: auto;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  border-left: 1px solid var(--em-line);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
}
.em-menu.is-open { transform: translateX(0); }

.em-menu__brand {
  font-family: var(--em-font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--em-line);
  color: var(--em-gold);
}

.em-menu__label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--em-ink-faint);
  margin: 0 0 8px;
}

.em-menu__group { margin-bottom: 22px; }

.em-menu__item {
  display: block;
  width: 100%;
  padding: 12px 0;
  border: none;
  background: none;
  text-align: left;
  font: inherit;
  color: var(--em-ink);
  cursor: pointer;
  border-bottom: 1px solid var(--em-line);
}
.em-menu__item.is-here {
  color: var(--em-ember);
  font-weight: 700;
}

/* ============================== grids ============================== */

.em-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--em-gap);
}

.em-crumbs {
  font-size: 12.5px;
  color: var(--em-ink-faint);
  margin-bottom: 12px;
}
.em-crumbs a { color: var(--em-ember); }

.em-winghead { margin-bottom: 16px; }
.em-winghead h1 {
  margin: 0 0 4px;
  font-family: var(--em-font-display);
  font-size: 1.45rem;
  letter-spacing: -0.01em;
}
.em-winghead__count {
  margin: 0;
  color: var(--em-ink-dim);
  font-size: 13px;
}

.em-wingview {
  padding: var(--em-space-lg) var(--em-pad) var(--em-space-lg);
}

.em-more-sentinel {
  text-align: center;
  padding: 16px;
  color: var(--em-ink-faint);
  font-size: 12.5px;
}

/* ==========================================================================
   Desktop adaptation
   --------------------------------------------------------------------------
   Mobile-first: everything above is the single-column phone layout. These
   breakpoints widen the shell, reflow the grids and give the ad slots a
   desktop-proportioned banner. Nothing here changes the DOM — only how the
   existing blocks are arranged.
   ========================================================================== */

/* — tablet — */
@media (min-width: 768px) {
  :root {
    --em-shell: min(100% - 48px, 720px);
    --em-pad: 24px;
    --em-gap: 16px;
    --em-space-lg: 40px;
  }

  /* Top bar */
  .em-bar__row { min-height: 60px; padding-block: 10px; }
  .em-logo { font-size: 1rem; gap: 10px; }
  .em-logo__mark { width: 34px; height: 34px; font-size: 13px; }
  .em-round { width: 44px; height: 44px; }

  /* Home */
  .em-home > .em-showcase > .em-showcase__stage {
    height: calc(44.5vh - 124px);
  }
  .em-showcase { padding-inline: 0; }
  .em-intro { padding-inline: 0; }
  .em-block { padding-inline: 0; margin-bottom: 48px; }
  .em-block__title { font-size: 1.15rem; }

  /* Rail: wider cards, still a horizontal strip (grid rules in components.css) */
  .em-rail > .em-tile { flex-basis: 168px; }

  /* Wings hub: centre the column at --em-shell */
  .em-wings {
    width: var(--em-shell);
    max-width: 100%;
    margin-inline: auto;
  }
  .em-wings__intro { padding-inline: 0; }
  .em-wings__title { font-size: 1.9rem; }
  .em-wings__sub { font-size: 14px; max-width: 46ch; }
  .em-sortrow { padding-inline: 0; }
  .em-mosaic { padding-inline: 0; }
  .em-wingtile--big { grid-column: span 2; grid-row: span 2; }
  .em-wingtile--band { grid-column: span 3; }
  .em-pulse { padding-inline: 0; }

  /* Wing view: centred column (grid rules in components.css) */
  .em-wingview {
    width: var(--em-shell);
    max-width: 100%;
    margin-inline: auto;
    padding: var(--em-space-lg) 0;
  }

  /* Detail */
  .em-detail-hero { min-height: 480px; }
  /* Detail: centre the hero copy and the article column */
  .em-detail-hero__body {
    width: var(--em-shell);
    max-width: 100%;
    margin-inline: auto;
    padding: var(--em-space-md) 0 0;
  }
  .em-detail__name { font-size: 2.1rem; }
  .em-detail {
    width: var(--em-shell);
    max-width: 100%;
    margin-inline: auto;
    margin-top: -40px;
    padding: 0 0 var(--em-space-lg);
  }
  .em-stats { grid-template-columns: repeat(4, 1fr); }

  /* Prose */
  .em-prose { padding-inline: var(--em-pad); }
  .em-prose h1 { font-size: 2rem; }

  /* Footer */
  .em-foot { padding-top: 48px; }

  /* Ad slots: a desktop banner is wider than the phone column */
  .em-ad__unit--flow { padding: 14px 18px; }
  .em-ad__unit--flow,
  .em-ad__unit--flow * { font-size: 12px; }
}

/* — desktop — */
@media (min-width: 1024px) {
  :root {
    --em-shell: min(100% - 64px, 1120px);
    --em-pad: 32px;
    --em-gap: 20px;
  }

  .em-bar__row { min-height: 68px; }

  /*
   * Home column is centred. The hero keeps the fold budget: the ad slot right
   * beneath it starts at ~42% of the viewport, and the intro becomes a
   * full-width band below that.
   */
  .em-home {
    width: var(--em-shell);
    max-width: 100%;
    margin-inline: auto;
    display: block;
  }

  .em-home > .em-showcase,
  .em-home > .em-intro,
  .em-home > .em-block,
  .em-home > .em-ad {
    width: 100%;
  }

  .em-home > .em-showcase { margin-bottom: 0; }

  .em-home > .em-showcase > .em-showcase__stage {
    width: 100%;
    aspect-ratio: auto;
    height: calc(44.5vh - 155px);
    max-height: none;
  }

  /* The intro's illustration returns on desktop, beside its copy. */
  .em-home > .em-intro {
    margin-block: var(--em-space-md);
  }
  .em-home > .em-intro > .em-intro__art { display: block; }

  .em-showcase { margin-bottom: 0; }
  .em-intro__title { font-size: 1.6rem; }
  .em-intro__sub { font-size: 14px; max-width: 60ch; }

  /* Ad slots get desktop breathing room. */
  .em-ad { margin-block: 32px; }

  /* Prose: comfortable measure, centred inside the shell */
  .em-prose {
    width: min(100% - 64px, 760px);
    max-width: 760px;
    margin-inline: auto;
    padding-inline: 0;
  }

  /* Ad slots: a desktop banner gets more breathing room */
  .em-ad { margin-block: 32px; }
  .em-ad__unit--flow { padding: 16px 22px; }
}

/* — wide desktop — */
@media (min-width: 1440px) {
  :root { --em-shell: min(100% - 96px, 1320px); }
}
