/* site.css — public website. Colours come only from the app's tokens
   (/site/tokens.css, exported from frontend/src/index.css at build time by
   frontend/scripts/export-site-tokens.mjs), so site and app share one palette
   and the CI contrast check covers both. Light is the default. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.site {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 17px;
  line-height: 1.6;
}
.num { font-family: var(--font-display, 'Space Mono', monospace); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-secondary); }
.small { font-size: 14px; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 5vw, 46px); }
h2 { font-size: clamp(22px, 3vw, 28px); margin-top: 0; }
h3 { font-size: 18px; }
p { margin: 0 0 1em; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 599px) { .wrap { padding: 0 16px; } body.site { font-size: 16px; } }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--bg-surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Language hint (shown by site.js) */
.lang-hint { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
  padding: 8px 16px; background: var(--bg-surface); border-bottom: 1px solid var(--border); font-size: 15px; }
.lang-hint[hidden] { display: none; }
.lang-hint-close { background: none; border: 0; color: var(--text-secondary); font-size: 22px; line-height: 1;
  min-width: 44px; min-height: 44px; cursor: pointer; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg-base); }
.header-row { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text-primary); text-decoration: none; font-size: 19px; }
.logo b { font-weight: 700; }
.logo-mark { width: 14px; height: 14px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-muted); }
.env-badge { font-family: var(--font-display); font-size: 12px; padding: 2px 8px; border: 1px solid var(--amber); color: var(--amber); border-radius: 4px; }
.nav-desktop { display: flex; gap: 22px; margin-left: 12px; }
.nav-desktop a, .nav-mobile nav a { color: var(--text-secondary); text-decoration: none; font-weight: 500; }
.nav-desktop a:hover, .nav-desktop a[aria-current="page"],
.nav-mobile nav a[aria-current="page"] { color: var(--text-primary); }
.nav-desktop a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 8px; }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.lang-switch { display: inline-flex; gap: 6px; align-items: center; color: var(--text-tertiary); font-size: 15px; }
.lang-switch a { color: var(--text-secondary); text-decoration: none; padding: 10px 4px; }
.lang-switch a[aria-current="true"] { color: var(--text-primary); font-weight: 700; }
.theme-toggle { background: none; border: 1px solid var(--border-strong); color: var(--text-secondary); border-radius: 6px;
  min-width: 40px; min-height: 40px; cursor: pointer; font-size: 18px; }
.theme-toggle:not(.js) { display: none; }

