/* Iustitia — shared stylesheet (landing + docs). Polar-style dark SaaS, violet→indigo. */

:root {
  --bg: #0f0b1a;
  --bg-soft: #15102a;
  --bg-card: #1a1430;
  --bg-card-hover: #211a3d;
  --border: #2a2148;
  --border-soft: #1f1840;
  --text: #e7e3f5;
  --text-dim: #a89fc9;
  --text-faint: #6f6694;
  --accent: #8b5cf6;
  --accent-2: #6366f1;
  --accent-soft: rgba(139, 92, 246, 0.14);
  --accent-line: rgba(139, 92, 246, 0.35);
  --grad: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 45%, #6366f1 100%);
  --green: #4ade80;
  --yellow: #facc15;
  --red: #f87171;
  --green-soft: rgba(74, 222, 128, 0.14);
  --yellow-soft: rgba(250, 204, 21, 0.14);
  --red-soft: rgba(248, 113, 113, 0.14);
  --radius: 14px;
  --radius-sm: 9px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1140px;
}

* { 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;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient violet haze behind the page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 520px at 78% -8%, rgba(139, 92, 246, 0.20), transparent 60%),
    radial-gradient(760px 480px at 12% 6%, rgba(99, 102, 241, 0.16), transparent 60%);
  pointer-events: none;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #bda6fc; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---- Top navigation ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 11, 26, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 62px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; letter-spacing: 0.2px; color: var(--text); }
.brand .diamond {
  width: 18px; height: 18px;
  background: var(--grad);
  transform: rotate(45deg);
  border-radius: 4px;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.55);
}
.brand:hover { color: var(--text); }
.nav-links { display: flex; gap: 22px; margin-left: 8px; }
.nav-links a { color: var(--text-dim); font-size: 14.5px; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-cta { margin-left: auto; }
.nav-spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border-radius: 10px;
  font-weight: 600; font-size: 14.5px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  cursor: pointer;
}
.btn:hover { background: var(--bg-card-hover); border-color: var(--accent-line); color: var(--text); transform: translateY(-1px); }
.btn-primary {
  background: var(--grad);
  border: none;
  color: #fff;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.30);
}
.btn-primary:hover { color: #fff; box-shadow: 0 10px 30px rgba(139, 92, 246, 0.42); }

/* ---- Section headers (two-line: small label + big gradient title) ---- */
.section { padding: 86px 0; }
.section-label {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 16px;
}
.section-title .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.section-lead { color: var(--text-dim); font-size: 17px; max-width: 640px; }

/* ---- Hero ---- */
.hero { padding: 72px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 13px; border-radius: 999px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  font-size: 12.5px; font-weight: 600; color: #c4b5fd;
  margin-bottom: 22px;
}
.hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.hero h1 {
  font-size: clamp(40px, 6.2vw, 68px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin-bottom: 18px;
}
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.hero p.tagline { color: var(--text-dim); font-size: 18px; max-width: 520px; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.hero-meta { color: var(--text-faint); font-size: 13.5px; }
.hero-meta code { font-family: var(--mono); color: var(--text-dim); background: var(--bg-soft); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border-soft); }

/* ---- Console widget ---- */
.console {
  background: linear-gradient(180deg, #120c24 0%, #0c0817 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(139, 92, 246, 0.08) inset;
  overflow: hidden;
  font-family: var(--mono);
}
.console-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px;
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid var(--border-soft);
}
.console-bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.console-bar .r { background: #ff5f57; }
.console-bar .y { background: #febc2e; }
.console-bar .g { background: #28c840; }
.console-bar .title { margin-left: 8px; font-size: 12px; color: var(--text-faint); }
.console-body { padding: 18px 18px 20px; font-size: 13.5px; line-height: 1.7; min-height: 188px; color: var(--text-dim); }
.console-body .line { white-space: pre-wrap; }
.console-body .prompt { color: var(--accent); }
.console-body .ok { color: var(--green); }
.console-body .warn { color: var(--yellow); }
.console-body .flag { color: var(--red); }
.console-body .dim { color: var(--text-faint); }
.cursor { display: inline-block; width: 8px; height: 15px; background: var(--accent); vertical-align: -2px; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---- Validated-on strip ---- */
.validated { padding: 30px 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); background: rgba(0,0,0,0.12); }
.validated-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }
.validated-label { font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--text-faint); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 7px 15px; border-radius: 999px;
  background: var(--bg-card); border: 1px solid var(--border);
  font-size: 13.5px; font-weight: 600; color: var(--text-dim);
  font-family: var(--mono);
}
.validated-sub { color: var(--text-faint); font-size: 13px; width: 100%; margin-top: 4px; }

/* ---- Feature grid ---- */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color .4s cubic-bezier(.23,1,.32,1), background .3s ease, transform .3s ease, box-shadow .3s ease;
  position: relative;
  overflow: hidden;
}
/* detect.ac-style light sweep on hover */
.card::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(139,92,246,0.10), transparent);
  transition: left .6s ease;
  pointer-events: none;
  z-index: 0;
}
.card:hover::before { left: 100%; }
.card:hover { border-color: var(--accent-line); background: var(--bg-card-hover); transform: translateY(-4px) scale(1.02); box-shadow: 0 14px 30px rgba(139,92,246,0.12); }
.card .icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; margin-bottom: 16px;
  transition: transform .4s cubic-bezier(.23,1,.32,1), box-shadow .3s ease;
  position: relative; z-index: 1;
}
.card:hover .icon { transform: scale(1.12) rotate(-6deg); box-shadow: 0 6px 18px rgba(139,92,246,0.28); }
.card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; position: relative; z-index: 1; }
.card p { color: var(--text-dim); font-size: 14.5px; position: relative; z-index: 1; }

