:root {
  --primary: #3157ff;
  --ink: #14213d;
  --muted: #667085;
  --soft: #f5f7fb;
  --line: #e6eaf2;
}

* { box-sizing: border-box; }

body {
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
  background: #ffffff;
}

.navbar-brand { letter-spacing: -0.03em; }
.brand-dot { color: var(--primary); }
.nav-link { font-weight: 600; color: #3b4658; }
.nav-link:hover { color: var(--primary); }

.btn-primary {
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: #2445d8;
  --bs-btn-hover-border-color: #2445d8;
}

.hero-section {
  padding: 96px 0;
  background:
    radial-gradient(circle at top left, rgba(49, 87, 255, 0.14), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #f6f8ff 100%);
}

.profile-card {
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 32px;
  padding: 36px;
  text-align: center;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px);
}

.profile-avatar {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  border-radius: 28px;
  color: white;
  background: linear-gradient(135deg, #3157ff, #18c8a8);
  font-size: 32px;
  font-weight: 800;
}

.mini-stat {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
}

.mini-stat strong,
.mini-stat span { display: block; }
.mini-stat strong { font-size: 20px; }
.mini-stat span { color: var(--muted); font-size: 14px; }

.section-padding { padding: 88px 0; }
.bg-soft { background: var(--soft); }
.section-label {
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.section-title {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.content-width { max-width: 640px; }

.feature-card,
.project-card {
  border: 1px solid var(--line);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(20, 33, 61, 0.06);
}
.feature-card { transition: transform 180ms ease, box-shadow 180ms ease; }
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 24px 70px rgba(20, 33, 61, 0.1); }
.icon-pill {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: white;
  background: var(--primary);
  font-weight: 800;
}

.project-image { height: 180px; }
.gradient-one { background: linear-gradient(135deg, #3157ff, #98d8ff); }
.gradient-two { background: linear-gradient(135deg, #18c8a8, #d7f75b); }
.gradient-three { background: linear-gradient(135deg, #ffb703, #fb7185); }
.gradient-four { background: linear-gradient(135deg, #0f172a, #38bdf8); }
.project-card a { color: var(--primary); font-weight: 700; text-decoration: none; }

.timeline { border-left: 1px solid rgba(255,255,255,0.2); padding-left: 28px; }
.timeline-item { position: relative; padding-bottom: 30px; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -36px;
  top: 6px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #66e3ff;
  box-shadow: 0 0 0 6px rgba(102, 227, 255, 0.14);
}
.timeline-item span {
  color: #66e3ff;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.timeline-item p { color: rgba(255,255,255,0.64); margin-bottom: 0; }

.contact-panel {
  padding: 64px 28px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: linear-gradient(135deg, #ffffff, #f6f8ff);
}

.docs-hero { padding: 72px 0 40px; background: var(--soft); }
.docs-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: white;
  box-shadow: 0 16px 45px rgba(20,33,61,0.06);
}
.docs-sidebar {
  position: sticky;
  top: 92px;
}
.docs-sidebar a {
  display: block;
  padding: 10px 14px;
  border-radius: 12px;
  color: #3b4658;
  text-decoration: none;
  font-weight: 600;
}
.docs-sidebar a:hover { color: var(--primary); background: #eef2ff; }
.docs-content h2 { margin-top: 10px; font-weight: 800; letter-spacing: -0.03em; }
.docs-content h3 { margin-top: 28px; font-weight: 750; }
.docs-content p, .docs-content li { color: var(--muted); }

@media (max-width: 767px) {
  .hero-section { padding: 64px 0; }
  .section-padding { padding: 64px 0; }
  .profile-card { padding: 26px; }
  .docs-sidebar { position: static; }
}

/* Project case study pages */
.project-hero {
  padding: 78px 0;
}
.ecr-hero {
  background:
    radial-gradient(circle at top right, rgba(255, 0, 200, 0.35), transparent 34%),
    radial-gradient(circle at bottom left, rgba(49, 87, 255, 0.4), transparent 28%),
    linear-gradient(135deg, #17003d 0%, #4b00b5 48%, #9100a8 100%);
}
.text-white-75 { color: rgba(255,255,255,0.78); }
.project-preview-card {
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255,255,255,0.12);
  padding: 10px;
}
.project-preview-card img {
  width: 100%;
  display: block;
  border-radius: 16px;
}
.callout-card,
.feature-list-card {
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  padding: 20px;
  box-shadow: 0 12px 36px rgba(20, 33, 61, 0.05);
}
.callout-card {
  color: var(--primary);
  font-weight: 800;
}
.screenshot-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.screenshot-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background: white;
  box-shadow: 0 18px 50px rgba(20, 33, 61, 0.08);
}
.screenshot-card.large {
  grid-column: 1 / -1;
}
.screenshot-card img {
  width: 100%;
  display: block;
  background: #f5f7fb;
}
.screenshot-card figcaption {
  padding: 16px 18px;
  color: var(--muted);
  font-size: 0.95rem;
}
.workflow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.workflow-grid div {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff, #f7f8ff);
  padding: 18px;
}
.workflow-grid span {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.workflow-grid strong {
  display: block;
  margin-bottom: 6px;
}
.workflow-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 767px) {
  .project-hero { padding: 56px 0; }
  .screenshot-gallery,
  .workflow-grid { grid-template-columns: 1fr; }
  .screenshot-card.large { grid-column: auto; }
}

/* Floating back-to-top button */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1040;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 44px;
  border: 1px solid rgba(49, 87, 255, 0.28);
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), #6d00ff);
  box-shadow: 0 16px 36px rgba(49, 87, 255, 0.28);
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  box-shadow: 0 20px 45px rgba(49, 87, 255, 0.36);
}
.back-to-top:focus-visible {
  outline: 3px solid rgba(49, 87, 255, 0.28);
  outline-offset: 4px;
}

@media (max-width: 767px) {
  .back-to-top {
    right: 14px;
    bottom: 14px;
    min-width: 64px;
    min-height: 40px;
    font-size: 0.9rem;
  }
}

/* Packet Insight page */
.packet-hero {
  background:
    radial-gradient(circle at top right, rgba(0, 216, 255, 0.32), transparent 34%),
    radial-gradient(circle at bottom left, rgba(34, 197, 94, 0.28), transparent 28%),
    linear-gradient(135deg, #04111f 0%, #073763 48%, #0f766e 100%);
}
.packet-visual {
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 28px;
  padding: 18px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(14px);
}
.packet-window-bar {
  display: flex;
  gap: 8px;
  padding: 10px 12px 16px;
}
.packet-window-bar span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
}
.packet-grid {
  display: grid;
  grid-template-columns: 1fr 40px 1fr 40px 1fr;
  align-items: center;
  gap: 10px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.92);
}
.packet-node {
  display: grid;
  place-items: center;
  min-height: 86px;
  border-radius: 18px;
  color: #0f172a;
  background: #ecfeff;
  font-weight: 900;
  text-align: center;
}
.packet-node.active {
  color: white;
  background: linear-gradient(135deg, #3157ff, #06b6d4);
}
.packet-line {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #3157ff, #06b6d4);
}
.packet-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.packet-metrics div {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.88);
}
.packet-metrics strong,
.packet-metrics span { display: block; }
.packet-metrics strong { color: #0f172a; }
.packet-metrics span { color: var(--muted); font-size: 0.8rem; }

@media (max-width: 767px) {
  .packet-grid { grid-template-columns: 1fr; }
  .packet-line { width: 4px; height: 28px; justify-self: center; }
  .packet-metrics { grid-template-columns: repeat(2, 1fr); }
}

/* NetSafe Auditor page */
.netsafe-hero {
  background:
    radial-gradient(circle at top right, rgba(125, 92, 255, 0.38), transparent 34%),
    radial-gradient(circle at bottom left, rgba(14, 165, 233, 0.34), transparent 30%),
    linear-gradient(135deg, #101828 0%, #1e1b4b 48%, #3730a3 100%);
}
.netsafe-visual {
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 28px;
  padding: 24px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(14px);
}
.netsafe-panel-title {
  margin-bottom: 18px;
  color: rgba(255,255,255,0.88);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.netsafe-device-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.92);
}
.netsafe-device-row strong { color: #111827; }
.netsafe-device-row em {
  color: var(--muted);
  font-size: 0.86rem;
  font-style: normal;
  font-weight: 700;
}
.device-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.device-dot.ok { background: #22c55e; }
.device-dot.warn { background: #f59e0b; }
.device-dot.risk { background: #ef4444; }
.netsafe-score {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  color: white;
  background: rgba(0,0,0,0.22);
}
.netsafe-score span {
  display: block;
  margin-bottom: 10px;
  font-weight: 800;
}
.score-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.24);
  overflow: hidden;
}
.score-fill {
  width: 68%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #38bdf8);
}
.status-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  background: linear-gradient(135deg, #ffffff, #f7f8ff);
}

@media (max-width: 767px) {
  .netsafe-device-row { grid-template-columns: 18px 1fr; }
  .netsafe-device-row em { grid-column: 2; }
}

/* Profile page */
.profile-hero {
  padding: 86px 0;
  background:
    radial-gradient(circle at top left, rgba(49, 87, 255, 0.12), transparent 34%),
    radial-gradient(circle at bottom right, rgba(24, 200, 168, 0.14), transparent 32%),
    linear-gradient(135deg, #ffffff 0%, #f5f7fb 100%);
}
.profile-timeline {
  display: grid;
  gap: 18px;
}
.profile-timeline div {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  background: linear-gradient(135deg, #ffffff, #f7f8ff);
  box-shadow: 0 14px 36px rgba(20, 33, 61, 0.05);
}
.profile-timeline span {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.profile-timeline h3 {
  margin-bottom: 10px;
}
.profile-timeline p {
  margin-bottom: 0;
  color: var(--muted);
}

/* Profile photo card */
.profile-photo-card {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 32px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(16px);
}
.profile-photo-card img {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 4.7;
  object-fit: cover;
  object-position: center top;
}
.profile-photo-caption {
  padding: 28px;
}

/* Documentation article hub */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tag-cloud span {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  color: #3b4658;
  background: #ffffff;
  font-weight: 700;
  font-size: 0.92rem;
}
.article-draft {
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(24px, 5vw, 46px);
  background: linear-gradient(135deg, #ffffff, #f7f8ff);
  box-shadow: 0 16px 45px rgba(20, 33, 61, 0.06);
}
.article-draft p {
  font-size: 1.03rem;
}

/* Contact modal */
.contact-modal {
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(20, 33, 61, 0.22);
}
.contact-modal .form-control {
  border-radius: 14px;
  border-color: var(--line);
  padding: 12px 14px;
}
.contact-modal .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(49, 87, 255, 0.14);
}
