/* main.css — Kernelv5, Inc. — Dark Infrastructure Theme */
/* Fonts: Outfit (headings) · DM Sans (body) · DM Mono (labels/code) */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@700;800&family=DM+Sans:opsz,wght@9..40,400;9..40,500&family=DM+Mono:wght@400;500&display=swap');

/* ── Design Tokens ───────────────────────────────────── */
:root {
  --bg:          #070c14;
  --surface:     #0c1420;
  --card:        #0f1928;
  --card-hover:  #132035;
  --border:      rgba(255, 255, 255, 0.07);
  --border-glow: rgba(0, 212, 255, 0.22);
  --accent:      #00d4ff;
  --accent-dim:  rgba(0, 212, 255, 0.08);
  --text-1:      #e8edf5;
  --text-2:      #7a8fa8;
  --text-3:      #3d5470;
  --ease:        cubic-bezier(0.22, 1, 0.36, 1);
  --side:        20%;
}

/* ── Base ────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text-2);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Subtle grid texture layered over entire page */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: 0;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #ffffff;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5em 1.35em;
  border-radius: 999px;
  text-decoration: none;
  transition: opacity 0.15s, box-shadow 0.2s;
}

.btn-primary:hover {
  opacity: 0.88;
  box-shadow: 0 0 22px rgba(0, 212, 255, 0.35);
}

.btn-ghost {
  display: inline-block;
  background: transparent;
  color: var(--text-1);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5em 1.35em;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.btn-ghost:hover {
  border-color: var(--border-glow);
  background: var(--accent-dim);
}

/* ── Hero ────────────────────────────────────────────── */
.hero {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  height: 100vh;
  min-height: 520px;
  max-height: 720px;
  padding: 12rem var(--side) 0;
  overflow: hidden;
}

/* Radial glow anchored behind hero text */
.hero::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 5%;
  width: 500px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(0, 212, 255, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  flex: 0 0 48%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0;
  animation: fadeUp 0.55s 0.05s var(--ease) forwards;
}

.hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 3.6rem;
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin: 0;
  background: linear-gradient(110deg, #10dbc5 0%, #d46fc8 52%, #9b7df5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  animation: fadeUp 0.55s 0.18s var(--ease) forwards;
}

.subhead {
  font-family: 'DM Mono', monospace;
  font-size: 0.92rem;
  color: var(--text-2);
  margin: 0;
  line-height: 1.5;
  opacity: 0;
  animation: fadeUp 0.55s 0.3s var(--ease) forwards;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.55s 0.42s var(--ease) forwards;
}

.hero-canvas-wrap {
  flex: 1 1 auto;
  align-self: stretch;
  overflow: hidden;
  position: relative;
}

/* ── Service Constellation Cards ─────────────────── */
.svc-constellation {
  position: absolute;
  inset: 0;
}

/* SVG connecting lines */
.svc-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.svc-lines line {
  stroke: rgba(0, 212, 255, 0.22);
  stroke-width: 0.8;
  stroke-dasharray: 3 6;
  animation: dash-scroll 3s linear infinite;
}

@keyframes dash-scroll {
  to { stroke-dashoffset: -18; }
}

/* Individual card */
.svc-card {
  position: absolute;
  background: rgba(var(--cx, 0,212,255), 0.10);
  border: 1px solid rgba(var(--cx, 0,212,255), 0.42);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  min-width: 128px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 18px rgba(var(--cx, 0,212,255), 0.14),
              inset 0 0 12px rgba(var(--cx, 0,212,255), 0.06);
  animation: floatY 4s var(--delay, 0s) ease-in-out infinite alternate;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  cursor: default;
}

.svc-card:hover {
  background: rgba(var(--cx, 0,212,255), 0.16);
  border-color: rgba(var(--cx, 0,212,255), 0.72);
  box-shadow: 0 0 36px rgba(var(--cx, 0,212,255), 0.32),
              0 0 72px rgba(var(--cx, 0,212,255), 0.12),
              inset 0 0 18px rgba(var(--cx, 0,212,255), 0.1);
}

@keyframes floatY {
  from { transform: translateY(0px); }
  to   { transform: translateY(-11px); }
}

/* Hub card — more prominent */
.svc-card--hub {
  --cx: 0,212,255;
  background: rgba(0, 212, 255, 0.14);
  border-color: rgba(0, 212, 255, 0.60);
  box-shadow: 0 0 48px rgba(0, 212, 255, 0.28),
              0 0 96px rgba(0, 212, 255, 0.10),
              inset 0 0 20px rgba(0, 212, 255, 0.10);
  animation-duration: 5s;
}

/* Card internals */
.svc-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(var(--cx, 0,212,255), 1);
  box-shadow: 0 0 10px rgba(var(--cx, 0,212,255), 1),
              0 0 20px rgba(var(--cx, 0,212,255), 0.6);
  margin-right: 0.45rem;
  vertical-align: middle;
  animation: dot-pulse 2.5s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1;    box-shadow: 0 0 10px rgba(var(--cx, 0,212,255), 1), 0 0 22px rgba(var(--cx, 0,212,255), 0.6); }
  50%       { opacity: 0.6; box-shadow: 0 0 6px  rgba(var(--cx, 0,212,255), 0.6), 0 0 12px rgba(var(--cx, 0,212,255), 0.3); }
}

