/* Doc Intelligence Engine — docs.unykorn.org */
/* From The Hart Trading LLC — Sovereign Document Infrastructure */

:root {
  --bg:       #060608;
  --surface:  #0d0d10;
  --card:     #14141a;
  --card2:    #1a1a22;
  --border:   #252530;
  --border2:  #303040;
  --gold:     #c9a227;
  --gold-lt:  #e6bc3a;
  --gold-dim: #8a6e18;
  --text:     #e2e2e8;
  --muted:    #7a7a8a;
  --faint:    #3a3a4a;
  --green:    #2a7a4a;
  --green-lt: #3ab86a;
  --red:      #8a2a2a;
  --red-lt:   #e05555;
  --mono:     'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --sans:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--faint); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.9rem); }
h3 { font-size: 1rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); font-weight: 500; }
p  { color: var(--muted); line-height: 1.75; }
a  { color: var(--gold); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-lt); }
code, .mono { font-family: var(--mono); font-size: 0.85em; }

/* ── LAYOUT ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }
.section { padding: 5rem 0; }
.section + .section { border-top: 1px solid var(--border); }

/* ── HEADER / NAV ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(6,6,8,.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-brand {
  display: flex; align-items: center; gap: .75rem;
}
.nav-logo {
  width: 28px; height: 28px;
  background: var(--gold);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}
.nav-brand-text {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--gold);
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1.2;
}
.nav-brand-sub { font-size: .65rem; color: var(--muted); letter-spacing: .08em; }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  font-size: .78rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); transition: color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold); }
.nav-cta {
  font-size: .75rem; letter-spacing: .08em; text-transform: uppercase;
  padding: .45rem 1rem;
  background: var(--gold-dim);
  color: #fff;
  border-radius: 4px;
  transition: background .2s;
}
.nav-cta:hover { background: var(--gold); color: #000; }

/* ── HERO ── */
.hero {
  padding: 7rem 0 5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(201,162,39,.07), transparent);
  pointer-events: none;
}
.hero-eyebrow {
  font-family: var(--mono);
  font-size: .7rem; letter-spacing: .2em;
  color: var(--gold-dim); text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.hero h1 { margin-bottom: 1.25rem; }
.hero h1 span { color: var(--gold); }
.hero-desc { max-width: 620px; font-size: 1.05rem; color: var(--muted); margin-bottom: 2.5rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.4rem;
  font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 500;
  border-radius: 4px;
  transition: all .2s;
  cursor: pointer;
  border: none;
}
.btn-primary { background: var(--gold); color: #000; }
.btn-primary:hover { background: var(--gold-lt); color: #000; }
.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
}
.btn-outline:hover { border-color: var(--gold); background: rgba(201,162,39,.06); }
.btn-sm { padding: .45rem 1rem; font-size: .72rem; }

/* ── STATUS GRID ── */
.status-bar {
  display: flex; gap: 1rem; flex-wrap: wrap;
  padding: 1.25rem 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 3rem;
}
.status-item {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--mono);
  font-size: .7rem; color: var(--muted);
  letter-spacing: .04em;
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green-lt);
  box-shadow: 0 0 6px var(--green-lt);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.4; } }
.status-label { color: var(--text); }

/* ── MODULE CARDS ── */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}
.module-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.75rem;
  transition: border-color .2s, transform .2s;
  position: relative;
  overflow: hidden;
}
.module-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--gold-dim), transparent);
  opacity: 0;
  transition: opacity .2s;
}
.module-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.module-card:hover::before { opacity: 1; }
.module-icon {
  width: 36px; height: 36px;
  background: rgba(201,162,39,.1);
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
  font-size: 1rem;
}
.module-card h3 { color: var(--text); margin-bottom: .6rem; font-size: .9rem; letter-spacing: .04em; }
.module-card p { font-size: .82rem; line-height: 1.6; }
.module-ports {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--gold-dim);
  letter-spacing: .06em;
}
.module-count {
  position: absolute; top: 1.25rem; right: 1.25rem;
  font-family: var(--mono);
  font-size: .65rem; color: var(--faint);
}

