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

:root {
  --bg:            #0a0d12;
  --bg-raised:     #0f131a;
  --surface:       #12161f;
  --surface-2:     #171c26;
  --border:        #212734;
  --border-soft:   #1a1f29;

  --text-1:        #e7eaf0;
  --text-2:        #9aa3b5;
  --text-3:        #626c80;

  --accent:        #ff3b5c;   /* crimson */
  --accent-dim:    #7a1f2c;
  --cyan:          #2de0c9;   /* verified / interactive */
  --cyan-dim:      #145a52;

  --sev-critical:  #ff3b5c;
  --sev-high:      #ff8a3d;
  --sev-medium:    #ffd23d;
  --sev-low:       #4da3ff;
  --sev-info:      #6b7280;

  --radius:        4px;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --disp: 'Space Grotesk', sans-serif;
  --body: 'Inter', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  background: var(--bg);
  scrollbar-gutter: stable;
}

/* Reliable cross-page fade: fade the incoming page in (pure CSS, always
   fires on load) and fade the outgoing page out via a JS-toggled class
   right before navigation (see script.js). This is deterministic across
   all browsers, unlike the experimental View Transitions API. */
body {
  animation: page-fade-in 0.22s ease both;
}
body.page-leaving {
  opacity: 0;
  transition: opacity 0.16s ease;
}
@keyframes page-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 900px 500px at 85% -10%, rgba(255,59,92,0.07), transparent 60%),
    radial-gradient(ellipse 700px 500px at -10% 100%, rgba(45,224,201,0.05), transparent 60%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #0a0d12; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* Focus visibility */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ============ TOP NAVBAR (Glassmorphism) ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 13, 18, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nav-links a {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: #b6bdcc;
  padding: 7px 12px;
  border-radius: var(--radius);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.nav-links a:hover {
  color: var(--text-1);
  background: var(--surface);
}
.nav-links a.active {
  color: var(--text-1);
  background: var(--surface-2);
  border-bottom: 2px solid var(--accent);
}

.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(45, 224, 201, 0.15);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Language Toggle */
html:not([data-lang="az"]) .lang-az { display: none !important; }
html[data-lang="az"] .lang-en { display: none !important; }

.lang-toggle {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
  flex-shrink: 0;
}
.lang-toggle button {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lang-toggle button:hover { color: var(--text-1); }
.lang-toggle button.active {
  color: var(--bg);
  background: var(--cyan);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-1);
  padding: 6px 10px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
}

/* ============ MAIN CONTENT CONTAINER ============ */
.content-wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 50px 24px 80px;
  min-height: calc(100vh - 150px);
}

/* ============ HERO SECTION ============ */
.hero {
  margin-bottom: 48px;
}
h1.hero-title {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 46px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 12px;
  color: #fff;
}
.hero-role {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 20px;
}
.hero-lede {
  color: var(--text-2);
  font-size: 16px;
  max-width: 720px;
  line-height: 1.7;
}

/* ============ GENERAL HEADINGS ============ */
h1.page-title {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 38px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 14px;
}
.page-lede {
  color: var(--text-2);
  font-size: 16px;
  max-width: 680px;
  margin-bottom: 40px;
}

section.block { margin-bottom: 56px; }
section.block h2 {
  font-family: var(--disp);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-2);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}

