/* ovika.net legal/static pages — the Ovika Index system carried to the documents
   (round-4 launch gate, area 3): parchment canvas, ink typography, the homepage header
   and footer, serif headings over DM Sans body, gold restrained to links and marks.
   Self-hosted (CSP style-src 'self'); tokens mirror src/styles.css — the contrast test
   in scripts/site.test.mjs measures THESE values, so keep them in lockstep. */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("/fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/fonts/dm-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/fonts/dm-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("/fonts/dm-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond Fallback";
  src: local("Georgia");
  size-adjust: 87%;
  line-gap-override: 0%;
}

:root {
  --paper: #f7f2e8;
  --ink: #221e15; /* 14.9:1 on paper */
  --ink-soft: #635b4b; /* 6.0:1 on paper */
  --stage: #171310; /* the 404 ink plate */
  --rule: rgba(34, 30, 21, 0.18);
  --rule-faint: rgba(34, 30, 21, 0.1);
  --rule-ivory: rgba(247, 242, 232, 0.16);
  --gold-ink: #7c5b0e; /* text-capable gold on paper — 5.6:1 */
  --gold: #a9841c; /* non-text gold on paper — 3.1:1 */
  --gold-bright: #c9a12e; /* gold on the ink plate — 7.6:1 */

  --serif: "Cormorant Garamond", "Cormorant Garamond Fallback", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.mono {
  font-family: var(--mono);
}
::selection {
  background: rgba(169, 132, 28, 0.28);
}
:focus-visible {
  outline: 2px solid var(--gold-ink);
  outline-offset: 3px;
  border-radius: 1px;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

/* ── Header — the homepage masthead, links in place of module buttons ────────── */
.site-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0 1.2rem;
  border-bottom: 1px solid var(--rule);
}
.wordmark {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.site-head nav {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2rem);
}
.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.3s, border-color 0.3s;
}
.nav-link:hover {
  color: var(--ink);
  border-color: var(--gold);
}

/* ── The document ────────────────────────────────────────────────────────────── */
.doc {
  max-width: 44rem;
  padding: clamp(2.2rem, 6vh, 3.6rem) 0 clamp(3rem, 7vh, 4.5rem);
}
h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.2rem, 4.5vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
}
.meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--rule);
}
h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1.2;
  margin: 2.6rem 0 0.7rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-faint);
}
h3 {
  font-size: 1.02rem;
  font-weight: 500;
  margin: 1.7rem 0 0.4rem;
}
p,
ul {
  margin: 0 0 1rem;
}
p,
li {
  max-width: 65ch;
}
ul {
  padding-left: 1.15rem;
}
li {
  margin-bottom: 0.45rem;
}
li::marker {
  color: var(--gold);
}
strong {
  font-weight: 500;
  color: var(--ink);
}
.doc a {
  color: var(--gold-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.3s;
}
.doc a:hover {
  color: var(--ink);
}

/* Tables in the catalogue language: mono column heads, fine rules. */
.table-scroll {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
  margin: 1.1rem 0 1.4rem;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.85rem 0.6rem 0;
  border-bottom: 1px solid var(--rule-faint);
}
th {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom-color: var(--rule);
}

/* ── 404 — a tipped-in ink plate: the resolution motif, ended mid-line ───────── */
.lost {
  max-width: none;
}
.lost-plate {
  position: relative;
  background: var(--stage);
  color: var(--paper);
  padding: clamp(3rem, 9vw, 5.5rem) clamp(1.6rem, 7vw, 5rem);
  margin: clamp(2rem, 7vh, 4rem) 0 0;
}
.plate-frame {
  position: absolute;
  inset: 13px;
  border: 1px solid var(--rule-ivory);
  pointer-events: none;
}
.lost-num {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  color: var(--gold-bright);
}
.lost-plate h1 {
  color: var(--paper);
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  max-width: 16ch;
  margin: 0.9rem 0 0;
}
/* The clear line, stopped short of its point — the page that never resolved. */
.lost-line {
  display: block;
  position: relative;
  width: min(220px, 42%);
  height: 1px;
  background: var(--gold-bright);
  margin: 2.1rem 0 2.3rem;
}
.lost-line::after {
  content: "";
  position: absolute;
  right: -22px;
  top: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold-bright);
}
.lost-plate a {
  color: var(--gold-bright);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.lost-plate a:hover {
  color: var(--paper);
}
.lost-plate :focus-visible {
  outline-color: var(--gold-bright);
}

/* ── Footer — the homepage colophon ──────────────────────────────────────────── */
.site-foot {
  padding: 1.8rem 0 3.2rem;
  border-top: 1px solid var(--rule);
}
.site-foot nav {
  display: flex;
  gap: 1.4rem;
}
.site-foot nav a {
  font-size: 0.88rem;
  color: var(--ink-soft);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.3s;
}
.site-foot nav a:hover {
  color: var(--gold-ink);
}
.company {
  font-family: var(--mono);
  margin: 0.9rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

@media (max-width: 700px) {
  .site-head nav {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
