@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --ink: #14181A;
  --ink-muted: #5B564A;
  --paper: #E4DCC8;
  --paper-deep: #D8CCA9;
  --paper-line: #C7B98D;
  --navy: #131D26;
  --navy-deep: #0C141B;
  --seal-red: #8B2E2E;
  --seal-red-deep: #6E2222;
  --verified-green: #2F5E42;
  --brass: #96793B;
  --brass-light: #B8985A;
  --white: #FBF9F3;

  --font-display: 'Source Serif 4', Georgia, serif;
  --font-body: 'IBM Plex Sans', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --radius: 3px;
  --shadow-card: 0 1px 2px rgba(20,24,26,0.08), 0 4px 14px rgba(20,24,26,0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brass); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; margin: 0 0 0.4em; color: var(--ink); }
h1 { font-size: 2.4rem; letter-spacing: -0.01em; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

code, .mono, .hash { font-family: var(--font-mono); }

/* ---------- Layout shell ---------- */
.site-header {
  background: var(--navy);
  color: var(--white);
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
  border-bottom: 2px solid var(--brass);
}
.site-header .header-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 62px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--white);
}
.brand .brand-mark {
  width: 30px; height: 30px; border: 1.5px solid var(--brass-light); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.6rem; color: var(--brass-light);
}
.brand-sub { font-family: var(--font-body); font-weight: 400; font-size: 0.68rem; color: #9AA6AE; letter-spacing: 0.04em; text-transform: uppercase; display: block; margin-top: 1px;}

.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { color: #C9D0D4; font-size: 0.92rem; font-weight: 500; }
.nav-links a:hover { color: var(--white); text-decoration: none; }
.nav-links a.active { color: var(--brass-light); }

.user-chip {
  display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: #C9D0D4;
}
.user-chip .role-tag {
  background: rgba(184,152,90,0.16); color: var(--brass-light); padding: 3px 9px; border-radius: 20px;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600;
}
.btn-logout {
  background: transparent; border: 1px solid #3B4854; color: #C9D0D4; padding: 6px 12px; border-radius: var(--radius);
  cursor: pointer; font-family: var(--font-body); font-size: 0.82rem;
}
.btn-logout:hover { border-color: var(--brass-light); color: var(--white); }

.container { max-width: 1180px; margin: 0 auto; padding: 40px 24px 80px; }
.container-narrow { max-width: 620px; margin: 0 auto; padding: 60px 24px 80px; }

.site-footer {
  background: var(--navy-deep); color: #8A96A0; padding: 28px 24px; font-size: 0.82rem; text-align: center;
  border-top: 1px solid #22303A;
}
.site-footer a { color: #ABB6BE; }

/* ---------- Cards / dossier folder motif ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 28px;
}
.folder-card {
  background: var(--white);
  border: 1px solid var(--paper-line);
  border-top: 3px solid var(--brass);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 24px;
}
.eyebrow {
  font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--brass); font-weight: 600; margin-bottom: 8px; display: block;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.9rem;
  padding: 11px 20px; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer;
  transition: all 0.15s ease;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-deep); text-decoration: none; }
.btn-brass { background: var(--brass); color: var(--white); }
.btn-brass:hover { background: #7E6631; text-decoration: none; }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--white); text-decoration: none; }
.btn-danger { background: var(--seal-red); color: var(--white); }
.btn-danger:hover { background: var(--seal-red-deep); text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Forms ---------- */
label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
input, select, textarea {
  width: 100%; padding: 10px 12px; font-family: var(--font-body); font-size: 0.95rem;
  border: 1px solid #B9AF95; border-radius: var(--radius); background: var(--white); color: var(--ink);
  margin-bottom: 18px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brass); outline-offset: 1px; border-color: var(--brass);
}
.field-hint { font-size: 0.78rem; color: var(--ink-muted); margin-top: -14px; margin-bottom: 18px; }
.form-error {
  background: #F5E6E4; border: 1px solid var(--seal-red); color: var(--seal-red-deep);
  padding: 12px 14px; border-radius: var(--radius); font-size: 0.88rem; margin-bottom: 20px;
}
.form-success {
  background: #E7EFE8; border: 1px solid var(--verified-green); color: var(--verified-green);
  padding: 12px 14px; border-radius: var(--radius); font-size: 0.88rem; margin-bottom: 20px;
}

/* ---------- Tables / lists ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-muted); padding: 10px 12px; border-bottom: 2px solid var(--paper-line); }
td { padding: 12px; border-bottom: 1px solid var(--paper-deep); vertical-align: top; }
tr:hover td { background: rgba(150,121,59,0.05); }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.badge-open { background: #E5EEE8; color: var(--verified-green); }
.badge-under_trial { background: #F5EAD6; color: #8A6417; }
.badge-closed { background: #E7E4DA; color: var(--ink-muted); }
.badge-pending { background: #F5EAD6; color: #8A6417; }
.badge-active { background: #E5EEE8; color: var(--verified-green); }
.badge-suspended { background: #F5E6E4; color: var(--seal-red-deep); }
.badge-flagged { background: #F5E6E4; color: var(--seal-red-deep); }

.hash-chip {
  font-family: var(--font-mono); font-size: 0.78rem; background: var(--paper-deep); color: var(--ink);
  padding: 2px 8px; border-radius: var(--radius); word-break: break-all;
}

/* ---------- Hero / hash chain signature element ---------- */
.hero {
  background: var(--navy); color: var(--white); padding: 70px 24px 60px; position: relative; overflow: hidden;
  border-bottom: 2px solid var(--brass);
}
.hero-inner { max-width: 1180px; margin: 0 auto; position: relative; z-index: 2; }
.hero-eyebrow { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.1em; color: var(--brass-light); text-transform: uppercase; margin-bottom: 16px; }
.hero h1 { color: var(--white); font-size: 3rem; max-width: 800px; margin-bottom: 20px; }
.hero p.lede { font-size: 1.15rem; color: #C9D0D4; max-width: 620px; margin-bottom: 32px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 56px; }

.chain-row {
  display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding-bottom: 8px;
}
.chain-block {
  flex: 1 1 0; min-width: 150px;
  background: #1B2A36; border: 1px solid #2C3E4B; border-radius: var(--radius);
  padding: 14px 16px; position: relative;
  opacity: 0; transform: translateY(8px);
  animation: block-in 0.5s ease forwards;
}
.chain-block:nth-child(1) { animation-delay: 0.05s; }
.chain-block:nth-child(2) { animation-delay: 0.25s; }
.chain-block:nth-child(3) { animation-delay: 0.45s; }
.chain-block:nth-child(4) { animation-delay: 0.65s; }
.chain-block:nth-child(5) { animation-delay: 0.85s; }
@keyframes block-in { to { opacity: 1; transform: translateY(0); } }

.chain-block .step-num { font-family: var(--font-mono); font-size: 0.7rem; color: var(--brass-light); }
.chain-block .step-title { font-family: var(--font-body); font-weight: 600; font-size: 0.92rem; margin: 6px 0 4px; color: var(--white); }
.chain-block .step-hash { font-family: var(--font-mono); font-size: 0.68rem; color: #6E7C86; word-break: break-all; }
.chain-link {
  flex: 0 0 20px; display: flex; align-items: center; justify-content: center;
  color: var(--brass-light); font-size: 1rem; opacity: 0; animation: block-in 0.4s ease forwards;
}
.chain-link:nth-of-type(2) { animation-delay: 0.2s; }

/* ---------- Landing sections ---------- */
.section { padding: 64px 24px; }
.section-title-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; gap: 12px;}
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.role-card { background: var(--white); border: 1px solid var(--paper-line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-card); }
.role-card .role-icon { font-family: var(--font-mono); font-size: 0.72rem; color: var(--brass); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; display:block;}

@media (max-width: 860px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.1rem; }
  .chain-row { flex-direction: column; }
  .chain-link { display: none; }
}

/* ---------- Dashboard stat tiles ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-tile { background: var(--white); border: 1px solid var(--paper-line); border-left: 3px solid var(--brass); border-radius: var(--radius); padding: 18px 20px; }
.stat-tile .stat-num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-tile .stat-label { font-size: 0.8rem; color: var(--ink-muted); margin-top: 6px; }

/* ---------- Evidence chain timeline (functional reuse of hero motif) ---------- */
.timeline { border-left: 2px solid var(--brass); margin-left: 10px; padding-left: 24px; }
.timeline-item { position: relative; padding-bottom: 26px; }
.timeline-item::before {
  content: ''; position: absolute; left: -30px; top: 4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--brass); border: 2px solid var(--white); box-shadow: 0 0 0 2px var(--brass);
}
.timeline-item.verdict-fail::before { background: var(--seal-red); box-shadow: 0 0 0 2px var(--seal-red); }
.timeline-item .t-action { font-weight: 600; font-size: 0.92rem; }
.timeline-item .t-meta { font-size: 0.8rem; color: var(--ink-muted); margin: 2px 0 6px; }
.timeline-item .t-detail { font-size: 0.85rem; color: var(--ink); margin-bottom: 6px; }

.verdict-banner {
  padding: 18px 22px; border-radius: var(--radius); margin-bottom: 28px; font-weight: 600; display: flex; align-items: center; gap: 12px;
}
.verdict-pass { background: #E5EEE8; border: 1px solid var(--verified-green); color: var(--verified-green); }
.verdict-fail { background: #F5E6E4; border: 1px solid var(--seal-red); color: var(--seal-red-deep); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--ink-muted); }
.empty-state h3 { color: var(--ink-muted); }

.breadcrumb { font-size: 0.82rem; color: var(--ink-muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--ink-muted); }

.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

.kv-list dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); margin-top: 12px; }
.kv-list dd { margin: 2px 0 0; font-size: 0.95rem; }
.kv-list dt:first-child { margin-top: 0; }
