/* ============================================================
   CERTCOR — shared.css
   SINGLE SOURCE OF TRUTH. All global styles live here.
   Nothing global is ever defined in a page file.
   Breakpoint: 768px (only breakpoint used sitewide)
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Exo+2:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  /* Core Palette */
  --color-bg:           #0A0F1C;
  --color-surface:      #0F1A2E;
  --color-surface-2:    #132034;
  --color-surface-3:    #172844;

  /* Accent */
  --color-accent:       #2F6BFF;
  --color-accent-hover: #4C82FF;
  --color-accent-glow:  rgba(47, 107, 255, 0.18);
  --color-accent-glow-strong: rgba(47, 107, 255, 0.35);

  /* Text */
  --color-text:         #E6EAF2;
  --color-text-muted:   #8A94A6;
  --color-text-faint:   #4A5568;

  /* Status */
  --color-green:        #00D084;
  --color-amber:        #FFB020;
  --color-red:          #FF4D4F;

  /* Borders */
  --border-subtle:      1px solid rgba(255,255,255,0.06);
  --border-accent:      1px solid rgba(47,107,255,0.35);
  --border-muted:       1px solid rgba(138,148,166,0.2);

  /* Typography */
  --font-heading:       'Rajdhani', sans-serif;
  --font-body:          'Exo 2', sans-serif;
  --font-mono:          'JetBrains Mono', monospace;

  /* Spacing */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Layout */
  --max-width: 1200px;
  --nav-height: 68px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-std:  200ms ease;

  /* Gradients */
  --gradient-bg: linear-gradient(180deg, #0A0F1C 0%, #0F1A2E 100%);
  --gradient-surface: linear-gradient(135deg, #0F1A2E 0%, #132034 100%);
  --gradient-accent: linear-gradient(135deg, #2F6BFF 0%, #4C82FF 100%);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* ── Typography Scale ─────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
h4 { font-size: 1.2rem; }
h5 { font-size: 1rem; }

p { color: var(--color-text); line-height: 1.7; }

.text-muted    { color: var(--color-text-muted); }
.text-accent   { color: var(--color-accent); }
.text-green    { color: var(--color-green); }
.text-amber    { color: var(--color-amber); }
.text-red      { color: var(--color-red); }
.text-mono     { font-family: var(--font-mono); }

/* ALL CAPS label utility */
.label {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.label-accent {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* ── Layout Utilities ─────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.section {
  padding: var(--space-3xl) 0;
}

.section-sm {
  padding: var(--space-2xl) 0;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-xl); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-xl); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-lg); }

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col     { display: flex; flex-direction: column; }
.gap-sm       { gap: var(--space-sm); }
.gap-md       { gap: var(--space-md); }
.gap-lg       { gap: var(--space-lg); }
.gap-xl       { gap: var(--space-xl); }

.text-center { text-align: center; }
.text-left   { text-align: left; }

.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.75rem 1.75rem;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  transition: background var(--transition-std),
              box-shadow var(--transition-std),
              border-color var(--transition-std),
              color var(--transition-std);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 0 0 rgba(47,107,255,0);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #4C82FF 0%, #6094FF 100%);
  box-shadow: 0 0 20px var(--color-accent-glow-strong),
              0 0 40px var(--color-accent-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text-muted);
  border: var(--border-muted);
}
.btn-secondary:hover {
  color: var(--color-text);
  border-color: rgba(47,107,255,0.5);
  box-shadow: 0 0 12px var(--color-accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--color-accent);
  border: var(--border-accent);
}
.btn-ghost:hover {
  background: var(--color-accent-glow);
  box-shadow: 0 0 16px var(--color-accent-glow-strong);
}

.btn-sm {
  font-size: 0.75rem;
  padding: 0.5rem 1.2rem;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--gradient-surface);
  border: var(--border-subtle);
  border-radius: 4px;
  padding: var(--space-xl);
  transition: border-color var(--transition-std),
              box-shadow var(--transition-std);
}
.card:hover {
  border-color: rgba(47,107,255,0.25);
  box-shadow: 0 0 24px var(--color-accent-glow);
}

.card-flat {
  background: var(--color-surface);
  border: var(--border-subtle);
  border-radius: 4px;
  padding: var(--space-xl);
}

