/* Synapticore shared theme overrides
   Loaded after each page's inline styles to unify the visual system. */

:root{
  --void-black:#050505;
  --void-black-edge:#000000;
  --signal-white:#ffffff;
  --synapse-cyan:#00FFC2;

  --glass-surface:rgba(255,255,255,0.035);
  --glass-surface-strong:rgba(255,255,255,0.065);
  --border-color:rgba(255,255,255,0.10);

  --text-color:rgba(255,255,255,0.92);
  --text-secondary:rgba(255,255,255,0.68);
  --text-muted:rgba(255,255,255,0.52);

  --radius-sm:10px;
  --radius-md:14px;
  --radius-lg:18px;

  --shadow-elev:0 18px 56px rgba(0,0,0,0.55);
  --shadow-soft:0 10px 30px rgba(0,0,0,0.45);

  --container-max:1200px;
  --nav-height:80px;
  --nav-height-sm:72px;

  --focus-ring:0 0 0 3px rgba(0,255,194,0.22);
}

html{
  color-scheme:dark;
  text-rendering:optimizeLegibility;
}

*{ box-sizing:border-box; }

body{
  color:var(--text-color);
  font-family:'Inter Tight','Roboto',system-ui,-apple-system,Segoe UI,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  background:radial-gradient(ellipse at top, rgba(0,255,194,0.06) 0%, transparent 42%),
             radial-gradient(ellipse at center, var(--void-black) 0%, var(--void-black-edge) 100%);
}

/* Subtle global grid/noise overlay (kept low contrast for cohesion). */
body::before{
  content:'';
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.02) 2px, rgba(255,255,255,0.02) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(255,255,255,0.02) 2px, rgba(255,255,255,0.02) 4px);
  opacity:0.55;
}

.container, .nav-container{
  max-width:var(--container-max);
}

a{
  color:inherit;
  text-underline-offset:0.18em;
  text-decoration-thickness:0.06em;
}

a:hover{
  color:var(--signal-white);
}

:where(a, button, input, textarea, select):focus-visible{
  outline:none;
  box-shadow:var(--focus-ring);
  border-radius:var(--radius-sm);
}

/* Headings: match logo’s sci‑fi tone. */
h1, h2, h3, h4, h5, h6, .section-title, .synapticore-title{
  font-family:'Chakra Petch','Oxanium',system-ui,-apple-system,Segoe UI,Helvetica,Arial,sans-serif;
  letter-spacing:0.04em;
}

/* Navigation: unify across all pages (including mobile drawer). */
nav{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  z-index:1000 !important;
  background:rgba(5,5,5,0.72);
  border-bottom:1px solid var(--border-color);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}

nav.scrolled{
  background:rgba(5,5,5,0.90);
  box-shadow:0 10px 40px rgba(0,0,0,0.45);
}

nav .nav-container{
  max-width:none !important;
  width:100%;
  margin:0 !important;
  height:var(--nav-height);
  padding:0 clamp(18px, 3vw, 44px);
}

.nav-link{
  color:var(--text-secondary);
  transition:color 0.25s ease, text-shadow 0.25s ease, transform 0.25s ease;
}

.nav-links{
  margin-left:auto;
}

.nav-link:hover{
  color:var(--signal-white);
  text-shadow:0 0 14px rgba(255,255,255,0.18);
  transform:translateY(-1px);
}

.nav-link::after{
  background:var(--synapse-cyan);
  box-shadow:0 0 12px rgba(0,255,194,0.55);
}

.nav-logo img{
  max-height:22px !important;
  width:auto;
}

.mobile-menu-btn{
  display:none;
  width:44px;
  height:44px;
  align-items:center;
  justify-content:center;
  border-radius:var(--radius-sm);
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.03);
  color:var(--text-color);
}

.mobile-menu-btn .hamburger{
  width:18px;
  height:12px;
  position:relative;
  display:block;
}

.mobile-menu-btn .hamburger::before,
.mobile-menu-btn .hamburger::after,
.mobile-menu-btn .hamburger span{
  content:'';
  position:absolute;
  left:0;
  right:0;
  height:2px;
  border-radius:2px;
  background:rgba(255,255,255,0.85);
  box-shadow:0 0 14px rgba(0,255,194,0.12);
  transition:transform 0.22s ease, opacity 0.22s ease, top 0.22s ease, bottom 0.22s ease;
}

