/* Shell CSS — admitted Shell-family layout and chrome composition.
 *
 * This carrier owns L5 Shell rules only. Surface and artifact compositions
 * stay in compositions.css; primitive rules stay in primitives.css.
 */

.shell-skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 200;
  padding: 10px 16px;
  font-family: var(--lp-font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--lp-cta-fg);
  background: var(--lp-cta);
  border-radius: 8px;
  text-decoration: none;
  transition: top 140ms ease;
}
.shell-skip-link:focus,
.shell-skip-link:focus-visible {
  top: 16px;
  outline: 2px solid var(--lp-orange);
  outline-offset: 2px;
}

.shell-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  overflow-x: clip;
  background: var(--surface-workspace-bg);
  border-bottom: 1px solid var(--surface-workspace-rule);
}
body.surface-marketing .shell-topbar,
body[data-surface="marketing"] .shell-topbar {
  background: var(--lp-bg);
  border-bottom-color: var(--lp-rule);
}
.shell-topbar-inner {
  height: var(--shell-topbar-h);
  max-width: var(--shell-topbar-max-w);
  margin: 0 auto;
  padding: 0 var(--shell-topbar-pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}
body.surface-marketing .shell-topbar-inner,
body[data-surface="marketing"] .shell-topbar-inner {
  height: calc(var(--shell-topbar-h) + 12px);
  padding: 0 28px;
}

.shell-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--lp-text);
  font-weight: 500;
}
.shell-brand:hover { color: var(--lp-text); text-decoration: none; }
.shell-brand .lp-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}
body[data-surface="marketing"] .shell-brand .lp-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}
.shell-brand-wordmark {
  font-family: var(--lp-font-sans);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1;
  color: var(--lp-text);
}
body[data-surface="marketing"] .shell-brand-wordmark {
  font-family: var(--lp-font-serif);
  font-size: var(--identity-strip-wordmark-marketing);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.shell-topbar-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.shell-signin {
  font-family: var(--lp-font-sans);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--lp-text);
  text-decoration: none;
  padding: 4px 8px;
}
.shell-signin:hover { color: var(--lp-orange); text-decoration: none; }

.shell-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: var(--lp-font-sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: var(--lp-cta-fg);
  background: var(--lp-cta);
  border-radius: 6px;
  text-decoration: none;
  transition: background 140ms ease;
}
.shell-cta svg { transition: transform 140ms ease; }
.shell-cta:hover { background: #1A2842; color: var(--lp-cta-fg); text-decoration: none; }
.shell-cta:hover svg { transform: translateX(2px); }
.shell-cta:focus-visible {
  outline-offset: 4px;
  border-radius: 8px;
}

.shell-menu {
  position: relative;
}
.shell-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: var(--lp-text);
  color: var(--lp-cta-fg);
  font-family: var(--lp-font-sans);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 140ms ease, transform 140ms ease;
}
.shell-menu-toggle::-webkit-details-marker { display: none; }
.shell-menu-toggle:hover { background: #1A2842; transform: scale(1.04); }
.shell-menu-toggle:focus-visible {
  outline: 2px solid var(--lp-orange);
  outline-offset: 2px;
}
.shell-menu[open] .shell-menu-toggle { background: #1A2842; }

.shell-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: 6px;
  background: var(--color-surface);
  border: 1px solid var(--lp-rule);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(10, 31, 61, 0.14),
              0 2px 6px rgba(10, 31, 61, 0.06);
  z-index: 60;
}
.shell-menu-identity {
  padding: 8px 10px 6px;
  font-family: var(--lp-font-sans);
  font-size: 13px;
}
.shell-menu-identity-name {
  display: block;
  color: var(--lp-text);
  font-weight: 600;
}
.shell-menu-rule {
  height: 1px;
  background: var(--lp-rule);
  margin: 4px -6px;
}
.shell-menu-nav {
  display: flex;
  flex-direction: column;
}
.shell-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  padding: 7px 10px;
  font-family: var(--lp-font-sans);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--lp-text);
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}
.shell-menu-item:hover {
  background: var(--lp-bg-soft);
  text-decoration: none;
  color: var(--lp-text);
}
.shell-menu-item.is-active {
  background: var(--lp-bg-soft);
  font-weight: 600;
}
.shell-menu-item-button {
  width: 100%;
  color: var(--lp-text-mid);
  font-weight: 400;
}
.shell-menu-alert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10.5px;
  font-weight: 600;
  background: var(--lp-orange);
  color: var(--lp-cta-fg);
  border-radius: 999px;
}

