/* Event Horizon Official Website — Paper-Ink & Forest Green System
   Zero external fonts, zero trackers, zero cookies. Brand-matched to EH Client. */
:root {
  --bg: #f4f6f2;
  --surface: #ffffff;
  --surface-sage: #edf2e8;
  --surface-soft: #f7f9f5;
  --forest: #1f2b28;
  --forest-mid: #283a34;
  --primary: #2f4b3c;
  --primary-hover: #3f604d;
  --ink: #222b28;
  --ink-muted: #5d6a63;
  --ink-faint: #7d8a83;
  --line: #dde3da;
  --line-strong: #c8d3c3;
  --accent-bg: #dbe8c9;
  --accent-ink: #25402a;
  --warn-bg: #fbf5ea;
  --warn-line: #dfc294;
  --warn-ink: #5d4015;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 10px rgba(24, 38, 32, 0.04);
  --shadow-md: 0 14px 36px rgba(24, 38, 32, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid #7d9d8b; outline-offset: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* --- Top Navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244, 246, 242, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 650;
  font-size: 15.5px;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--accent-bg);
  font-family: var(--serif);
  font-style: italic;
  font-size: 21px;
  font-weight: 400;
  flex-shrink: 0;
}
.brand-sub {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 13.5px;
  color: var(--ink-muted);
}
.nav-links a { color: var(--ink-muted); font-weight: 500; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 10px; }

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px;
  background: var(--surface);
}
.lang-switch button {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 550;
  padding: 4px 10px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.lang-switch button.active {
  background: var(--forest);
  color: #edf4ee;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 9px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 560;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 14px; font-size: 12.5px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-sage); }
.btn-ghost { background: transparent; color: var(--ink-muted); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-sage); color: var(--ink); }

/* --- Hero --- */
.hero {
  padding: 64px 0 56px;
  border-bottom: 1px solid var(--line);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 44px;
  align-items: center;
}
.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-sage);
  border: 1px solid #d1dec9;
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 18px;
}
.eyebrow-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3d7a47;
}
.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(32px, 4.2vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--forest);
  font-weight: 680;
}
.hero-lead {
  margin: 0 0 26px;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink-muted);
  max-width: 540px;
}
.hero-lead strong { color: var(--ink); font-weight: 620; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: 12.5px;
  color: var(--ink-muted);
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.trust-strip span { display: inline-flex; align-items: center; gap: 6px; }
.trust-strip .check { color: var(--primary); font-weight: 700; }

/* --- Hero Contract Terminal Card --- */
.contract-card {
  background: var(--forest);
  color: #e6eee8;
  border-radius: 16px;
  border: 1px solid #2e4038;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.contract-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: #182320;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}
.contract-tabs { display: inline-flex; gap: 6px; }
.contract-tabs button {
  border: 1px solid transparent;
  background: transparent;
  color: #9ab0a4;
  font-size: 12px;
  font-weight: 550;
  padding: 5px 10px;
  border-radius: 7px;
}
.contract-tabs button.active {
  background: #2c4138;
  border-color: #466355;
  color: #eff6f0;
}
.contract-badge {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(219, 232, 201, 0.14);
  color: #d3e5be;
}
.contract-badge.warn {
  background: rgba(235, 168, 120, 0.16);
  color: #f3c6a0;
}
.contract-body {
  margin: 0;
  padding: 18px 18px 20px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  overflow-x: auto;
  color: #dce7df;
  min-height: 318px;
}
.contract-body .c-head { color: #b7d8a8; }
.contract-body .c-ev { color: #9fcbb9; }
.contract-body .c-card { color: #e8e2b5; font-weight: 600; }
.contract-body .c-warn { color: #f0b880; }
.contract-body .c-dim { color: #7e9488; }
.contract-body .c-bad { color: #e89b90; }
.contract-foot {
  padding: 10px 16px;
  background: #182320;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11.5px;
  color: #9bb0a4;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* --- Sections --- */
section.band { padding: 68px 0; border-bottom: 1px solid var(--line); }
section.band.sage { background: var(--surface-sage); }
section.band.white { background: var(--surface); }
.section-eyebrow {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}
.section-title {
  margin: 0 0 12px;
  font-size: clamp(24px, 3vw, 33px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--forest);
  font-weight: 660;
}
.section-desc {
  margin: 0 0 32px;
  font-size: 15.5px;
  color: var(--ink-muted);
  max-width: 680px;
}

/* --- Three Simple Ideas --- */
.ideas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.idea-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 24px 26px;
  box-shadow: var(--shadow-sm);
}
.idea-num {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 650;
  color: var(--accent-ink);
  background: var(--accent-bg);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.idea-card h3 { margin: 0 0 8px; font-size: 17px; color: var(--forest); }
.idea-card p { margin: 0; font-size: 14px; color: var(--ink-muted); }

/* --- Proof Showcase --- */
.proof-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.proof-tab {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-muted);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 560;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.proof-tab:hover { background: var(--surface-sage); color: var(--ink); }
.proof-tab.active {
  background: var(--forest);
  border-color: var(--forest);
  color: #edf4ee;
}
.proof-tab small {
  display: block;
  font-size: 11px;
  font-weight: 450;
  opacity: 0.78;
  margin-top: 2px;
}
.proof-stage {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.proof-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.proof-meta h3 { margin: 0 0 6px; font-size: 19px; color: var(--forest); }
.proof-meta p { margin: 0; font-size: 14px; color: var(--ink-muted); max-width: 700px; }
.proof-stat {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-sage);
  color: var(--accent-ink);
  border: 1px solid #d1dec9;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
}
.proof-media {
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #141c19;
  text-align: center;
}
.proof-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 540px;
  object-fit: contain;
  margin: 0 auto;
}

/* --- Tables --- */
.table-wrap {
  margin-top: 22px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
th, td {
  padding: 12px 15px;
  border-bottom: 1px solid #ebefe8;
  text-align: left;
  vertical-align: top;
}
tr:last-child td { border-bottom: 0; }
th {
  background: var(--surface-soft);
  color: var(--forest);
  font-weight: 630;
  font-size: 12.5px;
  white-space: nowrap;
}
td.eh-col, th.eh-col {
  background: #edf4e7;
  color: #1f3a25;
  font-weight: 600;
}
td code {
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(31, 43, 40, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
}
.footnote {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--ink-faint);
  line-height: 1.6;
}

/* --- NL50 Archive Bar --- */
.archive-card {
  margin-top: 26px;
  background: var(--surface-sage);
  border: 1px solid #d1dec9;
  border-radius: var(--radius);
  padding: 22px 24px;
}
.archive-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.archive-head h4 { margin: 0; font-size: 15.5px; color: var(--forest); }
.archive-tag {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-bg);
  padding: 2px 9px;
  border-radius: 999px;
}
.metric-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.metric-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
}
.metric-box strong {
  display: block;
  font-family: var(--mono);
  font-size: 20px;
  color: var(--forest);
  font-weight: 650;
}
.metric-box span {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 3px;
}

/* --- Architecture --- */
.arch-diagram {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.arch-diagram svg { display: block; width: 100%; max-width: 960px; height: auto; margin: 0 auto; }
.trust-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.trust-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.trust-card h3 { margin: 0 0 8px; font-size: 16px; color: var(--forest); }
.trust-card p { margin: 0; font-size: 14px; color: var(--ink-muted); }

/* --- Quickstart --- */
.qs-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: start;
}
.code-card {
  background: var(--forest);
  color: #e6eee8;
  border-radius: var(--radius);
  border: 1px solid #2e4038;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #182320;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.os-tabs { display: inline-flex; gap: 6px; }
.os-tabs button {
  border: 0;
  background: transparent;
  color: #9ab0a4;
  font-size: 12px;
  font-weight: 550;
  padding: 5px 10px;
  border-radius: 6px;
}
.os-tabs button.active { background: #2c4138; color: #eff6f0; }
.copy-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #dce7df;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.14); }
.code-card pre {
  margin: 0;
  padding: 18px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  overflow-x: auto;
  color: #e2ede5;
}
.qs-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.qs-steps li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 18px;
}
.qs-steps b {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-size: 12.5px;
  flex-shrink: 0;
  margin-top: 1px;
}
.qs-steps strong { display: block; font-size: 14.5px; color: var(--forest); margin-bottom: 3px; }
.qs-steps p { margin: 0; font-size: 13.5px; color: var(--ink-muted); }

/* --- Scope & Legal Callout --- */
.scope-box {
  margin-top: 26px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-left: 4px solid #a66c24;
  border-radius: 12px;
  padding: 18px 22px;
  color: var(--warn-ink);
  font-size: 13.5px;
}
.scope-box strong { display: block; font-size: 14.5px; margin-bottom: 8px; color: #422b0b; }
.scope-box ul { margin: 0; padding-left: 18px; }
.scope-box li { margin: 5px 0; }
.scope-box a { color: #6e4510; text-decoration: underline; }

/* --- Terms Standalone Page --- */
.terms-shell {
  max-width: 820px;
  margin: 40px auto 72px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px 44px;
  box-shadow: var(--shadow-sm);
}
.terms-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-bottom: 24px;
  background: var(--surface-sage);
  border: 1px solid #d1dec9;
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--accent-ink);
}
.terms-meta-bar code { font-family: var(--mono); font-size: 11.5px; word-break: break-all; }
.terms h1 { font-size: 26px; line-height: 1.25; margin: 0 0 18px; color: var(--forest); }
.terms h2 { font-size: 19px; margin: 32px 0 12px; color: var(--forest); padding-top: 10px; border-top: 1px solid #edf0ea; }
.terms h3 { font-size: 16px; margin: 22px 0 8px; color: var(--forest); }
.terms p, .terms li { font-size: 14.5px; color: var(--ink); line-height: 1.75; margin: 8px 0; }
.terms ul { padding-left: 22px; }
.terms blockquote { margin: 14px 0; padding: 10px 14px; border-left: 3px solid var(--primary); background: var(--surface-soft); color: var(--ink-muted); }
.terms code { font-family: var(--mono); font-size: 13px; background: #eef2ec; padding: 1px 5px; border-radius: 4px; }
.terms hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.terms table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13.5px; }
.terms th, .terms td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
.terms th { background: var(--surface-sage); color: var(--forest); font-weight: 620; }

/* --- Footer --- */
.site-footer {
  background: var(--forest);
  color: #c7d4cc;
  padding: 46px 0 38px;
  font-size: 13.5px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-brand { display: flex; align-items: center; gap: 11px; color: #eef5ee; font-weight: 640; font-size: 15.5px; margin-bottom: 10px; }
.footer-brand .brand-mark { background: var(--accent-bg); color: var(--forest); }
.site-footer h4 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: #8ea598; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.footer-links a { color: #d7e3dc; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #8ea598;
}

/* --- Responsive --- */
@media (max-width: 960px) {
  .hero-grid, .qs-grid, .footer-grid { grid-template-columns: 1fr; }
  .ideas-grid { grid-template-columns: 1fr; }
  .metric-row { grid-template-columns: repeat(2, 1fr); }
  .trust-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 600px) {
  .hero { padding: 40px 0 38px; }
  section.band { padding: 46px 0; }
  .terms-shell { margin: 20px 14px 48px; padding: 24px 20px; }
  .metric-row { grid-template-columns: 1fr; }
  .header-inner { height: 58px; }
}
