/* Zvaad Tools static pages. Fonts are the same files the Flutter build ships,
   served from this site. */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/app/assets/assets/fonts/IBMPlexSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/app/assets/assets/fonts/IBMPlexSans-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/app/assets/assets/fonts/IBMPlexMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #f7f8f7;
  --surface: #ffffff;
  --surface-2: #f1f4f3;
  --text: #17201e;
  --muted: #56625f;
  --line: #dde4e2;
  --accent: #0e6b5c;
  --accent-ink: #ffffff;
  --accent-soft: #e2f0ec;
  --focus: #0e6b5c;
  --code-bg: #f3f6f5;
  --radius: 14px;
  --gutter: 16px;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101413;
    --surface: #171c1b;
    --surface-2: #1d2322;
    --text: #e6ecea;
    --muted: #a3b0ac;
    --line: #2c3533;
    --accent: #5fcfb6;
    --accent-ink: #062a23;
    --accent-soft: #16302b;
    --focus: #8ee5d1;
    --code-bg: #121716;
  }
}
@media (min-width: 600px) {
  :root { --gutter: 24px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -48px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 10px; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container--wide { max-width: 1480px; }
.container--narrow { max-width: 820px; }

/* Header and footer */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.125rem;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.site-nav a:hover { background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--accent); }

.site-footer {
  margin-top: 64px;
  padding: 32px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer a { color: var(--muted); }

/* Page intro */
.intro { padding: 36px 0 20px; }
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.9375rem;
}
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
h1, h2, h3 { line-height: 1.25; font-weight: 600; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem); margin: 0 0 12px; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; margin: 48px 0 14px; }
h3 { font-size: 1.125rem; margin: 28px 0 8px; }
.lede { max-width: 760px; margin: 0; color: var(--muted); font-size: 1.125rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.9375rem;
}
.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* Embedded Flutter workspace */
.workspace { padding: 8px 0 0; }
.app-host {
  position: relative;
  width: 100%;
  height: clamp(600px, calc(100svh - 88px), 940px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
}
@media (max-width: 599px) {
  .app-host { height: max(640px, calc(100svh - 72px)); border-radius: 12px; }
}
.app-loading, .app-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}
.app-error { display: none; }
.app-host.has-error .app-error { display: grid; }
.app-host.has-error .app-loading { display: none; }
.spinner {
  justify-self: center;
  width: 32px;
  height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.workspace-hint { margin: 10px 0 0; color: var(--muted); font-size: 0.9375rem; }

/* Advertising: manual, labelled, separated from the tool */
.ad-slot {
  margin: 48px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.ad-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ad-frame {
  width: 100%;
  max-width: 100%;
  min-height: 280px;
}
@media (min-width: 900px) { .ad-frame { min-height: 250px; } }
.ad-frame ins { display: block; width: 100%; }
.ad-placeholder {
  display: grid;
  place-content: center;
  min-height: inherit;
  border: 2px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 16px;
}

/* Content */
.content p, .content li, .content dd { max-width: 78ch; }
.steps { padding-left: 1.4em; }
.steps li { margin: 6px 0; padding-left: 4px; }
.rules { margin: 0; }
.rules dt { font-weight: 600; margin-top: 18px; }
.rules dd { margin: 4px 0 0; }
.example {
  margin: 20px 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.example h3 { margin-top: 0; }
.example-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.example-grid > * { min-width: 0; }
@media (min-width: 900px) {
  .example-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.code-label { margin: 0 0 6px; font-weight: 600; font-size: 0.9375rem; }
pre {
  margin: 0;
  max-height: 460px;
  overflow: auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--code-bg);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.55;
  tab-size: 2;
}
code { font-family: var(--mono); font-size: 0.9em; }
.notes { margin: 12px 0 0; padding-left: 1.2em; color: var(--muted); font-size: 0.9375rem; }
.notes code { color: var(--text); }
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
}
.faq summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 600;
  list-style-position: outside;
}
.faq details p { margin: 0 0 14px; }

/* Cards */
.card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.tool-card {
  display: block;
  height: 100%;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.tool-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.tool-card h3 { margin: 0 0 6px; }
.tool-card p { margin: 0 0 14px; color: var(--muted); }
.tool-card .cta { color: var(--accent); font-weight: 600; }
.tool-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 600;
}
@media (prefers-reduced-motion: reduce) { .tool-card { transition: none; } .tool-card:hover { transform: none; } }

.related { margin-top: 8px; }
.note-box {
  margin: 24px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
}
.button {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}
.error-page { padding: 72px 0 24px; }
.error-code { margin: 0; color: var(--accent); font-family: var(--mono); font-weight: 600; }
