/* =========================================================================
   Actuator Security - site.css
   Single source of truth for design tokens + shared components.
   Every page links ONLY this file for chrome/layout. Edit here once.
   ========================================================================= */

/* ---- Design tokens ----------------------------------------------------- */
:root {
  /* Canonical brand palette (previously drifted: blog used #3cf2c6/#22d3ee) */
  --bg:            #030712;
  --panel:         #0a0f1c;
  --panel-dark:    #060915;
  --panel-2:       #0b1222;

  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text:          #e8eef7;
  --text-muted:    #8b93a3;
  --muted:         var(--text-muted);   /* back-compat alias */

  --accent:        #48e2c2;
  --accent2:       #2ee39d;
  --accent-soft:   rgba(72, 226, 194, 0.12);

  /* Severity scale (CVE feed) */
  --sev-critical:  #ff4e4e;
  --sev-high:      #ff9f3f;
  --sev-med:       #f7d23e;
  --sev-low:       #2ee39d;

  --radius:        16px;
  --radius-sm:     10px;
  --shadow:        0 8px 22px rgba(0, 0, 0, 0.35);

  --maxw:          1120px;
  --font:          "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono:          ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

/* ---- Base / reset (low specificity via :where) ------------------------- */
*, *::before, *::after { box-sizing: border-box; }

:where(html) { color-scheme: dark; scroll-behavior: smooth; }

body {
  margin: 0;
  background: radial-gradient(circle at 20% -10%, #0f172a 0%, #030712 40%, #000 100%)
              no-repeat fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:where(a) { color: inherit; text-decoration: none; }
:where(img) { max-width: 100%; display: block; }
:where(hr) { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

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

/* Skip link for keyboard / screen-reader users */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #04140f;
  font-weight: 600;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* =========================================================================
   HEADER / NAV  (rendered from partials/header.html)
   ========================================================================= */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(3, 7, 18, 0.85);
  border-bottom: 1px solid var(--border);
  /* Reserve height so the page does not jump while the partial loads */
  min-height: 57px;
}

nav.site-nav {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0.8rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.logo { display: flex; gap: 0.55rem; align-items: center; }
.logo-img {
  height: 34px;
  width: auto;
  border-radius: 6px;
  box-shadow: 0 0 14px rgba(46, 227, 157, 0.25);
}
.logo-text-main { font-size: 0.88rem; letter-spacing: 0.05em; font-weight: 600; }
.logo-text-sub  { font-size: 0.65rem; letter-spacing: 0.14em; color: var(--text-muted); }

.nav-links {
  display: flex;
  gap: 1.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  align-items: center;
}
.nav-links a { position: relative; transition: color 0.18s ease; }
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 1px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.2s ease;
}
.nav-links a:hover::after { width: 100%; }
/* Active page (set by include.js) */
.nav-links a[aria-current="page"] { color: var(--accent); }
.nav-links a[aria-current="page"]::after { width: 100%; }

.btn-mini-jsi {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0a0f15;
  box-shadow: 0 4px 14px rgba(46, 227, 157, 0.22);
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.btn-mini-jsi:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(46, 227, 157, 0.32);
}

.mobile-menu-btn {
  display: none;
  font-size: 1.6rem;
  line-height: 1;
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
  cursor: pointer;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--panel-dark);
  border-bottom: 1px solid var(--border);
  padding: 1rem;
}
.mobile-menu a { padding: 0.5rem 0.25rem; color: var(--text-muted); }
.mobile-menu a:hover { color: var(--text); }
.mobile-menu.open { display: flex; }

@media (max-width: 720px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: inline-block; order: 3; }
  .logo { order: 1; }
  .btn-mini-jsi { order: 2; margin-inline: auto; }
}
@media (min-width: 721px) {
  .mobile-menu { display: none !important; }
}

/* =========================================================================
   LAYOUT
   ========================================================================= */
main.page {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 1.8rem 1.25rem 4rem;
}

.page-title {
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  letter-spacing: -0.02em;
  margin: 0.5rem 0 1.4rem;
}

/* =========================================================================
   HERO
   ========================================================================= */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1.1fr);
  gap: 2.2rem;
  margin-bottom: 2.4rem;
  align-items: center;
}
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.74rem;
  color: var(--text-muted);
  background: var(--panel-dark);
}
.hero-eyebrow::before { content: "*"; font-size: 0.85rem; color: var(--accent); opacity: 0.85; }

