:root {
  --bg-deep: #070d14;
  --bg-panel: #0f1724;
  --bg-elevated: #141f30;
  --border: rgba(0, 212, 170, 0.15);
  --text: #e8f1ff;
  --text-muted: #8ba3c4;
  --accent: #00d4aa;
  --accent-dim: #00a884;
  --danger: #ff4d6d;
  --warning: #ffb020;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-display: "Outfit", var(--font-sans);
  --radius: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(0, 212, 170, 0.12), transparent),
    radial-gradient(900px 500px at 90% 0%, rgba(59, 130, 246, 0.1), transparent),
    var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
}

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

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

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(7, 13, 20, 0.85);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
}
.brand:hover {
  text-decoration: none;
  color: var(--accent);
}
.brand img {
  height: 40px;
  width: auto;
}

.nav-main {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  font-size: 0.95rem;
}
.nav-main a {
  color: var(--text-muted);
}
.nav-main a:hover {
  color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #03120e;
  box-shadow: 0 8px 24px rgba(0, 212, 170, 0.25);
}
.site-header .btn--nav-login {
  background: #e8f1ff;
  color: #070d14;
  border: 1px solid rgba(232, 241, 255, 0.55);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}
.site-header .btn--nav-login:hover {
  background: #ffffff;
  color: #070d14;
}
.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  background: transparent;
}

.hero {
  padding: 3.5rem 0 4rem;
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    padding: 4.5rem 0 5rem;
  }
}

/* Clear sticky header (~4.25rem) so hero artwork and brand are not clipped */
.hero--image-bg {
  display: block;
  min-height: min(88vh, 720px);
  padding: calc(4.35rem + clamp(2rem, 5vw, 3.5rem)) 0 clamp(3.5rem, 12vw, 6rem);
  margin: 0;
  background-image: linear-gradient(
      110deg,
      rgba(7, 13, 20, 0.93) 0%,
      rgba(7, 13, 20, 0.78) 42%,
      rgba(7, 13, 20, 0.42) 100%
    ),
    var(--hero-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--border);
}

/* Home: extra top padding so artwork in the hero clears the sticky header */
.page-home .hero--image-bg {
  padding-top: calc(5.65rem + clamp(2rem, 5vw, 3.5rem));
  background-position: center top;
  background-size: cover;
}

.hero--image-bg.hero {
  grid-template-columns: 1fr;
}

.hero--image-bg .hero__inner {
  max-width: none;
  width: 100%;
}

/* Keep hero copy off center-left artwork/text in the image (readable column on the right). */
.hero--image-bg .hero__copy--align-end {
  max-width: min(38rem, 100%);
}
@media (min-width: 720px) {
  .hero--image-bg .hero__copy--align-end {
    margin-left: auto;
    margin-right: 0;
  }
}

.hero--image-bg h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.85rem);
  line-height: 1.15;
  margin: 0 0 1rem;
  color: #f4f9ff;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.45);
}

.hero-lead--on-image {
  color: rgba(232, 241, 255, 0.9);
  font-size: 1.1rem;
  max-width: 36rem;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.4);
}