@media (max-width: 720px) {
  .shell-topbar-inner { padding: 0 14px; }
  .shell-brand-wordmark { font-size: 14px; }
  .shell-topbar[data-surface="marketing"] .shell-topbar-inner {
    gap: 8px;
    padding: 0 10px;
  }
  .shell-topbar[data-surface="marketing"] .shell-topbar-left {
    flex: 0 0 auto;
    gap: 0;
    overflow: visible;
  }
  .shell-topbar[data-surface="marketing"] .shell-brand {
    gap: 0;
  }
  .shell-topbar[data-surface="marketing"] .shell-brand .lp-mark {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px;
  }
  .shell-topbar[data-surface="marketing"] .shell-brand-wordmark {
    display: none;
  }
  .shell-topbar[data-surface="marketing"] .shell-topbar-right {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
    gap: 4px;
  }
  .shell-topbar[data-surface="marketing"] .shell-action-strip {
    gap: 4px;
    min-width: 0;
  }
  .shell-topbar[data-surface="marketing"] .shell-action-strip [data-primitive="action_trigger"] {
    min-height: 32px;
    padding: 6px 7px;
    font-size: 10.5px;
    letter-spacing: 0.035em;
    white-space: nowrap;
  }
  .shell-menu-panel { right: -8px; min-width: 200px; }
  .shell-topbar[data-surface="workspace"] .shell-topbar-inner {
    gap: 8px;
    padding: 0 10px;
  }
  .shell-topbar[data-surface="workspace"] .shell-topbar-left {
    gap: 8px;
  }
  .shell-topbar[data-surface="workspace"] .shell-brand-wordmark {
    display: none;
  }
  .shell-topbar[data-surface="workspace"] .shell-topnav {
    margin-left: 6px;
    padding-left: 6px;
  }
  .shell-topbar[data-surface="workspace"] .shell-topnav-link {
    padding: 0 7px;
    font-size: 0;
  }
  .shell-topbar[data-surface="workspace"] .shell-topnav-link::after {
    content: attr(data-mobile-label);
    font-size: 12.5px;
    line-height: 1;
  }
}

.shell-main {
  min-height: 60vh;
}

.shell-footbar {
  border-top: 1px solid var(--surface-workspace-rule);
  background: var(--surface-workspace-bg);
  margin-top: 64px;
}
body.surface-marketing .shell-footbar,
body[data-surface="marketing"] .shell-footbar {
  border-top-color: var(--lp-rule);
  background: var(--lp-bg-soft);
}
.shell-footbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 40px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
}
.shell-footbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--lp-font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--lp-text);
}
.shell-footbar-wordmark { line-height: 1; }
.shell-footbar-discipline {
  font-family: var(--lp-font-sans);
  font-size: 13px;
  line-height: 1.55;
  color: var(--lp-text-soft);
  max-width: 720px;
}
.shell-footbar-nav {
  display: inline-flex;
  gap: 24px;
  flex-wrap: wrap;
}
.shell-footbar-nav a {
  font-family: var(--lp-font-sans);
  font-size: 13px;
  color: var(--lp-text-mid);
  text-decoration: none;
}
.shell-footbar-nav a:hover {
  color: var(--lp-orange);
  text-decoration: none;
}
@media (max-width: 820px) {
  .shell-footbar-inner {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 24px 18px;
  }
}

.shell-topbar-left {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.shell-location { display: none; }

.shell-side-rail { display: none; }
.shell-body-frame { display: block; }

.shell-topnav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid var(--color-rule);
  flex: 1 1 auto;
  max-width: 100%;
  min-width: 0;
  width: 100%;
  overflow-x: auto;
  contain: paint;
  scrollbar-width: none;
}
.shell-topnav::-webkit-scrollbar { display: none; }
.shell-topnav-link {
  display: inline-flex;
  align-items: center;
  height: calc(var(--shell-topbar-h) - 1px);
  padding: 0 12px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 120ms, border-color 120ms;
}
.shell-topnav-link:hover {
  color: var(--color-text);
  text-decoration: none;
}
.shell-topnav-link.is-active {
  color: var(--color-text);
  border-bottom-color: var(--color-action);
}
.shell-topnav-badge {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--color-danger);
  color: white;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
}

.shell-main--reader { width: 100%; max-width: none; }
.shell-main--presentation {
  width: 100vw;
  height: calc(100vh - var(--shell-topbar-h));
  padding: 0;
}

@media (max-width: 720px) {
  .shell-topnav {
    margin-left: 8px;
    padding-left: 8px;
  }
  .shell-topnav-link {
    padding: 0 10px;
    font-size: 13px;
  }
}

.shell-topbar--reader,
.shell-topbar--internal {
  /* inherits .shell-topbar */
}

.shell-brand-badge {
  margin-left: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 3px;
}

.shell-presentation-transport {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-rule);
  border-radius: 999px;
  box-shadow: var(--shadow-popover);
  z-index: 50;
}

.shell-action-strip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.shell-topbar--reader .shell-action-strip {
  gap: 10px;
}