.svc-name {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(var(--cx, 0,212,255), 1);
  text-shadow: 0 0 12px rgba(var(--cx, 0,212,255), 0.6);
  vertical-align: middle;
}

.svc-sub {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  color: rgba(var(--cx, 0,212,255), 0.55);
  margin-top: 0.4rem;
}

.svc-tags {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}

.svc-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(var(--cx, 0,212,255), 0.85);
  background: rgba(var(--cx, 0,212,255), 0.16);
  border: 1px solid rgba(var(--cx, 0,212,255), 0.25);
  padding: 0.15em 0.5em;
  border-radius: 3px;
}

/* Monitoring mini sparkline */
.svc-sparkline {
  margin-top: 0.5rem;
  border-top: 1px solid rgba(var(--cx, 212,111,200), 0.12);
  padding-top: 0.4rem;
}

.svc-spark-svg {
  width: 100%;
  height: 22px;
  display: block;
  overflow: visible;
}

.spark-line {
  fill: none;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spark-line--1 {
  stroke: rgba(212, 111, 200, 0.75);
  animation: spark-shift 2.8s linear infinite;
}

.spark-line--2 {
  stroke: rgba(0, 212, 255, 0.45);
  animation: spark-shift 3.4s linear infinite reverse;
}

@keyframes spark-shift {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-8px); }
}

/* ── Keyframes ───────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4), 0 0 0 3px rgba(0, 212, 255, 0.2); }
  50%       { box-shadow: 0 0 0 6px rgba(0, 212, 255, 0), 0 0 0 3px rgba(0, 212, 255, 0.2); }
}

/* ── Services Map ────────────────────────────────────── */
.services {
  position: relative;
  z-index: 1;
  padding: 6rem var(--side);
}

.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 1rem;
}

.services-header {
  margin-bottom: 3.5rem;
}

.services-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: var(--text-1);
  margin: 0;
}

.services-map {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

/* Node entrance animation */
.service-node {
  background: var(--card);
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  position: relative;
  cursor: default;
  opacity: 0;
  transform: translateY(16px);
  transition: background 0.2s, opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.service-node.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.service-node:hover { background: var(--card-hover); }

/* Glowing inset border on hover */
.service-node::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color 0.2s;
}

.service-node:hover::after { border-color: var(--border-glow); }

.node-index {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.service-node h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-1);
  margin: 0;
  line-height: 1.25;
}

.service-node p {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.65;
  margin: 0;
}

.node-intro {
  font-size: 0.855rem;
  color: var(--text-2);
  line-height: 1.65;
  margin: 0;
}

.node-list {
  list-style: none;
  margin: 0.1rem 0 0;
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.node-list li {
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.55;
  padding-left: 1.1rem;
  position: relative;
}

.node-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.9rem;
  line-height: 1.4;
  opacity: 0.7;
}

.node-footer {
  font-size: 0.78rem;
  color: var(--text-3);
  line-height: 1.6;
  margin: 0;
  font-style: italic;
}