.btn--hero-primary {
  background: linear-gradient(135deg, #00e8bb, var(--accent-dim));
  color: #041210;
  font-weight: 700;
}

.btn--hero-ghost {
  border-color: rgba(232, 241, 255, 0.45);
  color: #f4f9ff;
  background: rgba(15, 23, 36, 0.35);
}
.btn--hero-ghost:hover {
  background: rgba(15, 23, 36, 0.55);
  color: #ffffff;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.85rem);
  line-height: 1.15;
  margin: 0 0 1rem;
}
.hero-lead {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 36rem;
}
.hero-visual {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.hero-visual img {
  width: 100%;
}

.messages-wrap {
  padding-top: 0.75rem;
  padding-bottom: 0.25rem;
}

.contact-lead-grid {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}
@media (min-width: 880px) {
  .contact-lead-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-lead-card .section-title {
  margin-bottom: 0.5rem;
}

.section--contact-lead {
  padding-top: 2rem;
}

.dashboard-preview {
  margin: 1.5rem 0 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--bg-panel);
}
.dashboard-preview img {
  width: 100%;
  height: auto;
  display: block;
}
.dashboard-preview figcaption {
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  border-top: 1px solid var(--border);
}
.dashboard-preview code {
  font-size: 0.85em;
  color: var(--accent);
}

/* Services page: alternate card alignment for visual rhythm */
.service-block {
  margin-top: 2rem;
  max-width: 48rem;
}
.shell > section.service-block:first-of-type {
  margin-top: 2.5rem;
}
.service-block--left {
  margin-right: auto;
  margin-left: 0;
}
.service-block--right {
  margin-left: auto;
  margin-right: 0;
}
.service-block--right > .section-title {
  text-align: right;
}
.service-block--center {
  margin-left: auto;
  margin-right: auto;
}
.service-block--center > .section-title {
  text-align: center;
}
.service-block .card {
  max-width: none;
}
@media (max-width: 640px) {
  .service-block--right,
  .service-block--center {
    margin-left: 0;
    margin-right: auto;
  }
  .service-block--right > .section-title,
  .service-block--center > .section-title {
    text-align: left;
  }
}

.services-page-cta {
  margin-top: 2rem;
  max-width: 44rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

ul.service-list {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
}
ul.service-list li {
  margin-bottom: 0.35rem;
}

.section {
  padding: 3rem 0;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin: 0 0 1rem;
}

.grid-cards {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 720px) {
  .grid-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1000px) {
  .grid-cards.three {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover {
  border-color: rgba(0, 212, 170, 0.35);
  transform: translateY(-2px);
}
.card h3 {
  font-family: var(--font-display);
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}
.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.site-footer {
  margin-top: 4rem;
  padding: 2rem 0 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-legal {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(0, 212, 170, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.footer-copy {
  margin: 0;
  color: var(--text-muted);
}

.footer-links {
  margin: 0;
}

.footer-sep {
  margin: 0 0.5rem;
  opacity: 0.5;
}

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

.input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
}
.textarea {
  min-height: 140px;
  resize: vertical;
}
label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.form-row {
  margin-bottom: 1rem;
}
.errorlist {
  color: var(--danger);
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}
.messages li {
  padding: 0.65rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}
.messages .success {
  background: rgba(0, 212, 170, 0.12);
  border: 1px solid rgba(0, 212, 170, 0.35);
}
.messages .warning {
  background: rgba(255, 176, 32, 0.1);
  border: 1px solid rgba(255, 176, 32, 0.35);
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.data th,
table.data td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.data th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-weight: 600;
}
.weak-enc {
  color: var(--danger);
  font-weight: 700;
}

.portal-layout {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 960px) {
  .portal-layout {
    grid-template-columns: 240px 1fr;
    align-items: start;
  }
}

.portal-nav {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.portal-nav a {
  display: block;
  padding: 0.45rem 0.5rem;
  color: var(--text-muted);
  border-radius: 8px;
}
.portal-nav a:hover {
  background: var(--bg-elevated);
  color: var(--accent);
  text-decoration: none;
}

.metric-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.metric {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.metric-link {
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.metric-link:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: rgba(0, 212, 170, 0.35);
}
.metric .value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
}
.metric-grid--top {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.metric-time--critical .value {
  color: var(--danger);
}
.metric-time--warning .value {
  color: var(--warning);
}
.metric-time--ok .value {
  color: var(--accent);
}
.metric .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.portal-narrative {
  margin-bottom: 1.35rem;
}
.portal-narrative h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.portal-narrative .portal-prose {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.portal-narrative .card.portal-prose {
  padding: 1.1rem 1.25rem;
}

.portal-highlight {
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  margin-bottom: 0.65rem;
  border: 1px solid var(--border);
}
.portal-highlight--critical {
  border-color: rgba(255, 77, 109, 0.55);
  background: rgba(255, 77, 109, 0.08);
}
.portal-highlight--critical .portal-highlight__title {
  color: var(--danger);
}
.portal-highlight--warning {
  border-color: rgba(255, 176, 32, 0.45);
  background: rgba(255, 176, 32, 0.07);
}
.portal-highlight--warning .portal-highlight__title {
  color: var(--warning);
}
.portal-highlight__title {
  font-weight: 700;
  margin: 0 0 0.35rem;
  font-size: 1rem;
}
.portal-highlight__detail {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  white-space: pre-wrap;
}

.host-ports-list {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
}
.host-ports-list li {
  margin-bottom: 0.4rem;
  line-height: 1.45;
}
.host-card-collapsible summary::-webkit-details-marker {
  display: none;
}
.host-card-collapsible .host-toggle-text--collapse {
  display: none;
}
.host-card-collapsible[open] .host-toggle-text--expand {
  display: none;
}
.host-card-collapsible[open] .host-toggle-text--collapse {
  display: block;
}
.host-card-collapsible > summary::after {
  content: "▸";
  float: right;
  color: var(--text-muted);
}
.host-card-collapsible[open] > summary::after {
  content: "▾";
}

#cy-root,
#cy-client {
  min-height: 420px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

#wireless-canvas-wrap {
  position: relative;
  max-width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
#wireless-canvas-wrap img {
  width: 100%;
  display: block;
}
#wireless-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.graph-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal-backdrop.open {
  display: flex;
}
.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}
.modal h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: none;
}
