/* ============================================================
   PatchAhead — design system
   Dark, enterprise security aesthetic. Zero external deps.
   ============================================================ */

:root {
  --bg:            #060912;
  --bg-2:          #0a0f1e;
  --surface:       #0e1424;
  --surface-2:     #121a2e;
  --surface-3:     #16203a;
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text:          #e8edf8;
  --text-soft:     #b7c2d8;
  --muted:         #8492ab;
  --faint:         #5d6b85;

  --brand:         #5eead4;   /* mint / teal */
  --brand-2:       #38bdf8;   /* sky */
  --brand-3:       #6366f1;   /* indigo */
  --accent-warm:   #f9a8d4;
  --danger:        #fb7185;
  --ok:            #34d399;
  --warn:          #fbbf24;

  --grad: linear-gradient(135deg, #5eead4 0%, #38bdf8 45%, #6366f1 100%);
  --grad-soft: linear-gradient(135deg, rgba(94,234,212,.16), rgba(56,189,248,.10) 50%, rgba(99,102,241,.16));

  --radius:   16px;
  --radius-sm: 10px;
  --radius-lg: 24px;

  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .75);
  --shadow-glow: 0 0 0 1px var(--border), 0 30px 80px -40px rgba(56, 189, 248, .35);

  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --container: 1180px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select, button { font-family: inherit; font-size: inherit; color: inherit; }

/* ---------- ambient background ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1100px 600px at 78% -8%, rgba(56, 189, 248, .16), transparent 60%),
    radial-gradient(900px 520px at 8% 4%, rgba(99, 102, 241, .14), transparent 55%),
    radial-gradient(800px 700px at 50% 110%, rgba(94, 234, 212, .08), transparent 60%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 75%);
}

/* ---------- layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 24px; }
.section { padding: 96px 0; position: relative; }
.section.tight { padding: 64px 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }

/* ---------- typography ---------- */
h1, h2, h3, h4 { line-height: 1.1; font-weight: 650; letter-spacing: -0.025em; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--brand); opacity: .7; }
.eyebrow.center { justify-content: center; }
h1.headline { font-size: clamp(2.4rem, 5.4vw, 4.3rem); font-weight: 700; letter-spacing: -0.035em; }
.section-title { font-size: clamp(1.9rem, 3.4vw, 2.9rem); }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--text-soft); max-width: 60ch; }
.lead.center { margin-inline: auto; }
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1px solid transparent; transition: transform .15s ease, box-shadow .2s ease, background .2s, border-color .2s, color .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #03121a; box-shadow: 0 10px 30px -10px rgba(56,189,248,.6); }
.btn-primary:hover { box-shadow: 0 16px 40px -12px rgba(56,189,248,.75); transform: translateY(-2px); }
.btn-outline { border-color: var(--border-strong); color: var(--text); background: rgba(255,255,255,.02); }
.btn-outline:hover { border-color: var(--brand); color: #fff; background: rgba(94,234,212,.06); }
.btn-ghost { color: var(--text-soft); }
.btn-ghost:hover { color: #fff; }
.btn-lg { padding: 15px 30px; font-size: 16px; }
.btn-sm { padding: 8px 16px; font-size: 13.5px; }
.btn-block { width: 100%; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: rgba(6, 9, 18, .72);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.site-header.scrolled { border-bottom-color: var(--border); background: rgba(6, 9, 18, .9); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.brand .mark { width: 34px; height: 34px; flex: none; }
.brand b { font-weight: 750; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { font-size: 14.5px; color: var(--text-soft); font-weight: 500; transition: color .15s; position: relative; }
.nav-links a:hover { color: #fff; }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); padding: 6px; }

/* ---------- hero ---------- */
.hero { padding: 92px 0 72px; position: relative; }
.hero-inner { max-width: 880px; }
.hero .center.hero-inner { margin-inline: auto; }
.badge-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  border: 1px solid var(--border); background: rgba(255,255,255,.03); color: var(--text-soft);
}
.badge svg { color: var(--brand); }
.hero .subhead { margin-top: 22px; font-size: clamp(1.05rem,1.6vw,1.3rem); color: var(--text-soft); max-width: 56ch; }
.hero .center .subhead { margin-inline: auto; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.hero .center .hero-cta { justify-content: center; }
.hero-note { margin-top: 18px; font-size: 13.5px; color: var(--muted); }

/* ---------- trust strip ---------- */
.trust { margin-top: 64px; }
.trust p { text-align: center; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-bottom: 22px; }
.trust-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 40px; align-items: center; opacity: .85; }
.trust-row span { font-weight: 600; color: var(--muted); font-size: 16px; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 9px; }

/* ---------- cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.feature-card .ic {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad-soft); border: 1px solid var(--border); color: var(--brand); margin-bottom: 18px;
}
.feature-card h3 { font-size: 1.2rem; margin-bottom: 9px; }
.feature-card p { color: var(--muted); font-size: 14.7px; }
.card-link { color: var(--brand); font-weight: 600; font-size: 14px; display: inline-flex; gap: 6px; margin-top: 14px; }

/* ---------- how it works ---------- */
.step-card .ic {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad-soft); border: 1px solid var(--border); color: var(--brand); margin-bottom: 18px;
}
.step-card h3 { font-size: 1.18rem; margin-bottom: 8px; }
.step-card p { color: var(--muted); font-size: 14.6px; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }
.stat { text-align: center; padding: 30px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(255,255,255,.015); }
.stat .n { font-size: clamp(2rem, 3.6vw, 2.9rem); font-weight: 750; letter-spacing: -.03em; }
.stat .l { color: var(--muted); font-size: 13.5px; margin-top: 6px; }

/* ---------- "ahead of the CVE" timeline ---------- */
.timeline { position: relative; padding: 8px 0; }
.tl-track { position: relative; height: 3px; background: var(--border); border-radius: 3px; margin: 60px 0 40px; }
.tl-fill { position: absolute; left: 0; top: 0; height: 100%; width: 62%; background: var(--grad); border-radius: 3px; }
.tl-pt { position: absolute; top: 50%; transform: translate(-50%,-50%); }
.tl-pt .pin { width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--brand-2); }
.tl-pt.ph .pin { border-color: var(--brand); background: var(--brand); box-shadow: 0 0 0 6px rgba(94,234,212,.16); }
.tl-pt.vendor .pin { border-color: var(--faint); }
.tl-pt .cap { position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 12.5px; }
.tl-pt .cap.top { bottom: 26px; }
.tl-pt .cap.bot { top: 26px; color: var(--muted); }
.tl-pt .cap b { color: var(--text); }

/* ---------- CTA band ---------- */
.cta-band {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--grad-soft);
  padding: 56px; text-align: center; position: relative; overflow: hidden;
}
.cta-band h2 { font-size: clamp(1.8rem,3vw,2.6rem); margin-bottom: 14px; }
.cta-band p { color: var(--text-soft); max-width: 52ch; margin: 0 auto 28px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 64px 0 36px; margin-top: 40px; background: rgba(0,0,0,.25); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; }
.footer h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); margin-bottom: 16px; font-weight: 600; }
.footer ul { list-style: none; padding: 0; display: grid; gap: 11px; }
.footer a { color: var(--text-soft); font-size: 14.3px; }
.footer a:hover { color: #fff; }
.footer .blurb { color: var(--muted); font-size: 14px; max-width: 32ch; margin-top: 16px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--faint); font-size: 13px; }

