/* ===================================================================
   audit-labs.dev — shared styles
   Design system: DM Serif Display (display) · DM Sans (body) ·
   IBM Plex Mono (labels/code). Warm palette, amber accent.

   The home page uses a single-column hero (`.hero`); project pages
   opt into a two-column hero with `.hero.split`.
   =================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --black: #0a0a0a;
    --off-white: #f4f1eb;
    --warm-white: #faf8f4;
    --amber: #d97706;
    --amber-light: #fbbf24;
    --green: #15803d;
    --gray-1: #1c1c1c;
    --gray-2: #2e2e2e;
    --gray-3: #6b6b6b;
    --gray-4: #a3a3a3;
    --gray-5: #d4d4d4;
    --border: #e5e1d8;
    --red: #c0392b;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--warm-white);
    color: var(--black);
    line-height: 1.6;
}

.mono { font-family: 'IBM Plex Mono', monospace; }
.serif { font-family: 'DM Serif Display', serif; }

/* ---------- NAV ---------- */
nav { position: sticky; top: 0; z-index: 100; background: var(--warm-white); border-bottom: 1px solid var(--border); padding: 0 2rem; }
.nav-inner { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; height: 60px; }
.logo { font-family: 'IBM Plex Mono', monospace; font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em; color: var(--black); text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.logo span { color: var(--amber); }
.nav-links { display: flex; gap: 2rem; align-items: center; list-style: none; flex-shrink: 0; }
.nav-links a { font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; color: var(--gray-3); text-decoration: none; white-space: nowrap; transition: color 0.15s; }
.nav-links a:hover { color: var(--black); }
.nav-links .btn-github { background: var(--black); color: var(--off-white); padding: 0.45rem 1rem; border-radius: 4px; font-size: 0.75rem; transition: background 0.15s; }
.nav-links .btn-github:hover { background: var(--gray-2); color: var(--off-white); }

/* ---------- HERO (base = home; .split = project pages) ---------- */
.hero { background: var(--black); color: var(--off-white); padding: 7rem 2rem 5rem; position: relative; overflow: hidden; }
.hero::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255,255,255,0.03) 39px, rgba(255,255,255,0.03) 40px),
        repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255,255,255,0.03) 39px, rgba(255,255,255,0.03) 40px);
}
.hero-inner { max-width: 1100px; margin: 0 auto; position: relative; }

.hero.split { padding: 5.5rem 2rem 4.5rem; }
.hero.split .hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; align-items: center; }
/* Let grid tracks shrink below content width so a long code line scrolls inside
   its box instead of widening the track and overflowing the page. */
.hero.split .hero-inner > * { min-width: 0; }
@media (max-width: 820px) { .hero.split .hero-inner { grid-template-columns: 1fr; gap: 2.5rem; } }

.hero-label { font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--amber-light); margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.5rem; }
.hero-label::before { content: ''; display: inline-block; width: 1.5rem; height: 1px; background: var(--amber-light); }

.crumb { font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--amber-light); margin-bottom: 1.4rem; display: flex; align-items: center; gap: 0.5rem; }
.crumb::before { content: ''; width: 1.5rem; height: 1px; background: var(--amber-light); }
.crumb a { color: var(--amber-light); text-decoration: none; opacity: 0.8; }

h1 { font-family: 'DM Serif Display', serif; font-size: clamp(2.8rem, 6vw, 5rem); font-weight: 400; line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 1.5rem; max-width: 700px; }
h1 em { font-style: italic; color: var(--amber-light); }
.hero.split h1 { font-size: clamp(2.4rem, 5vw, 3.9rem); line-height: 1.08; margin-bottom: 1.3rem; max-width: none; }

.hero-desc { font-size: 1.05rem; color: #a09a8e; max-width: 540px; margin-bottom: 2.5rem; line-height: 1.75; }
.hero.split .hero-desc { font-size: 1.02rem; max-width: 34rem; margin-bottom: 2rem; }

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 4rem; }
.hero.split .hero-actions { margin-bottom: 0; }

