/* LVLground — shared stylesheet
   aesthetic: refined terminal / precision-instrument. deep teal-black, single teal accent,
   monospace display, the spirit-level "calibration line" as a recurring motif. */

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

:root {
  --bg:          #0A1316;
  --bg-elev:     #0F1D22;
  --bg-elev-2:   #13262C;
  --border:      rgba(93, 202, 165, 0.14);
  --border-mid:  rgba(93, 202, 165, 0.26);
  --border-warm: rgba(239, 159, 39, 0.30);

  --text:        #D9E2DE;
  --text-dim:    #8B9C96;
  --text-faint:  #5C6C67;

  --teal:        #5DCAA5;
  --teal-bright: #84E6C6;
  --teal-deep:   #1D9E75;
  --amber:       #EF9F27;
  --coral:       #D85A30;
  --red:         #E24B4A;

  --font-mono:    'Space Mono', ui-monospace, monospace;
  --font-body:    'IBM Plex Sans', system-ui, sans-serif;
  --font-code:    'JetBrains Mono', ui-monospace, monospace;

  --maxw: 1080px;
  --radius: 4px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* atmosphere: faint calibration grid + a single horizon glow up top */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 0.5px, transparent 0.5px),
    linear-gradient(90deg, var(--border) 0.5px, transparent 0.5px);
  background-size: 64px 64px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 0%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  top: -30vh; left: 50%; transform: translateX(-50%);
  width: 80vw; height: 60vh;
  background: radial-gradient(ellipse at center, rgba(29,158,117,0.10), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.wrap { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(10, 19, 22, 0.72);
  border-bottom: 0.5px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand svg { display: block; }
.brand .word { font-family: var(--font-mono); font-size: 19px; letter-spacing: -0.5px; }
.brand .word b { color: var(--teal); font-weight: 700; }
.brand .word span { color: var(--text-dim); font-weight: 400; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-family: var(--font-mono); font-size: 13px; color: var(--text-dim);
  text-decoration: none; padding: 8px 13px; border-radius: var(--radius);
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.nav-links a:hover { color: var(--text); background: var(--bg-elev); }
.nav-links a.active { color: var(--teal); }
.nav-toggle { display: none; }

/* ---------- shared bits ---------- */
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 1.5px;
  color: var(--teal); text-transform: lowercase; display: inline-flex; align-items: center; gap: 8px;
}

/* the spirit-level calibration line — a recurring brand motif */
.level-rule { display: flex; align-items: center; gap: 0; margin: 18px 0 0; height: 12px; }
.level-rule .bar { height: 1px; background: var(--border-mid); flex: 1; }
.level-rule .tick { width: 1px; height: 9px; background: var(--border-mid); }
.level-rule .bubble {
  width: 9px; height: 9px; border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 10px rgba(93,202,165,0.5); margin: 0 9px;
}

a { color: var(--teal); }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 13px;
  padding: 11px 18px; border-radius: var(--radius); text-decoration: none;
  border: 0.5px solid var(--border-mid); color: var(--text);
  background: var(--bg-elev); transition: all 0.18s var(--ease);
}
.btn:hover { border-color: var(--teal); color: var(--teal); transform: translateY(-1px); }
.btn-ghost { background: transparent; }
.btn .arr { transition: transform 0.18s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }

/* ---------- hero ---------- */
.hero { padding: 110px 0 80px; }
.hero .mark { margin-bottom: 30px; }
.hero h1 {
  font-family: var(--font-mono); font-weight: 700; line-height: 1.08;
  font-size: clamp(40px, 7vw, 76px); letter-spacing: -2px; color: var(--text);
}
.hero h1 .t { color: var(--teal); }
.hero .lede {
  max-width: 620px; margin-top: 24px; font-size: 19px; color: var(--text-dim); line-height: 1.6;
}
.hero .cta { margin-top: 40px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- sections ---------- */
section { padding: 64px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-head h2 { font-family: var(--font-mono); font-weight: 700; font-size: 26px; letter-spacing: -0.5px; }
.section-head .more { font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); text-decoration: none; white-space: nowrap; }
.section-head .more:hover { color: var(--teal); }

/* ---------- card grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--bg-elev); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 22px 22px 20px; text-decoration: none;
  color: inherit; transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; height: 100%; width: 2px;
  background: var(--teal); transform: scaleY(0); transform-origin: top; transition: transform 0.25s var(--ease);
}
.card:hover { border-color: var(--border-mid); transform: translateY(-3px); background: var(--bg-elev-2); }
.card:hover::before { transform: scaleY(1); }
.card .meta { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); margin-bottom: 14px; flex-wrap: wrap; }
.card .meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-faint); }
.card h3 { font-family: var(--font-mono); font-weight: 700; font-size: 18px; line-height: 1.3; letter-spacing: -0.3px; margin-bottom: 10px; }
.card:hover h3 { color: var(--teal-bright); }
.card p { font-size: 14.5px; color: var(--text-dim); line-height: 1.6; flex: 1; }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }

.tag {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-dim);
  padding: 3px 9px; border: 0.5px solid var(--border); border-radius: 100px;
}

/* severity badges for CVEs */
.sev { font-family: var(--font-mono); font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: var(--radius); letter-spacing: 0.5px; }
.sev-critical { color: #ffb3b2; background: rgba(226,75,74,0.14); border: 0.5px solid rgba(226,75,74,0.4); }
.sev-high     { color: #f4b76a; background: rgba(216,90,48,0.14); border: 0.5px solid rgba(216,90,48,0.4); }
.sev-medium   { color: var(--amber); background: rgba(239,159,39,0.12); border: 0.5px solid var(--border-warm); }
.sev-low      { color: var(--teal); background: rgba(93,202,165,0.12); border: 0.5px solid var(--border-mid); }
.cve-id { font-family: var(--font-code); color: var(--teal); }

/* ---------- filter bar ---------- */
.filterbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 28px; }
.search {
  flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px;
  background: var(--bg-elev); border: 0.5px solid var(--border); border-radius: var(--radius); padding: 0 14px; height: 42px;
}
.search:focus-within { border-color: var(--teal); }
.search .ico { color: var(--text-faint); flex: none; display: flex; }
.search input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-family: var(--font-code); font-size: 14px; }
.search input::placeholder { color: var(--text-faint); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
  padding: 7px 13px; border: 0.5px solid var(--border); border-radius: 100px;
  background: none; cursor: pointer; transition: all 0.16s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--border-mid); }
.chip.on { color: var(--bg); background: var(--teal); border-color: var(--teal); }
.empty { font-family: var(--font-mono); color: var(--text-faint); padding: 40px 0; text-align: center; }

/* ---------- mission strip ---------- */
.mission { border-top: 0.5px solid var(--border); border-bottom: 0.5px solid var(--border); }
.mission .inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }
.mission h2 { font-family: var(--font-mono); font-weight: 700; font-size: clamp(24px, 3vw, 34px); line-height: 1.25; letter-spacing: -0.5px; }
.mission h2 em { color: var(--teal); font-style: normal; }
.mission p { color: var(--text-dim); margin-top: 16px; }
.mission .stats { display: flex; flex-direction: column; gap: 18px; }
.mission .stat { border-left: 2px solid var(--teal); padding-left: 16px; }
.mission .stat .n { font-family: var(--font-mono); font-size: 30px; font-weight: 700; color: var(--text); }
.mission .stat .l { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }

/* ---------- article / prose ---------- */
.article { max-width: 740px; margin: 0 auto; padding: 56px 0 40px; }
.article .back { font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); text-decoration: none; }
.article .back:hover { color: var(--teal); }
.article-head { margin: 26px 0 8px; }
.article-head .meta { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); margin-bottom: 16px; flex-wrap: wrap; }
.article-head h1 { font-family: var(--font-mono); font-weight: 700; font-size: clamp(28px, 4.5vw, 42px); line-height: 1.12; letter-spacing: -1px; }
.article-head .standfirst { font-size: 19px; color: var(--text-dim); margin-top: 18px; line-height: 1.55; }
.prose { font-size: 16.5px; line-height: 1.75; }
.prose > * + * { margin-top: 20px; }
.prose h2 { font-family: var(--font-mono); font-weight: 700; font-size: 22px; letter-spacing: -0.3px; margin-top: 44px; padding-top: 4px; }
.prose h3 { font-family: var(--font-mono); font-weight: 700; font-size: 17px; color: var(--text); margin-top: 30px; }
.prose p, .prose li { color: var(--text); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-top: 8px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-mid); }
.prose a:hover { text-decoration-color: var(--teal); }
.prose code { font-family: var(--font-code); font-size: 0.88em; background: var(--bg-elev-2); color: var(--teal-bright); padding: 2px 6px; border-radius: 3px; }
.prose pre {
  font-family: var(--font-code); font-size: 13.5px; line-height: 1.7;
  background: #08100F; border: 0.5px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; overflow-x: auto; position: relative;
}
.prose pre code { background: none; color: #c9d6cf; padding: 0; }
.prose pre::before {
  content: attr(data-lang); position: absolute; top: 0; right: 0;
  font-family: var(--font-mono); font-size: 10px; color: var(--text-faint);
  padding: 5px 10px; letter-spacing: 1px;
}
.prose figure { margin: 30px 0; }
.prose img { display: block; max-width: 100%; height: auto; margin: 0 auto; border: 0.5px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); }
.prose figcaption { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); margin-top: 10px; text-align: center; }
.prose blockquote { border-left: 2px solid var(--teal); padding: 4px 0 4px 20px; color: var(--text-dim); font-style: italic; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 0.5px solid var(--border); }
.prose th { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); font-weight: 700; }