@media (max-width: 720px) {
  .shell-topbar--reader {
    overflow-x: visible;
  }
  .shell-topbar--reader .shell-topbar-inner {
    height: auto;
    min-height: var(--shell-topbar-h);
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
  }
  .shell-topbar--reader .shell-topbar-left {
    width: 100%;
    flex: 0 1 auto;
    gap: 8px;
  }
  .shell-topbar--reader .shell-return-link {
    flex: 0 0 auto;
    padding: 3px 6px;
  }
  .shell-topbar--reader .shell-brand {
    min-width: 0;
  }
  .shell-topbar--reader .shell-brand-wordmark {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
  }
  .shell-topbar--reader .shell-topbar-right {
    width: 100%;
    flex: 0 0 auto;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .shell-topbar--reader .shell-topbar-right::-webkit-scrollbar {
    display: none;
  }
  .shell-topbar--reader .shell-action-strip {
    width: max-content;
    min-width: 100%;
    gap: 6px;
  }
  .shell-topbar--reader .shell-action-strip [data-primitive="action_trigger"] {
    min-height: 32px;
    padding: 6px 8px;
    font-size: 10.5px;
    letter-spacing: 0.035em;
    white-space: nowrap;
  }
}

.shell-return-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 120ms, color 120ms;
}
.shell-return-link:hover {
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.04);
  text-decoration: none;
}
.shell-return-link-arrow {
  font-size: 14px;
  line-height: 1;
}

/* Surface body and workspace primitive posture. */
body.surface-marketing, body.marketing {
  /* Frame applied to the canvas */
  background: var(--lp-bg);
  color: var(--lp-text);
  font-family: var(--lp-font-sans);
  font-size: 16px;
  line-height: var(--lp-body-line);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
}

/* Workspace body — the TOOL canvas. Calm near-white rather than the
   marketing cream so the surface reads as a working instrument, not
   a promotional landing. Marketing surfaces keep --lp-bg upstream. */
body.surface-workspace {
  background: var(--surface-workspace-bg);
  color: var(--lp-text);
  font-family: var(--lp-font-sans);
  font-size: 15px;
  line-height: var(--lp-body-line);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
}

/* ============================================================
 * Workspace-surface posture for admitted primitives.
 *
 * The primitive registry declares each primitive's CANONICAL look
 * (marketing posture — uppercase CTA, larger serif headline).
 * Workspace surfaces compose those same primitives in a quieter
 * tool-context posture: no uppercase, tighter tracking, a hair
 * smaller. Linear / Mercury / Bloomberg all share this: tools are
 * sentence-case, not brand-event uppercase.
 *
 * IMPORTANT: this is NOT a new namespace. The primitives still own
 * their selectors ([data-primitive="button"], …). These rules
 * only re-apply the admitted primitive at a different surface
 * scope — exactly what the design law admits as composition.
 * ============================================================ */

body.surface-workspace [data-primitive="button"],
body.surface-workspace [data-primitive="action_trigger"] {
  text-transform: none;
  font-size: 13.5px;
  letter-spacing: 0.005em;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 6px;
}
body.surface-workspace [data-primitive="button"][data-variant="primary"],
body.surface-workspace [data-primitive="action_trigger"][data-variant="primary"] {
  /* The workspace primary CTA is the calm dark navy of the brand,
     not the marketing-event orange. Orange remains the marketing
     primary; here it would shout against the off-white tool canvas. */
  background: var(--lp-cta);
  color: var(--lp-cta-fg);
  border-color: var(--lp-cta);
}
body.surface-workspace [data-primitive="button"][data-variant="primary"]:hover,
body.surface-workspace [data-primitive="action_trigger"][data-variant="primary"]:hover {
  background: #1A2842;  /* one tick lighter than --lp-cta on hover */
  color: #fff;
}

/* Workspace headline posture: page H1s stay serif (brand DNA stays)
 * but at a smaller size — a TOOL headline, not a marketing hero.
 * 22 px is the workspace canon. The marketing surfaces keep the
 * larger display-2 token so the landing keeps its hero scale. */

/* Workspace panels (cards) — calmer rule colour pairs with the
 * workspace canvas. The marketing-rule (-D9DCE1) is too heavy on
 * the off-white tool background and makes every card look stamped
 * onto the page. */

/* Surface focus-visible posture. */
/* Designed focus-visible on every interactive surface.  The
 * browser-default focus ring is invisible on dark CTAs and
 * inconsistent across browsers — we own this.  Orange matches
 * the brand accent so the keyboard path tracks the same color
 * as the highlight bind.  Applies to BOTH surfaces (canon). */
body.surface-marketing a:focus-visible,
body.surface-marketing button:focus-visible,
body.surface-marketing [tabindex]:focus-visible,
body.surface-workspace a:focus-visible,
body.surface-workspace button:focus-visible,
body.surface-workspace [tabindex]:focus-visible,
body.marketing a:focus-visible,
body.marketing button:focus-visible,
body.marketing [tabindex]:focus-visible {
  outline: 3px solid var(--lp-orange);
  outline-offset: 3px;
  border-radius: 4px;
}
/* Buttons that already have a border radius keep their shape. */
body.surface-marketing .lp-cta-primary:focus-visible,
body.surface-marketing .lp-cta-secondary:focus-visible,
body.marketing .lp-cta-primary:focus-visible,
body.marketing .lp-cta-secondary:focus-visible {
  outline-offset: 4px;
  border-radius: 8px;
}