/* ── TABLE ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
  margin: 1.5rem 0;
}
.data-table th {
  text-align: left;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(201,162,39,.02); }
.tag {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: .68rem; letter-spacing: .06em;
}
.tag-op { background: rgba(58,184,106,.12); color: var(--green-lt); border: 1px solid rgba(58,184,106,.2); }
.tag-gold { background: rgba(201,162,39,.12); color: var(--gold); border: 1px solid rgba(201,162,39,.2); }
.tag-muted { background: var(--card); color: var(--muted); border: 1px solid var(--border); }

/* ── CODE BLOCK ── */
.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .78rem;
  line-height: 1.7;
  color: #a8b8d0;
  margin: 1.5rem 0;
}
.code-block .c-key   { color: #7dd3fc; }
.code-block .c-val   { color: #86efac; }
.code-block .c-str   { color: #fde68a; }
.code-block .c-num   { color: #c084fc; }
.code-block .c-com   { color: var(--muted); }
.code-block .c-gold  { color: var(--gold-lt); }

/* ── SECTION HEADER ── */
.section-header { margin-bottom: 3rem; }
.section-header .eyebrow {
  font-family: var(--mono);
  font-size: .68rem; letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: .75rem;
}
.section-header h2 { margin-bottom: .75rem; }
.section-header p  { max-width: 560px; font-size: .9rem; }

/* ── TIER CARDS ── */
.tier-stack { display: flex; flex-direction: column; gap: 1rem; }
.tier-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold-dim);
  border-radius: 0 8px 8px 0;
  padding: 1.5rem 2rem;
}
.tier-card.tier-0 { border-left-color: var(--green-lt); }
.tier-card.tier-1 { border-left-color: var(--gold); }
.tier-card.tier-2 { border-left-color: var(--red-lt); }
.tier-label {
  font-family: var(--mono);
  font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: .5rem;
}
.tier-0 .tier-label { color: var(--green-lt); }
.tier-1 .tier-label { color: var(--gold); }
.tier-2 .tier-label { color: var(--red-lt); }
.tier-card h3 { color: var(--text); font-size: 1rem; letter-spacing: 0; text-transform: none; margin-bottom: .4rem; }
.tier-card p  { font-size: .83rem; }
.tier-examples {
  margin-top: .75rem;
  font-family: var(--mono);
  font-size: .7rem; color: var(--muted);
}

/* ── PIPELINE ── */
.pipeline {
  display: flex; flex-wrap: wrap; gap: 0;
  margin: 1.5rem 0;
}
.pipeline-step {
  display: flex; align-items: center; gap: .75rem;
  background: var(--card);
  border: 1px solid var(--border);
  padding: .75rem 1.25rem;
  font-size: .82rem;
  min-width: 160px;
  flex: 1;
  position: relative;
}
.pipeline-step + .pipeline-step::before {
  content: '→';
  position: absolute; left: -1rem;
  color: var(--gold-dim);
  font-size: .8rem;
  z-index: 1;
}
.pipeline-num {
  font-family: var(--mono);
  font-size: .65rem; color: var(--gold-dim);
  min-width: 1.5rem;
}
.pipeline-name { font-weight: 500; }
.pipeline-desc { font-size: .72rem; color: var(--muted); }

/* ── COMPLIANCE CHIPS ── */
.compliance-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.compliance-chip {
  padding: .35rem .85rem;
  background: rgba(201,162,39,.08);
  border: 1px solid var(--gold-dim);
  border-radius: 20px;
  font-family: var(--mono);
  font-size: .7rem; letter-spacing: .06em;
  color: var(--gold);
}

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  margin-top: 5rem;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1.5rem;
}
.footer-brand {
  font-family: var(--mono);
  font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}
.footer-brand span { color: var(--gold); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-size: .75rem; color: var(--muted); }
.footer-links a:hover { color: var(--gold); }
.footer-disclaimer {
  width: 100%;
  font-family: var(--mono);
  font-size: .65rem; color: var(--faint);
  letter-spacing: .04em;
}

/* ── BREADCRUMB ── */
.breadcrumb {
  font-family: var(--mono);
  font-size: .7rem; letter-spacing: .08em;
  color: var(--muted);
  padding: 1.25rem 0;
  display: flex; gap: .5rem; align-items: center;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb .sep { color: var(--faint); }
.breadcrumb .current { color: var(--gold); }

/* ── DIVIDER ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* ── ALERT / NOTICE ── */
.notice {
  padding: 1rem 1.5rem;
  background: rgba(201,162,39,.06);
  border: 1px solid rgba(201,162,39,.2);
  border-radius: 6px;
  font-size: .82rem; color: var(--muted);
  margin: 1.5rem 0;
}
.notice strong { color: var(--gold); }

/* ── QR / AGREEMENT SPECIFIC ── */
.agreement-wrap {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 820px) { .agreement-wrap { grid-template-columns: 1fr; } }

.agreement-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-label {
  font-family: var(--mono);
  font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}
.form-input, .form-select, .form-textarea {
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: .65rem 1rem;
  color: var(--text);
  font-family: var(--sans);
  font-size: .88rem;
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(201,162,39,.08);
}
.form-input::placeholder { color: var(--faint); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-select option { background: var(--card); }

.qr-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  position: sticky; top: 80px;
}
.qr-panel .panel-title {
  font-family: var(--mono);
  font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
#qr-container {
  width: 220px; height: 220px;
  margin: 0 auto 1.5rem;
  background: #fff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
}
#qr-container canvas, #qr-container img { max-width: 100%; }
.qr-placeholder {
  width: 196px; height: 196px;
  background: #f5f5f5;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: #aaa;
  font-size: .75rem;
  font-family: var(--mono);
  text-align: center;
}
.qr-session-id {
  font-family: var(--mono);
  font-size: .7rem; color: var(--muted);
  word-break: break-all;
  margin-bottom: .75rem;
  letter-spacing: .04em;
}
.qr-session-id strong { color: var(--gold); display: block; margin-bottom: .25rem; }
.qr-actions { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }

/* ── SIGNING PAGE ── */
.sign-page { max-width: 760px; margin: 0 auto; padding: 3rem 1.5rem; }
.sign-header {
  text-align: center;
  padding: 2.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
  border-bottom: none;
}
.sign-header .sign-badge {
  display: inline-block;
  padding: .3rem .8rem;
  background: rgba(201,162,39,.1);
  border: 1px solid var(--gold-dim);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: .65rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}
.sign-body {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 1px solid var(--border);
  padding: 2rem 2.5rem;
}
.sign-footer-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 1.5rem 2.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.fingerprint-row {
  font-family: var(--mono);
  font-size: .68rem; color: var(--muted); letter-spacing: .04em;
}
.fingerprint-row strong { color: var(--gold-dim); }
.fingerprint-hash { color: var(--text); }

.otp-wrap { max-width: 340px; margin: 2rem auto; text-align: center; }
.otp-inputs { display: flex; gap: .5rem; justify-content: center; margin: 1.5rem 0; }
.otp-digit {
  width: 46px; height: 56px;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 6px;
  text-align: center;
  font-family: var(--mono);
  font-size: 1.4rem;
  color: var(--gold);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.otp-digit:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.12); }
.otp-hint { font-size: .75rem; color: var(--muted); }

.certificate-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  font-family: var(--mono);
  font-size: .76rem; line-height: 1.8;
  color: var(--muted);
  display: none;
}
.certificate-box.show { display: block; }
.cert-line { display: flex; gap: 1rem; }
.cert-key { color: var(--gold-dim); min-width: 180px; flex-shrink: 0; }
.cert-val { color: var(--text); word-break: break-all; }
.cert-title {
  font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}

/* ── PROGRESS FLOW ── */
.flow-steps {
  display: flex; gap: 0; margin: 2rem 0;
  overflow-x: auto;
}
.flow-step {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; min-width: 80px; gap: .4rem;
  font-size: .68rem; font-family: var(--mono);
  color: var(--faint); text-align: center;
  position: relative; letter-spacing: .04em;
}
.flow-step + .flow-step::before {
  content: '──';
  position: absolute; top: 12px; left: -30%;
  color: var(--faint); font-size: .6rem;
}
.flow-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid var(--faint);
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem;
  transition: all .3s;
}
.flow-step.done .flow-dot { background: var(--green-lt); border-color: var(--green-lt); color: #000; }
.flow-step.active .flow-dot { background: var(--gold); border-color: var(--gold); color: #000; animation: pulse 1.5s infinite; }
.flow-step.done { color: var(--green-lt); }
.flow-step.active { color: var(--gold); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero { padding: 4rem 0 3rem; }
  .module-grid { grid-template-columns: 1fr; }
  .pipeline { flex-direction: column; }
  .pipeline-step + .pipeline-step::before { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ── ANIMATIONS ── */
.fade-in { animation: fadeIn .5s ease forwards; }
@keyframes fadeIn { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: none; } }
