/* ─────────────────────────────────────────────
   VeriCore — editorial dark theme
   Palette: warm near-black base, bone ink, amber accent.
   No framework. One stylesheet.
   ───────────────────────────────────────────── */

:root {
  --bg:        #0d0c0a;
  --bg-raise: #14120e;
  --border:   #26221c;
  --border-strong: #3a342b;
  --fg:       #ece1cf;
  --fg-muted: #9a9287;
  --fg-dim:   #64604f;
  --accent:   #d4a574;
  --accent-soft: #f0d8b8;
  --ok:       #a9c7a0;
  --err:      #e4967a;

  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif:'Instrument Serif', 'Iowan Old Style', 'Apple Garamond', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --max:     1120px;
  --max-read: 680px;
  --radius:  6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11';
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(212,165,116,0.09), transparent 70%),
    radial-gradient(ellipse 30% 25% at 85% 40%, rgba(212,165,116,0.04), transparent 70%),
    var(--bg);
}

/* grain overlay — pure CSS/SVG, no external asset */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ─── typography ─── */

h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
a { color: var(--fg); text-decoration: none; }
a:hover { color: var(--accent-soft); }
code, pre { font-family: var(--font-mono); }
code { font-size: 0.9em; }

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-label::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--fg-dim);
}

/* ─── layout primitives ─── */

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
}

section {
  padding: 96px 0;
  border-top: 1px solid var(--border);
}
section:first-of-type { border-top: none; }

/* ─── nav ─── */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: rgba(13, 12, 10, 0.75);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--fg);
}
.nav-mark {
  width: 22px;
  height: 22px;
  color: var(--fg);
}
.brand-word {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.22em;
}
.nav-links {
  display: flex;
  gap: 28px;
  font-size: 13px;
  color: var(--fg-muted);
}
.nav-links a { color: var(--fg-muted); transition: color 160ms; }
.nav-links a:hover { color: var(--fg); }

/* ─── hero ─── */

.hero {
  padding-top: 96px;
  padding-bottom: 120px;
  border-top: none;
  text-align: left;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 48px;
}
.hero-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--fg-dim);
}
.hero-mark {
  width: 64px;
  height: 64px;
  color: var(--accent);
  margin-bottom: 40px;
}
.hero-mark svg { width: 100%; height: 100%; display: block; }
.headline {
  font-family: var(--font-serif);
  font-size: clamp(44px, 7vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: 36px;
  max-width: 16ch;
}
.headline em {
  font-style: italic;
  color: var(--accent);
}
.lede {
  font-family: var(--font-serif);
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.5;
  color: var(--fg-muted);
  max-width: var(--max-read);
  margin-bottom: 56px;
}

.cta-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.install {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 12px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-raise);
  font-family: var(--font-mono);
  font-size: 14px;
  transition: border-color 160ms;
}
.install:hover { border-color: var(--accent); }
.install .prompt { color: var(--fg-dim); }
.install code { color: var(--fg); background: none; padding: 0; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  margin-left: 4px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: transparent;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 160ms;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { color: var(--ok); border-color: var(--ok); }

.btn-ghost, .btn-solid {
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: all 160ms;
}
.btn-ghost {
  color: var(--fg-muted);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { color: var(--fg); border-color: var(--fg-muted); }
.btn-solid {
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent);
}
.btn-solid:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--bg); }

/* ─── pullquote ─── */

.quote { text-align: center; padding: 120px 0; }
.quote blockquote {
  margin: 0 auto;
  max-width: 26ch;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.2;
  color: var(--fg-muted);
  letter-spacing: -0.01em;
}
.quote-accent { color: var(--fg); font-style: italic; }

/* ─── principles grid ─── */

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card {
  background: var(--bg);
  padding: 32px 28px;
  transition: background 200ms;
}
.card:hover { background: var(--bg-raise); }
.card h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  margin-bottom: 12px;
  color: var(--fg);
}
.card p {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.55;
  margin: 0;
}
.card code {
  color: var(--accent-soft);
  background: rgba(212, 165, 116, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .grid-4 { grid-template-columns: 1fr; }
}

/* ─── terminal ─── */

.demo { }
.terminal {
  background: var(--bg-raise);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 24px 28px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--fg);
  overflow-x: auto;
  white-space: pre;
  margin: 0;
  position: relative;
}
.terminal::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  box-shadow: 14px 0 0 var(--border-strong), 28px 0 0 var(--border-strong);
}
.terminal { padding-top: 40px; }
.t-prompt { color: var(--accent); margin-right: 8px; }
.t-muted  { color: var(--fg-dim); }
.t-str    { color: var(--accent-soft); }
.t-accent { color: var(--accent); }
.t-ok     { color: var(--ok); }
.t-err    { color: var(--err); }
.t-comment{ color: var(--fg-dim); font-style: italic; }

/* ─── spec ─── */

.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.spec-grid h2 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: 24px;
  max-width: 14ch;
}
.spec-grid p {
  color: var(--fg-muted);
  max-width: 44ch;
  margin-bottom: 1.1em;
}
.spec-grid code { color: var(--accent-soft); }
.spec-links {
  margin-top: 24px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.spec-links a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 160ms;
}
.spec-links a:hover { border-bottom-color: var(--accent); }

.chain-diagram {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--fg-muted);
  margin: 0;
  padding: 28px 24px;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  white-space: pre;
}

@media (max-width: 820px) {
  .spec-grid { grid-template-columns: 1fr; gap: 48px; }
}

/* ─── entries ─── */

.entry-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.entry {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 32px;
  align-items: baseline;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  transition: background 160ms;
}
.entry:last-child { border-bottom: none; }
.entry:hover { background: var(--bg-raise); }
.entry-type {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.entry-desc {
  color: var(--fg-muted);
  font-size: 15px;
}
.entry-desc code {
  color: var(--accent-soft);
  background: rgba(212, 165, 116, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 13px;
}

@media (max-width: 640px) {
  .entry { grid-template-columns: 1fr; gap: 6px; }
}

/* ─── close ─── */

.close {
  text-align: center;
  padding: 140px 0;
}
.close-text {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.3;
  color: var(--fg);
  max-width: 28ch;
  margin: 0 auto 40px;
}

/* ─── footer ─── */

.foot {
  border-top: 1px solid var(--border);
  padding: 40px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-size: 12px;
  color: var(--fg-dim);
  max-width: var(--max);
  margin: 0 auto;
  flex-wrap: wrap;
}
.foot-left {
  display: flex;
  align-items: center;
  gap: 14px;
  letter-spacing: 0.04em;
}
.foot-mark { width: 18px; height: 18px; color: var(--fg-dim); }
.foot-right { display: flex; gap: 24px; }
.foot-right a { color: var(--fg-dim); transition: color 160ms; }
.foot-right a:hover { color: var(--fg); }

/* ─── reduced motion ─── */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
