/* MergeGrade marketing site. Light/dark follows the visitor's system setting. */
:root {
  color-scheme: light dark;

  --bg: #fbfbfa;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --ink: #111418;
  --muted: #5b6472;
  --line: #e3e6ea;
  --brand: #2f5bea;
  --brand-ink: #ffffff;
  --brand-soft: #e8edfd;
  --grade-a: #1f8a4c;
  --grade-b: #2f6fc4;
  --grade-c: #a8690f;
  --grade-d: #c2413b;
  --code-bg: #0f1419;
  --code-ink: #e6edf3;

  @media (prefers-color-scheme: dark) {
    --bg: #0d1117;
    --surface: #151b23;
    --surface-2: #1b222c;
    --ink: #e6edf3;
    --muted: #9aa4b2;
    --line: #2a313c;
    --brand: #7aa2ff;
    --brand-ink: #0d1117;
    --brand-soft: #1c2a4d;
    --grade-a: #4cc07f;
    --grade-b: #6ea6f0;
    --grade-c: #e0a54a;
    --grade-d: #ef7a73;
    --code-bg: #0a0e13;
  }

  accent-color: var(--brand);
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
}
a { color: var(--brand); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible + label {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}
img, svg { max-width: 100%; }
code, pre { font-family: var(--mono); font-size: 0.9em; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; }
p { margin: 0; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.eyebrow {
  font: 600 0.78rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.05rem; }
.logo img { width: 28px; height: 28px; }
.nav { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  font: 600 0.95rem/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 8px 14px; font-size: 0.9rem; }

/* Hero */
.hero { padding: 72px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.02em; margin: 14px 0 18px; }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero .note { margin-top: 14px; font-size: 0.9rem; color: var(--muted); }

/* PR comment mock */
.pr-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 18px 40px -24px rgb(0 0 0 / 0.35);
  overflow: hidden;
}
.pr-card header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 0.88rem; }
.pr-card header img { width: 20px; height: 20px; }
.pr-card header b { font-weight: 600; }
.pr-card .body { padding: 18px 16px 16px; display: grid; gap: 16px; }
.grade-row { display: flex; align-items: center; gap: 16px; }
.grade {
  width: 64px; height: 64px; border-radius: 14px; display: grid; place-items: center;
  font: 700 1.9rem/1 var(--font); color: #fff; background: var(--grade-b); flex: none;
}
.grade-row strong { display: block; font-size: 1.05rem; }
.delta { color: var(--grade-a); font-weight: 600; }
.files { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.files td { padding: 7px 0; border-top: 1px solid var(--line); }
.files td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.files code { font-size: 0.85em; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; margin-left: 6px; }
.pill.c { background: color-mix(in srgb, var(--grade-c) 18%, transparent); color: var(--grade-c); }
.pill.a { background: color-mix(in srgb, var(--grade-a) 18%, transparent); color: var(--grade-a); }
.prompt { background: var(--code-bg); color: var(--code-ink); border-radius: 10px; padding: 12px 14px; font: 0.8rem/1.55 var(--mono); white-space: pre-wrap; margin: 0; }
.prompt-label { display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; color: var(--muted); }
.copy-chip { border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: 0.75rem; }
.pr-card footer { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 0.8rem; color: var(--muted); }

/* Sections */
section.block { padding: 72px 0; border-top: 1px solid var(--line); }
.section-head { max-width: 46em; margin-bottom: 36px; display: grid; gap: 12px; }
.section-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); letter-spacing: -0.01em; }
.section-head p { color: var(--muted); font-size: 1.05rem; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 8px; align-content: start; }
.steps li::before {
  counter-increment: step; content: counter(step);
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-weight: 700;
}
.steps h3 { font-size: 1.1rem; }
.steps p { color: var(--muted); font-size: 0.95rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 10px; align-content: start; }
.card h3 { font-size: 1.1rem; }
.card p, .card li { color: var(--muted); font-size: 0.95rem; }
.card ul { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; }

.grades { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.grades span { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--muted); }
.grades b { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-size: 0.9rem; }
.g-a { background: var(--grade-a); } .g-b { background: var(--grade-b); } .g-c { background: var(--grade-c); } .g-d { background: var(--grade-d); }

