/* OpenCourt site: design A ("Letterhead"). Black, white, one red accent. */
:root {
  --ink: #0b0b0c;
  --body: #3a3a3f;
  --muted: #55555a;
  --rule: #c9c9cc;
  --rule-soft: #e3e3e6;
  --paper: #ffffff;
  --panel: #fafafa;
  --on-ink-muted: #b5b5ba;
  --on-ink-rule: #3a3a3f;
  --accent: #a3131f;
  --serif-display: 'Cormorant Garamond', Georgia, serif;
  --serif-body: 'EB Garamond', Georgia, serif;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif-body); -webkit-font-smoothing: antialiased; }
a { color: var(--ink); }
a:hover { color: var(--accent); }
img { max-width: 100%; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.ruled { border-top: 1px solid var(--ink); }

/* Header */
.top-line { height: 6px; background: var(--ink); }
.site-header { display: flex; flex-direction: column; align-items: center; padding-top: 48px; }
.site-header .logo { display: block; width: 280px; max-width: 70vw; height: auto; }
.site-header .tie { width: 72px; height: 2px; background: var(--accent); margin-top: 36px; }
.site-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 36px; margin-top: 12px; font-size: 14px; letter-spacing: 0.22em; text-transform: uppercase; }
.site-nav a { text-decoration: none; padding: 14px 0; }
.site-nav a[aria-current="page"] { border-bottom: 1px solid var(--accent); }
.site-header .rule { width: 100%; height: 1px; background: var(--ink); margin-top: 8px; }