/* ── Dividers ─────────────────────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: rgba(255,255,255,0.05);
  margin: var(--space-xl) 0;
}

.divider-accent {
  width: 48px;
  height: 2px;
  background: var(--gradient-accent);
  margin-bottom: var(--space-lg);
}

/* ── Status Badges ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: 2px;
}

.badge-green  { background: rgba(0,208,132,0.1);  color: var(--color-green);  border: 1px solid rgba(0,208,132,0.25); }
.badge-amber  { background: rgba(255,176,32,0.1);  color: var(--color-amber);  border: 1px solid rgba(255,176,32,0.25); }
.badge-red    { background: rgba(255,77,79,0.1);   color: var(--color-red);    border: 1px solid rgba(255,77,79,0.25); }
.badge-blue   { background: var(--color-accent-glow); color: var(--color-accent); border: var(--border-accent); }

.badge-dot::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ── Section Headers ──────────────────────────────────────── */
.section-header {
  margin-bottom: var(--space-2xl);
}

.section-header.centered {
  text-align: center;
}

.section-header .label,
.section-header .label-accent {
  display: block;
  margin-bottom: var(--space-md);
}

.section-header h2 {
  margin-bottom: var(--space-md);
}

.section-header p {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  max-width: 560px;
}

.section-header.centered p {
  margin: 0 auto;
}

/* ── Hex Grid Background Pattern ─────────────────────────── */
.hex-bg {
  position: relative;
}
.hex-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(47,107,255,0.07) 1px, transparent 0);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}
.hex-bg > * { position: relative; z-index: 1; }

/* ── Code / Mono Blocks ───────────────────────────────────── */
.code-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: rgba(47,107,255,0.1);
  color: var(--color-accent-hover);
  border: var(--border-accent);
  border-radius: 3px;
  padding: 0.2rem 0.6rem;
}

/* ── Navigation ───────────────────────────────────────────── */
#cc-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(10,15,28,0.92);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: var(--border-subtle);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.nav-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--gradient-accent);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--color-accent-glow);
}

.nav-logo-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-link {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link:hover { color: var(--color-text); }

.nav-link.active {
  color: var(--color-accent);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Hamburger (mobile) */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--color-text-muted);
  transition: all var(--transition-std);
}

/* Mobile Nav Drawer */
.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: rgba(10,15,28,0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: var(--border-subtle);
  padding: var(--space-lg) var(--space-xl);
  z-index: 999;
}

.nav-mobile.open { display: flex; flex-direction: column; gap: var(--space-md); }

.nav-mobile .nav-link {
  font-size: 0.85rem;
  padding: var(--space-sm) 0;
  border-bottom: var(--border-subtle);
}

.nav-mobile .nav-actions {
  flex-direction: column;
  align-items: stretch;
  margin-top: var(--space-sm);
}

.nav-mobile .btn { justify-content: center; }

/* ── Footer ───────────────────────────────────────────────── */
#cc-footer {
  background: var(--color-surface);
  border-top: var(--border-subtle);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer-brand p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: var(--space-md);
  max-width: 280px;
}

.footer-col-title {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-link {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.footer-link:hover { color: var(--color-text); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-xl);
  border-top: var(--border-subtle);
}

.footer-copyright {
  font-size: 0.78rem;
  color: var(--color-text-faint);
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
}

.footer-bottom-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-bottom-link {
  font-size: 0.78rem;
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
  text-decoration: none;
  transition: color var(--transition-fast);
  text-transform: uppercase;
}
.footer-bottom-link:hover { color: var(--color-text-muted); }

/* ── Page Wrapper (offset for fixed nav) ──────────────────── */
.page-body {
  padding-top: var(--nav-height);
}

/* ── Responsive — 768px breakpoint ───────────────────────── */
@media (max-width: 768px) {
  :root {
    --space-xl:  1.5rem;
    --space-2xl: 2.5rem;
    --space-3xl: 4rem;
  }

  .container {
    padding: 0 var(--space-lg);
  }

  /* Nav */
  .nav-links,
  .nav-actions { display: none; }
  .nav-hamburger { display: flex; }

  /* Grids */
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  /* Section header */
  .section-header p {
    font-size: 0.95rem;
  }

  /* Buttons */
  .btn { font-size: 0.8rem; padding: 0.7rem 1.5rem; }
}
