/* MarkSave: ArticleSave's sibling. Same type and layout grammar; colour = PDF red merging into Markdown blue. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --subtle: #f6f7f9;
  --ink: #0f1419;
  --ink-2: #566170;
  --line: #eceff3;
  --line-2: #cfd6de;
  --pdf: #e5252a;
  --md: #2f5ae0;
  --merge: #8a3fc8;
  --grad: linear-gradient(100deg, var(--pdf), var(--merge) 50%, var(--md));
  --grad-soft: linear-gradient(100deg, color-mix(in srgb, var(--pdf) 9%, var(--bg)), color-mix(in srgb, var(--md) 9%, var(--bg)));
  --btn: #0f1419;
  --btn-ink: #ffffff;
  --error: #e5252a;
  --ok: #12a26b;
  --shadow-lg: 0 1px 2px rgba(15, 20, 25, .04), 0 12px 40px -12px rgba(15, 20, 25, .18);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #0b0c0e;
    --subtle: #15171b;
    --ink: #e8eaed;
    --ink-2: #8a929c;
    --line: #262a30;
    --line-2: #3a3f46;
    --pdf: #ff5257;
    --md: #6f8dff;
    --merge: #b46cf0;
    --btn: #eef0f3;
    --btn-ink: #0f1419;
    --shadow-lg: 0 0 0 1px #262a30;
  }
}
@supports (background: linear-gradient(in oklch, red, blue)) {
  :root { --grad: linear-gradient(100deg in oklch, var(--pdf), var(--md)); }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
b, strong { font-weight: 700; }
a { color: inherit; }
.page { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); font-weight: 500; }

/* Touch vs pointer copy */
.when-coarse { display: none; }
@media (pointer: coarse) { .when-fine { display: none !important; } .when-coarse { display: inline; } }

/* Nav */
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(16px, env(safe-area-inset-top)) 0 16px;
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.mark svg { width: 32px; height: 32px; display: block; }
.mark stop:first-child { stop-color: var(--pdf); }
.mark stop:last-child { stop-color: var(--md); }
.mark-page { fill: #fff; }
.mark-glyph { fill: none; stroke: #0f1419; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-cta, .sibling-pill {
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px;
  padding: 8px 16px; border: 1px solid var(--line-2); border-radius: 999px;
}
.nav-cta:hover, .sibling-pill:hover { background: var(--subtle); }
.sibling-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; color: var(--ink-2); }
.sibling-pill:hover { color: var(--ink); }
/* ArticleSave's own mark, in its own monochrome */
.mini-mark svg, .sibling-mark svg { display: block; }
.mini-mark svg { width: 22px; height: 22px; }
.mini-mark rect, .sibling-mark rect { fill: var(--ink); }
.mini-mark .mark-page, .sibling-mark .mark-page { fill: var(--bg); }
.mark-arrow { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 479px) { .sibling-label { display: none; } .sibling-pill { padding: 6px; } .nav-cta { padding: 8px 14px; } }

/* Hero */
.hero { display: grid; gap: 48px; align-items: center; padding: 40px 0 64px; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.12fr .88fr; padding: 64px 0 88px; gap: 56px; } }
.hero-copy { min-width: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 20px;
  padding: 6px 12px 6px 10px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-2); font-size: 13px; font-weight: 600;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--merge) 20%, transparent); }
h1 {
  font-size: clamp(40px, 6.2vw, 62px); line-height: 1.03; letter-spacing: -.045em; font-weight: 800;
  margin: 0 0 18px;
}
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .06em; }
@media (min-width: 600px) { .nw { white-space: nowrap; } }
.lede { color: var(--ink-2); font-size: clamp(17px, 2.2vw, 19px); line-height: 1.5; margin: 0 0 28px; max-width: 32em; }

/* Drop zone: gradient border via two backgrounds */
.drop {
  position: relative; display: grid; justify-items: center; text-align: center; gap: 6px;
  max-width: 560px; padding: 28px 20px 24px; border-radius: 24px; cursor: pointer;
  border: 1.5px dashed var(--line-2); background: var(--subtle);
  transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
  outline: none;
}
.drop:hover { border-color: color-mix(in srgb, var(--merge) 55%, var(--line-2)); }
.drop:focus-visible { box-shadow: 0 0 0 4px color-mix(in srgb, var(--md) 22%, transparent); border-color: var(--md); }
.drop.over {
  border: 1.5px solid transparent; transform: scale(1.01);
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box;
}
.drop-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 6px; border-radius: 14px; background: var(--grad); }
.drop-icon svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.drop-title { font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.drop-hint { color: var(--ink-2); font-size: 15px; }
.drop-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }

.toggle { display: inline-flex; align-items: center; gap: 10px; margin: 16px 4px 0; font-size: 15px; font-weight: 600; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; flex: none; width: 40px; height: 24px; border-radius: 999px; background: var(--line-2); transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s; }
.toggle input:checked + .switch { background: var(--grad); }
.toggle input:checked + .switch::after { transform: translateX(16px); }
.toggle input:focus-visible + .switch { box-shadow: 0 0 0 3px color-mix(in srgb, var(--md) 30%, transparent); }

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 56px; padding: 0 28px; border-radius: 999px;
  font: inherit; font-size: 17px; font-weight: 700; letter-spacing: -.01em;
  text-decoration: none; cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  transition: transform .08s, opacity .15s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn-sm { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-xs { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-primary { background: var(--btn); color: var(--btn-ink); }
.btn-primary:hover { opacity: .88; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-outline:hover { background: var(--subtle); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { color: var(--ink); background: var(--subtle); }
.spinner {
  display: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2.2px solid color-mix(in srgb, var(--btn-ink) 30%, transparent); border-top-color: var(--btn-ink);
  animation: spin .7s linear infinite;
}
.btn.busy { pointer-events: none; }
.btn.busy .btn-label { opacity: .7; }
.btn.busy .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.status { min-height: 1.5em; margin: 12px 4px 0; color: var(--ink-2); font-size: 15px; font-weight: 500; }
.status.error { color: var(--error); }

/* Hero visual: a PDF page and its Markdown, fanned like ArticleSave's two phones */
.hero-visual { position: relative; display: flex; justify-content: center; align-items: flex-start; padding: 8px 0 36px; min-height: 400px; max-width: 100%; }
.sheet { margin: 0; position: relative; width: min(47%, 250px); min-width: 0; }
.sheet-body {
  position: relative; display: flex; flex-direction: column; gap: 7px; overflow: hidden;
  aspect-ratio: 210 / 297; padding: 34px 18px 18px; border-radius: 16px;
  background: #fff; border: 1px solid #e4e7eb;
  box-shadow: 0 2px 4px rgba(15,20,25,.06), 0 30px 60px -24px rgba(15,20,25,.4);
}
@media (prefers-color-scheme: dark) { .sheet-body { border-color: #2a2e34; } }
.sheet-tag {
  position: absolute; top: 10px; left: 12px; padding: 2px 7px; border-radius: 5px;
  color: #fff; font: 800 10px/1.4 Inter, sans-serif; letter-spacing: .06em;
}
.tag-pdf { background: var(--pdf); }
.tag-md { background: var(--md); }
.bar { display: block; height: 6px; border-radius: 3px; background: #e6e9ed; }
.bar.short { width: 55%; }
.bar.mid { width: 78%; }
.bar.gap { margin-top: 6px; }
.bar-title { height: 11px; background: #1f252c; width: 92%; }
.bar-title.short { width: 60%; margin-bottom: 4px; }
.bar-img { display: block; height: 30%; border-radius: 8px; margin: 4px 0; background: linear-gradient(135deg, color-mix(in srgb, var(--pdf) 22%, #fff), color-mix(in srgb, var(--pdf) 8%, #fff)); }
.sheet-foot { margin-top: auto; align-self: center; color: #a3abb5; font-size: 9px; font-weight: 600; text-decoration: line-through; text-decoration-color: var(--pdf); }
.sheet-body.mono { gap: 0; background: #fbfcff; }
.sheet-body.mono code { display: block; font: 500 clamp(9px, 1.05vw, 11.5px)/1.75 var(--mono); color: #1f252c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-body.mono code.dim { color: #8a93a0; }
.tk-h { color: var(--md); font-weight: 700; }
.tk-li { color: var(--merge); font-weight: 700; }
.tk-fence { color: #8a93a0; font-weight: 700; }
.sheet-pdf { transform: rotate(-5deg) translate(14px, 18px); z-index: 1; }
.sheet-md { transform: rotate(4deg) translate(-14px, -4px); z-index: 2; }
.sheet figcaption { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; font-size: 14px; font-weight: 700; }
.step-dot { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--btn); color: var(--btn-ink); font-size: 12px; font-weight: 800; }
.float-chip {
  position: absolute; z-index: 3; right: 4%; bottom: 22%;
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px 9px 10px; border-radius: 999px;
  background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 700;
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.float-chip svg { width: 18px; height: 18px; fill: none; stroke: var(--ok); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: no-preference) {
  .sheet-md { animation: float 6s ease-in-out infinite; }
  .float-chip { animation: float 6s ease-in-out -3s infinite; }
  @keyframes float { 50% { translate: 0 -8px; } }
}
@media (max-width: 899px) { .hero-visual { margin-top: 8px; min-height: 0; } }

/* Queue */
.queue-section { padding: 8px 0 56px; }
.queue-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.queue-head h2 { margin: 0; }
.queue-summary { color: var(--ink-2); font-size: 15px; margin-top: 4px; }
.queue-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.queue-actions .btn { height: 48px; font-size: 16px; padding: 0 22px; }
@media (max-width: 559px) {
  .queue-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .queue-actions #zip { grid-column: 1 / -1; }
}
.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 14px;
  padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface);
  box-shadow: var(--shadow-lg); animation: rise .35s cubic-bezier(.2, .8, .2, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.md-badge {
  display: grid; place-items: center; width: 44px; height: 52px; border-radius: 8px;
  background: var(--subtle); color: var(--ink-2); font-size: 12px; font-weight: 800; letter-spacing: .04em;
  transition: background .3s, color .3s;
}
.row.done .md-badge { background: var(--md); color: #fff; }
.row.working .md-badge { background: var(--grad); color: #fff; }
.row.failed .md-badge { background: color-mix(in srgb, var(--error) 14%, var(--surface)); color: var(--error); }
.row-main { min-width: 0; display: grid; gap: 8px; padding-top: 2px; }
.row-top { display: grid; min-width: 0; }
.row-name { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { color: var(--ink-2); font-size: 13px; }
.row.failed .row-meta { color: var(--error); }
.progress { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 2px; transition: width .25s; }
.row.done .progress, .row.failed .progress { display: none; }
.row-actions { display: flex; gap: 6px; align-self: center; }
@media (max-width: 559px) {
  .row { grid-template-columns: auto 1fr; }
  .row-actions { grid-column: 1 / -1; }
  .row-actions .btn { flex: 1; }
}
.preview summary { cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 600; width: max-content; }
.preview summary:hover { color: var(--ink); }
.preview pre {
  margin: 8px 0 0; max-height: 320px; overflow: auto; padding: 14px; border-radius: 12px;
  background: var(--subtle); font: 500 12.5px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word;
}

/* Sections */
section.steps, section.features, section.sibling, section.faq { padding: 64px 0; border-top: 1px solid var(--line); }
h2 { font-size: clamp(26px, 4vw, 34px); letter-spacing: -.035em; line-height: 1.15; font-weight: 800; margin: 0 0 28px; }
h3 { font-size: 17px; letter-spacing: -.01em; margin: 0 0 6px; font-weight: 700; }
p { margin: 0; }

.step-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .step-grid { grid-template-columns: repeat(3, 1fr); } }
.step { padding: 22px; border-radius: 20px; background: var(--subtle); }
.step p { color: var(--ink-2); font-size: 15px; }
.step b { color: var(--ink); }
.num {
  display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 16px; border-radius: 50%;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 15px;
}

.features { display: grid; gap: 28px 32px; }
@media (min-width: 640px) { .features { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .features { grid-template-columns: repeat(4, 1fr); } }
.feature p { color: var(--ink-2); font-size: 15px; }
.feature b { color: var(--ink); }
.ficon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px; border-radius: 12px; border: 1px solid var(--line); }
.ficon svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.feature:nth-child(1) .ficon svg { stroke: var(--pdf); }
.feature:nth-child(2) .ficon svg { stroke: color-mix(in srgb, var(--pdf) 60%, var(--merge)); }
.feature:nth-child(3) .ficon svg { stroke: color-mix(in srgb, var(--md) 60%, var(--merge)); }
.feature:nth-child(4) .ficon svg { stroke: var(--md); }

.sibling-card {
  display: grid; gap: 20px; align-items: center; padding: 28px; border-radius: 24px;
  background: var(--subtle); border: 1px solid var(--line);
}
@media (min-width: 760px) { .sibling-card { grid-template-columns: auto 1fr auto; gap: 28px; padding: 32px; } }
.sibling-mark svg { width: 56px; height: 56px; }
.sibling-kicker { color: var(--ink-2); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.sibling-copy h2 { font-size: clamp(22px, 3vw, 26px); margin: 0 0 8px; }
.sibling-copy p:last-child { color: var(--ink-2); max-width: 36em; }
.sibling-btn { height: 48px; font-size: 16px; justify-self: start; }

.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
  padding: 18px 0; cursor: pointer; list-style: none; font-weight: 700; font-size: 17px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-right: 4px;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg) translateY(-3px);
  transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.faq details p { padding: 0 0 18px; color: var(--ink-2); font-size: 16px; max-width: 40em; }
.faq details b { color: var(--ink); }

.foot {
  display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between;
  padding: 28px 0 max(36px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
  color: var(--ink-2); font-size: 13px;
}
.foot a { color: var(--ink); font-weight: 600; }
.brand.small { font-size: 15px; gap: 8px; }
.brand.small .mark svg { width: 24px; height: 24px; }