/* Hero */
.hero { text-align: center; padding: 128px 24px 72px; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.hero h1 { margin: 0; font-family: var(--serif-display); font-weight: 400; font-size: clamp(56px, 9vw, 128px); line-height: 0.95; letter-spacing: -0.01em; }
.hero p { margin: 0; font-size: 22px; color: var(--body); }
.page-hero { padding: 104px 24px 64px; }
.page-hero h1 { font-size: clamp(48px, 7vw, 96px); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 12px; }
.btn { display: inline-block; min-height: 44px; padding: 15px 31px; border: 1px solid var(--ink); font-family: var(--serif-body); font-size: 14px; letter-spacing: 0.2em; text-transform: uppercase; text-decoration: none; }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { color: var(--paper); background: #26262a; }
em, .italic { font-style: italic; }

/* Search */
.search-section { padding: 0 24px 104px; }
.search-bar { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 8px 0 22px; border: 1px solid var(--ink); border-radius: 999px; background: var(--paper); font-family: var(--sans); }
.search-bar:focus-within { box-shadow: 0 0 0 3px rgba(163, 19, 31, 0.15); }
.search-bar svg { flex: 0 0 auto; }
.search-bar input { flex: 1 1 auto; min-width: 0; border: 0; padding: 18px 0; font: 17px var(--sans); color: var(--ink); background: transparent; outline: none; }
.tool-toggle { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: #f2f2f3; color: var(--accent); font: 500 16px var(--serif-body); cursor: pointer; }
.tool-toggle:hover { background: #e7e7ea; }
.tool-menu { margin: 10px 0 0; padding: 8px; list-style: none; border: 1px solid #d4d4d8; border-radius: 16px; background: var(--paper); font-family: var(--sans); }
.tool-menu[hidden] { display: none; }
.tool-menu li { display: grid; grid-template-columns: 6px 190px 1fr; align-items: center; gap: 2px 14px; min-height: 48px; padding: 8px 14px; border-radius: 10px; cursor: pointer; }
.tool-menu li:hover, .tool-menu li.active { background: #f2f2f3; }
.tool-menu li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px; background: transparent; }
.tool-menu li[aria-selected="true"]::before { background: var(--accent); }
.tool-menu .name { font: 500 16px var(--serif-body); color: var(--accent); }
.tool-menu .desc { font-size: 14px; color: var(--muted); }
.search-note { margin: 14px 0 0; text-align: center; font: 13px var(--sans); color: var(--muted); }
.search-status { margin: 14px 0 0; text-align: center; font: 14px var(--sans); color: var(--ink); }
.search-status[hidden] { display: none; }

/* Pillars */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.pillars > div { padding: 48px 32px 56px; display: flex; flex-direction: column; gap: 10px; }
.pillars > div + div { border-left: 1px solid var(--rule); }
.pillars > div:first-child { padding-left: 0; }
.pillars > div:last-child { padding-right: 0; }
.numeral { font-family: var(--serif-display); font-size: 22px; color: var(--accent); }
.pillars h2 { margin: 0; font-family: var(--serif-display); font-weight: 500; font-size: 30px; }
.pillars p { margin: 0; font-size: 18px; line-height: 1.55; color: var(--body); }

/* Section heading (small caps + red rule) */
.eyebrow { margin: 0; font-family: var(--serif-body); font-size: 15px; font-weight: 500; letter-spacing: 0.3em; text-transform: uppercase; }
.tie-center { width: 48px; height: 2px; background: var(--accent); margin: 0 auto; }

/* Corpus */
.corpus { padding: 96px 0; display: flex; flex-direction: column; gap: 40px; }
.corpus-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.corpus-head .big { margin: 0; font-family: var(--serif-display); font-size: clamp(40px, 5vw, 60px); line-height: 1.05; }
.corpus-head .tagline { margin: 0; font-size: 19px; font-style: italic; color: var(--body); }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.figures > div { padding: 28px 20px; }
.figures > div + div { border-left: 1px solid var(--rule); }
.figures > div:first-child { padding-left: 0; }
.figures .n { font-family: var(--serif-display); font-size: 40px; font-variant-numeric: tabular-nums; }
.figures .label { font-size: 17px; }
.figures .sub { font-size: 15px; color: var(--muted); }
.fineprint { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 14px; color: var(--muted); }
.fineprint .caps { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; }

/* MCP */
.mcp { padding: 96px 0; display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.mcp .lead { flex: 1 1 300px; display: flex; flex-direction: column; gap: 14px; }
.mcp h2 { margin: 0; font-family: var(--serif-display); font-weight: 400; font-size: 44px; line-height: 1.05; }
.mcp p { margin: 0; font-size: 18px; line-height: 1.55; color: var(--body); }
pre.code { flex: 1 1 520px; min-width: 0; margin: 0; padding: 24px; border: 1px solid var(--ink); background: var(--panel); font: 14px/1.7 var(--mono); overflow-x: auto; }

/* Fees band */
.fees { background: var(--ink); color: var(--paper); }
.fees a { color: var(--paper); }
.fees a:hover { color: #ff8a93; }
.fees .inner { padding: 104px 24px; }
.fees .eyebrow { text-align: center; margin-bottom: 8px; }
.fees .tie-center { margin-bottom: 40px; }
.fee-list { border-top: 2px solid var(--paper); border-bottom: 2px solid var(--paper); }
.fee-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; padding: 24px 0; }
.fee-row + .fee-row { border-top: 1px solid var(--on-ink-rule); }
.fee-row .title { font-size: 22px; font-weight: 500; }
.fee-row .desc { font-size: 16px; color: var(--on-ink-muted); }
.fee-row .price { font-size: 22px; font-variant-numeric: tabular-nums; }
.fees .more { margin: 32px 0 0; text-align: center; font-size: 17px; font-style: italic; }
.provisional { display: inline-block; margin-left: 10px; padding: 2px 8px; border: 1px solid var(--on-ink-muted); font: 11px var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-ink-muted); vertical-align: middle; }

/* Pricing page tables */
.price-table { width: 100%; border-collapse: collapse; font-size: 17px; }
.price-table caption { text-align: left; padding-bottom: 12px; font-size: 15px; color: var(--on-ink-muted); }
.price-table th, .price-table td { text-align: left; padding: 16px 12px 16px 0; border-bottom: 1px solid var(--on-ink-rule); vertical-align: top; }
.price-table thead th { font-weight: 500; color: var(--on-ink-muted); border-bottom: 1px solid var(--paper); }
.price-table td.num, .price-table th.num { text-align: right; padding-right: 0; font-variant-numeric: tabular-nums; }
.price-table code { font: 14px var(--mono); }
.price-table .tool-name { font-weight: 500; color: var(--paper); white-space: nowrap; }
.table-scroll { overflow-x: auto; }

.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.tiers > div { padding: 32px 24px; display: flex; flex-direction: column; gap: 8px; }
.tiers > div + div { border-left: 1px solid var(--rule); }
.tiers > div:first-child { padding-left: 0; }
.tiers .label { font-size: 14px; letter-spacing: 0.2em; text-transform: uppercase; }
.tiers .n { font-family: var(--serif-display); font-size: 44px; line-height: 1; }
.tiers p { margin: 0; font-size: 17px; line-height: 1.5; color: var(--body); }

.faq { padding: 96px 0 112px; }
.faq dl { margin: 24px 0 0; border-top: 1px solid var(--ink); }
.faq dt { padding: 20px 0 6px; font-size: 20px; font-weight: 500; }
.faq dd { margin: 0; padding: 0 0 20px; font-size: 18px; line-height: 1.6; color: var(--body); border-bottom: 1px solid var(--rule); }

/* Legal pages */
.legal { padding: 0 24px 120px; }
.legal .meta { font-size: 16px; color: var(--muted); border-top: 1px solid var(--ink); padding-top: 18px; }
.legal .placeholder { margin-top: 32px; padding: 32px; border: 1px dashed var(--rule); font-size: 18px; line-height: 1.6; color: var(--muted); }

/* Journal */
.journal { padding: 104px 24px 112px; }
.journal .list { margin-top: 24px; border-top: 1px solid var(--ink); }
.journal a { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; padding: 20px 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.journal .t { font-size: 20px; }
.journal .d { font-size: 16px; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--ink); }
.site-footer .wrap { padding-top: 40px; padding-bottom: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; }
.site-footer .brand { display: flex; flex-direction: column; gap: 14px; }
.site-footer .brand img { display: block; width: 220px; height: auto; }
.site-footer .brand .line { font-family: var(--serif-display); font-style: italic; font-size: 24px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 24px; font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; }
.site-footer nav a { text-decoration: none; color: var(--muted); padding: 12px 0; }
.site-footer nav a:hover { color: var(--accent); }
.site-footer .small { width: 100%; font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }

/* Sign-in in the nav */
.site-nav { align-items: center; }
.auth-login { min-height: 36px; padding: 0 18px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); font: 13px var(--serif-body); letter-spacing: 0.22em; text-transform: uppercase; cursor: pointer; }
.auth-login:hover { background: var(--ink); color: var(--paper); }
.auth-user { display: flex; align-items: center; min-height: 44px; }
[hidden] { display: none !important; }
.link-button { border: 0; padding: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Search results */
.results { margin-top: 24px; font-family: var(--sans); }
.result-lead { margin: 0 0 8px; font: italic 18px var(--serif-body); color: var(--body); }
.result-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.result { padding: 18px 0; border-bottom: 1px solid var(--rule-soft); }
.result-title { font: 20px/1.3 var(--serif-display); font-weight: 500; text-decoration: none; }
.result-title[href]:hover { text-decoration: underline; text-underline-offset: 3px; }
.result-meta { margin-top: 4px; font: 12px var(--mono); color: var(--muted); }
.result-snippet { margin: 8px 0 0; font: 15px/1.55 var(--serif-body); color: var(--body); }
.result-cite { margin-top: 6px; font-size: 12px; color: var(--muted); }
.result-status { display: inline-block; margin-left: 10px; padding: 2px 8px; border: 1px solid var(--ink); font: 600 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; vertical-align: middle; }
.result-status.status-problem, .result-status.status-not_found { border-color: var(--accent); background: var(--accent); color: var(--paper); }
.result-status.status-ambiguous, .result-status.status-unverifiable { border-color: var(--muted); color: var(--muted); }
.result-empty { margin: 12px 0 0; font-size: 15px; color: var(--muted); }

/* Account page */
.account { padding: 0 24px 112px; }
.account .signed-out { padding: 40px 0; text-align: center; font-size: 19px; color: var(--body); }
.account .signed-out .btn { margin-top: 20px; }
.meter { height: 6px; background: var(--rule-soft); margin-top: 14px; }
.meter > span { display: block; height: 100%; background: var(--ink); }
.topups { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.topups button { min-height: 48px; padding: 0 22px; border: 1px solid var(--paper); background: transparent; color: var(--paper); font: 17px var(--serif-body); cursor: not-allowed; opacity: 0.7; }
.account-note { margin: 18px 0 0; font-size: 15px; color: var(--on-ink-muted); }

@media (max-width: 640px) {
  .pillars > div, .figures > div, .tiers > div { padding-left: 0; padding-right: 0; }
  .pillars > div + div, .figures > div + div, .tiers > div + div { border-left: 0; border-top: 1px solid var(--rule); }
  .hero { padding-top: 88px; }
  .site-nav { gap: 0 20px; letter-spacing: 0.16em; }
  /* Tool menu: every description sits under its name, not only the ones that happen to overflow. */
  .tool-menu li { grid-template-columns: 6px 1fr; }
  .tool-menu .desc { grid-column: 2; }
}
