/* Styles of the static site (landing, help, imprint).
   Colors come from theme.css, which tool/build_site.dart generates from
   common/lib/theme. Do not add color literals here. */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bgPage);
  color: var(--textPrimary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: currentColor;
  vertical-align: -0.125em;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--onAccent);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn-lg { padding: 18px 36px; font-size: 15px; }

.btn-text {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--textSecondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.btn-text:hover { background: var(--surface); color: var(--textPrimary); }

.icon-btn {
  display: inline-flex;
  padding: 8px;
  border-radius: 50%;
  color: var(--textSecondary);
  font-size: 20px;
}
.icon-btn:hover { background: var(--surface); }

/* ── Top bar ─────────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bgPanel) 97%, transparent);
  border-bottom: 0.5px solid var(--divider);
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  min-height: 64px;
  padding: 8px 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  text-decoration: none;
}
.brand .logo { width: 28px; height: 28px; }

.topnav { display: flex; gap: 4px; margin-left: 16px; }
.topnav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--textSecondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.topnav a:hover { background: var(--surface); color: var(--textPrimary); }
.topnav a[aria-current] { color: var(--textPrimary); }

/* Same look as ChoiceChips in the Flutter app: separate chips with a gap. */
.lang {
  display: inline-flex;
  gap: 8px;
}
.lang a {
  padding: 6px 12px;
  border: 1px solid var(--overlay);
  border-radius: 6px;
  background: var(--surface);
  color: var(--textSecondary);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
}
.lang a[aria-current] {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 15%, transparent);
  color: var(--blue);
  font-weight: 600;
}

.topbar-actions { display: flex; align-items: center; margin-left: auto; }
.topbar-actions > span { display: inline-flex; align-items: center; gap: 8px; }

@media (max-width: 800px) {
  .topbar-inner { min-height: 56px; padding: 8px 16px; }
  .brand { font-size: 16px; }
  .brand .logo { width: 24px; height: 24px; }
  .topnav { display: none; }
}

@media (max-width: 480px) {
  .brand span { display: none; }
  .btn-text, .btn { padding: 8px 10px; font-size: 13px; }
}

/* ── Landing: banners ────────────────────────────────────────────────── */

.update-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-size: 13px;
}
.update-banner .icon { font-size: 18px; }
.update-banner span { flex: 1 1 220px; }
.update-banner a, .update-banner button {
  padding: 4px 10px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.update-banner button { color: var(--textSecondary); font-weight: 400; }

.beta {
  padding: 10px 20px;
  background: var(--static-accent);
  color: var(--static-bgChart);
  font-size: 13px;
  text-align: center;
}
.beta p, .beta span {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 6px;
  margin: 0;
}
.beta span { display: inline-flex; }
.beta strong { font-weight: 600; }
.beta a { color: inherit; font-weight: 700; }
.beta .beta-small { margin-top: 4px; font-size: 12px; }

/* ── Landing: hero ───────────────────────────────────────────────────── */

.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 580px;
  padding: 96px 28px;
  overflow: hidden;
  background: linear-gradient(to bottom right,
    var(--hero-0), var(--hero-1), var(--hero-2));
  text-align: center;
}
.isobars { position: absolute; inset: 0; width: 100%; height: 100%; }
.isobars path {
  fill: none;
  stroke: var(--static-blue);
  stroke-opacity: 0.035;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.hero-inner { position: relative; max-width: 720px; }
.hero h1 {
  margin: 0;
  color: var(--static-illustrationText);
  font-size: 56px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -1.5px;
}
.hero h1 span { display: block; }
.hero h1 .gold { color: var(--static-accent); }
.hero .lead {
  max-width: 560px;
  margin: 28px auto 40px;
  color: var(--static-textSecondary);
  line-height: 1.75;
}
.hero .btn { background: var(--static-accent); color: var(--static-onAccent); }

@media (max-width: 860px) {
  .hero { min-height: 480px; padding: 64px 28px; }
  .hero h1 { font-size: 40px; }
}

/* ── Landing: intro video ────────────────────────────────────────────── */

.demo { padding: 72px 28px; background: var(--bgPanel); }
.demo-inner { max-width: 960px; margin: 0 auto; text-align: center; }
.demo h2 { margin: 20px 0 12px; font-size: 30px; font-weight: 800; }
.demo p { margin: 0 auto 28px; max-width: 560px; color: var(--textSecondary); line-height: 1.7; }
.demo .demo-credit { margin: 10px 0 0; font-size: 12px; color: var(--textSecondary); }
.demo-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--divider);
  border-radius: 12px;
  background: var(--bgPage);
}