.nav-mobile { display: none; position: relative; }
.nav-mobile summary { list-style: none; cursor: pointer; padding: 10px 14px; border: 1px solid var(--border-strong);
  border-radius: 6px; min-height: 44px; display: flex; align-items: center; color: var(--text-primary); font-weight: 500; }
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile-panel { position: absolute; right: 0; top: calc(100% + 8px); background: var(--bg-base); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 12px 16px; min-width: 220px; z-index: 5; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.nav-mobile-panel nav { display: flex; flex-direction: column; }
.nav-mobile-panel nav a { padding: 10px 0; min-height: 44px; }
.nav-mobile-panel .lang-switch { padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }

@media (max-width: 899px) {
  .nav-desktop, .header-tools .lang-switch { display: none; }
  .nav-mobile { display: block; }
  .header-row { gap: 10px; }
  .header-tools { gap: 8px; }
}
.theme-toggle-menu { width: 100%; margin-top: 8px; text-align: left; padding: 8px 12px; font-size: 15px; }
@media (min-width: 900px) { .theme-toggle-menu { display: none !important; } }
@media (max-width: 599px) {
  .theme-toggle-head, .env-badge, .menu-word { display: none !important; }
  .btn-login { padding: 8px 14px; }
}
@media (max-width: 380px) { .logo-text { font-size: 17px; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px;
  border-radius: 6px; font-weight: 700; text-decoration: none; border: 1px solid transparent; font-size: 16px; }
.btn-primary { background: var(--accent); color: var(--text-inverse); }
.btn-primary:hover { background: var(--accent-dim); }
.btn-ghost { border-color: var(--border-strong); color: var(--text-primary); }
.btn-lg { padding: 12px 22px; font-size: 17px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 12px; }

/* Home */
.hero { padding: 56px 0 48px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; }
@media (max-width: 899px) { .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; } .hero { padding: 32px 0; } }
.eyebrow { font-family: var(--font-display); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 12px; }
.lead { font-size: 19px; color: var(--text-secondary); max-width: 34em; }

.mock { margin: 0; }
.mock-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px; }
.mock figcaption { font-size: 13px; color: var(--text-tertiary); margin-top: 8px; text-align: right; }
.mock-tiles { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 18px; }
.mock-tiles .tile:first-child { grid-column: 1 / -1; }
.tile { background: var(--bg-base); border: 1px solid var(--border); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile-label { font-size: 13px; color: var(--text-secondary); }
.tile-value { font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile:first-child .tile-value { font-size: 26px; }
.tile-sub { font-size: 13px; color: var(--text-secondary); }
.mock-chart { display: flex; align-items: flex-end; gap: 6px; height: 96px; padding: 10px; background: var(--chart-bg); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 16px; }
.mock-chart span { flex: 1; background: var(--series-1); border-radius: 2px 2px 0 0; min-height: 4px; opacity: .85; }
.stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: 6px 0 12px; background: var(--bg-base); }
.s1 { background: var(--series-1); } .s2 { background: var(--series-2); } .s3 { background: var(--series-3); } .s4 { background: var(--series-4); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 16px; font-size: 14px; }
.legend li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.legend .num { margin-left: auto; }
.legend .muted { margin-left: 0; font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

section { padding: 48px 0; }
.band { background: var(--bg-surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 24px; }
.step-no { display: inline-flex; width: 36px; height: 36px; border-radius: 50%; align-items: center; justify-content: center;
  border: 2px solid var(--accent); color: var(--accent); font-weight: 700; margin-bottom: 10px; }
.steps p, .card p { color: var(--text-secondary); margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 20px; margin-top: 24px; }
.card { border: 1px solid var(--border); border-radius: 10px; padding: 20px; background: var(--bg-base); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 32px; }
.plain-list, .link-list { margin: 0; padding-left: 1.2em; }
.plain-list li, .link-list li { margin-bottom: 8px; }
.link-list { list-style: none; padding: 0; }
.link-list a { display: inline-block; padding: 6px 0; }

/* Content pages */
.page { padding-top: 40px; padding-bottom: 56px; max-width: 820px; }
.page-head { margin-bottom: 28px; }
.page-meta { color: var(--text-secondary); font-size: 15px; margin: 0 0 12px; }
.note { background: var(--bg-surface); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 4px; font-size: 15px; color: var(--text-secondary); }
.note-draft { border-left-color: var(--amber); }
.prose h2 { margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.prose blockquote { margin: 1em 0; padding: 4px 16px; border-left: 3px solid var(--border-strong); color: var(--text-secondary); }
.prose code { font-family: var(--font-display); font-size: .88em; background: var(--bg-surface); padding: 1px 5px; border-radius: 3px; overflow-wrap: anywhere; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0 1.5em; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { color: var(--text-secondary); font-weight: 500; }
.prose details { border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; margin-bottom: 10px; }
.prose summary { cursor: pointer; font-weight: 700; min-height: 28px; }
.prose .example { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px 18px; margin: 1em 0; }
@media (max-width: 599px) {
  .prose table, .prose thead, .prose tbody, .prose tr, .prose th, .prose td { display: block; }
  .prose thead { position: absolute; left: -9999px; }
  .prose tr { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; margin-bottom: 10px; }
  .prose td { border: 0; padding: 4px 0; }
  .prose td:first-child { font-weight: 700; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-surface); padding: 32px 0 40px; font-size: 15px; }
.no-advice { font-weight: 500; color: var(--text-primary); max-width: 46em; }
.company-line { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--text-secondary); }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 8px 0 16px; }
.footer-links a { color: var(--text-secondary); padding: 8px 0; display: inline-block; }
.footer-links a[aria-current="page"] { color: var(--text-primary); }
.footer-small { color: var(--text-tertiary); font-size: 14px; margin: 0; }
