/* Common stage and navigation. The landing page never receives the shell marker. */

html[data-pi-shell] {
  --pi-shell-width: 76rem;
  --pi-shell-gutter: clamp(1rem, 5.8vw, 6rem);
  --pi-shell-lamp-offset: clamp(.6rem, 2.8dvh, 1.85rem);
  --pi-shell-ink: #f5ebdf;
  --pi-shell-copper: #edbd91;
  --pi-shell-border: #6b5140;
  --pi-shell-panel: linear-gradient(142deg, #2d241cd9, #171310ed 78%);
  overflow: hidden;
}

html[data-pi-shell] .workspace[data-pi-shell] {
  position: fixed !important;
  inset: var(--pi-app-top, 0px) 0 var(--pi-app-bottom, 0px);
  z-index: 1;
  display: block !important;
  overflow: clip;
  isolation: isolate;
}

html[data-pi-shell] .workspace[data-pi-shell]::before {
  content: "";
  position: absolute;
  inset: 0 !important;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, #100b08e8, #b9875440 2.8%, #20170d32 5.5%, transparent 13% 87%, #20170d32 94.5%, #b9875440 97.2%, #100b08e8),
    radial-gradient(ellipse at 50% -15%, #b17d475e, transparent 55%),
    linear-gradient(180deg, #2b20169c, #1b130cb0 72%, #2e1b1182),
    url("./assets/work-scenes/stage.png") center bottom / 100% 100% no-repeat;
  background-color: #1c1713;
  background-blend-mode: normal;
}

html[data-pi-shell] .workspace[data-pi-shell]::after {
  content: "";
  position: absolute;
  inset: var(--pi-shell-lamp-offset) var(--pi-shell-gutter) auto;
  inline-size: min(calc(100% - 2 * var(--pi-shell-gutter)), var(--pi-shell-width));
  block-size: 2px;
  margin-inline: auto;
  border-radius: 999px;
  background: #fff0da;
  box-shadow: 0 0 5px 1px #f8b588, 0 3px 16px 4px #e6955b7a, 0 4px 32px 7px #dc8c465c;
  pointer-events: none;
}

html[data-pi-shell] body .workspace[data-pi-shell] > .pi-app-layout {
  display: grid !important;
  grid-template: auto minmax(0, 1fr) / minmax(0, 1fr);
  min-block-size: 0;
  block-size: 100%;
  margin: 0;
  padding: 0;
}

html[data-pi-shell] .pi-shell-controls {
  grid-area: 1 / 1;
  inline-size: min(calc(100% - 2 * var(--pi-shell-gutter)), var(--pi-shell-width));
  margin: calc(var(--pi-shell-lamp-offset) + .75rem) auto 0;
  min-height: 44px;
  padding-inline: .125rem;
  background: transparent;
  border: 0;
  font: 600 .95rem/1.25 PI Work, Manrope, system-ui, sans-serif;
}
html[data-pi-shell] .pi-shell-controls :is(a,button) { color: var(--pi-shell-copper); }
html[data-pi-shell] .pi-shell-controls [hidden] { display: none; }
html[data-pi-shell] .pi-shell-section {
  grid-column: 2;
  grid-row: 1;
  color: #e7d4c4;
  text-align: center;
}
html[data-pi-shell] body .workspace[data-pi-shell] .pi-app-layout > #main {
  grid-area: 2 / 1;
  width: 100%;
  max-width: none !important;
  min-width: 0;
  max-height: 100%;
  height: 100%;
  margin: 0;
  padding: .45rem max(var(--pi-shell-gutter), calc((100% - var(--pi-shell-width)) / 2)) 1.75rem !important;

  box-sizing: border-box;
}
html[data-pi-shell] #main > .fc-routebar { display: none !important; }
html[data-pi-shell] #main #app {
  min-height: 0;
  max-width: 100%;
  background-color: transparent;
}
html[data-pi-shell] #main #app > .ic-entry:has(.ic-breadcrumbs) { min-width: 0; }

html[data-pi-shell] #app[data-pi-scene="start"] > .section-studio {
  padding: 0;
}
html[data-pi-shell] #app[data-pi-scene="start"] .pi-start-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 1.125rem;
}
html[data-pi-shell] #app .pi-start-grid > :is(header, .ss-next) {
  border: 1px solid var(--pi-shell-border);
  border-radius: .72rem;
  padding: clamp(1.35rem, 3.55vw, 3.65rem);
  margin: 0;
  background: var(--pi-shell-panel);
  box-shadow: 0 10px 36px #0002, inset 0 1px #e1aa7111;
}
html[data-pi-shell] #app .pi-start-grid h1 {
  font-size: clamp(2.45rem, 4.6vw, 4.4rem);
  max-width: 11ch;
  color: var(--pi-shell-ink);
}
html[data-pi-shell] #app .pi-start-grid .ss-next h2 {
  font-size: clamp(1.85rem, 3vw, 2.85rem);
  line-height: 1.06;
  color: var(--pi-shell-ink);
}
html[data-pi-shell] #app .pi-start-grid :where(.ss-lead, .ss-next p) {
  color: #dbc6b4;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
}
html[data-pi-shell] #app .pi-start-grid .ss-choice {
  border-radius: .42rem;
  border-color: #604736;
  background: #18130fcc;
}
html[data-pi-shell] #app .pi-start-grid .ss-choice[aria-pressed="true"] {
  border-color: #825b3d;
  background: linear-gradient(105deg,#543a27,#34261b);
}
html[data-pi-shell] #main #app .pi-start-grid .ss-primary {
  color: #23150d;
  background: #e9b285;
  border-color: #efbd96;
  border-radius: .42rem;
}
html[data-pi-shell] #app .pi-start-grid .ss-tabs {
  border: 0;
  padding-inline: .25rem;
  margin: 0;
}

