/* LCZ4Everyone landing enhancements, layered on top of the design-tool export.
   The export uses inline styles, which React serialises as "prop: rgb(r, g, b)",
   so dark mode rewrites those exact strings. If the design palette changes,
   update the rgb() values below. */

/* ---------- skip link ---------- */
.lcz-skip {
  position: fixed; top: 8px; left: 8px; z-index: 1000;
  transform: translateY(-200%);
  background: #1d1d1f; color: #ffffff;
  font-size: 14px; font-weight: 600; line-height: 1;
  padding: 11px 16px; border-radius: 980px; text-decoration: none;
  transition: transform .15s ease;
}
.lcz-skip:focus { transform: none; }
html.dark .lcz-skip { background: #f5f5f7; color: #1d1d1f; }

/* skip target: clear the sticky header, don't ring the whole page */
#main { scroll-margin-top: 60px; }
#main:focus { outline: none; }

/* ---------- keyboard focus ---------- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid #0b6b46;
  outline-offset: 2px;
}
html.dark :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline-color: #4cc38a;
}

/* ---------- tool logos ---------- */
.tool-logo { height: 44px; width: auto; flex: none; }
.tool-logo.wide { height: 36px; }
.tool-logo.sm { height: 30px; margin-bottom: 4px; }
.tool-logo.sm.wide { height: 24px; }

/* ---------- topbar extras ---------- */
.lcz-iconbtn { background: transparent; border: 1px solid #d2d2d7; color: #1d1d1f; font: inherit; font-size: 13px;
  line-height: 1; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; display: inline-grid; place-items: center; padding: 0; }
.lcz-iconbtn:hover { border-color: #86868b; }
.lcz-menu { display: none; }
@media (max-width: 760px) {
  .lcz-menu { display: inline-grid; }
  /* closed: only the theme + menu buttons stay in the bar */
  header nav { flex-wrap: nowrap !important; }
  html:not(.nav-open) header nav > :not(.lcz-iconbtn) { display: none !important; }
  /* open: a right-aligned column under the two buttons */
  html.nav-open header nav { flex-direction: column; align-items: flex-end; gap: 10px !important; padding-block: 4px 14px; }
  html.nav-open header nav > a[href^="#"] { font-size: 16px !important; }
  html.nav-open .lcz-iconbtn { order: -1; }
  html.nav-open header > div { height: auto !important; min-height: 52px; padding-block: 12px !important; align-items: flex-start !important; }
}

/* ---------- hero mosaic ---------- */
.lcz-demo { width: 100%; max-width: 760px; display: grid; gap: 12px; }
.lcz-mosaic { display: grid; grid-template-columns: repeat(26, 1fr); gap: 3px; }
.lcz-mosaic > i { aspect-ratio: 1; border-radius: 3px; display: block; cursor: crosshair;
  transition: transform .15s ease, opacity .3s ease, outline-color .15s; outline: 2px solid transparent; outline-offset: 1px; }
.lcz-mosaic > i:hover, .lcz-mosaic > i.on { transform: scale(1.25); outline-color: #1d1d1f; position: relative; z-index: 1; }
.lcz-mosaic.dim > i:not(.on) { opacity: .25; }
.lcz-demo-cap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: #6e6e73; min-height: 20px; }
.lcz-demo-cap b { color: #1d1d1f; font-weight: 600; }

/* ---------- stats strip ---------- */
.lcz-stats { width: 100%; max-width: 980px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px;
  background: #d2d2d7; border: 1px solid #d2d2d7; border-radius: 18px; overflow: hidden; }
.lcz-stats > div { background: #fff; padding: 18px 12px; display: grid; gap: 2px; justify-items: center; }
.lcz-stats strong { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; color: #1d1d1f; font-variant-numeric: tabular-nums; }
.lcz-stats span { font-size: 13px; color: #6e6e73; }

/* ---------- code tabs ---------- */
.lcz-tabs-wrap { display: grid; gap: 14px; justify-items: center; text-align: center; margin-top: 12px; }
.lcz-tabs-wrap h3 { margin: 0; font-size: clamp(22px, 2.6vw, 30px); font-weight: 600; letter-spacing: -0.02em; color: #1d1d1f; }
.lcz-tabs { width: 100%; max-width: 760px; text-align: left; border-radius: 16px; overflow: hidden; background: #1d1d1f; color: #f5f5f7; }
.lcz-tabs-head { display: flex; align-items: center; gap: 4px; padding: 8px; border-bottom: 1px solid rgba(255,255,255,.1); flex-wrap: wrap; }
.lcz-tabs-head [role="tab"] { background: transparent; border: 0; color: rgba(255,255,255,.6); font: inherit; font-size: 13px; font-weight: 500;
  padding: 7px 12px; border-radius: 8px; cursor: pointer; }
.lcz-tabs-head [role="tab"][aria-selected="true"] { background: rgba(255,255,255,.12); color: #fff; }
.lcz-copy { margin-left: auto; background: transparent; border: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.8); font: inherit;
  font-size: 12px; padding: 5px 10px; border-radius: 8px; cursor: pointer; }
.lcz-panel { margin: 0; padding: 22px 24px; font-family: 'SF Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px;
  line-height: 1.8; overflow-x: auto; white-space: pre; }
.lcz-panel .k { color: #ff8ab7; } .lcz-panel .f { color: #7ecfa0; } .lcz-panel .s { color: #8fc7ff; } .lcz-panel .c { color: #86868b; }
.lcz-panel[hidden] { display: none; }
ol.lcz-panel { white-space: normal; font-family: inherit; font-size: 15px; padding-left: 46px; display: grid; gap: 6px; }

/* ---------- scroll reveal (only when JS + motion allowed) ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.reveal-on .rv { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
  html.reveal-on .rv.in { opacity: 1; transform: none; }
}

/* ================= dark mode ================= */
html.dark { color-scheme: dark; }
html.dark body, html.dark #dc-root { background: #000 !important; }
html.dark a { color: #4cc38a; }
/* surfaces */
html.dark [style*="background: rgb(245, 245, 247)"] { background: #161618 !important; }
html.dark [style*="background: rgb(255, 255, 255)"] { background: #242426 !important; }
html.dark [style*="background-color: rgb(232, 232, 237)"] { background-color: #38383a !important; }
html.dark [style*="background: rgba(251, 251, 253, 0.82)"] { background: rgba(22, 22, 23, 0.8) !important; }
html.dark [style*="background: rgba(11, 107, 70, 0.1)"] { background: rgba(76, 195, 138, 0.16) !important; }
html.dark [style*="box-shadow: rgba(0, 0, 0, 0.0"] { box-shadow: none !important; }
/* text: only where the element has no LCZ swatch background of its own */
html.dark [style*="color: rgb(29, 29, 31)"]:not([style*="background"]),
html.dark [style*="color: rgb(29, 29, 31)"][style*="background: rgb(255, 255, 255)"],
html.dark [style*="color: rgb(29, 29, 31)"][style*="background: rgb(245, 245, 247)"],
html.dark [style*="color: rgb(29, 29, 31)"][style*="background: transparent"] { color: #f5f5f7 !important; }
html.dark [style*="color: rgb(110, 110, 115)"] { color: #a1a1a6 !important; }
html.dark [style*="color: rgb(11, 107, 70)"] { color: #4cc38a !important; }
/* borders */
html.dark [style*="rgb(210, 210, 215)"], html.dark [style*="rgb(240, 240, 243)"], html.dark [style*="rgb(232, 232, 237)"] { border-color: #38383a !important; }
html.dark [style*="border-bottom: 1px solid rgba(0, 0, 0, 0.08)"] { border-bottom-color: rgba(255, 255, 255, 0.1) !important; }
/* primary (dark) buttons flip to light */
html.dark a[style*="background: rgb(29, 29, 31)"], html.dark button[style*="background: rgb(29, 29, 31)"] { background: #f5f5f7 !important; color: #1d1d1f !important; border-color: #f5f5f7 !important; }
/* the dark LCZ Studio card and code windows: lift them off the black page */
html.dark article[style*="background: rgb(29, 29, 31)"], html.dark div[style*="background: rgb(29, 29, 31)"] { background: #1c1c1e !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
html.dark img[alt^="First page"], html.dark img[alt^="Global 100"] { filter: brightness(.9); }
/* enhancement components */
html.dark .lcz-iconbtn { border-color: #424245; color: #f5f5f7; }
html.dark .lcz-mosaic > i:hover, html.dark .lcz-mosaic > i.on { outline-color: #f5f5f7; }
html.dark .lcz-demo-cap { color: #a1a1a6; } html.dark .lcz-demo-cap b { color: #f5f5f7; }
html.dark .lcz-stats { background: #38383a; border-color: #38383a; }
html.dark .lcz-stats > div { background: #161618; }
html.dark .lcz-stats strong, html.dark .lcz-tabs-wrap h3 { color: #f5f5f7; }
html.dark .lcz-tabs { background: #1c1c1e; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