/* ============ CARDS & GRID ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: #2a3242; }

.skill-grid { display: grid; gap: 18px; }
.skill-card h3 {
  font-family: var(--disp);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 10px;
}
.skill-card h3 .num { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.skill-card ul { list-style: none; margin: 14px 0 16px; display: flex; flex-direction: column; gap: 9px; }
.skill-card li { color: var(--text-2); font-size: 14px; padding-left: 16px; position: relative; line-height: 1.65; }
.skill-card li::before { content: '▸'; position: absolute; left: 0; top: 0; color: var(--accent); font-size: 12px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--mono); font-size: 12px; color: var(--text-2);
  border: 1px solid var(--border); padding: 5px 10px; border-radius: 4px;
  background: var(--surface); transition: all 0.15s ease;
}
.tag:hover { color: var(--cyan); border-color: var(--cyan-dim); }

/* ============ CONTACT / SOCIAL ROW ============ */
.social-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.social-btn {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  border: 1px solid var(--border); border-radius: 5px;
  font-family: var(--mono); font-size: 12.5px; color: var(--text-1);
  background: var(--surface); transition: all 0.15s ease;
}
.social-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.social-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ============ CERTIFICATIONS ============ */
.cert-list { display: flex; flex-direction: column; gap: 1px; background: var(--border-soft); border: 1px solid var(--border-soft); border-radius: 6px; overflow: hidden; }
.cert-row {
  background: var(--surface); padding: 20px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.cert-main { display: flex; align-items: center; gap: 16px; }
.cert-info h3 { font-family: var(--disp); font-size: 16px; font-weight: 600; }
.cert-info p { font-family: var(--mono); font-size: 12px; color: var(--text-3); margin-top: 3px; }
.cert-verify {
  font-family: var(--mono); font-size: 12px; color: var(--text-2);
  border: 1px solid var(--border); padding: 8px 14px; border-radius: 4px;
  white-space: nowrap; transition: all 0.15s ease;
}
.cert-verify:hover { border-color: var(--cyan); color: var(--cyan); }
.cert-pending {
  font-family: var(--mono); font-size: 11px; color: var(--sev-medium);
  border: 1px dashed var(--sev-medium); padding: 6px 12px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* ============ CVE CARDS ============ */
.cve-card {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--sev-medium); border-radius: 0 6px 6px 0;
  padding: 24px 26px; margin-bottom: 16px;
}
.cve-card.reserved { border-left-color: var(--sev-info); opacity: 0.88; }
.cve-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 10px; }
.cve-id { font-family: var(--mono); font-size: 17px; font-weight: 700; color: var(--text-1); }
.cve-status {
  font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 4px 10px; border-radius: 3px; display: flex; align-items: center; gap: 6px;
}
.cve-status.published { color: var(--cyan); background: rgba(45,224,201,0.08); border: 1px solid var(--cyan-dim); }
.cve-status.reserved { color: var(--text-3); background: rgba(107,114,128,0.08); border: 1px solid var(--border); }
.cve-status .dot { width: 5px; height: 5px; background: currentColor; box-shadow: none; }
.cve-title { font-family: var(--disp); font-size: 18px; font-weight: 600; margin-bottom: 8px; line-height: 1.35; }
.cve-desc { color: var(--text-2); font-size: 14px; margin-bottom: 16px; max-width: 700px; }
.cve-meta { display: flex; flex-wrap: wrap; gap: 22px; margin-bottom: 14px; }
.cve-meta div { display: flex; flex-direction: column; gap: 3px; }
.cve-meta .k { font-family: var(--mono); font-size: 10px; color: var(--text-3); text-transform: uppercase; }
.cve-meta .v { font-family: var(--mono); font-size: 13px; color: var(--text-1); }
.cvss-bar { width: 130px; height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-top: 5px; }
.cvss-fill { height: 100%; border-radius: 3px; }
.cve-link { font-family: var(--mono); font-size: 12px; color: var(--cyan); display: inline-flex; align-items: center; gap: 6px; }
.cve-link:hover { text-decoration: underline; }

/* ============ EMPTY STATE ============ */
.empty-state {
  border: 1px dashed var(--border); border-radius: 6px; padding: 56px 30px;
  text-align: center; background: repeating-linear-gradient(135deg, transparent, transparent 12px, rgba(255,255,255,0.008) 12px, rgba(255,255,255,0.008) 24px);
}
.empty-state .glyph {
  font-family: var(--mono); font-size: 12px; color: var(--sev-medium);
  border: 1px solid var(--sev-medium); display: inline-block; padding: 6px 14px;
  border-radius: 4px; text-transform: uppercase; margin-bottom: 18px;
}
.empty-state h3 { font-family: var(--disp); font-size: 20px; margin-bottom: 8px; }
.empty-state p { color: var(--text-2); font-size: 14px; max-width: 440px; margin: 0 auto; }

/* ============ FOOTER ============ */
footer.main-footer {
  border-top: 1px solid var(--border-soft);
  background: var(--bg-raised);
  padding: 36px 0;
  margin-top: auto;
}
.footer-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
}
.footer-links { display: flex; gap: 16px; }
.footer-links a:hover { color: var(--cyan); }

/* ============ RESPONSIVE (MOBILE) ============ */
@media (max-width: 900px) {
  .topbar-inner { flex-wrap: wrap; }
  .nav-toggle { display: block; }
  
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
    margin-top: 10px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; padding: 10px; }
  
  h1.hero-title { font-size: 34px; }
  .cert-row { flex-direction: column; align-items: flex-start; }
}