/* PRISM — shared.css */

/* ─── FONTS ──────────────────────────────────────────────────────────────── */
/* Plus Jakarta Sans — served locally, no external requests, CSP-safe        */
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/fonts/plus-jakarta-sans-v12-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/fonts/plus-jakarta-sans-v12-latin-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ─── TOKENS ─────────────────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:           #08090d;
  --bg2:          #0e0f16;
  --bg3:          #13141e;

  /* Borders */
  --border:       rgba(255, 255, 255, 0.07);

  /* Text */
  --text:         #e8e9f0;
  --muted:        rgba(232, 233, 240, 0.45);

  /* Brand spectrum */
  --accent:       #7c6cfa;   /* violet   */
  --accent2:      #fa6c8e;   /* rose     */
  --accent3:      #6cfabc;   /* mint     */
  --prism-grad:   linear-gradient(135deg, #7c6cfa 0%, #fa6c8e 50%, #6cfabc 100%);

  /* Typography */
  --font-head:    'Plus Jakarta Sans', sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', Consolas, 'Liberation Mono', monospace;
  --font-body:    'Plus Jakarta Sans', sans-serif;

  /* Layout */
  --radius:       12px;
  --max-w:        1100px;   /* override per-page if needed (docs uses 1400px) */
}

/* ─── RESET ──────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  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-weight:  400;
  line-height:  1.65;
  overflow-x:   hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ─── NOISE LAYER ────────────────────────────────────────────────────────── */
/* Subtle grain overlay — sits fixed, pointer-events off, never blocks clicks */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('/noise.svg');
  opacity: 0.025;
  pointer-events: none;
  z-index: 0;
}

/* ─── LAYOUT UTILITIES ───────────────────────────────────────────────────── */
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

.section      { padding: 5rem 0; }
.section--alt { background: var(--bg2); }

/* ─── NAV ────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 9, 13, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  height: 60px;
}

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

.nav-logo {
  font-family:     var(--font-head);
  font-size:       1.3rem;
  font-weight:     800;
  letter-spacing:  0.06em;
  display:         flex;
  align-items:     center;
  gap:             0.4rem;
  color:           var(--text);
  text-decoration: none;
}
.nav-logo:hover { text-decoration: none; }

.nav-logo .glyph {
  width:          28px;
  height:         28px;
  background:     var(--prism-grad);
  border-radius:  6px;
  display:        grid;
  place-items:    center;
  font-size:      0.9rem;
  flex-shrink:    0;
}

.nav-links {
  display:     flex;
  align-items: center;
  gap:         1.5rem;
  list-style:  none;
}

.nav-links a {
  font-size:   0.875rem;
  color:       var(--muted);
  font-weight: 500;
  transition:  color 0.2s;
}
.nav-links a:hover          { color: var(--text); text-decoration: none; }

.nav-cta {
  background:    var(--accent);
  color:         #fff !important;
  padding:       0.45rem 1.1rem;
  border-radius: 8px;
  font-weight:   500 !important;
  transition:    opacity 0.2s !important;
}
.nav-cta:hover { opacity: 0.85; text-decoration: none; }

/* Mobile hamburger — hidden by default, shown via media query */
.nav-mobile-toggle {
  display:    none;
  background: none;
  border:     none;
  cursor:     pointer;
  color:      var(--text);
  padding:    0.25rem;
}

/* ─── SHARED BUTTONS ─────────────────────────────────────────────────────── */
.btn-primary {
  display:        inline-flex;
  align-items:    center;
  gap:            0.5rem;
  background:     var(--accent);
  color:          #fff;
  font-family:    var(--font-body);
  font-weight:    500;
  font-size:      0.95rem;
  padding:        0.75rem 1.75rem;
  border-radius:  10px;
  border:         none;
  cursor:         pointer;
  transition:     transform 0.15s, opacity 0.15s;
  text-decoration: none;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); text-decoration: none; }

.btn-ghost {
  display:        inline-flex;
  align-items:    center;
  gap:            0.5rem;
  background:     transparent;
  color:          var(--text);
  font-family:    var(--font-body);
  font-weight:    500;
  font-size:      0.95rem;
  padding:        0.75rem 1.75rem;
  border-radius:  10px;
  border:         1px solid var(--border);
  cursor:         pointer;
  transition:     border-color 0.2s, background 0.2s;
  text-decoration: none;
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.04); text-decoration: none; }

