/* A shared reading directory; the game and the designer's writing stay central. */
.has-site-nav { --directory-space: 192px; padding-right: var(--directory-space); }
.has-site-nav > .page {
  width: min(1100px, calc(100% - 72px));
  container: portfolio / inline-size;
}
.site-directory {
  position: fixed; z-index: 20; top: 50%; right: 20px;
  width: 152px; transform: translateY(-50%);
}
.directory-nav {
  max-height: calc(100svh - 48px); overflow-y: auto;
  padding: 4px 0 4px 16px; border-left: 1px solid rgb(220 231 224 / 28%);
  scrollbar-width: thin; scrollbar-color: var(--gold) transparent;
}
.directory-nav ul { margin: 0; padding: 0; list-style: none; }
.directory-nav > ul > li + li { margin-top: 20px; }
.directory-nav .directory-children { padding-left: 12px; margin-top: 4px; }
.directory-link {
  display: flex; align-items: center; min-height: 36px; padding: 7px 2px;
  color: var(--soft-paper); font-size: 15px; font-weight: 500; line-height: 1.55;
  text-decoration: none; text-underline-offset: 6px; text-decoration-thickness: 1px;
}
.directory-children .directory-link {
  min-height: 34px; font-size: 13px; font-weight: 400;
  color: var(--muted, #c4d6cc);
}
.directory-link.is-current-page { color: var(--paper); font-weight: 600; }
.directory-link.is-current { color: var(--gold); text-decoration-line: underline; }
.directory-link:hover { color: var(--paper); text-decoration-line: underline; }
.directory-link:focus-visible, .directory-toggle:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 3px;
}
.directory-nav ::selection { color: var(--teal); background: var(--gold); }
.directory-toggle { display: none; }
.has-site-nav main [id] { scroll-margin-top: 24px; }
.has-site-nav .gameplay-page { padding-top: 32px; }
.has-site-nav .flow-intro { padding-top: 8px; }

@media (min-width: 768px) and (max-width: 1050px) {
  .has-site-nav { --directory-space: 176px; }
  .has-site-nav > .page { width: calc(100% - 48px); }
  .site-directory { width: 140px; right: 16px; }
  .directory-nav { padding-left: 12px; }
  .directory-link { font-size: 14px; }
}

/* Reflow against the space left for the article, not the full screen width. */
@container portfolio (max-width: 900px) {
  .case-body { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .case-copy { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
  .case-copy section + section { margin-top: 0; }
}
@container portfolio (max-width: 680px) {
  .home-page .masthead h1 { width: min(460px, 100%); }
  .home-page .game-copy h2 { margin-bottom: 16px; }
  .case-hero, .revision-layout { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .case-hero { padding: 28px 0 40px; }
  .case-intro h1 { font-size: 112px; }
  .case-film { margin: 0; }
  .auction-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .auction-flow li::after { display: none; }
  .rules-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .funds-rule { grid-column: auto; }
}
@container portfolio (max-width: 560px) {
  .home-page .game {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto;
    grid-template-areas: "cover" "copy" "progress"; gap: 28px; margin-top: 28px;
  }
}
@container portfolio (max-width: 620px) {
  .case-copy { display: block; }
  .case-copy section + section { margin-top: 24px; }
  .featured-case > summary { grid-template-columns: minmax(0, 1fr) 120px 18px; gap: 18px; }
  .case-teaser h3 { display: block; font-size: 23px; }
  .case-teaser h3 span { display: block; margin-top: 5px; font-size: 16px; }
  .daily-flow { gap: 18px; }
  .daily-flow strong { font-size: 14px; }
  .daily-flow li:not(:last-child)::after { right: -16px; font-size: 19px; }
}

@media (max-width: 767px) {
  .has-site-nav { padding-right: 0; }
  .has-site-nav > .page { width: calc(100% - 40px); }
  .site-directory { position: static; width: auto; margin: 20px; transform: none; }
  .directory-nav { max-height: none; }
  .nav-ready { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .nav-ready .site-directory {
    position: fixed; top: auto; right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom)); margin: 0; width: auto;
  }
  .nav-ready .directory-toggle {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    min-width: 92px; min-height: 48px; padding: 12px 16px;
    border: 1px solid rgb(220 231 224 / 60%); border-radius: 8px;
    background: #1b3c37; color: var(--paper); font: inherit; font-size: 14px;
    cursor: pointer;
  }
  .directory-toggle svg { width: 18px; height: 18px; flex: none; }
  .nav-ready .directory-nav {
    display: none; position: absolute; right: 0; bottom: 60px;
    width: min(244px, calc(100vw - 32px)); max-height: calc(100svh - 112px);
    padding: 16px 20px; border: 1px solid rgb(220 231 224 / 40%);
    border-radius: 12px; background: #1b3c37; overscroll-behavior: contain;
  }
  .nav-ready .site-directory.is-open .directory-nav { display: block; }
  .directory-nav > ul > li + li { margin-top: 12px; }
  .directory-link, .directory-children .directory-link { min-height: 44px; }
  .directory-link { font-size: 15px; }
  .directory-children .directory-link { font-size: 14px; }
}
@media (max-width: 430px) {
  .has-site-nav .featured-case > summary { grid-template-columns: minmax(0, 1fr) 92px 12px; gap: 12px; }
  .has-site-nav .case-teaser h3 { font-size: 21px; }
  .has-site-nav .daily-flow strong { font-size: 12px; }
}
@media (max-width: 340px) {
  .has-site-nav .featured-case > summary { grid-template-columns: minmax(0, 1fr) 72px 12px; gap: 10px; }
  .has-site-nav .case-teaser h3 { font-size: 19px; }
}
@media (prefers-reduced-motion: no-preference) {
  .directory-link { transition: color 120ms ease-out; }
}
@media print {
  .has-site-nav { padding: 0; }
  .site-directory { display: none; }
  .has-site-nav > .page { width: 100%; }
}
