/* PDF Sign & Fill · pdfsign.bytehavenstudios.com
   One stylesheet for every page. Shell and class vocabulary cloned from ntfsforge-web (itself from
   driveforge-web), then re-dressed in the app's own default look, the "Paper" palette: warm paper ground,
   slate for headings and the brand, ink blue for the one action, IBM Plex Sans (the face the app ships).
   Every colour below is a token from the app, never invented:
   apps/pdfsign/app/src/main/kotlin/.../ui/theme/Palette.kt → Paper (light + dark), and launchkit.yml → brand:.
   Neutrals (cards, hairlines) are color-mix()es of those tokens, not new colours.
   Light and dark both follow the system, as the app does. AA checked: every text pair below is >= 4.5:1.
   No JavaScript anywhere on this host (CSP script-src 'none'); everything below is CSS-only. */

/* ---------- font (self-hosted, OFL, the variable IBM Plex Sans from the app's res/font) ---------- */
@font-face { font-family: "IBM Plex Sans"; font-weight: 100 700; font-style: normal; font-display: swap;
  src: url("/assets/fonts/IBMPlexSans-Var.woff2") format("woff2"); }

/* ---------- tokens (Palette.kt → Paper) ---------- */
:root {
  --ground: #FBF8F3;        /* light.background, "Paper" */
  --card: #FFFFFF;          /* page white, the document itself */
  --heading: #1F3A5F;       /* light.primary, Slate (also ic_launcher_background) */
  --text: #1B1C1E;          /* light.ink */
  --body: #1B1C1E;
  --muted: #4A4740;         /* light.muted, 8.7:1 on paper */
  --accent: #2F6FD6;        /* light.accent, InkBlue: the one action (4.5:1 on paper) */
  --on-accent: #FFFFFF;
  --tint: #8A6A3A;          /* light.tint, warm label colour (4.7:1 on paper) */
  --fold: #D8CFC0;          /* the icon's page fold */
  --border: color-mix(in oklab, var(--text) 12%, var(--ground));
  --hairline: color-mix(in oklab, var(--text) 8%, var(--ground));
  --wash: color-mix(in oklab, var(--accent) 7%, var(--ground));
  --shadow: 0 1px 2px rgba(27,28,30,0.06), 0 18px 48px rgba(31,58,95,0.12);
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --w: 68rem;               /* page column */
  --w-text: 46rem;          /* long-form column (policy, support) */
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #14171C;      /* dark.background */
    --card: color-mix(in oklab, #E4E2DD 5%, #14171C);
    --heading: #A9C7F0;     /* dark.primary */
    --text: #E4E2DD;        /* dark.ink */
    --body: #E4E2DD;
    --muted: #C4C1BA;       /* dark.muted */
    --accent: #9DBDF5;      /* dark.accent */
    --on-accent: #0B2552;   /* dark.onAccent */
    --tint: #C4C1BA;
    --fold: color-mix(in oklab, #E4E2DD 25%, #14171C);
    --shadow: 0 18px 48px rgba(0,0,0,0.45);
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--ground); }
body {
  margin: 0;
  font: 400 1.0625rem/1.65 var(--sans);
  color: var(--body);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { color: var(--heading); line-height: 1.14; text-wrap: balance; margin: 0 0 0.6em; font-weight: 600; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--heading); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; height: auto; display: block; }
strong { font-weight: 600; color: var(--text); }
code { font-family: var(--mono); font-size: 0.88em; background: var(--wash); padding: 0.1em 0.35em; border-radius: 0.25rem; overflow-wrap: anywhere; }
.skip { position: absolute; left: -999px; top: 0; z-index: 99; background: var(--card); color: var(--text); padding: 0.6rem 1rem; border-radius: 0 0 8px 0; }
.skip:focus { left: 0; }

/* small label, sentence case */
.eyebrow { font-weight: 500; font-size: 0.88rem; color: var(--tint); margin: 0 0 0.7rem; }

/* ---------- header ---------- */
.site-head-wrap { background: color-mix(in oklab, var(--ground) 88%, transparent); border-bottom: 1px solid var(--hairline);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
.site-head { max-width: var(--w); margin: 0 auto; padding: 0.8rem 1.25rem; display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.site-head .brand { display: flex; align-items: center; gap: 0.7rem; color: var(--heading); text-decoration: none; }
.site-head .brand img { width: 36px; height: 36px; border-radius: 9px; }
.site-head .brand b { display: block; font-weight: 600; font-size: 1.12rem; line-height: 1.1; }
.site-head .brand small { display: block; font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.site-head nav { margin-left: auto; display: flex; gap: 1.3rem; flex-wrap: wrap; align-items: center; }
.site-head nav a { font-size: 0.92rem; font-weight: 500; color: var(--muted); text-decoration: none; }
.site-head nav a:hover, .site-head nav a[aria-current="page"] { color: var(--heading); }
.site-head nav .lang-switch { border: 1px solid var(--border); border-radius: 6px; padding: 0.1rem 0.5rem; }

/* ---------- hero ---------- */
.hero { max-width: var(--w); margin: 0 auto; padding: 4rem 1.25rem 3.5rem;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); margin-bottom: 1.1rem; letter-spacing: -0.025em; }
.hero h1 .accent { color: var(--accent); }
.hero .lede { font-size: 1.16rem; max-width: 33em; }

/* the hero phone: the app's own first store screenshot on a sheet of paper with a signing line */
.phone { position: relative; justify-self: center; width: min(300px, 82%); }
.phone::before { content: ""; position: absolute; inset: 6% -18% -4% -14%; z-index: -1; border-radius: 28px;
  background: var(--card); border: 1px solid var(--border); transform: rotate(-4deg); box-shadow: var(--shadow); }
.phone::after { content: ""; position: absolute; left: -8%; right: 22%; bottom: 7%; height: 2px; z-index: -1;
  background: var(--heading); opacity: 0.55; transform: rotate(-4deg); }
.phone img { border-radius: 24px; border: 1px solid var(--border); box-shadow: var(--shadow); }

/* ---------- store badge (DEAD until the listing resolves) ---------- */
.badges { display: flex; gap: 1rem; flex-wrap: wrap; padding: 0; margin: 2rem 0 0; list-style: none; }
.badges li { border: 1px solid var(--border); border-radius: 12px; padding: 0.6rem 1.3rem; background: var(--card);
  display: flex; flex-direction: column; gap: 0.05rem; min-width: 11rem; }
.badges .store { font-weight: 600; color: var(--heading); font-size: 1rem; }
.badges .soon { font-size: 0.82rem; font-weight: 500; color: var(--tint); }

/* ---------- at-a-glance strip ---------- */
.strip-wrap { border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); background: var(--card); }
.strip { max-width: var(--w); margin: 0 auto; padding: 1rem 1.25rem; display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; list-style: none; }
.strip li { font-size: 0.94rem; font-weight: 500; color: var(--text); }
.strip li::before { content: ""; display: inline-block; width: 0.8rem; height: 0.45rem; margin-right: 0.6rem; vertical-align: 0.2em;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }

/* ---------- sections ---------- */
.section { max-width: var(--w); margin: 0 auto; padding: 4.5rem 1.25rem; }
.section > h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); margin-bottom: 0.45em; }
.section .sub { color: var(--muted); max-width: 42em; margin-bottom: 2.2rem; font-size: 1.06rem; }

