/* ==========================================================================
   LG Studio · Shared shell chrome
   Canonical header (.nav), mobile drawer, site footer (.foot).
   Visual north star: studio/index.html homepage treatment.
   Page CSS styles page content — not this chrome.
   ========================================================================== */

:root {
  --lg-studio-nav-h: 62px;
  --lg-studio-chapter-h: 40px;
  --lg-studio-shell-ink: var(--ink, #0F1111);
  --lg-studio-shell-ivory: var(--ivory, #F7F2E9);
  --lg-studio-shell-muted: var(--text-on-ink-muted, rgba(247, 242, 233, 0.62));
  --lg-studio-shell-rule: var(--rule-on-ink, rgba(247, 242, 233, 0.12));
  --lg-studio-shell-terracotta: var(--terracotta, #C96E53);
  --lg-studio-shell-body: var(--font-body, "Inter", system-ui, sans-serif);
  --lg-studio-shell-structural: var(--font-structural, "Big Shoulders Display", sans-serif);
  --lg-studio-shell-system: var(--font-system, "JetBrains Mono", ui-monospace, monospace);
  --lg-studio-shell-editorial: var(--font-editorial, "Fraunces", Georgia, serif);
  --lg-studio-shell-ease: var(--dur-hover, 160ms);
  --lg-studio-chapter-top: calc(var(--lg-eco-strip-offset, 30px) + var(--lg-studio-nav-h, 62px));
}

/* Host offset: strip only — nav + chapter bar stay in document flow (sticky).
   Must beat body.studio-lovable.has-ecosystem-nav padding from editorial CSS. */
body.studio-shell.has-ecosystem-nav,
body.studio-shell.studio-lovable.has-ecosystem-nav,
body.studio-shell.studio-lovable.has-ecosystem-nav[data-eco-context="studio"] {
  padding-top: var(--lg-eco-strip-offset, 30px) !important;
}

body.studio-shell.has-studio-chapters {
  --lg-studio-chrome-top: var(--lg-eco-strip-offset, 30px);
  --lg-studio-chapter-top: calc(var(--lg-eco-strip-offset, 30px) + var(--lg-studio-nav-h, 62px));
}

/* Legacy .ed-nav markup (if any remains) must not compete with shell .nav */
body.studio-shell .ed-nav {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Header — compact monogram + LG Studio wordmark
   -------------------------------------------------------------------------- */

body.studio-shell .nav {
  position: sticky;
  top: var(--lg-eco-strip-offset, 30px);
  z-index: 150;
  background: var(--lg-studio-shell-ink);
  border-bottom: 1px solid var(--lg-studio-shell-rule);
  color-scheme: dark;
}

body.studio-shell .nav-in {
  max-width: 1320px;
  margin: 0 auto;
  padding: 15px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 32px;
  min-width: 0;
  box-sizing: border-box;
  min-height: var(--lg-studio-nav-h, 62px);
}

body.studio-shell .nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  flex-shrink: 0;
  justify-self: start;
  color: inherit;
  transform: translateY(-3px);
}

body.studio-shell .nav-brand img {
  height: 32px;
  width: auto;
  filter: invert(1) brightness(1.6);
  display: block;
}

body.studio-shell .nav-name {
  font-family: var(--lg-studio-shell-structural);
  font-weight: 600;
  font-size: 1.1875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lg-studio-shell-ivory);
  line-height: 1;
}

body.studio-shell .nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  justify-self: center;
  flex-shrink: 0;
}

body.studio-shell .nav-links a {
  font-family: var(--lg-studio-shell-body);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lg-studio-shell-muted);
  text-decoration: none;
  padding: 0.15rem 0;
  transition: color var(--lg-studio-shell-ease);
  white-space: nowrap;
}

body.studio-shell .nav-links a:hover,
body.studio-shell .nav-links a:focus-visible {
  color: var(--lg-studio-shell-terracotta);
}

body.studio-shell .nav-links a[aria-current="page"] {
  color: var(--lg-studio-shell-ivory);
}

body.studio-shell .nav-links a:focus-visible {
  outline: 2px solid var(--lg-studio-shell-terracotta);
  outline-offset: 4px;
}

body.studio-shell .nav-sep {
  display: none;
}

body.studio-shell .nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  justify-self: end;
}

/* Practice resource — quieter than primary Practice / Work links */
body.studio-shell .nav-resource {
  font-family: var(--lg-studio-shell-body);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lg-studio-shell-muted);
  text-decoration: none;
  padding: 0.15rem 0;
  white-space: nowrap;
  opacity: 0.72;
  transition: color var(--lg-studio-shell-ease), opacity var(--lg-studio-shell-ease);
}

