/* Shared chrome: one header, one footer, one skip link, one primary and one secondary button.
   Loaded last on every page (see lib/site-chrome.cjs). Dark pages use the default colours;
   paper pages (home, tool and guide pages, anything with body.paper) use the light set. */

:root {
  --sc-ink: #efece4;
  --sc-muted: #b4b5bc;
  --sc-line: rgba(239, 236, 228, 0.16);
  --sc-link: #d9ac55;
  --sc-focus: #d9ac55;
  --sc-panel: #1c1d22;
  --sc-gold: #b8862e;
  --sc-gold-hi: #c99a44;
  --sc-pill-ink: #16130b;
  --sc-serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --sc-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
body.home,
body.tools-page,
body.paper {
  --sc-ink: #17140e;
  --sc-muted: #5f584a;
  --sc-line: rgba(23, 20, 14, 0.14);
  --sc-link: #684814;
  --sc-focus: #8a6423;
  --sc-panel: #fdfbf4;
}

/* Links never fall back to the browser blue. Zero specificity: any page rule wins. */
:where(a:link, a:visited) { color: var(--sc-link); }
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--sc-focus);
  outline-offset: 3px;
}

/* ---------- skip link ---------- */
html body .sc-skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--sc-gold);
  color: var(--sc-pill-ink);
  font: 600 16px/1.2 var(--sc-sans);
  text-decoration: none;
}
html body .sc-skip:focus { top: 12px; }

/* ---------- buttons: one primary, one secondary ----------
   #sc-x never matches an element; :is() takes the highest specificity in its list,
   so these rules beat the older body.tools-page button rules without !important. */
html body :is(#sc-x, .sc-pill, .sc-btn, .masthead-cta--store, .footer-cta--store, .store-btn-lg, .app-cta, button.tool-button, .hero-actions a) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid var(--sc-gold);
  border-radius: 999px;
  background: var(--sc-gold);
  color: var(--sc-pill-ink);
  font: 600 16px/1.2 var(--sc-sans);
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
html body :is(#sc-x, .sc-pill, .sc-btn, .masthead-cta--store, .footer-cta--store, .store-btn-lg, .app-cta, button.tool-button, .hero-actions a):hover:not(:disabled) {
  background: var(--sc-gold-hi);
  border-color: var(--sc-gold-hi);
  color: var(--sc-pill-ink);
}
html body :is(#sc-x, .sc-btn-secondary, button.tool-secondary, .tool-result-actions button, .tool-presets button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1.5px solid var(--sc-ink);
  border-radius: 999px;
  background: transparent;
  color: var(--sc-ink);
  font: 600 16px/1.2 var(--sc-sans);
  text-decoration: none;
  cursor: pointer;
}
html body :is(#sc-x, .sc-btn-secondary, button.tool-secondary, .tool-result-actions button, .tool-presets button):hover:not(:disabled) {
  border-color: var(--sc-gold);
  color: var(--sc-ink);
  background: rgba(184, 134, 46, 0.14);
}

/* ---------- header ---------- */
html body .sc-header {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--sc-line);
  font-family: var(--sc-sans);
  background: transparent;
}
html body .sc-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  box-sizing: border-box;
  height: 64px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
}
html body .sc-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--sc-ink);
  font: 400 22px/1 var(--sc-serif);
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}
html body .sc-glyph {
  font-family: 'Bravura', var(--sc-serif);
  font-size: 24px;
  line-height: 1;
  color: var(--sc-link);
}
html body .sc-word { font-family: var(--sc-serif); }
html body .sc-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 0 auto;
}
html body :is(.sc-nav, .sc-menu-panel) a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 12px;
  color: var(--sc-muted);
  font: 500 16px/1.5 var(--sc-sans);
  text-decoration: none;
}
html body :is(.sc-nav, .sc-menu-panel) a:hover,
html body :is(.sc-nav, .sc-menu-panel) a[aria-current] { color: var(--sc-ink); }
html body :is(.sc-nav, .sc-menu-panel) a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--sc-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}
html body .sc-menu { display: none; }
html body .sc-menu:not([open]) .sc-menu-panel { display: none; }