/* ---- Philosophy block ---- */
.philosophy { background: var(--bg-soft); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); margin-bottom: 96px; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 34px; }
.pillar { padding: 22px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.pillar h4 { font-size: 15px; margin-bottom: 8px; color: var(--text); }
.pillar p { color: var(--text-dim); font-size: 14px; }
.pillar .num { font-family: var(--mono); color: var(--accent); font-size: 13px; font-weight: 700; display: block; margin-bottom: 10px; letter-spacing: 1px; }

/* ---- Stats band ---- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 30px; }
.stat { text-align: center; padding: 26px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.stat .n { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; letter-spacing: -0.02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.stat .l { color: var(--text-faint); font-size: 12.5px; margin-top: 6px; letter-spacing: 0.3px; }

/* ---- Install ---- */
.install-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: start; }
.steps { list-style: none; counter-reset: step; }
.steps li { position: relative; padding: 16px 0 16px 52px; border-bottom: 1px solid var(--border-soft); }
.steps li:last-child { border-bottom: none; }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 14px; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent); font-weight: 700; display: flex; align-items: center; justify-content: center; font-family: var(--mono); }
.steps li b { color: var(--text); }
.steps li span { color: var(--text-dim); font-size: 14.5px; }
.prereqs { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.prereqs h4 { font-size: 14px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-faint); margin-bottom: 14px; }
.prereqs .row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border-soft); font-size: 14.5px; }
.prereqs .row:last-child { border-bottom: none; }
.prereqs .row span:first-child { color: var(--text); }
.prereqs .row span:last-child { color: var(--text-dim); font-family: var(--mono); font-size: 13.5px; }
.install-cta { margin-top: 18px; }

/* ---- Checks teaser ---- */
.groups { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.group-card { padding: 24px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color .15s ease, transform .15s ease; display: block; }
.group-card:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.group-card .gname { font-size: 16px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.group-card .gcount { font-family: var(--mono); color: var(--accent); font-size: 26px; font-weight: 700; }
.group-card .gdesc { color: var(--text-faint); font-size: 13px; margin-top: 10px; }

/* ---- Footer ---- */
.footer { border-top: 1px solid var(--border-soft); padding: 40px 0 50px; margin-top: 30px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; color: var(--text-faint); font-size: 13.5px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text-dim); }
.footer-disclaimer { width: 100%; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-soft); font-size: 12.5px; color: var(--text-faint); }

