/* alapdf.com marketing site. Colours come from tokens.css only. System fonts: nothing loads
   from anywhere else. Layout: one centred column (--wrap) with full-bleed bands. */

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light dark; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

:root { --wrap: 1120px; --gutter: 16px; --radius: 18px; }
@media (min-width: 720px) { :root { --gutter: 32px; } }

.wrap { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

a { color: var(--link); text-underline-offset: 0.18em; }
a:focus-visible, button:focus-visible, .button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
  border-radius: 6px;
}
img { max-width: 100%; height: auto; display: block; }
code, kbd, .ext { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace; }
.small code { overflow-wrap: anywhere; }

h1, h2, h3 { line-height: 1.15; text-wrap: balance; letter-spacing: -0.015em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.1rem, 4.2vw, 3rem); font-weight: 750; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); font-weight: 720; }
h3 { font-size: 1.15rem; font-weight: 680; letter-spacing: 0; }
p { margin: 0 0 1em; }
.lead { font-size: clamp(1.08rem, 1.6vw, 1.25rem); color: var(--text-muted); max-width: 38em; }
.muted { color: var(--text-muted); }
.small { font-size: 0.9rem; }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.skip { position: absolute; left: -999px; top: 8px; background: var(--bg); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.wordmark { font-size: 1.3rem; font-weight: 500; letter-spacing: -0.01em; }
.wordmark b { font-weight: 800; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-size: 0.97rem; }
.nav a:hover { background: var(--surface); }
.nav a[aria-current="page"] { font-weight: 650; box-shadow: inset 0 -2px 0 var(--link); border-radius: 0; }
.nav .lang { color: var(--text-muted); }
/* The appearance switch (site.js): Match my computer / Light / Dark. */
.theme { display: inline-flex; gap: 2px; padding: 2px; margin: 0 4px; border: 1px solid var(--line); border-radius: 10px; }
.theme button {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); cursor: pointer;
}
.theme button:hover { color: var(--text); background: var(--surface); }
.theme button[aria-pressed="true"] { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.nav .button { margin-left: 8px; padding: 8px 16px; }
.menu-toggle { display: none; }
@media (max-width: 860px) {
  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
    background: none;
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 10px;
    padding: 8px 12px;
    font: inherit;
    cursor: pointer;
  }
  .nav { display: none; }
  .nav.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    padding: 8px var(--gutter) 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .nav.open .button { margin: 8px 0 0; text-align: center; }
  .nav.open .theme { align-self: flex-start; margin: 8px 0; }
}

/* Buttons */
.button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--accent-fill);
  color: var(--on-accent);
  font-weight: 650;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.button small { font-weight: 450; font-size: 0.78rem; opacity: 0.85; }
.button.secondary { background: var(--paper-shade); color: var(--ink); }
.button.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 1.5rem 0; }

/* Sections */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section.alt { background: var(--surface); }
.section-head { max-width: 46em; margin-bottom: 2.5rem; }
.section-head.center { text-align: center; margin-left: auto; margin-right: auto; }
.section-head.center .lead { margin: 0 auto; }

/* The Neapolitan rule: the three flavours, once per page, strawberry→vanilla→chocolate. */
.flavours { height: 4px; background: linear-gradient(90deg, var(--strawberry) 0 33.3%, var(--vanilla) 0 66.6%, var(--chocolate) 0); }

/* Hero */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(48px, 7vw, 96px); }
.hero .wrap { display: grid; gap: 48px; align-items: center; }
@media (min-width: 960px) { .hero .wrap { grid-template-columns: 1fr 1.1fr; } }
.hero h1 { margin-bottom: 0.4em; }
.trust { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--text-muted); font-size: 0.93rem; }
.trust li::before { content: "✓"; color: var(--link); font-weight: 700; margin-right: 6px; }

/* Screenshot frames */
.shot {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--raised);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.shot img { width: 100%; }
.hero .shot { transform: rotate(0.4deg); }
figure.captioned { margin: 0; }
figure.captioned figcaption { margin-top: 14px; color: var(--text-muted); font-size: 0.95rem; }
figure.captioned figcaption b { color: var(--text); }

/* Grids and cards */
.grid { display: grid; gap: 20px; }
@media (min-width: 640px) { .grid.two, .grid.three { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid.three { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.section.alt .card { background: var(--bg); }
.card h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-fill);
  color: var(--ink);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}
.icon svg { width: 22px; height: 22px; }
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { position: relative; padding-left: 1.4em; margin: 0.35em 0; }
.ticks li::before { content: ""; position: absolute; left: 0.2em; top: 0.62em; width: 7px; height: 7px; border-radius: 50%; background: var(--link); }

/* Steps */
.steps { counter-reset: step; }
.step-num {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-fill);
  color: var(--ink);
  font-weight: 750;
  font-size: 0.9rem;
  margin-right: 8px;
}

