/* MiexD public foundations: one palette, readable copy and quiet controls. */
:root {
  color-scheme: dark;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --background: #08090b;
  --surface: #101216;
  --ink: #e6e8ec;
  --muted: #a4a8b0;
  --line: #292d34;
  --header-height: 88px;
  --market-bg: var(--background);
  --market-panel: var(--surface);
  --market-ink: var(--ink);
  --market-muted: var(--muted);
  --market-line: var(--line);
  --market-silver: var(--ink);
  font-family: var(--font);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 24px); }
body { margin: 0; color: var(--ink); background: var(--background); font-family: var(--font); font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-underline-offset: 4px; }
img, svg { display: block; max-width: 100%; }
button svg, a svg { flex: 0 0 auto; }
h1, h2, h3, p { margin-top: 0; }
::selection { background: var(--ink); color: var(--background); }
[hidden] { display: none !important; }
:is(a, button, input, summary):focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; }
.shell, .market-shell { width: min(1160px, calc(100% - 96px)); margin-inline: auto; }
.section, .market-section { padding-block: 80px; }
.visually-hidden, .market-visually-hidden, .lesson-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link, .market-skip, .lesson-skip { position: fixed; top: 12px; left: 20px; z-index: 100; padding: 12px 18px; border-radius: 2px; background: var(--ink); color: var(--background); transform: translateY(-160%); }
.skip-link:focus, .market-skip:focus, .lesson-skip:focus { transform: none; }
.eyebrow, .market-eyebrow, .lesson-eyebrow { margin-bottom: 20px; font-size: 12px; font-weight: 550; line-height: 1.6; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.eyebrow { display: block; }
.wordmark, .footer-wordmark, .market-brand { display: inline-flex; align-items: center; min-height: 44px; flex: none; text-decoration: none; }
.wordmark img, .footer-wordmark img, .market-brand img { width: 140px; height: auto; }

/* All public headers share the same menu and account entry points. */
.site-header, .market-header { position: sticky; top: 0; z-index: 30; background: var(--background); border-bottom: 1px solid var(--line); }
.header-inner, .market-header-inner { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 88px; gap: 28px; padding-block: 12px; }
#main-nav, .market-nav { display: flex; align-items: center; gap: 28px; margin-left: auto; }
#main-nav a, .market-nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 400; color: var(--muted); text-decoration: none; }
.market-nav a[aria-current="page"], #main-nav a:hover, .market-nav a:hover { color: var(--ink); }
.nav-toggle { display: none; min-width: 44px; min-height: 44px; padding-inline: 12px; border: 1px solid var(--line); border-radius: 2px; background: transparent; color: var(--ink); align-items: center; justify-content: center; gap: 10px; font-size: 14px; }
.header-account { display: flex; align-items: center; gap: 20px; flex: none; }
.header-login, .header-start { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.header-login { color: var(--muted); }
.header-login:hover { color: var(--ink); }
.header-start { padding: 11px 18px; border: 1px solid var(--ink); border-radius: 2px; color: var(--background); background: var(--ink); line-height: 1.4; }
.header-start:hover { background: #fff; border-color: #fff; }
.button, .secondary-button, .market-button { display: inline-flex; justify-content: center; align-items: center; gap: 20px; min-height: 48px; padding: 14px 20px; border: 1px solid #525862; border-radius: 2px; color: var(--ink); background: transparent; font: inherit; font-size: 15px; font-weight: 500; line-height: 1.4; text-decoration: none; cursor: pointer; }
.button:hover, .secondary-button:hover { background: var(--surface); border-color: var(--muted); }
.button-dark, .market-button { background: var(--ink); color: var(--background); border-color: var(--ink); }
.button-dark:hover, .market-button:hover { background: #fff; color: var(--background); border-color: #fff; }
.text-link, .market-text-link { display: inline-flex; align-items: center; min-height: 44px; gap: 18px; padding: 0 0 4px; border: 0; border-bottom: 1px solid #626974; color: var(--ink); background: transparent; font-size: 15px; font-weight: 500; line-height: 1.6; text-decoration: none; }
.text-link:hover, .market-text-link:hover { color: #fff; border-bottom-color: var(--ink); }
.text-link svg { width: 14px; height: 14px; }
.quiet-expand { border-top: 1px solid var(--line); }
.quiet-expand:last-child { border-bottom: 1px solid var(--line); }
.quiet-expand > summary { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px 0; min-height: 64px; list-style: none; cursor: pointer; font-size: 18px; font-weight: 400; color: var(--ink); }
.quiet-expand > summary::-webkit-details-marker { display: none; }
.quiet-expand > summary::after { content: '+'; font-size: 22px; color: var(--muted); font-weight: 300; }
.quiet-expand[open] > summary::after { content: '−'; }
.quiet-expand > summary > [aria-hidden="true"] { display: none; }
.quiet-expand-body { padding: 4px 0 30px; color: var(--muted); font-size: 16px; line-height: 1.8; }
.quiet-expand-body > p { max-width: 740px; }
.quiet-expand-body h3 { font-size: 20px; font-weight: 400; color: var(--ink); }
.error-page { min-height: 100svh; display: grid; place-items: center; }
.error-content { max-width: 760px; padding-block: 72px; }
.error-content .wordmark { margin-bottom: 56px; }
.error-content h1 { margin-bottom: 24px; font-size: clamp(38px, 7vw, 64px); line-height: 1.1; font-weight: 400; letter-spacing: -.045em; }
.error-content > p { max-width: 520px; color: var(--muted); }
.error-code { font-size: 14px; letter-spacing: .1em; }
.error-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; margin-top: 30px; }
.error-info { display: inline-flex; align-items: center; min-height: 44px; margin-top: 30px; color: var(--muted); font-size: 15px; }
@media (max-width: 980px) {
  .header-inner, .market-header-inner { gap: 20px; }
  #main-nav, .market-nav { gap: 20px; }
  .header-account { gap: 16px; }
}
@media (max-width: 850px) {
  .shell, .market-shell { width: calc(100% - 48px); }
}
@media (max-width: 760px) {
  :root { --header-height: 124px; }
  .header-inner, .market-header-inner { flex-wrap: wrap; min-height: 80px; gap: 10px 16px; padding-block: 12px; }
  .wordmark img, .market-brand img { width: 128px; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  #main-nav, .market-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; margin: 0; padding: 12px 20px; flex-direction: column; align-items: stretch; gap: 0; background: var(--surface); border: 1px solid var(--line); }
  #main-nav.open, .market-nav.open { display: flex; }
  #main-nav a, .market-nav a { padding: 10px 0; }
  .header-account { width: 100%; justify-content: flex-end; gap: 18px; }
  html:not(.js) .nav-toggle { display: none; }
  html:not(.js) #main-nav, html:not(.js) .market-nav { display: flex; position: static; width: 100%; order: 3; flex-direction: row; flex-wrap: wrap; gap: 8px 22px; padding: 0; border: 0; background: transparent; }
  html:not(.js) #main-nav a, html:not(.js) .market-nav a { padding: 0; }
}
@media (max-width: 600px) {
  .shell, .market-shell { width: calc(100% - 40px); }
  .section, .market-section { padding-block: 56px; }
  .quiet-expand > summary { font-size: 17px; padding-block: 22px; }
  .button, .secondary-button, .market-button { padding-inline: 16px; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