/* ---------- feature cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.cards.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 1.5rem 1.5rem 1.1rem; position: relative; }
.card h3 { font-size: 1.12rem; display: flex; align-items: center; gap: 0.6rem; }
.card h3 .chip { font-size: 0.78rem; font-weight: 500; border: 1px solid var(--border); color: var(--muted); border-radius: 999px; padding: 0.05rem 0.6rem; }
.card > p { color: var(--muted); font-size: 0.97rem; }
.card ul { list-style: none; margin: 0; padding: 0; font-size: 0.97rem; }
.card li { padding: 0.45rem 0 0.45rem 1.4rem; position: relative; border-top: 1px solid var(--hairline); }
.card li:first-child { border-top: 0; }
.card li::before { content: ""; position: absolute; left: 0.1rem; top: 0.95rem; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
/* the page-fold corner, the icon's own motif */
.card.page::after { content: ""; position: absolute; top: -1px; right: -1px; width: 22px; height: 22px;
  background: linear-gradient(225deg, var(--ground) 50%, var(--fold) 50%); border-bottom-left-radius: 4px; }
.card.pro { border-color: color-mix(in oklab, var(--accent) 45%, var(--ground)); background: var(--wash); }
.card.pro h3 .chip { border-color: var(--accent); color: var(--accent); }

