/* Cipher Cortex — visual layer only. Layout/markup unchanged. */

:root {
  --bg: #06080c;
  --bg-panel: #0f141c;
  --surface: rgba(16, 22, 30, 0.82);
  --surface-hover: rgba(22, 30, 42, 0.92);
  --border: rgba(100, 130, 170, 0.14);
  --border-glow: rgba(72, 140, 210, 0.42);
  --text: #f0f4f9;
  --muted: #8fa3bc;
  --accent: #3b7ab5;
  --accent-hi: #6eb0e8;
  --accent-soft: rgba(62, 130, 200, 0.14);
  --glow: rgba(62, 130, 200, 0.28);
  --font: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --radius: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* ── Atmospheric background ── */
body.site-body,
body.bg-grid {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 100% 70% at 50% -30%, rgba(55, 120, 190, 0.22), transparent 55%),
    radial-gradient(ellipse 55% 45% at 0% 40%, rgba(35, 70, 120, 0.14), transparent 50%),
    radial-gradient(ellipse 45% 40% at 100% 70%, rgba(40, 80, 130, 0.12), transparent 50%),
    linear-gradient(rgba(80, 130, 190, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 130, 190, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 52px 52px, 52px 52px;
  background-attachment: fixed;
}

body.site-body::before,
body.bg-grid::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle 480px at 15% 20%, rgba(62, 130, 200, 0.07), transparent 70%),
    radial-gradient(circle 400px at 85% 75%, rgba(50, 100, 160, 0.06), transparent 70%);
  animation: ambient-drift 28s ease-in-out infinite alternate;
}

@keyframes ambient-drift {
  from { opacity: 0.85; transform: scale(1); }
  to   { opacity: 1; transform: scale(1.04); }
}

main,
nav,
footer {
  position: relative;
  z-index: 1;
}

::selection {
  background: rgba(62, 130, 200, 0.35);
  color: #fff;
}

/* ── Nav ── */
#navbar {
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

#navbar.nav-scrolled {
  background: rgba(6, 8, 12, 0.92) !important;
  border-color: var(--border) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.nav-blur {
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
}

#navbar a[href="/"] {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text) !important;
  text-shadow: 0 0 24px rgba(110, 176, 232, 0.25);
}

#navbar [data-nav].nav-active {
  color: var(--text) !important;
  background: var(--accent-soft);
}

/* ── Typography helpers ── */
.section-label {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent-hi);
  text-shadow: 0 0 20px rgba(110, 176, 232, 0.35);
}

.prose-muted {
  color: var(--muted);
}

/* Hero headline — gradient on existing h1, no markup change */
main > section:first-of-type h1 {
  background: linear-gradient(165deg, #f4f8fc 0%, #a8cce8 38%, #5a9fd4 72%, #3d6a96 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 40px rgba(90, 159, 212, 0.15));
}

main > section:first-of-type {
  position: relative;
}

main > section:first-of-type::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(720px, 90%);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-glow), transparent);
  opacity: 0.6;
}

/* Section headings */
main h2.text-2xl {
  letter-spacing: -0.02em;
}

/* Panel section (research band) */
section.border-y.border-slate-800 {
  background: linear-gradient(
    180deg,
    rgba(15, 20, 28, 0.55) 0%,
    rgba(12, 16, 22, 0.85) 50%,
    rgba(15, 20, 28, 0.55) 100%
  ) !important;
  border-color: var(--border) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 32px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.28s ease,
    box-shadow 0.28s ease,
    background 0.28s ease;
}

.card:hover {
  background: var(--surface-hover);
  border-color: var(--border-glow);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 16px 48px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(72, 140, 210, 0.12),
    0 0 32px rgba(62, 130, 200, 0.08);
  transform: translateY(-3px);
}

/* Service / eco link cards */
a.card {
  text-decoration: none;
  color: inherit;
}

a.card:hover .font-semibold {
  color: #fff;
}

/* Audience pills — no lift, softer hover */
.grid.gap-4.text-sm.prose-muted .card:hover {
  transform: translateY(-1px);
  color: var(--text);
}

/* Step numbers */
.card.p-5 > span.font-bold:first-child,
.card.p-5 > span[class*="4a7caf"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.4rem;
  border-radius: 6px;
  font-size: 0.8rem;
  background: var(--accent-soft);
  border: 1px solid rgba(72, 140, 210, 0.28);
  box-shadow: 0 0 16px rgba(62, 130, 200, 0.12);
}

/* ── Buttons ── */
.btn-primary,
a.btn-primary {
  background: linear-gradient(180deg, #6eb0e8 0%, #3b7ab5 55%, #2f6494 100%);
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 4px 20px var(--glow),
    0 1px 0 rgba(255, 255, 255, 0.2) inset;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  text-decoration: none;
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow:
    0 8px 32px var(--glow),
    0 1px 0 rgba(255, 255, 255, 0.25) inset;
}

.btn-secondary,
a.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text) !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* In-card / inline links */
a[class*="5d92c4"] {
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

a[class*="5d92c4"]:hover {
  text-shadow: 0 0 20px rgba(110, 176, 232, 0.35);
}

/* Final CTA section glow */
main > section:last-of-type {
  position: relative;
}

main > section:last-of-type::before {
  content: "";
  position: absolute;
  inset: -2rem -1rem;
  z-index: -1;
  border-radius: 20px;
  background: radial-gradient(ellipse 80% 60% at 50% 50%, rgba(62, 130, 200, 0.1), transparent 70%);
  pointer-events: none;
}

/* Inner page h1 */
main > section:first-of-type h1.text-4xl {
  background: linear-gradient(165deg, #f0f4f8 0%, #8eb8e0 50%, #4a7caf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Footer */
footer {
  border-top: 1px solid var(--border) !important;
  background: rgba(6, 8, 12, 0.94);
  backdrop-filter: blur(12px);
}

footer a:hover {
  color: var(--text) !important;
}

/* Forms */
input,
select,
textarea {
  background: rgba(14, 19, 26, 0.95) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: 8px !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--glow);
}

.notice-internal {
  border: 1px solid rgba(180, 120, 40, 0.35);
  border-left: 3px solid rgba(217, 160, 60, 0.75);
  border-radius: var(--radius);
  background: rgba(16, 22, 30, 0.95);
}

.notice-internal-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d4a24a;
}

.notice-internal-body {
  font-size: 0.875rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body.site-body::before,
  body.bg-grid::before { animation: none; }
  .card,
  .btn-primary,
  .btn-secondary { transition: none; }
  .card:hover { transform: none; }
}
