/* Filing Reader — design system.
   Restrained, editorial, precise: an instrument for reading serious documents.
   Provenance (on-device vs cloud) is a first-class visual primitive. */

:root {
  /* Near-neutral base */
  --ink: #16202E;          /* near-black, faint navy */
  --ink-2: #33414F;
  --paper: #FBFAF7;        /* warm off-white */
  --surface: #FFFFFF;
  --surface-2: #F5F3EE;
  --muted: #6B7280;
  --muted-2: #8A909B;
  --line: #E7E3DA;
  --line-2: #D8D3C7;

  /* Provenance: on-device = calm green (private), cloud = amber accent (metered) */
  --local: #0E6B54;
  --local-bg: #E6F4EF;
  --local-line: #BFE3D7;
  --cloud: #9A6A12;        /* deep amber — legible on light */
  --cloud-bg: #FBF1DC;
  --cloud-line: #ECD6A6;

  --accent: #9A6A12;       /* the one confident accent (== cloud state) */
  --danger: #9B2C2C;
  --danger-bg: #FBEDEC;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(22,32,46,.04), 0 8px 24px rgba(22,32,46,.06);
  --shadow-sm: 0 1px 2px rgba(22,32,46,.05);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ECEAE3; --ink-2: #C4C2BB; --paper: #14171B; --surface: #1B1F24;
    --surface-2: #232830; --muted: #9AA0A9; --muted-2: #7E858F; --line: #2C323B; --line-2: #3A414B;
    --local: #6FD0B4; --local-bg: #123027; --local-line: #1F4A3C;
    --cloud: #E4B968; --cloud-bg: #322411; --cloud-line: #4E3C1B; --accent: #E4B968;
    --danger: #E98B84; --danger-bg: #331C1B;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.mono, code, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
::selection { background: var(--cloud-bg); }

/* ---- Layout helpers ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }
.stack > * + * { margin-top: 1rem; }
.eyebrow { font-family: var(--mono); font-size: .7rem; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--accent); font-weight: 600; }
.muted { color: var(--muted); }
.center { text-align: center; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(2.1rem, 4.5vw, 3.3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0; }

/* ---- Buttons ---- */
.btn { font-family: var(--sans); font-weight: 600; font-size: .95rem; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--radius-sm); padding: .6rem 1rem;
  display: inline-flex; align-items: center; gap: .5rem; transition: .15s ease; text-align: center; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1.02rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-google { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-google:hover:not(:disabled) { background: var(--surface-2); }
.gicon { width: 16px; height: 16px; flex: none; }

/* ---- Header ---- */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 1.2rem; height: 60px; }
.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
.brand .mark { width: 22px; height: 22px; border-radius: 6px; background: var(--ink); color: var(--paper);
  display: grid; place-items: center; font-family: var(--mono); font-size: .8rem; font-weight: 700; }
.nav-links { display: flex; gap: .3rem; margin-left: .6rem; }
.nav-links a { padding: .4rem .7rem; border-radius: var(--radius-sm); font-size: .9rem; color: var(--ink-2); }
.nav-links a:hover { background: var(--surface-2); color: var(--ink); }
.nav-links a.active { color: var(--ink); font-weight: 600; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: .7rem; }
.acct-chip { display: flex; align-items: center; gap: .5rem; padding: .3rem .3rem .3rem .7rem; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); font-size: .85rem; }
.acct-chip .quota { font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--local); color: #fff; display: grid;
  place-items: center; font-size: .8rem; font-weight: 700; }

/* ---- Provenance primitives (used everywhere) ---- */
.prov { display: inline-flex; align-items: center; gap: .35rem; font-family: var(--mono); font-size: .68rem;
  font-weight: 600; letter-spacing: .3px; padding: .16rem .5rem; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.prov-local { color: var(--local); background: var(--local-bg); border-color: var(--local-line); }
.prov-cloud { color: var(--cloud); background: var(--cloud-bg); border-color: var(--cloud-line); }
.pill { display: inline-flex; align-items: center; gap: .35rem; font-family: var(--mono); font-size: .68rem;
  padding: .16rem .5rem; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); background: var(--surface); }
.pill-high { color: var(--local); border-color: var(--local-line); background: var(--local-bg); }
.pill-medium { color: var(--cloud); border-color: var(--cloud-line); background: var(--cloud-bg); }
.pill-low { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }

/* ---- Cards / sections ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.section { padding: 4.5rem 0; }
.section-sm { padding: 2.5rem 0; }
.disclaimer-note { font-size: .78rem; color: var(--muted); }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 3rem; }
.site-footer .wrap { padding: 2rem 1.5rem; display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; }
.site-footer .col h4 { font-family: var(--mono); font-size: .68rem; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--muted); margin: 0 0 .5rem; }
.site-footer .col a, .site-footer .col p { display: block; font-size: .85rem; color: var(--ink-2); margin: .25rem 0; }
.site-footer .col a:hover { color: var(--ink); }
.foot-legal { margin-left: auto; max-width: 320px; font-size: .78rem; color: var(--muted); }

/* ---- Auth modal ---- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10,14,20,.45); z-index: 60;
  display: none; align-items: center; justify-content: center; padding: 1.5rem; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  max-width: 400px; width: 100%; padding: 1.6rem; text-align: center; }
.modal h3 { font-size: 1.3rem; margin-bottom: .4rem; }
.modal p { color: var(--muted); font-size: .9rem; margin-bottom: 1.1rem; }
.modal .fine { font-size: .76rem; margin-top: 1rem; }

/* ---- Forms ---- */
input[type=text], input[type=email], select {
  font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: .55rem .7rem; width: 100%; }
input:focus, select:focus { outline: 2px solid var(--cloud-line); outline-offset: 1px; }
.field-row { display: flex; gap: .5rem; }

/* status text */
.status { font-size: .82rem; color: var(--muted); min-height: 1.1em; }
.status.ok { color: var(--local); }
.status.err { color: var(--danger); }

@media (max-width: 760px) {
  .nav-links { display: none; }
  .site-footer .wrap { flex-direction: column; gap: 1.2rem; }
  .foot-legal { margin-left: 0; }
}