/* callouts */
.callout { border: 0.5px solid var(--border); border-left: 2px solid var(--teal); border-radius: var(--radius); padding: 16px 20px; background: var(--bg-elev); }
.callout.warn { border-left-color: var(--amber); }
.callout.defend { border-left-color: var(--teal-deep); }
.callout .lbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px; color: var(--teal); text-transform: uppercase; display: block; margin-bottom: 6px; }
.callout.warn .lbl { color: var(--amber); }

/* refs / cve facts */
.factbox { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--border); border: 0.5px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 28px 0; }
.factbox .f { background: var(--bg-elev); padding: 14px 16px; }
.factbox .f .k { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); letter-spacing: 0.5px; }
.factbox .f .v { font-family: var(--font-mono); font-size: 14px; color: var(--text); margin-top: 4px; }

/* ---------- footer ---------- */
.site-footer { border-top: 0.5px solid var(--border); margin-top: 40px; padding: 48px 0 56px; }
.footer-grid { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; flex-wrap: wrap; }
.site-footer .tagline { font-family: var(--font-mono); font-size: 13px; color: var(--text-faint); margin-top: 12px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); text-decoration: none; }
.footer-links a:hover { color: var(--teal); }
.copyright { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); margin-top: 28px; }

/* ---------- page intro (list pages) ---------- */
.page-intro { padding: 72px 0 8px; }
.page-intro h1 { font-family: var(--font-mono); font-weight: 700; font-size: clamp(34px, 5vw, 52px); letter-spacing: -1.5px; }
.page-intro h1 .t { color: var(--teal); }
.page-intro p { color: var(--text-dim); margin-top: 16px; max-width: 560px; }

/* ---------- entrance animation ---------- */
.reveal { opacity: 0; transform: translateY(14px); animation: rise 0.6s var(--ease) forwards; }
.reveal:nth-child(2) { animation-delay: 0.06s; }
.reveal:nth-child(3) { animation-delay: 0.12s; }
.reveal:nth-child(4) { animation-delay: 0.18s; }
@keyframes rise { to { opacity: 1; transform: none; } }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .wrap { padding: 0 20px; }
  .nav-links { position: fixed; inset: 64px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(10,19,22,0.97); border-bottom: 0.5px solid var(--border); padding: 8px; display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px; }
  .nav-toggle { display: inline-flex; background: none; border: 0.5px solid var(--border); color: var(--text);
    font-family: var(--font-mono); font-size: 18px; width: 40px; height: 40px; border-radius: var(--radius); cursor: pointer; }
  .mission .inner { grid-template-columns: 1fr; gap: 32px; }
  .hero { padding: 72px 0 56px; }
  section { padding: 48px 0; }
}