@media (max-width: 860px) {
  .demo { padding: 48px 16px; }
  .demo h2 { font-size: 24px; }
}

/* ── Landing: story ──────────────────────────────────────────────────── */

.story { padding: 80px 28px; }
.story-inner { max-width: 680px; margin: 0 auto; }
.pill {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 20px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
}
.story h2 {
  margin: 24px 0 32px;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
}
.story p { margin: 0 0 20px; color: var(--textSecondary); line-height: 1.8; }
.story hr { margin: 48px 0 40px; border: 0; border-top: 1px solid var(--divider); }
.story-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 48px; }
.story-cta h3 { margin: 0 0 6px; font-size: 14px; font-weight: 700; }
.story-cta p { margin: 0 0 12px; font-size: 13px; line-height: 1.6; }
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

@media (max-width: 600px) {
  .story { padding: 56px 20px; }
  .story-cta { grid-template-columns: 1fr; }
}

/* ── Footer ──────────────────────────────────────────────────────────── */

.site-footer { padding: 20px 40px 40px; }
.footer-inner { padding-top: 20px; border-top: 1px solid var(--divider); }
.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}
.footer-brand .logo { width: 22px; height: 22px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px; }
.footer-links a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--textSecondary);
  font-size: 14px;
  text-decoration: none;
}
.footer-links a:hover { background: var(--surface); color: var(--textPrimary); }
.footer-meta { margin-top: 16px; color: var(--textSecondary); font-size: 12px; }
.footer-copy { color: var(--textMuted); }
.trademark {
  margin: 10px 0 0;
  color: var(--textMuted);
  font-size: 11px;
  text-align: center;
}

@media (max-width: 600px) {
  .site-footer { padding: 16px 16px 32px; }
}

/* ── Help ────────────────────────────────────────────────────────────── */

.help-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.toc-wrap { background: var(--bgSection); }
.toc { position: sticky; top: 64px; padding: 28px 0; }
.toc-title {
  margin: 0 20px 16px;
  color: var(--textSecondary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.toc ol { margin: 0; padding: 0; list-style: none; }
.toc li a {
  display: block;
  padding: 8px 20px 8px 17px;
  border-left: 3px solid transparent;
  color: var(--textSecondary);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
}
.toc li a:hover { color: var(--textPrimary); }
.toc li a[aria-current] {
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.toc-contact {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 24px 20px 0;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
  color: var(--textSecondary);
  font-size: 12px;
  text-decoration: none;
}

@media (max-width: 820px) {
  .help-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; padding: 20px 0; }
}

.help-section:nth-of-type(even) { background: var(--bgPanel); }
.section-inner { max-width: 860px; margin: 0 auto; padding: 48px 32px 56px; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.help-section h2 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.3px;
}
.help-section h3 { margin: 28px 0 8px; font-size: 17px; font-weight: 700; }
.help-section h4 { margin: 18px 0 6px; font-size: 14.5px; font-weight: 700; }
.steps h4, .scenario h4 { margin: 0 0 4px; }
.help-section p, .help-section li {
  color: var(--textSecondary);
  font-size: 14px;
  line-height: 1.7;
}
.help-section p { margin: 0 0 10px; }

@media (max-width: 600px) {
  .section-inner { padding: 36px 16px 44px; }
}

.bullets { margin: 0 0 10px; padding: 0; list-style: none; }
.bullets li { position: relative; padding: 4px 0 4px 18px; line-height: 1.6; }
.bullets li::before {
  content: "•";
  position: absolute;
  left: 2px;
  color: var(--accent);
}
.bullets strong { margin-right: 4px; color: var(--textPrimary); font-weight: 600; }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps > li {
  position: relative;
  min-height: 28px;
  margin-bottom: 16px;
  padding-left: 42px;
  counter-increment: step;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  top: 1px;
  left: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--onAccent);
  font-size: 13px;
  font-weight: 800;
}
.steps h4 {
  margin: 0 0 4px;
  color: var(--textPrimary);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}
.steps p, .steps .bullets li { margin-bottom: 6px; font-size: 13px; line-height: 1.6; }

.note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 4px;
  padding: 12px 16px;
  border-left: 3px solid;
  border-radius: 0 6px 6px 0;
}
.note .icon { margin-top: 3px; font-size: 16px; }
.note p { margin: 0; color: inherit; font-size: 13px; line-height: 1.6; }
.note.tip {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
}
.note.warn {
  border-color: var(--static-warning);
  background: color-mix(in srgb, var(--static-warning) 8%, transparent);
  color: var(--static-warning);
}

