/* PriorArtFast — Precision Patent Examiner Aesthetic (Zero AI Slop, iPhone 13 390px Verified) */
:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface-alt: #f1f4f8;
  --ink: #0f172a;
  --ink-secondary: #475569;
  --ink-muted: #64748b;
  --accent: #183b68;
  --accent-hover: #0f294a;
  --accent-tint: #edf3fa;
  --high-bg: #fef2f2;
  --high-ink: #991b1b;
  --mod-bg: #fffbeb;
  --mod-ink: #92400e;
  --ok-bg: #ecfdf5;
  --ok-ink: #065f46;
  --rule: rgba(15, 23, 42, 0.10);
  --rule-strong: rgba(15, 23, 42, 0.22);
  --radius: 6px;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --max-w: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.wrap { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(248, 249, 251, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 58px;
}

.brand {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--ink);
  font-family: var(--font-serif); font-size: 22px; font-weight: 600; letter-spacing: -0.02em;
}

.brand-sq { width: 9px; height: 9px; background: var(--accent); display: inline-block; }

.nav { display: flex; align-items: center; gap: 18px; }
.nav-link { color: var(--ink-secondary); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav-link:hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius);
  border: 1px solid transparent; font-family: var(--font-sans); font-size: 15px; font-weight: 600;
  line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary { background: var(--accent); color: #ffffff; }
.btn-primary:hover { background: var(--accent-hover); color: #ffffff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--rule-strong); }
.btn-secondary:hover { background: var(--surface-alt); }
.btn-sm { min-height: 38px; padding: 8px 14px; font-size: 14px; }
.btn-block { width: 100%; }

/* Hero */
.hero { padding: 48px 0 38px; border-bottom: 1px solid var(--rule); }
.kicker {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.05em;
  color: var(--accent); margin: 0 0 12px; font-weight: 600;
}

h1 {
  font-family: var(--font-serif); font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08; letter-spacing: -0.025em; font-weight: 600;
  margin: 0 0 18px; max-width: 19ch;
}

.hero-sub {
  font-size: 18px; line-height: 1.55; color: var(--ink-secondary);
  max-width: 64ch; margin: 0 0 24px;
}

.aeo-answer {
  background: var(--surface); border-left: 3px solid var(--accent);
  padding: 16px 18px; margin: 0 0 26px; max-width: 72ch;
}

.aeo-label {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent); margin: 0 0 6px; font-weight: 600;
}

.aeo-answer p { margin: 0; font-size: 15px; line-height: 1.55; }

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.muted { font-size: 13px; color: var(--ink-muted); }

/* Metric Strip */
.ledger-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--rule);
}

.ledger-cell {
  padding: 20px 16px 20px 0; border-right: 1px solid var(--rule);
}

.ledger-cell:not(:first-child) { padding-left: 20px; }
.ledger-cell:last-child { border-right: none; padding-right: 0; }
.ledger-label { font-size: 12px; color: var(--ink-muted); margin-bottom: 6px; }
.ledger-val { font-family: var(--font-mono); font-size: 21px; font-weight: 600; }
.ledger-sub { font-size: 12px; color: var(--ink-secondary); margin-top: 4px; }

/* Sections */
.section { padding: 56px 0; border-bottom: 1px solid var(--rule); }
.section:last-of-type { border-bottom: none; }

h2 {
  font-family: var(--font-serif); font-size: clamp(26px, 3.6vw, 36px);
  line-height: 1.15; letter-spacing: -0.02em; font-weight: 600; margin: 0 0 12px;
}

.section-intro { color: var(--ink-secondary); max-width: 66ch; margin: 0 0 28px; }

/* Screening Workbench */
.workbench {
  display: grid; grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 28px; align-items: start;
}

.panel {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 24px;
}

.panel h3 { font-family: var(--font-serif); font-size: 21px; margin: 0 0 14px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }

textarea, select, input[type="text"] {
  width: 100%; min-height: 44px; padding: 10px 12px;
  font-family: var(--font-sans); font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius);
}