/* Trend sketch */
.trend { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.trend svg { display: block; width: 100%; height: auto; }
.trend .t-axis { stroke: var(--line); }
.trend .t-line { stroke: var(--brand); fill: none; stroke-width: 2.5; }
.trend .t-mean { stroke: var(--muted); stroke-dasharray: 5 4; }
.trend .t-mark { stroke: var(--grade-a); stroke-width: 2; }
.trend text { fill: var(--muted); font: 12px var(--font); }
.trend .t-label { fill: var(--ink); font-weight: 600; }

/* FAQ */
.faq { display: grid; gap: 10px; max-width: 52em; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 18px; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style-position: inside; }
.faq details p { padding: 0 0 16px; color: var(--muted); }

/* CTA band */
.cta { text-align: center; display: grid; gap: 16px; justify-items: center; }
.cta h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }

/* Pricing */
.billing { border: 0; padding: 0; margin: 0 auto 32px; display: flex; justify-content: center; }
.billing legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { padding: 8px 18px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 0.92rem; color: var(--muted); }
.segmented input:checked + label { background: var(--brand-soft); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 0.15); }
.save { color: var(--grade-a); font-weight: 700; }

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.plan.featured { border: 2px solid var(--brand); }
.plan h2 { font-size: 1.25rem; display: flex; align-items: center; gap: 10px; }
.plan .tag { font-size: 0.72rem; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 3px 8px; border-radius: 999px; }
.plan .for { color: var(--muted); font-size: 0.93rem; }
.price { display: grid; gap: 2px; min-height: 76px; align-content: start; }
.price .amount { font-size: 2.4rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.price .amount small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.price .billed { color: var(--muted); font-size: 0.88rem; }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 0.94rem; }
.plan li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; }
.plan li::before { content: "✓"; color: var(--grade-a); font-weight: 700; }
.plan .btn { margin-top: auto; }

/* Annual prices are the default; monthly prices show when Monthly is picked. */
.when-monthly { display: none; }
body:has(#billing-monthly:checked) .when-monthly { display: grid; }
body:has(#billing-monthly:checked) .when-annual { display: none; }

.fine { display: grid; gap: 8px; margin-top: 28px; padding: 20px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.fine ul { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; color: var(--muted); font-size: 0.94rem; }

/* Legal pages */
.legal { max-width: 760px; padding: 56px 20px 72px; margin: 0 auto; }
.legal h1 { font-size: 2.1rem; margin-bottom: 8px; }
.legal h2 { font-size: 1.2rem; margin: 36px 0 10px; }
.legal p, .legal li { color: var(--ink); }
.legal p + p { margin-top: 10px; }
.legal ul { padding-left: 1.2em; display: grid; gap: 6px; margin: 10px 0; }
.legal table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.94rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.legal th { background: var(--surface-2); font-weight: 600; }
.table-scroll { overflow-x: auto; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 48px; font-size: 0.86rem; color: var(--muted); }
.site-footer .wrap { display: grid; gap: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer nav a { color: var(--ink); text-decoration: none; }
.site-footer address { font-style: normal; line-height: 1.7; }

@media (max-width: 860px) {
  .hero .wrap, .grid-2, .grid-3, .steps, .plans { grid-template-columns: 1fr; }
  .hero { padding-top: 48px; }
  .nav .hide-sm { display: none; }
  .nav { gap: 14px; }
  .site-header .wrap { gap: 12px; }
}

/* Landing islands (hero/ → public/assets). The hero stacks: copy centered
   over the animated pull request. */
.hero--stacked .wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; gap: 44px; }
.hero--stacked .lead { margin-inline: auto; }
.hero--stacked .actions { justify-content: center; }
.island { width: 100%; min-width: 0; }
#mg-hero-demo:not([data-island]) { display: flex; justify-content: center; }
#mg-hero-demo:not([data-island]) .pr-card { max-width: 560px; text-align: left; }

.legal .notice{margin:12px 0 0;padding:10px 14px;border-radius:10px;border:1px solid var(--line);background:var(--surface)}