.hero-title {
  margin: 0.7rem 0 0.5rem;
  font-size: clamp(2.3rem, 4.5vw, 3.1rem);
  letter-spacing: -0.02em;
}
.hero-title span { color: var(--accent); }

.hero-subtitle { margin-top: 0.4rem; color: var(--text-muted); max-width: 38rem; line-height: 1.55; }

.hero-badges { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.hero-badge {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  background: var(--panel-dark);
}

.hero-actions { display: flex; gap: 0.7rem; margin-top: 1.1rem; flex-wrap: wrap; }

/* Hero right panel (Selected Disclosures) */
.hero-panel {
  padding: 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel-dark);
  box-shadow: var(--shadow);
}
.hero-panel-label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.hero-cve-item { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 0.7rem; padding: 0.3rem 0; }
.hero-cve-id {
  background: rgba(255, 255, 255, 0.03);
  padding: 2px 7px;
  font-size: 0.73rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-family: var(--mono);
  align-self: start;
}
.hero-cve-meta { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; }
.hero-cve-cat {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-right: 0.4rem;
}

/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn {
  padding: 0.58rem 1.25rem;
  border-radius: 999px;
  font-size: 0.83rem;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0a0f15;
  box-shadow: 0 10px 24px rgba(46, 227, 157, 0.25);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }

/* =========================================================================
   SECTIONS
   ========================================================================= */
.section { margin-top: 2.6rem; }
.section-header { margin-bottom: 0.7rem; }
.section-kicker { text-transform: uppercase; font-size: 0.78rem; color: var(--accent); letter-spacing: 0.16em; }
.section-title { margin-top: 0.2rem; font-size: 1.28rem; }
.section-subtitle { color: var(--text-muted); max-width: 30rem; }
.prose { color: var(--text-muted); max-width: 40rem; line-height: 1.55; }
.prose a { color: var(--accent); }

/* =========================================================================
   TALKS
   ========================================================================= */
.talks-list {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel-dark);
}
.talk-row {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid var(--border);
  cursor: default;
}
.talk-row.expandable { cursor: pointer; }
.talk-row:hover { background: rgba(255, 255, 255, 0.025); }
.talk-title { font-size: 0.9rem; line-height: 1.3; }
.talk-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }
.expand-icon {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: transform 0.25s ease;
  padding-left: 0.75rem;
  align-self: center;
}
.talk-details {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  background: var(--panel-2);
  padding: 0 1rem;
  border-top: 1px solid var(--border);
  transition: max-height 0.38s ease, opacity 0.28s ease, padding 0.28s ease;
  white-space: pre-line;
  line-height: 1.48;
  font-size: 0.88rem;
  color: var(--text);
}
.talk-details.open { padding: 0.9rem 1rem; opacity: 1; }
.talk-details a { color: var(--accent); }

/* =========================================================================
   CVE TABLE
   ========================================================================= */
.cve-table-wrapper {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel-dark);
}
.cve-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.cve-table th, .cve-table td { padding: 0.48rem 0.7rem; border-bottom: 1px solid var(--border); }
.cve-table th {
  text-transform: uppercase;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  white-space: nowrap;
  text-align: left;
}
.cve-table tr:last-child td { border-bottom: none; }
.cve-chip-id {
  font-family: var(--mono);
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}
.cve-chip-id a { color: var(--accent); }

.impact-pill {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  display: inline-block;
  line-height: 1.3;
  color: #fff;
}
.sev-critical { background: rgba(255,  78,  78, 0.15); border: 1px solid rgba(255,  78,  78, 0.5); box-shadow: 0 0 6px rgba(255,  78,  78, 0.3); }
.sev-high     { background: rgba(255, 159,  63, 0.15); border: 1px solid rgba(255, 159,  63, 0.5); box-shadow: 0 0 6px rgba(255, 159,  63, 0.3); }
.sev-med      { background: rgba(247, 210,  62, 0.15); border: 1px solid rgba(247, 210,  62, 0.5); box-shadow: 0 0 6px rgba(247, 210,  62, 0.25); }
.sev-low      { background: rgba( 46, 227, 157, 0.15); border: 1px solid rgba( 46, 227, 157, 0.5); box-shadow: 0 0 6px rgba( 46, 227, 157, 0.3); }

