/* LatchID — shared design system
   Subject: identity/access control. Visual language borrows from
   hardware nameplates and lock spec sheets — tick rules, square
   status lights, flat bordered panels — instead of generic SaaS
   glow-and-card templates. */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600&family=Archivo+Expanded:wght@600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #111113;
  --panel: #19191c;
  --field: #1e1e22;
  --line: #2a292e;
  --line-soft: #201f23;
  --ink: #ece9e4;
  --muted: #8f8c92;
  --muted-dim: #625f65;
  --red: #e0394d;
  --red-deep: #5c1c24;
  --brass: #b8925a;
  --ok: #5fae82;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

h1, h2, h3, .display {
  font-family: 'Archivo Expanded', 'Archivo', sans-serif;
  letter-spacing: -0.01em;
  font-weight: 600;
}

h1 { font-weight: 700; letter-spacing: -0.02em; }

code, .mono {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}

/* faint schematic grid, fixed, behind everything */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.35;
  mask-image: linear-gradient(to bottom, black, black 60%, transparent 100%);
}

/* ---------- header ---------- */

header.site {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px clamp(20px, 6vw, 72px) 24px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Archivo Expanded', sans-serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}

.mark { width: 26px; height: 26px; object-fit: contain; display: block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s ease;
}

.nav-links a:hover { color: var(--ink); }

.nav-links a i { font-size: 14px; }

/* ---------- footer ---------- */

footer.site {
  position: relative;
  z-index: 2;
  padding: 22px clamp(20px, 6vw, 72px) 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted-dim);
  border-top: 1px solid var(--line);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12.5px;
  transition: color 0.15s ease;
}

.footer-links a:hover { color: var(--ink); }

@media (max-width: 560px) {
  header.site, main, footer.site { padding-left: 20px; padding-right: 20px; }
  footer.site { flex-direction: column; gap: 10px; align-items: flex-start; }
}

@media (max-width: 480px) {
  header.site { padding-top: 20px; padding-bottom: 18px; }
  .wordmark { font-size: 14.5px; gap: 8px; }
  .mark { width: 22px; height: 22px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 12.5px; }
}

/* ---------- tick rule: the one recurring signature device ---------- */

.ruler {
  height: 6px;
  width: 120px;
  background-image: repeating-linear-gradient(
    to right, var(--muted-dim) 0 1px, transparent 1px 9px
  );
  background-position: bottom left;
  background-repeat: repeat-x;
  background-size: auto 100%;
  margin-bottom: 20px;
}

/* ---------- status light: square, inline, not a pill ---------- */

.state {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 26px;
}

.state .light {
  width: 7px;
  height: 7px;
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-deep);
  flex-shrink: 0;
}

/* ---------- buttons / links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font-family: 'Archivo', sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 3px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.btn:hover { border-color: var(--muted); background: var(--panel); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.btn-primary:hover { background: #c92f42; border-color: #c92f42; }

.text-link {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--red-deep);
  padding-bottom: 2px;
  transition: border-color 0.15s ease;
}

.text-link:hover { border-color: var(--red); }

/* ---------- flat panels (replace rounded shadow cards) ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
}

/* ---------- list rows (case studies / legal docs) ---------- */

.row-list {
  border-top: 1px solid var(--line);
}

.row-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  position: relative;
  cursor: pointer;
  transition: padding-left 0.15s ease;
}

.row-item::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--red);
  transform: scaleY(0);
  transition: transform 0.15s ease;
}

.row-item:hover { padding-left: 16px; }
.row-item:hover::before { transform: scaleY(1); }

.row-item img {
  height: 28px;
  max-width: 120px;
  object-fit: contain;
  flex-shrink: 0;
}

.row-item .row-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.row-item .row-summary {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}

.row-item .row-main { flex: 1; min-width: 0; }

#empty {
  color: var(--muted);
  font-size: 14px;
  padding: 22px 4px;
  display: none;
}

/* ---------- detail view (markdown content) ---------- */

#detail { display: none; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 32px;
  cursor: pointer;
}

.back-link:hover { color: var(--ink); }

.detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.detail-header img {
  height: 36px;
  max-width: 150px;
  object-fit: contain;
}

.detail-header .row-title { font-size: 19px; margin: 0; }

#content {
  font-size: 16px;
  line-height: 1.7;
  max-width: 68ch;
}

#content h1 { font-family: 'Archivo Expanded', sans-serif; font-size: 1.7rem; margin-top: 0; }

#content h2 {
  font-family: 'Archivo Expanded', sans-serif;
  font-size: 1.2rem;
  margin-top: 44px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

#content p, #content li { color: #d3d0cc; }
#content strong { color: var(--ink); }

#content a {
  color: var(--red);
  text-decoration: none;
  border-bottom: 1px solid var(--red-deep);
}

#content hr { border: none; border-top: 1px solid var(--line); margin: 32px 0; }

#content blockquote {
  margin: 0;
  padding-left: 16px;
  border-left: 2px solid var(--red);
  color: var(--muted);
  font-style: italic;
}

#content code {
  background: var(--field);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.88em;
}

#content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 15px;
}

#content th, #content td {
  text-align: left;
  padding: 10px 16px 10px 0;
  border-bottom: 1px solid var(--line);
}

#content th {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

#content td { color: #d3d0cc; }