/* ─── SECTION TYPOGRAPHY ─────────────────────────────────────────────────── */
.section-label {
  font-family:     var(--font-mono);
  font-size:       0.72rem;
  letter-spacing:  0.14em;
  text-transform:  uppercase;
  color:           var(--accent);
  margin-bottom:   0.75rem;
}

.section-heading {
  font-family:    var(--font-head);
  font-size:      clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight:    800;
  line-height:    1.15;
  letter-spacing: -0.02em;
  margin-bottom:  1rem;
}

.section-sub {
  color:         var(--muted);
  max-width:     520px;
  margin-bottom: 3rem;
  font-size:     1rem;
}

/* ─── SITE FOOTER ────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding:    2.5rem 0;
  margin-top: 5rem;
  position:   relative;
  z-index:    1;
}

.footer-inner {
  max-width:       var(--max-w);
  margin:          0 auto;
  padding:         0 1.5rem;
  display:         flex;
  flex-wrap:       wrap;
  gap:             1.5rem;
  align-items:     center;
  justify-content: space-between;
}

.footer-logo {
  font-family:     var(--font-head);
  font-size:       1.1rem;
  font-weight:     800;
  display:         flex;
  align-items:     center;
  gap:             0.4rem;
  color:           var(--text);
  text-decoration: none;
}
.footer-logo:hover { text-decoration: none; }

.footer-logo .glyph {
  width:         22px;
  height:        22px;
  background:    var(--prism-grad);
  border-radius: 5px;
  display:       grid;
  place-items:   center;
  font-size:     0.7rem;
  flex-shrink:   0;
}

.footer-nav {
  display:   flex;
  flex-wrap: wrap;
  gap:       1.25rem;
  list-style: none;
}

.footer-nav a {
  font-size:  0.85rem;
  color:      var(--muted);
  transition: color 0.2s;
}
.footer-nav a:hover { color: var(--text); text-decoration: none; }

.footer-copy {
  font-size: 0.78rem;
  color:     rgba(232, 233, 240, 0.25);
  width:     100%;
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Nav collapses to hamburger */
  .nav-links { display: none; }
  .nav-links.open {
    display:       flex;
    flex-direction: column;
    position:      absolute;
    top:           60px;
    left:          0;
    right:         0;
    background:    rgba(8, 9, 13, 0.97);
    padding:       1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    z-index:       99;
  }
  .nav-mobile-toggle { display: block; }

  /* Section padding */
  .section { padding: 3.5rem 0; }

  /* Footer stack */
  .footer-inner   { flex-direction: column; align-items: flex-start; }
  .footer-copy    { text-align: left; }
}

@media (max-width: 480px) {
  .nav-logo { font-size: 1.1rem; }
}

/* ─── NAV ACTIVE STATE ───────────────────────────────────────────────────── */
.nav-links a.nav-active {
  color: var(--text);
  position: relative;
}
.nav-links a.nav-active::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 2px;
  background: var(--prism-grad);
  border-radius: 1px;
}

/* ─── LOGO SVG SIZING ────────────────────────────────────────────────────── */
/* Constrains the logo.ejs SVG in nav and footer contexts                     */
.nav-logo .header-logo,
.footer-logo .header-logo {
  flex-shrink: 0;
  display: block;
}
.nav-logo .header-logo {
  width:  32px;
  height: 32px;
}
.footer-logo .header-logo {
  width:  24px;
  height: 24px;
}
.nav-logo-text {
  font-family:    var(--font-head);
  font-size:      1.2rem;
  font-weight:    800;
  letter-spacing: 0.06em;
  color:          var(--text);
}
.footer-logo-text {
  font-family:    var(--font-head);
  font-size:      1rem;
  font-weight:    800;
  letter-spacing: 0.06em;
  color:          var(--text);
}

/* ─── LOGO BREATHING ANIMATION ───────────────────────────────────────────── */
.nav-logo .header-logo,
.footer-logo .header-logo,
.logo-wrapper .header-logo {
  animation: prism-breathing 4s ease-in-out infinite;
}

@keyframes prism-breathing {
  0%, 100% {
    filter: brightness(1) drop-shadow(0 0 5px rgba(0, 255, 255, 0.3));
    transform: scale(1);
  }
  50% {
    filter: brightness(1.2) drop-shadow(0 0 15px rgba(255, 0, 255, 0.5));
    transform: scale(1.05);
  }
}