.mobile-menu-btn .hamburger span{ top:5px; }
.mobile-menu-btn .hamburger::before{ top:0; }
.mobile-menu-btn .hamburger::after{ bottom:0; }

body.nav-open .mobile-menu-btn .hamburger span{ opacity:0; }
body.nav-open .mobile-menu-btn .hamburger::before{ top:5px; transform:rotate(45deg); }
body.nav-open .mobile-menu-btn .hamburger::after{ bottom:5px; transform:rotate(-45deg); }

.overlay{
  position:fixed;
  inset:0;
  z-index:900;
  background:rgba(0,0,0,0.62);
  opacity:0;
  pointer-events:none;
  transition:opacity 0.22s ease;
  backdrop-filter:blur(2px);
  -webkit-backdrop-filter:blur(2px);
}

body.nav-open .overlay{
  opacity:1;
  pointer-events:auto;
}

@media screen and (max-width: 860px){
  .nav-container{ height:var(--nav-height-sm); }

  .mobile-menu-btn{
    display:inline-flex;
    position:fixed;
    top:14px;
    right:16px;
    z-index:1100;
    width:40px;
    height:40px;
    background:transparent;
    border:1px solid rgba(255,255,255,0.15);
  }

  nav .mobile-menu-btn{
    position:relative;
    top:auto;
    right:auto;
  }

  .nav-links{
    display:flex !important;
    position:fixed;
    top:0;
    right:0;
    height:auto;
    min-height:100dvh;
    width:220px;
    padding:70px 20px 30px;
    flex-direction:column;
    gap:0;
    align-items:stretch;
    background:rgba(8,8,8,0.98);
    border-left:1px solid rgba(255,255,255,0.08);
    box-shadow:-10px 0 40px rgba(0,0,0,0.5);
    transform:translateX(100%);
    transition:transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index:1050;
  }

  body.nav-open .nav-links{
    transform:translateX(0);
  }

  .nav-link{
    width:100%;
    padding:12px 0 !important;
    color:rgba(255,255,255,0.85) !important;
    font-size:0.85rem;
    font-weight:600;
    letter-spacing:0.06em;
    border-bottom:1px solid rgba(255,255,255,0.08);
    background:transparent;
    border-radius:0;
    text-transform:uppercase;
  }

  .nav-link:last-child{
    border-bottom:none;
  }

  .nav-link:hover,
  .nav-link:active{
    color:var(--synapse-cyan) !important;
    text-shadow:none;
    transform:none;
  }

  .nav-link::after{
    display:none;
  }

  .nav-logo img{
    max-height:18px !important;
  }
}

/* Cards + surfaces: unify radius + contrast (kept subtle). */
.service-card,
.arch-container{
  border-radius:var(--radius-lg) !important;
  border:1px solid rgba(255,255,255,0.10) !important;
  background:linear-gradient(180deg, rgba(255,255,255,0.045) 0%, rgba(255,255,255,0.02) 100%) !important;
  box-shadow:var(--shadow-soft) !important;
}

.service-card:hover{
  background:linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%) !important;
  border-color:rgba(0,255,194,0.35) !important;
  box-shadow:0 0 0 1px rgba(0,255,194,0.12), 0 18px 56px rgba(0,0,0,0.60) !important;
}

.service-header{
  border-bottom:1px solid rgba(255,255,255,0.06) !important;
}

.section-title{
  color:var(--signal-white);
  text-shadow:0 0 18px rgba(255,255,255,0.22);
}

/* Docs pages (research + md export): centered typography + dark code blocks. */
main.doc{
  max-width:800px !important;
  margin:0 auto !important;
  padding:64px 28px 120px !important;
  width:100%;
  box-sizing:border-box;
}

main.doc > h1,
main.doc > h2{
  text-align:center;
}

main.doc > p:first-of-type{
  text-align:center;
}

main.doc > .architecture-interactive{
  text-align:center;
  display:flex;
  justify-content:center;
}

/* Research architecture image: keep it clean (no hover/zoom effects). */
body#preview .architecture-interactive{
  margin:40px auto 48px !important;
  max-width:980px;
  padding:0 !important;
}

body#preview .arch-container{
  padding:0 !important;
  background:transparent !important;
  border:none !important;
  box-shadow:none !important;
  border-radius:0 !important;
}

body#preview .arch-base-image{
  filter:none !important;
  border-radius:var(--radius-md);
  border:1px solid rgba(255,255,255,0.10);
  box-shadow:var(--shadow-soft);
}