/* Split rows: text beside a screenshot */
.split { display: grid; gap: 40px; align-items: center; }
.split + .split { margin-top: clamp(56px, 8vw, 96px); }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1.25fr; }
  .split.flip > :first-child { order: 2; }
}

/* Formats */
.exts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.ext { font-size: 0.82rem; padding: 3px 9px; border-radius: 7px; background: var(--surface); border: 1px solid var(--line); }
.section.alt .ext { background: var(--raised); }
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  vertical-align: middle;
}
/* "Coming soon": for features still under [Unreleased] in CHANGELOG.md (README.md). */
.badge-soon { background: var(--vanilla); color: var(--ink); }
.format-teaser { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.format-teaser .pill { padding: 8px 16px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); font-weight: 600; font-size: 0.95rem; }
.lang-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.lang-table th, .lang-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.lang-table th { font-weight: 650; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--raised); }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; padding: 0; list-style: none; }
.toc a { display: inline-block; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: 0.93rem; }
.toc a:hover { background: var(--surface); }
[id] { scroll-margin-top: 84px; }

/* Privacy band and CTA */
.band { background: var(--accent-fill); color: var(--ink); }
.band a { color: var(--ink); }
.band .lead { color: var(--ink); }
.band .card { background: var(--paper); color: var(--ink); border-color: transparent; }
.cta { text-align: center; }
.cta .actions { justify-content: center; }
.cta img { margin: 0 auto 20px; width: 72px; }
.note { background: var(--notice-bg); color: var(--notice-text); border-radius: 14px; padding: 16px 20px; }
.note a { color: var(--ink); }
.grid + .note { margin-top: 24px; }
.note > p:only-child { margin: 0; }

/* Download cards */
.dl { display: flex; flex-direction: column; gap: 14px; }
.dl .button { align-self: flex-start; }
.dl.disabled { opacity: 0.85; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 40px 0 48px; font-size: 0.93rem; color: var(--text-muted); }
.foot .wrap { display: grid; gap: 24px; }
@media (min-width: 720px) { .foot .wrap { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin: 6px 0; }
.foot a { color: var(--text-muted); }
.foot a:hover { color: var(--link); }
.foot .brand { margin-bottom: 10px; }
.foot h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 8px; color: var(--text); }

/* Prose pages (privacy, contact) */
.prose { max-width: 44em; }
.prose h2 { font-size: 1.4rem; margin-top: 2em; }
.actions.center { justify-content: center; }
.grid.middle { align-items: center; }
.lead.centered { margin-left: auto; margin-right: auto; }
.shot.crop img { aspect-ratio: 16 / 11; object-fit: cover; object-position: left top; }
.section.alt .button.secondary { background: var(--bg); color: var(--text); border-color: var(--line); }
.h3 { font-size: 1.15rem; font-weight: 680; letter-spacing: 0; }
.cta-logo { margin: 0 auto 20px; }
/* Single-column tracks may shrink below their content's width (phones). */
.hero .wrap, .grid, .split { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .hero .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } }
@media (min-width: 640px) { .grid.two, .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); } }
/* The header's download button keeps the button colours, whatever the nav does. */
.nav a.button, .nav a.button:hover { color: var(--on-accent); background: var(--accent-fill); box-shadow: none; border-radius: 12px; }
.nav a.button[aria-current="page"] { font-weight: 650; }

/* The "No cookies here" note (site.js). Informational only; it stores nothing. */
.nc {
  position: fixed; z-index: 30;
  right: calc(16px + env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: 20rem; display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 10px 12px 16px; border-radius: 16px;
  font-size: 0.85rem; line-height: 1.5; color: var(--text-muted);
  background: var(--raised); border: 1px solid var(--line); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.nc.show { opacity: 1; transform: none; }
.nc p { margin: 0; }
.nc strong { color: var(--text); font-weight: 700; }
.nc a { white-space: nowrap; }
.nc button {
  flex: none; margin: -4px -2px 0 0; width: 28px; height: 28px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-muted); font: 400 20px/1 sans-serif; cursor: pointer;
}
.nc button:hover { color: var(--text); background: var(--line); }
@media (max-width: 30rem) { .nc { left: calc(16px + env(safe-area-inset-left)); max-width: none; } }
@media (prefers-reduced-motion: reduce) { .nc { transition: none; transform: none; } }