html[data-pi-shell] #gr-site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 500;
  background: #110e0b;
}
html[data-pi-shell] #gr-site-header.tma-header .gr-header-inner {
  max-width: 94rem;
}
/* The direct-access rail remains visible on every interior screen. */
html[data-pi-shell] body #gr-site-header.tma-header .gr-main-nav {
  display: flex !important;
  flex-flow: row nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  touch-action: pan-x pinch-zoom;
  scrollbar-width: thin;
  scrollbar-color: #87684c transparent;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
}
html[data-pi-shell] body #gr-site-header.tma-header .tma-link {
  flex: 1 0 max-content;
  min-width: 76px;
  width: auto;
  padding-inline: 7px;
  touch-action: pan-x pinch-zoom;
}
html[data-pi-shell] #gr-site-header.tma-header .tma-link[aria-current]::after {
  block-size: 2px;
  inline-size: min(80%, 3.75rem);
  inset-inline-start: 50%;
  translate: -50% 0;
  background: #e5b68e;
}
html[data-pi-shell] #gr-site-header.tma-header .tma-scroll-hint { right: var(--pi-shell-gutter); }
html[data-pi-shell] #mas-bottom-navigation { display: none !important; }
html[data-pi-shell] body .workspace[data-pi-shell] > .pi-app-layout {
  grid-template-rows: auto minmax(0,1fr) auto;
}
html[data-pi-shell] body .workspace[data-pi-shell] .pi-app-layout > #main {
  overflow: clip !important;
  overflow-clip-margin: 0;
  scrollbar-gutter: auto;
  padding-block: .25rem 0 !important;
}
html[data-pi-shell] #main #app, html[data-pi-shell] #pi-dialog-pages > #sheet-content {
  position: relative;
  inset-block-start: var(--pi-page-offset, 0px);
}
html[data-pi-shell] #main :is(.cg-list-scroll,.sw-stage-lessons) {
  max-height: none !important;
  height: auto;
  overflow: visible !important;
}
html[data-pi-shell] .pi-shell-controls {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) var(--pi-hero-size);
  align-items: center;
  gap: .65rem;
  --pi-hero-size: 3.375rem;
}
html[data-pi-shell] .pi-shell-controls > [data-pi-app-back] { justify-self: start; white-space: nowrap; }
html[data-pi-shell] .pi-shell-controls > .pi-shell-home { grid-area: 1 / 3; justify-self: end; white-space: nowrap; }
html[data-pi-shell] #pi-shell-hero-slot {
  grid-area: 1 / 4;
  inline-size: var(--pi-hero-size);
  block-size: var(--pi-hero-size);
  display: grid;
  place-items: center;
  box-sizing: border-box;
  border: 1px solid #9a7052;
  border-radius: .45rem;
  background: radial-gradient(ellipse at top,#4b3324,#1c140f 80%);
  color: #f0bf93;
  font: 600 1.125rem/1 Georgia, serif;
  letter-spacing: .07em;
  box-shadow: inset 0 1px #e9ad732b;
  overflow: clip;
}
html[data-pi-shell] .pi-page-controls {
  display: grid;
  grid-template-columns: minmax(0,1fr) max-content minmax(0,1fr);
  align-items: center;
  gap: .5rem;
  inline-size: min(calc(100% - 2 * var(--pi-shell-gutter)),var(--pi-shell-width));
  margin: 0 auto;
  padding: .2rem 0 max(.35rem,env(safe-area-inset-bottom,0px));
  box-sizing: border-box;
  border-top: 1px solid #76583f;
  color: #dfc7b2;
  background: #201711;
  font: 600 .82rem/1.2 PI Work,Manrope,system-ui,sans-serif;
}
html[data-pi-shell] .pi-page-controls[hidden] { display: none; }
html[data-pi-shell] .pi-page-controls > button {
  min-block-size: 44px;
  padding: .2rem .5rem;
  border: 1px solid #77573c;
  border-radius: .35rem;
  background: #322318;
  color: #f5c79d;
  font: inherit;
  cursor: pointer;
}
html[data-pi-shell] .pi-page-controls > button[aria-disabled="true"] { color: #b09b89; background: #231a14; cursor: default; }
html[data-pi-shell] .pi-page-controls > :first-child { justify-self: start; }
html[data-pi-shell] .pi-page-controls > :last-child { justify-self: end; }
html[data-pi-shell] .pi-page-controls > span { font-variant-numeric: tabular-nums; }
html[data-pi-shell] .pi-page-controls > button:focus-visible { outline: 2px solid #ffc68d; outline-offset: 1px; }

html[data-pi-shell] #sheet[open]:has(#pi-dialog-pages) {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: calc(var(--pi-app-top, 0px) + 4.4rem) 0 calc(var(--pi-app-bottom, 0px) + .65rem);
  max-height: calc(100dvh - var(--pi-app-top, 0px) - var(--pi-app-bottom, 0px) - 5.05rem);
  z-index: 460;
  box-sizing: border-box;
  overflow: clip;
}
html[data-pi-shell] #pi-dialog-pages { min-block-size: 0; overflow: clip; }
html[data-pi-shell] body:has(#sheet[open]:has(#pi-dialog-pages)) #main { visibility: hidden; }
html[data-pi-shell] body:has(#sheet[open]:has(#pi-dialog-pages)) .pi-app-layout > .pi-page-controls { visibility: hidden; }
html[data-pi-shell] #sheet > .pi-page-controls { inline-size: 100%; flex: none; padding-bottom: .25rem; }

@media (max-width: 760px), (max-width: 1050px) and (max-height: 520px) {
  html[data-pi-shell] { --pi-shell-gutter: clamp(.7rem, 3.5vw, 1.5rem); --pi-shell-lamp-offset: .45rem; }
  html[data-pi-shell] body #gr-site-header.tma-header .gr-header-inner,
  html[data-pi-shell] body.mas-mobile #gr-site-header.tma-header .gr-header-inner {
    grid-template: auto / auto minmax(0,1fr);
    gap: .55rem;
    min-height: 0;
    padding-inline: max(.55rem,env(safe-area-inset-left)) max(.55rem,env(safe-area-inset-right));
  }
  html[data-pi-shell] body #gr-site-header.tma-header .gr-brand {
    grid-area: 1 / 1;
    padding-inline: .18rem .45rem;
    border-right: 1px solid #654832;
  }
  html[data-pi-shell] body #gr-site-header.tma-header .gr-brand > span { display: none; }
  html[data-pi-shell] body #gr-site-header.tma-header .gr-main-nav {
    grid-area: 1 / 2;
    width: 100%;
    height: 64px;
    padding-block: 2px 4px;
  }
  html[data-pi-shell] body #gr-site-header.tma-header .tma-link { min-height: 55px; gap: 2px; }
  html[data-pi-shell] body #gr-site-header.tma-header .tma-link .om-picture { width: 36px; height: 36px; }
  html[data-pi-shell] .pi-shell-controls {
    --pi-hero-size: 2.4rem;
    margin-top: .75rem;
    grid-template-columns: minmax(0,1fr) auto var(--pi-hero-size);
    gap: .45rem;
    font-size: .84rem;
  }
  html[data-pi-shell] .pi-shell-controls > .pi-shell-section { position: absolute; clip-path: inset(50%); }
  html[data-pi-shell] .pi-shell-controls > .pi-shell-home { grid-column: 2; }
  html[data-pi-shell] #pi-shell-hero-slot { grid-column: 3; font-size: .95rem; }
}
@media (max-width: 700px) {
  html[data-pi-shell] #app[data-pi-scene="start"] .pi-start-grid { grid-template-columns: minmax(0,1fr); gap: .75rem; }
}
@media (max-height: 520px) {
  html[data-pi-shell] #app .pi-start-grid > :is(header,.ss-next) { padding: .85rem 1rem; }
}
@media (forced-colors: active) {
  html[data-pi-shell] .workspace[data-pi-shell]::after { background: CanvasText; box-shadow: none; }
}
.om-picture:has(> [data-pi-menu-icon]) > :not([data-pi-menu-icon]) { display: none !important; }
.om-picture > [data-pi-menu-icon] { visibility: visible !important; object-fit: contain; }
html[data-pi-shell] body.pk-app.gr-unified .workspace[data-pi-shell] {
  width: auto !important;
  max-width: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}
html[data-pi-shell] body.pk-app.gr-unified .workspace[data-pi-shell] > .pi-app-layout {
  width: 100% !important;
  max-width: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}
html[data-pi-shell] body.pk-app.gr-unified .workspace[data-pi-shell] #main,
html[data-pi-shell] body.pk-app.gr-unified .workspace[data-pi-shell] #main > #app {
  background: transparent !important;
}