body#preview{
  padding-top:var(--nav-height) !important;
}

@media screen and (max-width: 860px){
  body#preview{
    padding-top:70px !important;
  }

  body#preview nav{
    display:none !important;
  }

  body#preview .back-btn{
    display:flex !important;
  }

  body#preview main.doc{
    padding:48px 18px 88px !important;
  }

  body#preview main.doc h1{
    font-size:clamp(1.35rem, 5.2vw, 1.75rem) !important;
    line-height:1.2;
    margin:12px 0 8px;
  }

  body#preview main.doc h2{
    font-size:clamp(0.78rem, 2.6vw, 0.95rem) !important;
    line-height:1.45;
    margin:10px 0 14px;
    font-weight:600;
  }

  body#preview main.doc h3{
    font-size:1rem !important;
    margin:16px 0 6px;
  }

  body#preview main.doc h4{
    font-size:0.92rem !important;
    margin:14px 0 6px;
  }

  body#preview main.doc h5{
    font-size:0.88rem !important;
  }

  body#preview main.doc h6{
    font-size:0.82rem !important;
  }

  body#preview main.doc p,
  body#preview main.doc li{
    font-size:0.9375rem;
    line-height:1.7;
  }

  body#preview main.doc > p:first-of-type{
    font-size:0.8125rem;
    line-height:1.55;
  }

  body#preview main.doc pre{
    font-size:0.8125rem;
    padding:12px 14px;
  }

  body#preview main.doc table{
    font-size:0.8125rem;
  }

  body#preview main.doc th,
  body#preview main.doc td{
    padding:8px 10px;
  }
}

/* Force docs export pages off white backgrounds. */
html, body#preview{
  background-color:var(--void-black-edge) !important;
}

body#preview{
  background:
    radial-gradient(ellipse at top, rgba(0,255,194,0.06) 0%, transparent 42%),
    radial-gradient(ellipse at center, var(--void-black) 0%, var(--void-black-edge) 100%) !important;
  margin:0;
}

main.doc h1{
  font-size:clamp(2.1rem, 2.8vw, 3rem);
  line-height:1.15;
  margin:26px 0 12px;
}

main.doc h2{
  color:rgba(255,255,255,0.86);
  margin:22px 0 10px;
}

main.doc h3, main.doc h4, main.doc h5, main.doc h6{
  color:rgba(255,255,255,0.86);
  margin:18px 0 8px;
}

main.doc h4{
  font-size:1.15rem;
}

main.doc h5{
  font-size:1rem;
}

main.doc h6{
  font-size:0.9rem;
  color:rgba(255,255,255,0.75);
}

main.doc p, main.doc li{
  color:var(--text-secondary);
  line-height:1.85;
}

main.doc hr{
  border:0;
  border-top:1px solid rgba(255,255,255,0.10);
  margin:22px 0;
}

main.doc a{
  color:rgba(0,255,194,0.92);
  text-decoration:none;
}

main.doc a:hover{
  text-decoration:underline;
}

main.doc pre{
  background:rgba(255,255,255,0.04) !important;
  border:1px solid rgba(255,255,255,0.10) !important;
  color:rgba(255,255,255,0.86) !important;
  border-radius:var(--radius-md) !important;
  padding:14px 16px;
  overflow:auto;
  box-shadow:0 10px 26px rgba(0,0,0,0.35);
}

main.doc code{
  background:rgba(255,255,255,0.05) !important;
  color:rgba(255,255,255,0.86) !important;
  border-radius:8px;
}

main.doc table{
  width:100%;
  border-collapse:collapse;
  margin:18px 0;
  overflow:hidden;
  border-radius:var(--radius-md);
}

main.doc th, main.doc td{
  border:1px solid rgba(255,255,255,0.10) !important;
  padding:10px 12px;
}

main.doc th{
  background:rgba(255,255,255,0.04);
  color:rgba(255,255,255,0.84);
}

/* Reduce motion for accessibility. */
@media (prefers-reduced-motion: reduce){
  *{ animation-duration:0.001ms !important; animation-iteration-count:1 !important; transition-duration:0.001ms !important; scroll-behavior:auto !important; }
}

/* Research page mobile: hide nav, show back button */
@media screen and (max-width: 860px){
  html body#preview nav,
  body#preview nav{
    display:none !important;
    visibility:hidden !important;
  }

  html body#preview .back-btn,
  body#preview .back-btn{
    display:flex !important;
    visibility:visible !important;
  }
}