body.studio-shell .nav-resource:hover,
body.studio-shell .nav-resource:focus-visible {
  color: var(--lg-studio-shell-terracotta);
  opacity: 1;
}

body.studio-shell .nav-resource[aria-current="page"] {
  color: var(--lg-studio-shell-ivory);
  opacity: 1;
}

body.studio-shell .nav-resource:focus-visible {
  outline: 2px solid var(--lg-studio-shell-terracotta);
  outline-offset: 4px;
}

body.studio-shell .nav .ed-nav-lang-toggle-header {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(247, 242, 233, 0.28);
  border-radius: 999px;
  padding: 2px;
}

body.studio-shell .nav .ed-nav-lang-toggle-header button {
  font-family: var(--lg-studio-shell-system);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  background: transparent;
  color: var(--lg-studio-shell-muted);
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
}

body.studio-shell .nav .ed-nav-lang-toggle-header button:hover {
  color: var(--lg-studio-shell-ivory);
}

body.studio-shell .nav .ed-nav-lang-toggle-header button.is-active {
  color: var(--lg-studio-shell-terracotta);
  background: rgba(201, 110, 83, 0.14);
}

body.studio-shell .nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 34px;
  padding: 0 18px;
  font-family: var(--lg-studio-shell-body);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid rgba(201, 110, 83, 0.55);
  border-radius: 12px;
  background: transparent;
  color: var(--lg-studio-shell-ivory);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  transition: background var(--lg-studio-shell-ease), color var(--lg-studio-shell-ease), border-color var(--lg-studio-shell-ease);
}

body.studio-shell .nav-cta:hover,
body.studio-shell .nav-cta:focus-visible {
  background: rgba(201, 110, 83, 0.18);
  border-color: var(--lg-studio-shell-terracotta);
  color: var(--lg-studio-shell-ivory);
}

body.studio-shell .nav-cta:focus-visible {
  outline: 2px solid var(--lg-studio-shell-terracotta);
  outline-offset: 3px;
}

body.studio-shell .nav .ed-nav-mobile {
  display: none;
  align-items: center;
  gap: 0.75rem;
}

body.studio-shell .nav .ed-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.15rem;
  border: none;
  background: transparent;
  color: var(--lg-studio-shell-ivory);
  cursor: pointer;
  font-family: var(--lg-studio-shell-system);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

body.studio-shell .nav .ed-menu-toggle:hover {
  color: var(--lg-studio-shell-terracotta);
}

body.studio-shell .nav .ed-menu-toggle-icon {
  display: inline-flex;
  line-height: 0;
}

body.studio-shell .nav .ed-menu-toggle:focus-visible {
  outline: 2px solid var(--lg-studio-shell-terracotta);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Mobile drawer
   -------------------------------------------------------------------------- */

body.studio-shell {
  --ed-ink: #0E0C0A;
  --ed-cream: #FAF6EF;
  --ed-coral: #C96E53;
  --ed-coral-dark: #B55F46;
  --ed-font-serif: var(--lg-studio-shell-editorial);
  --ed-font-mono: var(--lg-studio-shell-system);
  --ed-font-cond: var(--lg-studio-shell-structural);
  --ed-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ed-dur: 220ms;
}

body.studio-shell .ed-nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 10050;
  pointer-events: none;
}

body.studio-shell .ed-nav-drawer.is-open {
  pointer-events: auto;
}

body.studio-shell .ed-nav-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 12, 10, 0.42);
  opacity: 0;
  transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

body.studio-shell .ed-nav-drawer.is-open .ed-nav-drawer-backdrop {
  opacity: 1;
}

body.studio-shell .ed-nav-drawer-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 5vw, 40px);
  background: #FAF6EF;
  color: #0E0C0A;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

body.studio-shell .ed-nav-drawer.is-open .ed-nav-drawer-panel {
  opacity: 1;
  transform: translateY(0);
}

body.studio-shell .ed-nav-drawer-close {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  margin: 0 0 clamp(28px, 5vw, 48px);
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(14, 12, 10, 0.18);
  border-radius: 999px;
  background: #FAF6EF;
  cursor: pointer;
  font-family: var(--ed-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #0E0C0A;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

body.studio-shell .ed-nav-drawer-close::before {
  content: "×";
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0;
  transform: translateY(-1px);
}

body.studio-shell .ed-nav-drawer-close:hover {
  color: #F96F6E;
  border-color: rgba(249, 111, 110, 0.55);
  background: #fff;
}

body.studio-shell .ed-nav-drawer-close:focus-visible {
  outline: 2px solid #F96F6E;
  outline-offset: 3px;
}

body.studio-shell .ed-nav-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 4vw, 32px);
  flex: 1;
}