textarea:focus, select:focus, input:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}

/* Dossier Sheet */
.dossier {
  background: #ffffff; border: 1px solid var(--rule-strong);
  border-radius: var(--radius); padding: 26px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.dossier-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); margin-bottom: 16px;
}

.dossier-title { font-family: var(--font-serif); font-size: 20px; font-weight: 600; margin: 0; }
.dossier-meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink-muted); text-align: right; }

.signal-bar {
  background: var(--accent-tint); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 18px; font-size: 14px;
}

.citation-list { list-style: none; margin: 0; padding: 0; }
.citation-item {
  padding: 14px 0; border-bottom: 1px solid var(--rule);
}

.citation-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 4px;
}

.pub-link { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.tier {
  display: inline-block; font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 3px;
}

.tier-high { background: var(--high-bg); color: var(--high-ink); }
.tier-mod { background: var(--mod-bg); color: var(--mod-ink); }
.tier-low { background: var(--ok-bg); color: var(--ok-ink); }

.cit-title { font-weight: 600; font-size: 15px; margin: 2px 0; }
.cit-sub { font-size: 12px; color: var(--ink-muted); margin-bottom: 6px; }
.cit-snip { font-size: 13px; color: var(--ink-secondary); margin: 0; }

/* Gate */
.locked-region { position: relative; margin-top: 8px; }
.locked-content { filter: blur(4.5px); opacity: 0.52; pointer-events: none; user-select: none; }
.dossier.is-unlocked .locked-content { filter: none; opacity: 1; pointer-events: auto; user-select: auto; }
.dossier.is-unlocked .unlock-gate { display: none; }

.unlock-gate {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.97) 58%);
}

.unlock-box {
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  padding: 20px; max-width: 400px; width: 100%;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
}

.unlock-box h4 { font-family: var(--font-serif); font-size: 20px; margin: 0 0 6px; }
.unlock-box p { font-size: 13px; color: var(--ink-secondary); margin: 0 0 14px; }

.unlocked-bar { display: none; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule); gap: 10px; flex-wrap: wrap; }
.dossier.is-unlocked .unlocked-bar { display: flex; }

/* Comparison Table */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cmp-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.cmp-table th, .cmp-table td {
  padding: 14px 12px 14px 0; border-bottom: 1px solid var(--rule);
  text-align: left; font-size: 14px; vertical-align: top;
}
.cmp-table th { font-size: 12px; color: var(--ink-muted); font-weight: 600; border-bottom: 1px solid var(--rule-strong); }

/* FAQ */
.faq-list details { border-top: 1px solid var(--rule); padding: 16px 0; }
.faq-list details:last-child { border-bottom: 1px solid var(--rule); }
.faq-list summary {
  cursor: pointer; font-weight: 600; font-size: 16px; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font-family: var(--font-mono); color: var(--accent); font-size: 18px; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list p { margin: 10px 0 0; color: var(--ink-secondary); font-size: 15px; max-width: 72ch; }

.site-footer { padding: 40px 0 56px; color: var(--ink-muted); font-size: 13px; border-top: 1px solid var(--rule); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }

@media (max-width: 860px) {
  .workbench { grid-template-columns: 1fr; }
  .ledger-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger-cell { border-right: none; border-bottom: 1px solid var(--rule); padding: 16px 12px 16px 0; }
  .ledger-cell:not(:first-child) { padding-left: 0; }
}

@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .nav-link.hide-sm { display: none; }
  .hero { padding: 28px 0 24px; }
  .panel, .dossier { padding: 18px; }
  .dossier-head { flex-direction: column; }
  .dossier-meta { text-align: left; }
}

@media print {
  .site-header, .hero, .ledger-grid, .panel, .unlock-gate, .unlocked-bar, .no-print, .site-footer { display: none !important; }
  .workbench { display: block; }
  .dossier { border: none; box-shadow: none; padding: 0; }
  .locked-content { filter: none !important; opacity: 1 !important; }
}