/* ---------- what it is not ---------- */
.note { border-left: 3px solid var(--tint); background: var(--card); border-radius: 0 14px 14px 0; padding: 1.2rem 1.4rem; max-width: 50rem; }
.note p:last-child { margin: 0; }

/* ---------- private + need ---------- */
.panel { border: 1px solid var(--border); border-radius: 22px; padding: 2.4rem; background: var(--card);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; }
.panel h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); }
.panel ul { padding-left: 1.2rem; margin: 0 0 1rem; }
.panel li { margin: 0.35rem 0; }

.outro { text-align: center; padding: 4.5rem 1.25rem 4rem; max-width: var(--w); margin: 0 auto; }
.outro img { width: 88px; margin: 0 auto 1.4rem; border-radius: 22px; box-shadow: var(--shadow); }
.outro h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.outro .badges { justify-content: center; }

/* ---------- long-form documents (support) ---------- */
.doc { max-width: var(--w-text); margin: 0 auto; padding: 3rem 1.25rem 4.5rem; }
.doc h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 0.3em; }
.doc h2 { font-size: 1.25rem; margin-top: 2.4rem; }
.doc ul { padding-left: 1.25rem; }
.doc li { margin: 0.5rem 0; }
.doc .lang { font-size: 0.88rem; color: var(--muted); margin-bottom: 1.6rem; }
.doc .lang a { color: var(--muted); }
.doc .lang [aria-current="page"] { color: var(--heading); }
.doc .contact { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 1.1rem 1.3rem; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--hairline); margin-top: 2rem; background: var(--card); }
.site-foot .inner { max-width: var(--w); margin: 0 auto; padding: 1.6rem 1.25rem 3rem;
  display: flex; gap: 0.6rem 1.6rem; flex-wrap: wrap; align-items: center; font-size: 0.88rem; color: var(--muted); }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--heading); text-decoration: underline; }
.site-foot .studio { margin-right: auto; }
.site-foot .studio img { display: inline-block; width: 18px; height: 18px; vertical-align: -4px; margin-right: 0.5rem; }

/* ---------- screenshots (store captures, captions baked in) ---------- */
.shots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.shots img { display: block; width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--border); background: var(--card); }

