/* Gabarito by Naipe Foundry, SIL Open Font License 1.1 */
@font-face {
  font-family: 'Gabarito';
  src: url('/fonts/gabarito.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}

/* Palette matches the app (app/src/renderer/styles.css). */
:root {
  --bg: #fbf8f4;
  --panel: #ffffff;
  --panel-2: #f5eee7;
  --line: #ebe1d8;
  --text: #1c2238;
  --muted: #676b7e;
  --accent: #c8462a;
  --accent-hover: #b03b21;
  --accent-ink: #ffffff;
  --accent-soft: #fde4da;
  --ok: #1f8a4c;
  --info: #3a6da3;
  --warn: #a86400;
  --err: #c4243f;
  --thread: #b9ada2;
  --shadow: 0 1px 0 rgba(28, 34, 56, 0.04), 0 18px 40px -24px rgba(28, 34, 56, 0.35);
  --sans: 'Gabarito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141827;
    --panel: #1a1f31;
    --panel-2: #21273b;
    --line: #2d3449;
    --text: #eceef4;
    --muted: #9198ad;
    --accent: #ff6a45;
    --accent-hover: #ff825f;
    --accent-ink: #1c2238;
    --accent-soft: #3d2629;
    --ok: #3ccf7a;
    --info: #8fb0d4;
    --warn: #ffb12e;
    --err: #ff5d7a;
    --thread: #4a5370;
    --shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
code, kbd { font-family: var(--mono); font-size: 0.85em; }
kbd {
  padding: 0.1em 0.45em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--panel);
}
h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -0.01em; }
p { margin: 0; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -100px; padding: 8px 14px; background: var(--accent); color: var(--accent-ink); border-radius: 6px; z-index: 10; }
.skip:focus { top: 12px; }

/* ---------- header ---------- */

.site-header { border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand img { width: 56px; height: auto; }
.wordmark { font-size: 1.3rem; font-weight: 500; letter-spacing: -0.01em; }
.wordmark b { font-weight: 800; color: var(--accent); }
.nav { display: flex; gap: 4px 22px; list-style: none; margin: 0; padding: 0; font-weight: 500; }
.nav a { text-decoration: none; }
@media (max-width: 560px) {
  .nav li:not(:last-child):not(:nth-child(2)) { display: none; }
  .wordmark { font-size: 1.15rem; }
}

/* ---------- hero ---------- */

.hero { padding: 40px 0 0; overflow: hidden; }
.hero-grid { display: grid; gap: 8px; align-items: start; }
@media (min-width: 880px) {
  .hero { padding-top: 0; }
  .hero-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px; }
  .hero-copy { padding-top: 88px; }
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 4.75rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.03em;
  max-width: 11ch;
  text-wrap: balance;
}
.lede { margin-top: 24px; font-size: 1.2rem; line-height: 1.5; color: var(--muted); max-width: 34em; }

.cta { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.cta-alt { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.95rem; color: var(--muted); }
.release { margin-top: 18px; font-size: 0.9rem; color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
  transition: background-color 0.15s;
}
.btn:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn:active { box-shadow: none; transform: translateY(1px); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 0.95rem; border-radius: 8px; }

/* The mascot hangs on a thread from the header line. */
.mascot { position: relative; justify-self: center; width: min(78%, 400px); margin-top: 24px; padding-top: 56px; }
.mascot .thread {
  position: absolute;
  top: 0;
  left: 50.5%;
  width: 2px;
  height: calc(56px + 14%);
  background: var(--thread);
  transform-origin: top;
}
.mascot img { position: relative; width: 100%; }
@media (min-width: 880px) {
  .mascot { width: 100%; margin-top: 0; padding-top: 120px; }
  .mascot .thread { top: 0; height: calc(120px + 12%); }
}

/* ---------- app window ---------- */

.app {
  margin: 40px 0 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-size: 13px;
  line-height: 1.4;
}
@media (min-width: 880px) { .app { margin-top: 16px; } }

.app-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.crumb { color: var(--muted); }
.app-url {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  font: 12px var(--mono);
}
.app-state { color: var(--ok); font-weight: 600; }
.app-state::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
}
@media (max-width: 640px) { .crumb { display: none; } }

.app-tabs {
  display: flex;
  gap: 2px;
  padding: 6px 10px 0;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  overflow: hidden;
  white-space: nowrap;
}
.app-tabs span { padding: 6px 12px 7px; border-radius: 7px 7px 0 0; color: var(--muted); }
.app-tabs .on { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: 0 1px 0 var(--panel); }
.app-tabs em { font-style: normal; margin-left: 4px; font-variant-numeric: tabular-nums; opacity: 0.75; }
.app-tabs em.bad { color: var(--err); opacity: 1; }

.app-body { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .app-body { grid-template-columns: minmax(0, 1fr) 260px; } }

.table-scroll { overflow-x: auto; }
.crawl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.crawl th, .crawl td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crawl th { font-weight: 600; color: var(--muted); background: var(--panel); }
.crawl td:first-child { font-family: var(--mono); font-size: 12px; }
.crawl td:nth-child(n+5) { text-align: right; }
.crawl th:nth-child(n+5) { text-align: right; }
.crawl tbody tr:nth-child(3) { background: color-mix(in srgb, var(--accent-soft) 70%, transparent); }
.crawl b { display: inline-block; min-width: 38px; padding: 1px 6px; border-radius: 4px; text-align: center; font-weight: 600; color: #fff; }
.crawl .s2 { background: var(--ok); }
.crawl .s3 { background: var(--info); }
.crawl .s4 { background: var(--err); }
.crawl .s0 { background: var(--muted); }
@media (prefers-color-scheme: dark) { .crawl b { color: #1c2238; } }
.crawl .warn { color: var(--warn); font-weight: 600; }

.app-side { display: none; border-left: 1px solid var(--line); background: var(--panel-2); padding: 16px; }
@media (min-width: 980px) { .app-side { display: block; } }
.health { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.health .score {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid var(--ok);
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 800;
}
.issues { list-style: none; margin: 10px 0 0; padding: 0; }
.issues li { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.issues i, .checks h3::before { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.issues .err { background: var(--err); }
.issues .warn { background: var(--warn); }
.issues .info { background: var(--info); }
.issues em { margin-left: auto; font-style: normal; font-variant-numeric: tabular-nums; color: var(--muted); }

/* Page-load: rows land one by one, as in a real crawl. */
@media (prefers-reduced-motion: no-preference) {
  .js .mascot .thread { animation: thread 0.9s cubic-bezier(0.3, 0.7, 0.2, 1) both; }
  .js .mascot img { animation: drop 0.9s cubic-bezier(0.3, 0.7, 0.2, 1) both; }
  .js .crawl tbody tr { animation: row 0.25s ease-out both; }
}
.crawl tbody tr:nth-child(1) { animation-delay: 0.5s; }
.crawl tbody tr:nth-child(2) { animation-delay: 0.62s; }
.crawl tbody tr:nth-child(3) { animation-delay: 0.74s; }
.crawl tbody tr:nth-child(4) { animation-delay: 0.86s; }
.crawl tbody tr:nth-child(5) { animation-delay: 0.98s; }
.crawl tbody tr:nth-child(6) { animation-delay: 1.1s; }
.crawl tbody tr:nth-child(7) { animation-delay: 1.22s; }
.crawl tbody tr:nth-child(8) { animation-delay: 1.34s; }
.crawl tbody tr:nth-child(9) { animation-delay: 1.46s; }
.crawl tbody tr:nth-child(10) { animation-delay: 1.58s; }
@keyframes thread { from { transform: scaleY(0.25); } }
@keyframes drop { from { transform: translateY(-62%); } }
@keyframes row { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- sections ---------- */

.section { padding: 80px 0; border-top: 1px solid var(--line); }
@media (min-width: 880px) { .section { padding: 112px 0; } }
.hero + .section { border-top: 0; }

h2 { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 800; letter-spacing: -0.025em; }

.split { display: grid; gap: 40px; }
.split-head p { margin-top: 16px; color: var(--muted); max-width: 30em; }
@media (min-width: 880px) {
  .split { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 64px; }
  .split-head { position: sticky; top: 32px; align-self: start; }
}

/* Feature list: each item carries the severity colour it has in the app. */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 36px 48px; }
@media (min-width: 640px) { .checks { grid-template-columns: 1fr 1fr; } }
.checks h3 { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 700; }
.checks h3::before { content: ''; width: 10px; height: 10px; }
.checks .err h3::before { background: var(--err); }
.checks .warn h3::before { background: var(--warn); }
.checks .ok h3::before { background: var(--ok); }
.checks .info h3::before { background: var(--info); }
.checks p { margin-top: 8px; padding-left: 20px; color: var(--muted); max-width: 34em; }

.steps-section { background: var(--panel-2); }
.steps { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 28px; counter-reset: none; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 40px; } }
.steps li { display: flex; gap: 18px; align-items: baseline; }
.steps .n {
  flex: none;
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.steps p { font-size: 1.3rem; font-weight: 500; line-height: 1.3; max-width: 14em; }

.why { margin: 0; display: grid; gap: 32px 48px; }
@media (min-width: 640px) { .why { grid-template-columns: 1fr 1fr; } }
.why dt { font-size: 1.25rem; font-weight: 700; }
.why dd { margin: 8px 0 0; color: var(--muted); max-width: 30em; }

/* ---------- downloads ---------- */

.dl-release { margin-top: 12px; }
.dl {
  width: 100%;
  margin-top: 32px;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  border-spacing: 0;
}
.dl th, .dl td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); }
.dl tr:last-child td { border-bottom: 0; }
.dl th { font-size: 0.9rem; font-weight: 600; color: var(--muted); background: var(--panel-2); }
.dl td:first-child { font-weight: 600; }
.dl td:last-child { text-align: right; }
.dl code { color: var(--muted); }
.dl tr.mine td { background: var(--accent-soft); }
.dl .soon { font-size: 0.9rem; color: var(--muted); white-space: nowrap; }
.dl .yours { display: block; font-size: 0.85rem; font-weight: 500; color: var(--accent); }

@media (max-width: 640px) {
  .dl thead { display: none; }
  .dl, .dl tbody, .dl tr, .dl td { display: block; }
  .dl tr { display: grid; grid-template-columns: 1fr auto; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .dl tr:last-child { border-bottom: 0; }
  .dl td { padding: 0; border: 0; background: none !important; }
  .dl tr.mine { background: var(--accent-soft); }
  .dl td:nth-child(2) { grid-column: 1; grid-row: 2; font-size: 0.85rem; overflow-wrap: anywhere; }
  .dl td:last-child { grid-column: 2; grid-row: 1 / 3; align-self: center; padding-left: 12px; }
}

/* ---------- FAQ ---------- */

.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  flex: none;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1;
  color: var(--accent);
  transition: transform 0.2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 22px; color: var(--muted); max-width: 38em; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 40px 0 48px; color: var(--muted); font-size: 0.95rem; }
.footer-row { display: grid; gap: 20px; }
@media (min-width: 720px) { .footer-row { grid-template-columns: auto 1fr; gap: 48px; align-items: start; } }
.footer-text { display: grid; gap: 4px; }