@media (max-width: 519px) {
  html body .sc-bar { height: 56px; gap: 10px; padding: 0 12px 0 16px; }
  html body .sc-brand { font-size: 20px; }
  html body .sc-glyph { font-size: 21px; }
  html body .sc-nav { display: none; }
  html body .sc-pill { margin-left: auto; padding: 0 16px; font-size: 15px; }
  html body .sc-menu { display: block; }
  html body .sc-menu summary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    cursor: pointer;
    list-style: none;
  }
  html body .sc-menu summary::-webkit-details-marker { display: none; }
  html body .sc-burger,
  html body .sc-burger::before,
  html body .sc-burger::after {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--sc-ink);
    content: '';
  }
  html body .sc-burger { position: relative; }
  html body .sc-burger::before { position: absolute; top: -6px; left: 0; }
  html body .sc-burger::after { position: absolute; top: 6px; left: 0; }
  html body .sc-menu[open] .sc-burger { background: transparent; }
  html body .sc-menu[open] .sc-burger::before { top: 0; transform: rotate(45deg); }
  html body .sc-menu[open] .sc-burger::after { top: 0; transform: rotate(-45deg); }
  html body .sc-menu-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 50;
    display: flex;
    flex-direction: column;
    padding: 8px 16px 12px;
    border-bottom: 1px solid var(--sc-line);
    background: var(--sc-panel);
  }
  html body .sc-menu-panel a { width: 100%; padding: 12px 0; }
}

/* ---------- footer ---------- */
html body .sc-footer {
  box-sizing: border-box;
  width: 100%;
  max-width: 1200px;
  margin: 48px auto 0;
  padding: 40px clamp(16px, 4vw, 32px) 56px;
  border-top: 1px solid var(--sc-line);
  color: var(--sc-muted);
  font: 400 16px/1.6 var(--sc-sans);
  background: transparent;
}
html body .sc-footer :where(p) { margin: 0 0 14px; }
html body .sc-footer strong { color: var(--sc-ink); font-weight: 600; }
html body .sc-footer a { color: var(--sc-link); }
html body .sc-lede { max-width: 620px; margin-bottom: 28px; }
html body .sc-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 32px;
}
html body .sc-col { display: flex; flex-direction: column; }
html body .sc-col-title {
  margin-bottom: 4px;
  color: var(--sc-ink);
  font: 600 13px/1.5 var(--sc-sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
html body :is(.sc-col a, .sc-legal a, .sc-lang a) {
  display: block;
  padding: 12px 0;
  min-height: 44px;
  box-sizing: border-box;
  color: var(--sc-muted);
  font: 400 16px/1.5 var(--sc-sans);
  text-decoration: none;
}
html body :is(.sc-col a, .sc-legal a, .sc-lang a):hover { color: var(--sc-ink); text-decoration: underline; }
html body .sc-lang {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 20px;
  margin-top: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--sc-line);
}
html body .sc-lang .footer-col-title { color: var(--sc-ink); font-weight: 600; }
html body .sc-lang .lang-current { padding: 12px 0; color: var(--sc-ink); font-weight: 600; }
html body .sc-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 24px;
  margin-top: 8px;
}
html body .sc-legal { display: flex; flex-wrap: wrap; gap: 0 24px; }
html body .sc-base p { margin: 0; font-size: 14px; }
html body .sc-footer .fineprint { margin: 12px 0 0; font-size: 14px; color: var(--sc-muted); }
html body .sc-footer a[href="https://superlaunchlist.com"] { display: inline-flex; align-items: center; min-height: 44px; margin-top: 12px; line-height: 0; opacity: 0.85; }
html body .sc-footer a[href="https://superlaunchlist.com"] img { display: block; width: 120px; height: auto; }
html body .sc-footer .store-badge-link { display: inline-block; min-height: 44px; margin-top: 4px; }

@media (max-width: 719px) {
  html body .sc-cols { grid-template-columns: minmax(0, 1fr); }
  html body .sc-col-follow { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
  html body .sc-col-follow .sc-col-title { grid-column: 1 / -1; }
  html body .sc-footer { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
  /* the fixed store bar on phones sits over the footer's last row */
  html body.home .sc-footer { padding-bottom: calc(56px + 64px); }
}

/* ---------- tap targets on phones ---------- */
@media (max-width: 700px) {
  html body .faq summary { display: flex; align-items: center; min-height: 44px; }
  html body :is(.guide-toc, .reading-nav) a { display: flex; align-items: center; min-height: 44px; }
  html body .breadcrumbs a { display: inline-flex; align-items: center; min-height: 44px; }
  html body .breadcrumbs :is(ol, li) { align-items: center; }
}