.btn-primary { background: var(--amber); color: #fff; text-decoration: none; padding: 0.75rem 1.5rem; border-radius: 4px; font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; font-weight: 500; transition: background 0.15s; }
.btn-primary:hover { background: var(--amber-light); color: #000; }
.btn-secondary { background: transparent; color: var(--gray-4); text-decoration: none; padding: 0.75rem 1.5rem; border-radius: 4px; font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; border: 1px solid var(--gray-2); transition: border-color 0.15s, color 0.15s; }
.btn-secondary:hover { border-color: var(--gray-4); color: var(--off-white); }

/* ---------- TERMINAL ---------- */
.terminal { background: #111; border: 1px solid #2a2a2a; border-radius: 8px; overflow: hidden; max-width: 600px; }
.hero.split .terminal { max-width: none; }
.terminal-bar { background: #1a1a1a; border-bottom: 1px solid #2a2a2a; padding: 0.6rem 1rem; display: flex; gap: 0.4rem; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-red { background: #ff5f57; } .dot-yellow { background: #febc2e; } .dot-green { background: #28c840; }
.terminal-body { padding: 1.25rem 1.5rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.82rem; line-height: 1.9; overflow-x: auto; }
.hero.split .terminal-body { padding: 1.2rem 1.4rem; font-size: 0.78rem; line-height: 1.95; }
.t-prompt { color: #5a9060; } .t-cmd { color: #e8e0d0; } .t-comment { color: #555; }
.t-out { color: #7a9f7a; } .t-path { color: #d4a862; } .t-dim { color: #444; }
.t-bad { color: #e06c5e; } .t-hash { color: #8a8a8a; }

/* ---------- SECTIONS ---------- */
section { padding: 5rem 2rem; border-bottom: 1px solid var(--border); }
.section-inner { max-width: 1100px; margin: 0 auto; }
.eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber); margin-bottom: 0.9rem; }
h2 { font-family: 'DM Serif Display', serif; font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 400; line-height: 1.2; }
.eyebrow + h2 { margin-bottom: 0.6rem; }
.lede { color: var(--gray-3); font-size: 1rem; max-width: 44rem; line-height: 1.7; }

.section-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 3rem; flex-wrap: wrap; gap: 1rem; }
.section-link { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; color: var(--gray-3); text-decoration: none; border-bottom: 1px solid var(--gray-5); padding-bottom: 1px; transition: color 0.15s; }
.section-link:hover { color: var(--black); }

/* ---------- HOME: repos grid ---------- */
.repos { background: var(--warm-white); }
.repo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 1.5rem; }
.repo-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 2rem; text-decoration: none; color: inherit; display: block; transition: border-color 0.15s, box-shadow 0.15s; position: relative; }
.repo-card:hover { border-color: var(--amber); box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.repo-tag { font-family: 'IBM Plex Mono', monospace; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--amber); background: #fef3c7; padding: 0.2rem 0.5rem; border-radius: 3px; display: inline-block; margin-bottom: 1rem; }
.repo-card h3 { font-family: 'IBM Plex Mono', monospace; font-size: 0.95rem; font-weight: 700; margin-bottom: 0.6rem; color: var(--black); }
.repo-card p { font-size: 0.9rem; color: var(--gray-3); line-height: 1.65; margin-bottom: 1.5rem; }
.repo-langs { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.lang-badge { font-family: 'IBM Plex Mono', monospace; font-size: 0.65rem; background: var(--off-white); border: 1px solid var(--border); color: var(--gray-3); padding: 0.15rem 0.5rem; border-radius: 3px; }

/* ---------- HOME: tools grid ---------- */
.tools { background: #fff; }
.tools-intro { max-width: 550px; margin-bottom: 3rem; }
.tools-intro p { color: var(--gray-3); font-size: 0.95rem; margin-top: 0.75rem; line-height: 1.7; }
.tool-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.tool-item { background: #fff; padding: 1.75rem; transition: background 0.15s; }
.tool-item:hover { background: var(--warm-white); }
.tool-icon { font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; color: var(--amber); margin-bottom: 0.75rem; letter-spacing: 0.05em; }
.tool-item h4 { font-family: 'IBM Plex Mono', monospace; font-size: 0.85rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--black); }
.tool-item p { font-size: 0.82rem; color: var(--gray-3); line-height: 1.6; }

/* ---------- FRAMEWORKS strip (home + project pages) ---------- */
.frameworks { padding: 3.5rem 2rem; background: var(--warm-white); }
.frameworks-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 3rem; flex-wrap: wrap; }
.frameworks-label { font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gray-4); white-space: nowrap; }
.frameworks-list { display: flex; gap: 2.5rem; flex-wrap: wrap; align-items: center; }
.framework-tag { font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; font-weight: 700; color: var(--gray-3); letter-spacing: 0.05em; }

/* ---------- PROJECT PAGES: overview cards ---------- */
.guarantees { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; margin-top: 2.6rem; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 1.8rem; transition: border-color 0.15s, box-shadow 0.15s; }
.card:hover { border-color: var(--amber); box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.card .num { font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; color: var(--amber); letter-spacing: 0.1em; }
.card h3 { font-family: 'DM Serif Display', serif; font-weight: 400; font-size: 1.3rem; margin: 0.5rem 0 0.6rem; }
.card p { font-size: 0.9rem; color: var(--gray-3); line-height: 1.65; }
.card p .mono { color: var(--gray-1); }

/* ---------- PROJECT PAGES: contents / commands list ---------- */
.cmds { background: #fff; }
.cmd-list { margin-top: 2.4rem; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.cmd-row { display: grid; grid-template-columns: 11rem 1fr; gap: 1.5rem; padding: 1.15rem 1.5rem; border-bottom: 1px solid var(--border); align-items: baseline; }
.cmd-row:last-child { border-bottom: none; }
.cmd-row:hover { background: var(--warm-white); }
.cmd-name { font-family: 'IBM Plex Mono', monospace; font-size: 0.85rem; font-weight: 700; color: var(--black); }
.cmd-desc { font-size: 0.9rem; color: var(--gray-3); line-height: 1.6; }
.cmd-desc .mono { color: var(--amber); }
@media (max-width: 560px) { .cmd-row { grid-template-columns: 1fr; gap: 0.3rem; } }

/* ---------- PROJECT PAGES: install / quickstart ---------- */
.install { background: var(--warm-white); }
.install-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; margin-top: 2.4rem; align-items: start; }
.install-grid > * { min-width: 0; }
@media (max-width: 820px) { .install-grid { grid-template-columns: 1fr; } }
.install pre { background: #111; color: #e8e0d0; border-radius: 8px; padding: 1.25rem 1.4rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; line-height: 1.9; overflow-x: auto; }
.install pre .c { color: #555; } .install pre .p { color: #5a9060; }
.badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.2rem; }
.badge { font-family: 'IBM Plex Mono', monospace; font-size: 0.65rem; background: #fff; border: 1px solid var(--border); color: var(--gray-3); padding: 0.2rem 0.55rem; border-radius: 3px; }
.exit { margin-top: 1.4rem; display: flex; flex-direction: column; gap: 0.55rem; }
.exit .e { font-size: 0.85rem; color: var(--gray-3); display: flex; gap: 0.7rem; align-items: baseline; }
.exit .code { font-family: 'IBM Plex Mono', monospace; font-weight: 700; min-width: 1.2rem; }
.exit .g { color: var(--green); } .exit .r { color: var(--red); } .exit .a { color: var(--amber); }

/* ---------- FOOTER ---------- */
footer { background: var(--black); color: var(--gray-4); padding: 3rem 2rem; }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1.5rem; }
.footer-logo { font-family: 'IBM Plex Mono', monospace; font-weight: 700; font-size: 0.9rem; color: var(--gray-4); text-decoration: none; }
.footer-logo span { color: var(--amber); }
.footer-left p { font-size: 0.78rem; color: var(--gray-2); margin-top: 0.4rem; }
.footer-note { font-size: 0.7rem; color: var(--gray-3); max-width: 46ch; line-height: 1.5; }
.footer-links { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.footer-links a { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; color: var(--gray-3); text-decoration: none; transition: color 0.15s; }
.footer-links a:hover { color: var(--off-white); }

/* ---------- HOME ECOSYSTEM DIAGRAM ---------- */
.ecosystem { width: 100%; max-width: 600px; display: flex; flex-direction: column; align-items: stretch; }
.eco-cap { font-family: 'IBM Plex Mono', monospace; font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gray-4); margin-bottom: 1rem; }

.eco-node { display: flex; align-items: center; gap: 0.85rem; background: rgba(255,255,255,0.035); border: 1px solid rgba(255,255,255,0.09); border-radius: 12px; padding: 0.85rem 1.05rem; transition: border-color 0.2s, transform 0.2s; }
.eco-node:hover { border-color: rgba(251,191,36,0.5); transform: translateX(2px); }
.eco-icon { flex-shrink: 0; width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: 9px; background: rgba(251,191,36,0.12); color: var(--amber-light); }
.eco-icon svg { width: 1.15rem; height: 1.15rem; }
.eco-main { display: flex; flex-direction: column; gap: 0.12rem; min-width: 0; }
.eco-name { font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: 0.9rem; color: var(--off-white); }
.eco-role { font-size: 0.78rem; color: #a09a8e; line-height: 1.4; }

/* flagship end node — the destination of the whole pipeline */
.eco-node--flagship { border-color: rgba(251,191,36,0.55); background: linear-gradient(180deg, rgba(251,191,36,0.12), rgba(251,191,36,0.02)); box-shadow: 0 10px 34px rgba(217,119,6,0.16); }
.eco-node--flagship .eco-name { color: var(--amber-light); }
.eco-node--flagship .eco-icon { background: rgba(251,191,36,0.2); }

/* vertical connector with a chevron */
.eco-connector { width: 2px; height: 1.5rem; align-self: center; background: linear-gradient(180deg, rgba(251,191,36,0.75), rgba(251,191,36,0.12)); position: relative; }
.eco-connector::after { content: ''; position: absolute; left: 50%; bottom: -2px; width: 6px; height: 6px; border-right: 2px solid var(--amber-light); border-bottom: 2px solid var(--amber-light); transform: translateX(-50%) rotate(45deg); }

/* artifact pill sitting on the spine */
.eco-artifact { align-self: center; justify-self: center; font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; letter-spacing: 0.01em; color: var(--amber-light); background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.28); border-radius: 999px; padding: 0.25rem 0.75rem; white-space: nowrap; }
/* dashed variant — the conditional output of the optional seal step */
.eco-artifact--dashed { border-style: dashed; }

/* optional step in the spine — dashed border signals it can be skipped */
.eco-node--seal { border-style: dashed; border-color: rgba(251,191,36,0.32); }
.eco-optional { font-family: 'IBM Plex Mono', monospace; font-weight: 400; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--amber-light); border: 1px dashed rgba(251,191,36,0.45); border-radius: 999px; padding: 0.05rem 0.4rem; margin-left: 0.4rem; vertical-align: middle; }

/* control-coverage outputs */
.eco-outputs { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; margin-top: 0.8rem; }
.eco-outputs span { font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; color: var(--off-white); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 0.24rem 0.55rem; }
.eco-outputs span:first-child { color: var(--amber-light); border-color: rgba(251,191,36,0.35); background: rgba(251,191,36,0.1); }

/* ---------- ANIMATION ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.hero-label, .crumb { animation: fadeUp 0.5s ease both; }
h1 { animation: fadeUp 0.5s ease 0.1s both; }
.hero-desc { animation: fadeUp 0.5s ease 0.2s both; }
.hero-actions { animation: fadeUp 0.5s ease 0.3s both; }
.terminal { animation: fadeUp 0.5s ease 0.4s both; }
.ecosystem { animation: fadeUp 0.5s ease 0.4s both; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } html { scroll-behavior: auto; } }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 640px) {
    h1 { font-size: 2.4rem; }
}