/* ---------- section heading block ---------- */
.sec-head { max-width: 62ch; margin-bottom: 48px; }
.sec-head.center { margin-inline: auto; text-align: center; }

/* ---------- pills / tags ---------- */
.tag { font-size: 12px; font-weight: 600; color: var(--brand); background: rgba(94,234,212,.08); border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px; }

/* ---------- blog ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.post-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.post-card .cover { aspect-ratio: 16/9; background: var(--surface-2) var(--grad-soft); object-fit: cover; width: 100%; border-bottom: 1px solid var(--border); }
.post-card .pc-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card h3 { font-size: 1.22rem; line-height: 1.25; }
.post-card p { color: var(--muted); font-size: 14.3px; flex: 1; }
.post-meta { display: flex; gap: 12px; align-items: center; font-size: 12.7px; color: var(--faint); }
.post-meta .tag { color: var(--brand); }

/* ---------- article / prose ---------- */
.article { max-width: 760px; margin-inline: auto; }
.article-hero { max-width: 820px; margin: 0 auto 40px; text-align: center; }
.article-hero h1 { font-size: clamp(2rem, 4vw, 3.1rem); margin: 18px 0; }
.article-cover { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 40px; max-height: 460px; object-fit: cover; }
.prose { font-size: 17px; line-height: 1.8; color: var(--text-soft); }
.prose > * + * { margin-top: 1.25em; }
.prose h2 { font-size: 1.7rem; margin-top: 1.9em; color: var(--text); letter-spacing: -.02em; }
.prose h3 { font-size: 1.32rem; margin-top: 1.6em; color: var(--text); }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(94,234,212,.4); }
.prose a:hover { text-decoration-color: var(--brand); }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.4em; display: grid; gap: .5em; }
.prose li::marker { color: var(--brand); }
.prose blockquote { border-left: 3px solid var(--brand); padding: 4px 0 4px 22px; color: var(--text); font-style: italic; background: rgba(94,234,212,.03); }
.prose code { font-family: var(--mono); font-size: .87em; background: var(--surface-2); border: 1px solid var(--border); padding: 2px 7px; border-radius: 6px; color: var(--brand); }
.prose pre { background: #050810; border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; overflow-x: auto; font-size: 14px; }
.prose pre code { background: none; border: 0; padding: 0; color: var(--text-soft); }
.prose img { border-radius: 12px; border: 1px solid var(--border); margin-inline: auto; }
.prose hr { border: 0; border-top: 1px solid var(--border); }

/* ---------- forms ---------- */
.form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 8px; }
.label { font-size: 13.5px; font-weight: 600; color: var(--text-soft); }
.label .req { color: var(--brand); }
.input, .textarea, .select {
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 13px 15px; color: var(--text); transition: border-color .15s, box-shadow .15s; font-size: 15px;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(94,234,212,.14); }
.textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238492ab' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.form-note { font-size: 13px; color: var(--muted); }
.alert { padding: 14px 16px; border-radius: var(--radius-sm); font-size: 14.5px; border: 1px solid var(--border); }
.alert-ok { background: rgba(52,211,153,.08); border-color: rgba(52,211,153,.3); color: #a7f3d0; }
.alert-err { background: rgba(251,113,133,.08); border-color: rgba(251,113,133,.3); color: #fecdd3; }

/* ---------- split layout (contact) ---------- */
.split { display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: start; }
.contact-list { display: grid; gap: 22px; margin-top: 30px; }
.contact-list .ci { display: flex; gap: 14px; align-items: flex-start; }
.contact-list .ci .ic { width: 40px; height: 40px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--border); color: var(--brand); }
.contact-list .ci h4 { font-size: 15px; margin-bottom: 2px; }
.contact-list .ci p, .contact-list .ci a { color: var(--muted); font-size: 14px; }
.contact-list .ci a:hover { color: var(--brand); }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- admin ---------- */
.admin-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.admin-side { border-right: 1px solid var(--border); padding: 24px 18px; background: var(--bg-2); position: sticky; top: 0; height: 100vh; }
.admin-side .brand { margin-bottom: 30px; font-size: 16px; }
.admin-nav { display: grid; gap: 4px; }
.admin-nav a { padding: 10px 13px; border-radius: 9px; color: var(--text-soft); font-size: 14.5px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.admin-nav a:hover { background: var(--surface); color: #fff; }
.admin-nav a.active { background: var(--grad-soft); color: #fff; border: 1px solid var(--border); }
.admin-main { padding: 32px 36px; max-width: 1000px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.admin-head h1 { font-size: 1.7rem; }
.table { width: 100%; border-collapse: collapse; font-size: 14.3px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; padding: 11px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--border); color: var(--text-soft); vertical-align: middle; }
.table tr:hover td { background: rgba(255,255,255,.015); }
.chip { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; display: inline-block; }
.chip.pub { background: rgba(52,211,153,.12); color: #6ee7b7; }
.chip.draft { background: rgba(251,191,36,.12); color: #fcd34d; }
.stat-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-bottom: 30px; }
.editor-grid { display: grid; grid-template-columns: 1fr 320px; gap: 26px; align-items: start; }
.editor-side .card { padding: 20px; }
.md-toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.md-toolbar button { background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 6px 10px; font-size: 12.5px; color: var(--text-soft); }
.md-toolbar button:hover { color: #fff; border-color: var(--brand); }
.code-editor { min-height: 420px; font-family: var(--mono); font-size: 14px; line-height: 1.65; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 14px; }
.media-item { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.media-item img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.media-item .mi-foot { padding: 8px 10px; font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: 12px; padding: 30px; text-align: center; color: var(--muted); transition: border-color .2s, background .2s; }
.dropzone.drag { border-color: var(--brand); background: rgba(94,234,212,.05); color: var(--text); }
.lock-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.lock-card { max-width: 520px; }

/* ---------- 404 ---------- */
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.error-page .code { font-family: var(--mono); font-size: clamp(4rem,12vw,8rem); font-weight: 750; }

/* ---------- responsive ---------- */
@media (max-width: 940px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .split { grid-template-columns: 1fr; gap: 36px; }
  .editor-grid { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; display: none; }
}
@media (max-width: 820px) {
  .nav-links, .nav-actions .btn-show-desktop { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    position: absolute; top: 70px; left: 0; right: 0; padding: 16px 24px 22px;
    background: rgba(6,9,18,.97); border-bottom: 1px solid var(--border); backdrop-filter: blur(14px);
  }
  .nav-links.open a { padding: 10px 0; width: 100%; border-bottom: 1px solid var(--border); }
  .cols-2, .cols-3, .cols-4, .blog-grid, .stats, .stat-cards { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .section { padding: 68px 0; }
  .cta-band { padding: 40px 26px; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; }
  .container { padding-inline: 18px; }
}