.node-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  margin-top: auto;
  transition: color 0.2s;
}

.service-node:hover .node-tag { color: var(--accent); }

/* ── About ───────────────────────────────────────────── */
.about {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6rem;
  padding: 6rem var(--side);
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-content { flex: 1; max-width: 560px; }

.about-content h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: var(--text-1);
  margin: 0.5rem 0 1.5rem;
}

.about-content p {
  font-size: 0.975rem;
  color: var(--text-2);
  line-height: 1.85;
  margin: 0;
}

/* Geographic visual */
.about-geo {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.geo-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.25rem 0;
}

.geo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-3);
  box-shadow: 0 0 0 3px rgba(53, 74, 96, 0.35);
  margin-bottom: 0.5rem;
}

.geo-dot--active {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

.geo-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, var(--text-3), var(--accent));
  margin-left: 4px;
}

.geo-city {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-1);
}

.geo-role {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ── Certifications ──────────────────────────────────── */
.certifications {
  position: relative;
  z-index: 1;
  padding: 3.5rem var(--side);
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.cert-header {
  margin-bottom: 2rem;
}

.cert-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: #0f172a;
  margin: 0.5rem 0 0.75rem;
}

.cert-subtitle {
  font-size: 0.975rem;
  color: #475569;
  margin: 0;
}

.certifications .section-label {
  color: #4B5EAA;
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem 2rem;
}

.cert-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  background: none;
  border: none;
  text-align: center;
  cursor: default;
}

.cert-group-logo {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.3s;
}

.cert-group-logo img {
  max-height: 60px;
  max-width: 190px;
  width: 100%;
  height: auto;
  object-fit: contain;
  opacity: 0.9;
}

.cert-group-logo--lg {
  height: 110px;
}

.cert-group-logo--lg img {
  max-height: 90px;
  max-width: 240px;
}


.cert-group-issuer {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(var(--cc, 0,120,212), 0.85);
  width: 100%;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid #e2e8f0;
}

.cert-group-list {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
}

.cert-group-list li {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.79rem;
  font-weight: 500;
  color: #475569;
  line-height: 1.3;
  padding: 0.3rem 0.5rem 0.3rem 0.7rem;
  border-left: 2px solid rgba(var(--cc, 0,120,212), 0.3);
  background: rgba(var(--cc, 0,120,212), 0.05);
  border-radius: 0 4px 4px 0;
  transition: border-left-color 0.2s, color 0.2s;
}

.cert-group:hover .cert-group-list li {
  border-left-color: rgba(var(--cc, 0,120,212), 0.7);
  color: #0f172a;
}

@media (max-width: 1100px) {
  .cert-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .cert-grid { grid-template-columns: 1fr; }
  .cert-header h2 { font-size: 2rem; }
}

/* ── Contact Footer ──────────────────────────────────── */
.contact {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.contact-inner {
  text-align: center;
  padding: 7rem var(--side) 5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.contact h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 3.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-1);
  margin: 0;
}

.contact p {
  font-size: 0.975rem;
  color: var(--text-2);
  margin: 0 0 0.5rem;
}

.contact-cta {
  font-size: 0.95rem;
  padding: 0.65em 1.8em;
}

.email-link {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-3);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.15s;
}

.email-link:hover { color: var(--accent); }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1024px) {
  .services-map {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root { --side: 1.5rem; }

  .hero {
    flex-direction: column;
    height: auto;
    max-height: none;
    padding: 3.5rem 1.5rem 0;
    gap: 0;
  }

  .hero-content {
    flex: 0 0 auto;
    max-width: 100%;
    padding-bottom: 2.5rem;
  }

  .hero-canvas-wrap {
    width: 100%;
    height: 200px;
    flex: 0 0 auto;
  }

  .hero h1 { font-size: 2.5rem; }

  .services,
  .about { padding: 4rem 1.5rem; }

  .services-map { grid-template-columns: 1fr; }

  .services-header h2,
  .about-content h2 { font-size: 2rem; }

  .about {
    flex-direction: column;
    gap: 3rem;
  }

  .contact h2 { font-size: 2.25rem; }
}