.scenarios {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 28px 0 10px;
}
.scenario {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bgSection);
}
.scenario-icons {
  display: flex;
  justify-content: space-between;
  color: var(--accent);
  font-size: 20px;
}
.scenario-icons .icon + .icon { font-size: 13px; }
.scenario h3 { margin: 10px 0 2px; font-size: 13px; font-weight: 700; }
.scenario .sub { margin: 0 0 8px; font-size: 11px; font-weight: 500; }
.scenario p { font-size: 12px; line-height: 1.55; }
.scenario.dimmed {
  border-color: color-mix(in srgb, var(--border) 40%, transparent);
  background: var(--bgPage);
}
.scenario.dimmed > * { opacity: 0.5; }
.scenario.dimmed .scenario-icons { color: var(--textSecondary); }

.help-section .fine {
  display: flex;
  gap: 6px;
  color: var(--textMuted);
  font-size: 11px;
  line-height: 1.5;
}
.fine .icon { margin-top: 2px; font-size: 12px; }

.help-section .trademark-note {
  margin-top: 16px;
  color: var(--textMuted);
  font-size: 11px;
  line-height: 1.5;
}

.wx-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.help-section .wx-grid li {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 120px;
  height: 104px;
  padding: 10px;
  border: 0.5px solid var(--borderPanel);
  border-radius: 8px;
  background: var(--bgPanel);
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
}
.wx-icon { position: relative; display: block; width: 36px; height: 36px; overflow: hidden; }
.wx-glyph { position: absolute; display: block; }
.wx-glyph svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.wx-credit { font-size: 0.8rem; color: var(--textMuted); }
.wx-credit a { color: inherit; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 20px 0;
  padding: 10px 16px;
  border-top: 1px solid var(--divider);
  background: var(--bgPanel);
  list-style: none;
}
.legend li { display: flex; align-items: center; gap: 8px; }
.legend strong {
  display: block;
  color: var(--textPrimary);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.2px;
}
.legend small { display: block; color: var(--textMuted); font-size: 9.5px; line-height: 1.3; }

/* ── Imprint ─────────────────────────────────────────────────────────── */

.imprint { padding: 32px; }
.narrow { max-width: 680px; margin: 0 auto; }
.imprint h1 { margin: 0 0 32px; font-size: 28px; font-weight: 800; }
.imprint h2 {
  margin: 28px 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.imprint address { font-size: 15px; font-style: normal; line-height: 1.8; }
.imprint p { margin: 0; color: var(--textSecondary); font-size: 14px; line-height: 1.7; }
/* Lists in these pages read like the paragraphs around them. */
.imprint .bullets { margin: 6px 0 10px; }
.imprint .bullets li { color: var(--textSecondary); font-size: 14px; line-height: 1.7; }
.imprint .imprint-strong { color: var(--textPrimary); font-size: 15px; }
.imprint .card {
  margin-top: 40px;
  padding: 16px;
  border: 1px solid var(--divider);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 600px) {
  .imprint { padding: 24px 16px; }
}

/* Embedded in the web app help overlay: the app draws the frame. */
.embedded .topbar,
.embedded .site-footer { display: none; }
.embedded .toc { top: 0; }