/* ---- Docs: catalog + per-check ---- */
.docs-layout { display: grid; grid-template-columns: 240px 1fr; gap: 36px; align-items: start; padding: 36px 0 60px; }
.docs-side { position: sticky; top: 82px; max-height: calc(100vh - 104px); overflow-y: auto; align-self: start; padding-right: 4px; }
/* thin scrollbar for the docs sidebar so it reads as an independent panel */
.docs-side { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.docs-side::-webkit-scrollbar { width: 7px; }
.docs-side::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.docs-side::-webkit-scrollbar-thumb:hover { background: var(--accent-line); }
.docs-side::-webkit-scrollbar-track { background: transparent; }
.docs-side h4 { font-size: 11.5px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--text-faint); margin: 18px 0 8px; }
.docs-side h4:first-child { margin-top: 0; }
.docs-side a { display: block; padding: 5px 10px; border-radius: 7px; color: var(--text-dim); font-size: 14px; }
.docs-side a:hover { background: var(--bg-card); color: var(--text); }
.docs-side a.cur { background: var(--accent-soft); color: #c4b5fd; font-weight: 600; }
.docs-side a .badge-t { font-size: 10px; margin-left: 6px; opacity: .8; }

.group-head { display: flex; align-items: baseline; gap: 12px; margin: 40px 0 18px; }
.group-head h2 { font-size: 22px; font-weight: 800; }
.group-head .gtag { color: var(--text-faint); font-family: var(--mono); font-size: 14px; }

.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.check-card { display: block; padding: 18px 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: border-color .15s ease, transform .15s ease, background .15s ease; }
.check-card:hover { border-color: var(--accent-line); background: var(--bg-card-hover); transform: translateY(-2px); }
.check-card .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.check-card .name { font-weight: 700; font-size: 15.5px; color: var(--text); }
.check-card .desc { color: var(--text-faint); font-size: 13px; }

/* Tier badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; font-family: var(--sans); }
.badge-def { background: var(--red-soft); color: var(--red); border: 1px solid rgba(248,113,113,0.3); }
.badge-inf { background: var(--yellow-soft); color: var(--yellow); border: 1px solid rgba(250,204,21,0.3); }
.badge-grn { background: var(--green-soft); color: var(--green); border: 1px solid rgba(74,222,128,0.3); }
.badge .glyph { font-family: var(--mono); }

/* Per-check page */
.check-head { padding: 30px 0 10px; border-bottom: 1px solid var(--border-soft); margin-bottom: 30px; }
.breadcrumb { color: var(--text-faint); font-size: 13px; margin-bottom: 14px; }
.breadcrumb a { color: var(--text-dim); }
.breadcrumb .sep { margin: 0 8px; }
.check-title { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.check-title h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.check-title .meta { color: var(--text-faint); font-family: var(--mono); font-size: 13.5px; }
.check-sub { color: var(--text-dim); font-size: 16px; max-width: 700px; }

.doc-nav { display: flex; justify-content: space-between; gap: 14px; margin: 18px 0 30px; }
.doc-nav a { flex: 1; padding: 14px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: border-color .15s ease, background .15s ease; }
.doc-nav a:hover { border-color: var(--accent-line); background: var(--bg-card-hover); }
.doc-nav .dir { font-size: 11.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-faint); }
.doc-nav .who { font-weight: 700; color: var(--text); margin-top: 3px; }
.doc-nav .next { text-align: right; }

.doc-section { margin-bottom: 34px; }
.doc-section h2 { font-size: 13px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; font-weight: 700; }
.doc-section p { color: var(--text); font-size: 15.5px; max-width: 760px; }
.doc-section .sig { background: #120c24; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; font-family: var(--mono); font-size: 13.5px; color: var(--text-dim); line-height: 1.7; max-width: 760px; white-space: pre-wrap; }
.doc-section ul { list-style: none; max-width: 760px; }
.doc-section ul li { position: relative; padding: 7px 0 7px 24px; color: var(--text-dim); font-size: 14.5px; border-bottom: 1px solid var(--border-soft); }
.doc-section ul li:last-child { border-bottom: none; }
.doc-section ul li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }
.doc-section ul li b { color: var(--text); font-weight: 600; }

.cfg-table { width: 100%; max-width: 760px; border-collapse: collapse; font-size: 14.5px; }
.cfg-table th, .cfg-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border-soft); }
.cfg-table th { color: var(--text-faint); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; font-weight: 700; }
.cfg-table td { color: var(--text); }
.cfg-table td.val { font-family: var(--mono); color: var(--text-dim); }
.cfg-table .const-row td { color: var(--text-dim); }
.cfg-table .const-row td.val { color: var(--accent); }

.src-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 9px; font-family: var(--mono); font-size: 13px; color: var(--text-dim); transition: border-color .15s ease; }
.src-link:hover { border-color: var(--accent-line); color: var(--text); }

/* ---- Responsive ---- */
@media (max-width: 920px) {
  .hero-grid, .install-grid, .docs-layout { grid-template-columns: 1fr; }
  .docs-side { position: static; max-height: none; overflow: visible; }
  .grid-3, .grid-4, .pillars, .groups, .stats { grid-template-columns: repeat(2, 1fr); }
  .check-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid-3, .grid-4, .pillars, .groups, .stats, .grid-2 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .section { padding: 60px 0; }
}

/* ---- Scroll-reveal animations (detect.ac-style) ---- */
/* Elements start hidden + offset; .in-view (added by assets/reveal.js via
   IntersectionObserver) animates them in. .delay-N staggers a grid. */
.fade-in-scroll { opacity: 0; transform: translateY(30px); transition: opacity .8s ease, transform .8s ease; }
.slide-in-left   { opacity: 0; transform: translateX(-50px); transition: opacity .8s ease, transform .8s ease; }
.slide-in-right  { opacity: 0; transform: translateX(50px); transition: opacity .8s ease, transform .8s ease; }
.slide-in-bottom { opacity: 0; transform: translateY(50px); transition: opacity .8s ease, transform .8s ease; }
.zoom-in         { opacity: 0; transform: scale(.85); transition: opacity .8s ease, transform .8s cubic-bezier(.175,.885,.32,1.275); }
.in-view { opacity: 1 !important; transform: none !important; }
.delay-1 { transition-delay: .10s; }
.delay-2 { transition-delay: .20s; }
.delay-3 { transition-delay: .30s; }
.delay-4 { transition-delay: .40s; }
.delay-5 { transition-delay: .50s; }
.delay-6 { transition-delay: .60s; }
.delay-7 { transition-delay: .70s; }
@media (prefers-reduced-motion: reduce) {
  .fade-in-scroll, .slide-in-left, .slide-in-right, .slide-in-bottom, .zoom-in {
    opacity: 1 !important; transform: none !important; transition: none;
  }
}