@media (max-width: 640px) {
  .cve-table-wrapper { overflow-x: auto; }
  .cve-table { min-width: 720px; }
  .cve-table td, .cve-table th { padding: 0.45rem 0.5rem; }
  .cve-table th:first-child, .cve-table td:first-child { width: 1%; white-space: nowrap; }
  .cve-chip-id { font-size: 0.7rem; padding: 0.15rem 0.35rem; }
  .impact-pill { font-size: 0.66rem; padding: 0.12rem 0.4rem; }
}

/* =========================================================================
   CONTACT / CTA
   ========================================================================= */
.cta {
  margin-top: 1.4rem;
  padding: 1.4rem 1.2rem;
  background: linear-gradient(135deg, rgba(72, 226, 194, 0.26), rgba(15, 23, 42, 0.85));
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  max-width: 38rem;
}
.cta h2 { margin: 0; }
.cta p { color: var(--text-muted); max-width: 32rem; line-height: 1.5; }

/* =========================================================================
   CONTENT PANELS (disclosure / compliance / whitepapers)
   ========================================================================= */
.panel {
  background: var(--panel-dark);
  border: 1px solid var(--border);
  padding: 1.4rem;
  border-radius: var(--radius);
  margin: 1.2rem 0;
  line-height: 1.58;
}
.citation {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.2rem;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* =========================================================================
   BLOG  (listing grid + "recent" card on home)
   ========================================================================= */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.4rem;
}
.blog-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.blog-card:hover {
  transform: translateY(-2px);
  border-color: rgba(72, 226, 194, 0.25);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.blog-thumb { aspect-ratio: 16 / 9; background: #020617; }
.blog-thumb img { width: 100%; height: 100%; object-fit: cover; }
.blog-body { padding: 1.1rem 1.2rem 1.3rem; }
.blog-title { font-size: 1.05rem; font-weight: 600; color: var(--accent); margin-bottom: 0.3rem; }
.blog-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.blog-excerpt { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }

.recent-blog-wrap { margin-top: 1.5rem; max-width: 720px; }
.recent-blog-card {
  display: flex;
  gap: 1.2rem;
  padding: 1.4rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  color: inherit;
  align-items: center;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.recent-blog-card:hover {
  transform: translateY(-2px);
  border-color: rgba(72, 226, 194, 0.25);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.recent-blog-thumb {
  width: 96px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: #020617;
}
.recent-blog-thumb img { width: 100%; height: 100%; object-fit: cover; }
.recent-blog-content { display: flex; flex-direction: column; }
.recent-blog-title { font-size: 1.05rem; font-weight: 600; color: var(--accent); margin-bottom: 0.25rem; }
.recent-blog-card:hover .recent-blog-title { text-decoration: underline; text-decoration-color: rgba(72, 226, 194, 0.4); }
.recent-blog-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.recent-blog-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.45; }

@media (max-width: 600px) {
  .recent-blog-card { flex-direction: column; align-items: stretch; }
  .recent-blog-thumb { width: 100%; height: 140px; }
}

/* =========================================================================
   FOOTER  (rendered from partials/footer.html)
   ========================================================================= */
footer.site-footer {
  max-width: var(--maxw);
  margin: 2rem auto 0;
  padding: 1.2rem 1.25rem 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
  align-items: center;
}
.footer-socials { display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap; }
.footer-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.9);
  transition: border-color 0.25s ease;
}
.footer-socials a:hover { border-color: var(--accent); }
.footer-socials a svg {
  width: 16px;
  height: 16px;
  stroke: var(--accent);
  stroke-width: 1.8;
  fill: none;
  transition: transform 0.25s ease, filter 0.25s ease, stroke 0.25s ease;
}
.footer-socials a[aria-label="YouTube"] svg path:first-child { fill: rgba(72, 226, 194, 0.1); }
.footer-socials a:hover svg {
  stroke: var(--accent2);
  transform: translateY(-2px);
  filter: drop-shadow(0 0 6px rgba(72, 226, 194, 0.35));
}

/* =========================================================================
   MOTION PREFERENCES
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  :where(html) { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