/* ---------- narrow screens ---------- */
@media (max-width: 880px) {
  .shots { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .hero { overflow-x: clip; grid-template-columns: 1fr; gap: 2.8rem; padding-top: 2.6rem; }
  .panel { grid-template-columns: 1fr; gap: 2rem; padding: 1.6rem 1.3rem; }
  .section { padding: 3.2rem 1.25rem; }
  .site-head .brand small { display: none; }
}
@media (max-width: 420px) { .site-head nav { gap: 0.9rem; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- policy shell (privacy pages) ----------
   Same structure as ntfsforge-web: hero with the app's own icon, an on-this-page rail, the policy column,
   and the ByteHaven publisher card (the cove mark stays subordinate to the app's glyph). */
.policy { max-width: var(--w); margin: 0 auto; padding: 0 1.25rem 4rem; }
.policy-hero { margin: 2.4rem 0 2.6rem; padding: 2.2rem 2.2rem 1.6rem; border: 1px solid var(--border); border-radius: 22px; overflow: hidden;
  background: radial-gradient(120% 140% at 0% 0%, var(--wash) 0%, transparent 55%), var(--card); }
.policy-back { display: inline-flex; gap: 0.45rem; align-items: center; margin-bottom: 1.6rem; font-size: 0.9rem; font-weight: 500; color: var(--muted); text-decoration: none; }
.policy-back:hover { color: var(--accent); }
.policy-title { display: flex; gap: 1.4rem; align-items: center; }
.policy-icon { width: 72px; height: 72px; border-radius: 18px; flex: none; box-shadow: var(--shadow); }
.policy-eyebrow { font-size: 0.88rem; font-weight: 500; color: var(--tint); margin: 0 0 0.4rem; }
.policy-hero h1 { font-size: clamp(1.8rem, 4.4vw, 2.6rem); margin: 0 0 0.35rem; }
.policy-hero .docmeta { font-size: 0.92rem; color: var(--muted); margin: 0; }
.policy-hero .lang { font-size: 0.88rem; color: var(--muted); margin: 1.6rem 0 0; padding-top: 1.1rem; border-top: 1px solid var(--hairline); }
.policy-hero .lang a { color: var(--muted); }
.policy-hero .lang [aria-current="page"] { color: var(--accent); }
.policy-summary { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.3rem 0 0; padding: 0; list-style: none; }
.policy-summary li { font-size: 0.84rem; font-weight: 500; color: var(--heading); background: var(--wash); border-radius: 999px; padding: 0.2rem 0.75rem; }

.policy-grid { display: grid; grid-template-columns: 14rem minmax(0, var(--w-text)); gap: 3.5rem; justify-content: center; }
.policy-toc { position: sticky; top: 5.5rem; align-self: start; font-size: 0.9rem; }
.policy-toc-h { font-size: 0.82rem; font-weight: 500; color: var(--muted); margin: 0 0 0.8rem; }
.policy-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); counter-reset: toc; }
.policy-toc li { counter-increment: toc; }
.policy-toc a { display: block; padding: 0.32rem 0 0.32rem 1rem; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35; }
.policy-toc a::before { content: counter(toc, decimal-leading-zero) "  "; font-family: var(--mono); font-size: 0.72rem; opacity: 0.75; }
.policy-toc a:hover { color: var(--heading); border-left-color: var(--accent); }

.policy-body.doc { max-width: none; margin: 0; padding: 0; }
.policy-body h2 { scroll-margin-top: 5.5rem; padding-top: 2.2rem; margin-top: 2.2rem; border-top: 1px solid var(--hairline); }
.policy-body h2::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 2px; background: var(--accent); margin-right: 0.7rem; vertical-align: 0.18em; }

.publisher { max-width: calc(14rem + 3.5rem + var(--w-text)); margin: 4rem auto 0; padding: 2rem 2.2rem; border: 1px solid var(--border); border-radius: 22px; background: var(--card); }
.publisher-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.publisher-head h2 { font-size: 1.35rem; margin: 0; scroll-margin-top: 5.5rem; }
.publisher-head img { width: 40px; height: 40px; flex: none; }
.publisher-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 2rem; margin: 1.4rem 0; }
.publisher-facts div { border-left: 2px solid var(--accent); padding-left: 0.9rem; }
.publisher-facts dt { font-size: 0.82rem; font-weight: 500; color: var(--muted); }
.publisher-facts dd { margin: 0.2rem 0 0; }
.publisher-links { display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; margin: 0; font-size: 0.92rem; }
.publisher .policy-eyebrow { color: var(--muted); }

@media (max-width: 900px) {
  .policy-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .policy-toc { position: static; margin-bottom: 1rem; padding: 1.1rem 1.2rem; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
  .policy-toc ol { columns: 2; column-gap: 1.5rem; }
  .policy-hero { padding: 1.6rem 1.3rem 1.3rem; margin-top: 1.4rem; }
  .policy-title { gap: 1rem; }
  .policy-icon { width: 56px; height: 56px; border-radius: 14px; }
  .publisher { padding: 1.5rem 1.3rem; }
  .publisher-facts { grid-template-columns: 1fr; }
}
@media (max-width: 480px) { .policy-toc ol { columns: 1; } }