/* ---------- admin / forms ---------- */
.field { margin: 0 0 16px; }
.field label { display: block; font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.field input[type=text], .field input[type=email], .field input[type=password], .field select, .field textarea {
  width: 100%; background: var(--bg-elev); border: 0.5px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--font-body); font-size: 14px; padding: 10px 12px;
}
.field textarea.mono { font-family: var(--font-code); font-size: 13.5px; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--teal); }
.field input[type=file] { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel { background: var(--bg-elev); border: 0.5px solid var(--border); border-radius: var(--radius-lg, 12px); padding: 22px; }
.admin-top { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; }
.admin-actions { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.form-err { color: #ffb3b2; font-family: var(--font-mono); font-size: 12px; margin-top: 12px; min-height: 16px; }
.muted { color: var(--text-faint); }
.dropzone { border: 1px dashed var(--border-mid); border-radius: var(--radius); padding: 18px; text-align: center;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text-dim); transition: all 0.15s var(--ease); }
.dropzone.over { border-color: var(--teal); background: var(--bg-elev-2); color: var(--text); }
.linklike { color: var(--teal); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.imagelist { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.imgrow { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }
.imgrow .ok { color: var(--teal); } .imgrow .err { color: #ffb3b2; }
.mini { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); background: var(--bg-elev-2);
  border: 0.5px solid var(--border); border-radius: var(--radius); padding: 4px 9px; cursor: pointer; }
.mini:hover { color: var(--text); border-color: var(--border-mid); }
.mini.danger:hover { color: #ffb3b2; border-color: rgba(226,75,74,0.5); }
.preview { border: 0.5px solid var(--border); border-radius: var(--radius); padding: 18px 20px; min-height: 80px; background: var(--bg); }
.postrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 0.5px solid var(--border); font-size: 14px; }
.postrow:last-child { border-bottom: none; }
.postrow .muted { font-family: var(--font-mono); font-size: 11px; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } .admin-top { flex-direction: column; align-items: flex-start; gap: 12px; } }

/* ---------- favorites / accounts ---------- */
.card .stretch { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.fav { position: absolute; top: 11px; right: 11px; z-index: 2; background: none; border: none;
  padding: 4px; cursor: pointer; color: var(--text-faint); line-height: 0; transition: color 0.15s var(--ease); }
.fav:hover { color: var(--teal); }
.fav.on { color: var(--amber); }
.fav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.fav.on svg { fill: currentColor; }

.post-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.fav-lg { position: static; display: inline-flex; align-items: center; gap: 7px; flex: none;
  font-family: var(--font-mono); font-size: 12px; padding: 8px 13px; border: 0.5px solid var(--border-mid);
  border-radius: 100px; background: var(--bg-elev); color: var(--text-dim); margin-top: 6px; }
.fav-lg:hover { color: var(--teal); border-color: var(--teal); }
.fav-lg.on { color: var(--amber); border-color: var(--border-warm); }
.fav-lg svg { width: 15px; height: 15px; }

.authctl { display: flex; align-items: center; gap: 10px; }
.navbtn { font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); background: none;
  border: 0.5px solid var(--border); border-radius: var(--radius); padding: 7px 12px; cursor: pointer; transition: all 0.15s var(--ease); }
.navbtn:hover { color: var(--teal); border-color: var(--teal); }
.userchip { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); max-width: 120px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.modal-back { position: fixed; inset: 0; z-index: 200; background: rgba(5,10,12,0.66); backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-back[hidden] { display: none; }
.modal { position: relative; width: 100%; max-width: 380px; background: var(--bg-elev);
  border: 0.5px solid var(--border-mid); border-radius: 14px; padding: 28px; }
.modal h2 { font-family: var(--font-mono); font-size: 22px; letter-spacing: -0.5px; }
.modal-x { position: absolute; top: 12px; right: 15px; background: none; border: none; color: var(--text-faint);
  font-size: 24px; line-height: 1; cursor: pointer; }
.modal-x:hover { color: var(--text); }
.btn.google { background: #fff; color: #1f1f1f; border-color: #fff; gap: 10px; }
.btn.google:hover { background: #f0f0f0; color: #1f1f1f; border-color: #f0f0f0; }
.or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--text-faint);
  font-family: var(--font-mono); font-size: 11px; }
.or::before, .or::after { content: ""; flex: 1; height: 0.5px; background: var(--border); }