body.studio-shell .ed-nav-drawer-link {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  text-decoration: none;
  color: #0E0C0A;
  transition: color 160ms ease;
}

body.studio-shell .ed-nav-drawer-link:hover,
body.studio-shell .ed-nav-drawer-link:focus-visible {
  color: #F96F6E;
}

body.studio-shell .ed-nav-drawer-link:focus-visible {
  outline: 2px solid #F96F6E;
  outline-offset: 4px;
}

body.studio-shell .ed-nav-drawer-num {
  font-family: var(--ed-font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: rgba(14, 12, 10, 0.45);
  min-width: 1.25rem;
}

body.studio-shell .ed-nav-drawer-sep {
  font-family: var(--ed-font-mono);
  font-size: 0.75rem;
  color: rgba(14, 12, 10, 0.28);
}

body.studio-shell .ed-nav-drawer-label {
  font-family: var(--ed-font-serif);
  font-weight: 300;
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

body.studio-shell .ed-nav-drawer-resources {
  margin-top: 1.35rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(14, 12, 10, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

body.studio-shell .ed-nav-drawer-resources-label {
  margin: 0 0 0.35rem;
  font-family: var(--ed-font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(14, 12, 10, 0.42);
}

/* Quiet resource entry — not display-scale like 01–04 primary */
body.studio-shell .ed-nav-drawer-resource-link {
  display: block;
  padding: 0.25rem 0;
  font-family: var(--lg-studio-shell-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(14, 12, 10, 0.72);
  text-decoration: none;
  transition: color var(--ed-dur) var(--ed-ease);
}

body.studio-shell .ed-nav-drawer-resource-link:hover,
body.studio-shell .ed-nav-drawer-resource-link:focus-visible {
  color: var(--ed-coral);
}

body.studio-shell .ed-nav-drawer-resource-link[aria-current="page"] {
  color: var(--ed-ink);
}

body.studio-shell .ed-nav-drawer-resource-link:focus-visible {
  outline: 2px solid var(--ed-coral);
  outline-offset: 3px;
}

body.studio-shell .ed-nav-drawer-sublink {
  display: block;
  padding: 0.2rem 0;
  font-family: var(--lg-studio-shell-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(14, 12, 10, 0.5);
  text-decoration: none;
  transition: color var(--ed-dur) var(--ed-ease);
}

body.studio-shell .ed-nav-drawer-sublink:hover,
body.studio-shell .ed-nav-drawer-sublink:focus-visible {
  color: var(--ed-coral);
}

body.studio-shell .ed-nav-drawer-sublink:focus-visible {
  outline: 2px solid var(--ed-coral);
  outline-offset: 3px;
}

body.studio-shell .ed-nav-drawer-ecosystem {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin-top: clamp(28px, 5vw, 40px);
  padding-top: 1rem;
  border-top: 1px solid rgba(14, 12, 10, 0.1);
  font-family: var(--ed-font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body.studio-shell .ed-nav-drawer-ecosystem a {
  color: rgba(14, 12, 10, 0.55);
  text-decoration: none;
}

body.studio-shell .ed-nav-drawer-ecosystem a:hover,
body.studio-shell .ed-nav-drawer-ecosystem a:focus-visible {
  color: #0E0C0A;
}

body.studio-shell .ed-nav-drawer-ecosystem a[aria-current="page"] {
  color: #0E0C0A;
}

body.studio-shell .ed-nav-drawer-ecosystem__sep {
  color: rgba(14, 12, 10, 0.28);
  user-select: none;
}

body.studio-shell .ed-nav-drawer-foot {
  margin-top: clamp(28px, 5vw, 48px);
  padding-top: clamp(24px, 4vw, 40px);
  border-top: 1px solid rgba(14, 12, 10, 0.1);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

body.studio-shell .ed-nav-lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(14, 12, 10, 0.14);
  border-radius: 999px;
  padding: 2px;
}

body.studio-shell .ed-nav-lang-toggle button {
  font-family: var(--ed-font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: none;
  background: transparent;
  color: rgba(14, 12, 10, 0.55);
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

body.studio-shell .ed-nav-lang-toggle button:hover {
  color: #0E0C0A;
}

body.studio-shell .ed-nav-lang-toggle button.is-active {
  color: var(--lg-studio-shell-terracotta, #C96E53);
  background: rgba(201, 110, 83, 0.14);
}

body.studio-shell .ed-nav-lang-toggle button:focus-visible {
  outline: 2px solid var(--lg-studio-shell-terracotta, #C96E53);
  outline-offset: 2px;
}

body.studio-shell .ed-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 12px;
  font-family: var(--ed-font-cond);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: background var(--ed-dur) var(--ed-ease), border-color var(--ed-dur) var(--ed-ease), color var(--ed-dur) var(--ed-ease);
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

body.studio-shell .ed-btn-primary {
  background: var(--ed-coral);
  color: var(--ed-cream);
  border-color: var(--ed-coral);
}

body.studio-shell .ed-btn-primary:hover {
  background: var(--ed-coral-dark);
  border-color: var(--ed-coral-dark);
}

body.studio-shell .ed-nav-drawer-book {
  width: 100%;
  max-width: 320px;
  justify-content: center;
}

body.ed-nav-drawer-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  body.studio-shell .ed-nav-drawer-backdrop,
  body.studio-shell .ed-nav-drawer-panel {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Site footer
   -------------------------------------------------------------------------- */

body.studio-shell .foot {
  padding: clamp(3rem, 6vw, 4.5rem) 0 clamp(1.5rem, 3vw, 2rem);
  background: var(--lg-studio-shell-ink);
  color: var(--lg-studio-shell-ivory);
  color-scheme: dark;
}

body.studio-shell .foot .shell,
body.studio-shell .foot-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 40px;
  box-sizing: border-box;
}

body.studio-shell .foot-in {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

body.studio-shell .foot img {
  height: 54px;
  width: auto;
  filter: invert(1) brightness(1.6);
  margin-bottom: 20px;
  display: block;
}

body.studio-shell .foot h5 {
  font-family: var(--lg-studio-shell-body);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lg-studio-shell-muted);
  margin: 0 0 18px;
}

body.studio-shell .foot ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

body.studio-shell .foot li {
  margin-bottom: 11px;
}

body.studio-shell .foot a {
  font-size: 0.8125rem;
  color: var(--lg-studio-shell-muted);
  text-decoration: none;
  transition: color var(--lg-studio-shell-ease);
}

body.studio-shell .foot a:hover {
  color: var(--lg-studio-shell-ivory);
}

body.studio-shell .foot .body-s {
  font-size: 0.9375rem;
  line-height: 1.55;
  margin: 0;
}

body.studio-shell .foot-base {
  border-top: 1px solid var(--lg-studio-shell-rule);
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: #6F6A63;
}

body.studio-shell .foot-base a {
  color: inherit;
  text-decoration: none;
}

body.studio-shell .foot-base a:hover {
  color: var(--lg-studio-shell-ivory);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  body.studio-shell .nav-in {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px 20px;
  }

  body.studio-shell .nav-links {
    display: none;
  }

  body.studio-shell .nav-resource {
    display: none;
  }

  body.studio-shell .nav .ed-nav-mobile {
    display: flex;
  }

  body.studio-shell .foot .shell,
  body.studio-shell .foot-shell {
    padding: 0 20px;
  }

  body.studio-shell .foot-in {
    grid-template-columns: 1fr 1fr 1fr;
  }

  body.has-ecosystem-nav.studio-shell .mobile-menu-btn {
    display: none !important;
  }
}

@media (max-width: 820px) {
  body.studio-shell .foot-in {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  body.studio-shell .nav-in {
    padding: 12px 20px;
    column-gap: 12px;
  }

  body.studio-shell .nav-cta {
    height: 32px;
    padding: 0 14px;
    font-size: 10px;
    letter-spacing: 0.08em;
    border-radius: 11px;
  }

  body.studio-shell .nav .ed-nav-lang-toggle-header {
    display: none;
  }

  body.studio-shell .nav-name {
    font-size: 1.0625rem;
    letter-spacing: 0.12em;
  }

  body.studio-shell .nav-brand img {
    height: 28px;
  }

  body.studio-shell .nav-right {
    gap: 10px;
  }
}

@media (max-width: 359px) {
  body.studio-shell .nav-cta {
    display: none;
  }

  body.studio-shell .nav-name {
    display: none;
  }

  body.studio-shell .foot-in {
    grid-template-columns: 1fr;
  }
}
