/* MacDown2.0 landing page. Flat on purpose: warm white, hairlines, one blue accent, no shadows, no blur. */

:root {
  --bg: #fbfbfa;
  --bg2: #f2f2f0;
  --ink: #16171a;
  --ink2: #5d6068;
  --ink3: #6b6e76;
  --line: #e3e3e0;
  --acc: #2f6fdd;
  --acc: oklch(0.56 0.17 255);
  --acc-ink: #ffffff;
  --code: #16171a;
  --code-ink: #e9e9e6;
  --code-dim: #8b8e95;
  --code-line: #2a2c30;
  --code-fn: #8fb4f5;
  --code-fn: oklch(0.78 0.11 255);
  --shot: #e9e9e6;
  --bar-old: #c4c5c9;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f11;
    --bg2: #17181b;
    --ink: #ededea;
    --ink2: #a3a5ab;
    --ink3: #8a8d94;
    --line: #26282c;
    --acc: #5b9bff;
    --acc: oklch(0.66 0.15 255);
    --acc-ink: #0b0c0e;
    --code: #17181b;
    --shot: #1d1e21;
    --bar-old: #43464c;
    color-scheme: dark;
  }
}

html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; }
*, *::before, *::after { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Geist", -apple-system, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--acc); }
a.u { color: var(--acc); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.mono { font-family: "Geist Mono", ui-monospace, Menlo, monospace; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 4px; }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 10; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.skip:focus { top: 12px; color: var(--bg); }

.wrap { max-width: 1200px; margin: 0 auto; padding-left: 40px; padding-right: 40px; }

/* nav */
.nav { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.navin { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.brand img { width: 26px; height: 26px; }
.links { display: flex; gap: 28px; font-size: 14px; }
.links a { color: var(--ink2); }
.links a:hover { color: var(--ink); }
.right { display: flex; align-items: center; gap: 12px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg a { display: flex; align-items: center; font-size: 12px; padding: 6px 11px; min-height: 30px; color: var(--ink2); }
.seg a:hover { color: var(--ink); }
.seg a[aria-current] { background: var(--ink); color: var(--bg); }
.seg a:focus-visible { outline-offset: -3px; }

.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 8px; font-weight: 500; font-size: 14px; padding: 0 16px; height: 36px; cursor: pointer; }
.btn.pri { background: var(--acc); color: var(--acc-ink); }
.btn.pri:hover { color: var(--acc-ink); filter: brightness(1.08); }
.btn.big { height: 48px; padding: 0 22px; font-size: 16px; border-radius: 10px; }

/* hero */
.hero { text-align: center; padding-top: 96px; padding-bottom: 56px; }
.hero .icon { width: 120px; height: 120px; display: block; margin: 0 auto 32px; }
.eyebrow { font-size: 13px; color: var(--ink3); letter-spacing: 0.02em; margin-bottom: 20px; }
.eyebrow b { color: var(--acc); font-weight: 500; }
h1.t { font-size: 80px; line-height: 1; letter-spacing: -0.045em; font-weight: 700; margin: 0; text-wrap: balance; }
h1.t span { color: var(--ink3); }
.lead { font-size: 20px; line-height: 1.5; color: var(--ink2); max-width: 640px; margin: 28px auto 0; text-wrap: pretty; }
.ctas { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 40px; flex-wrap: wrap; }
.brew { display: flex; align-items: stretch; min-height: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); font-size: 14px; overflow: hidden; text-align: left; }
.brew code { padding: 0 16px; display: flex; align-items: center; white-space: nowrap; font: inherit; }
.brew code i { font-style: normal; color: var(--ink3); margin-right: 0.6ch; }
.copy { appearance: none; border: 0; background: none; font: inherit; cursor: pointer; padding: 0 14px; border-left: 1px solid var(--line); font-size: 12px; color: var(--ink2); font-family: "Geist Mono", ui-monospace, monospace; min-width: 60px; text-align: center; }
.copy:hover { color: var(--ink); background: var(--line); }
.copy:focus-visible { outline-offset: -3px; }
.copy .ok { display: none; color: var(--acc); }
.copy.done .idle { display: none; }
.copy.done .ok { display: inline; }
.meta { margin-top: 22px; font-size: 13px; color: var(--ink3); display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.shot { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--shot); }
.shot picture { display: block; }
.shot img { display: block; width: 100%; height: auto; }
.heroshot { max-width: 1200px; margin: 0 auto; padding: 0 40px; }

/* headline numbers */
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 96px; }
.metric { padding: 40px 32px; border-right: 1px solid var(--line); }
.metric:first-child { padding-left: 0; }
.metric:last-child { border-right: 0; }
.metric .n { font-size: 56px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.metric .n small { font-size: 24px; color: var(--ink3); font-weight: 500; letter-spacing: -0.02em; }
.metric .l { margin-top: 12px; font-size: 15px; color: var(--ink2); line-height: 1.45; }

/* sections */
.sec { padding-top: 120px; }
.kicker { font-size: 13px; color: var(--acc); font-weight: 500; margin-bottom: 16px; }
h2.s { font-size: 52px; letter-spacing: -0.04em; line-height: 1.05; margin: 0; font-weight: 700; max-width: 760px; text-wrap: balance; }
.sub { font-size: 18px; color: var(--ink2); line-height: 1.55; max-width: 600px; margin: 20px 0 0; text-wrap: pretty; }
.sub.flush { margin: 0 0 20px; }

.spec { margin-top: 56px; border-top: 1px solid var(--ink); }
.row { display: grid; grid-template-columns: 300px minmax(0, 1fr) 180px; gap: 32px; padding: 26px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.row .k { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.row .d { font-size: 16px; color: var(--ink2); line-height: 1.55; }
.row .v { font-size: 13px; color: var(--ink3); text-align: right; }

/* performance table */
.perf { width: 100%; margin-top: 56px; border-collapse: collapse; border-top: 1px solid var(--ink); table-layout: fixed; }
.perf th, .perf td { text-align: left; font-weight: 400; padding: 22px 16px 22px 0; border-bottom: 1px solid var(--line); vertical-align: bottom; }
.perf thead th { font-size: 13px; color: var(--ink3); padding-top: 14px; padding-bottom: 14px; }
.perf tbody th { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; width: 26%; vertical-align: middle; }
.perf td b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.perf td i { display: block; height: 6px; border-radius: 3px; width: var(--w); min-width: 3px; }
.perf td.new b { color: var(--acc); }
.perf td.new i { background: var(--acc); }
.perf td.old b { color: var(--ink2); }
.perf td.old i { background: var(--bar-old); }
.perf .x { width: 11%; text-align: right; padding-right: 0; font-variant-numeric: tabular-nums; vertical-align: middle; }
.perf td.x { font-size: 18px; font-weight: 600; }
.foot-note { max-width: 820px; margin-top: 24px; }

/* feature grid */
.grid { margin-top: 56px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cell { padding: 28px 24px 32px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 200px; }
.glyph { font-family: "Geist Mono", ui-monospace, monospace; font-size: 15px; color: var(--acc); height: 28px; display: flex; align-items: center; }
.cell h3 { font-size: 17px; margin: 20px 0 8px; letter-spacing: -0.01em; font-weight: 600; }
.cell p { font-size: 14px; line-height: 1.55; color: var(--ink2); margin: 0; text-wrap: pretty; }

/* workspace */
.ws { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; }
.wshead { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; align-items: end; }
.keys { display: flex; flex-wrap: wrap; gap: 8px; }
.kbd { font-family: "Geist Mono", ui-monospace, monospace; font-size: 13px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; color: var(--ink2); background: var(--bg2); }

/* command line */
.cli { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 56px; align-items: start; }
.term { background: var(--code); color: var(--code-ink); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.termbar { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 6px 18px; border-bottom: 1px solid var(--code-line); font-size: 12px; color: var(--code-dim); }
.termbar .copy { border: 0; color: #b4b6bc; min-height: 32px; border-radius: 6px; }
.termbar .copy:hover { background: transparent; color: #fff; }
.termbar .copy .ok { color: var(--code-fn); }
.lines { padding: 20px 22px 24px; font-family: "Geist Mono", ui-monospace, monospace; font-size: 14px; line-height: 2; overflow-x: auto; }
.ln { display: flex; justify-content: space-between; gap: 24px; white-space: nowrap; }
.term i { font-style: normal; }
.term .p, .term .c { color: var(--code-dim); }
.term .f { color: var(--code-fn); }

/* download band */
.band { margin-top: 140px; border-top: 1px solid var(--line); padding: 96px 0; text-align: center; }
.band h2 { font-size: 44px; letter-spacing: -0.035em; margin: 0; font-weight: 700; }
.note { font-size: 13px; color: var(--ink3); margin: 20px auto 0; line-height: 1.6; max-width: 640px; text-wrap: pretty; }
.foot-note { text-align: left; margin-left: 0; }

.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 13px; color: var(--ink3); }
.footin { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot a { color: var(--ink2); }
.foot a:hover { color: var(--acc); }
.foot .fl { display: flex; gap: 20px; flex-wrap: wrap; }

/* Chinese: no tight tracking, a little more air */
html[lang^="zh"] h1.t { font-size: 68px; letter-spacing: -0.01em; line-height: 1.12; }
html[lang^="zh"] h2.s, html[lang^="zh"] .band h2, html[lang^="zh"] .metric .n, html[lang^="zh"] .row .k { letter-spacing: 0; }
html[lang^="zh"] h2.s { line-height: 1.2; }
html[lang^="zh"] h1.t { word-break: keep-all; overflow-wrap: anywhere; }
html[lang^="zh"] .lead, html[lang^="zh"] .sub, html[lang^="zh"] .cell p, html[lang^="zh"] .row .d, html[lang^="zh"] .note { line-height: 1.7; }

@media (max-width: 860px) {
  html { scroll-padding-top: 68px; }
  .wrap, .heroshot { padding-left: 20px; padding-right: 20px; }
  .links, .navdl { display: none; }
  .hero { padding-top: 64px; padding-bottom: 40px; }
  .hero .icon { width: 88px; height: 88px; margin-bottom: 24px; }
  h1.t { font-size: 40px; letter-spacing: -0.04em; }
  html[lang^="zh"] h1.t { font-size: 38px; letter-spacing: 0; }
  .lead { font-size: 17px; }
  .ctas { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
  .btn.big { justify-content: center; }
  .brew { justify-content: space-between; min-width: 0; }
  .brew code { font-size: 12px; padding: 12px; white-space: normal; overflow-wrap: anywhere; min-width: 0; }
  .shot { border-radius: 10px; }
  .metrics { grid-template-columns: minmax(0, 1fr); margin-top: 56px; }
  .metric, .metric:first-child { border-right: 0; border-bottom: 1px solid var(--line); padding: 28px 0; }
  .metric:last-child { border-bottom: 0; }
  .metric .n { font-size: 44px; }
  .metric .n small { font-size: 20px; }
  .sec { padding-top: 80px; }
  h2.s, html[lang^="zh"] h2.s { font-size: 34px; }
  .sub { font-size: 16px; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 20px 0; }
  .row .v { text-align: left; }
  .perf { margin-top: 40px; }
  .perf th, .perf td { padding: 16px 10px 16px 0; }
  .perf tbody th { font-size: 14px; width: 28%; }
  .perf td b { font-size: 15px; margin-bottom: 8px; }
  .perf td.x { font-size: 14px; }
  .perf thead th { font-size: 11px; }
  .perf .x { width: 15%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell { min-height: 0; padding: 20px 16px 24px; }
  .wshead, .cli { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .lines { font-size: 12px; }
  .ln .c { display: none; }
  .band { margin-top: 80px; padding: 64px 0; }
  .band h2 { font-size: 30px; }
  .foot-note { margin-top: 20px; }
}

@media (max-width: 380px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .perf td b { font-size: 13px; }
}
