/* ============================================================
   cybersecurity303 — design tokens
   Ink navy base, verified-teal + clearance-amber accents.
   Display: Space Grotesk / Body: IBM Plex Sans / Utility: IBM Plex Mono
   ============================================================ */

:root {
  --ink: #0a1420;
  --panel: #101d2c;
  --panel-raised: #14243669;
  --line: #223247;
  --paper: #e7ecef;
  --muted: #8fa3b8;
  --signal: #3fa796;
  --signal-hover: #4fc0ac;
  --signal-dim: #3fa79626;
  --flag: #e8a33d;

  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  --max-w: 1120px;
  --edge: clamp(20px, 5vw, 64px);

  --card-shadow: none;
  --header-bg: rgba(10, 20, 32, 0.86);
}

/* ---------------- Light theme ----------------
   Same token names, different values. Every component in this file reads
   colors through these variables (never hardcoded), so defining a second
   palette here re-themes the whole site with no per-component overrides
   needed, except: a subtle card shadow (flat color blocks read as "blank"
   on a light background the way they don't on dark) and the client-logo
   cards, which stay permanently dark since the logos themselves are
   dark-background images we don't control - see .client-logo-card below. */
html[data-theme="light"] {
  --ink: #f5f7f9;
  --panel: #ffffff;
  --panel-raised: #ffffffcc;
  --line: #dbe2e8;
  --paper: #101d2c;
  --muted: #5b6b7c;
  --signal: #1f7a6c;
  --signal-hover: #17604f;
  --signal-dim: #1f7a6c1f;
  --flag: #b8791f;

  --card-shadow: 0 1px 3px rgba(16, 29, 44, 0.08);
  --header-bg: rgba(245, 247, 249, 0.86);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

body, .panel, .service-card, .client-logo-card, .chain-wrap, .chatbot-panel,
.field input, .field textarea, .nav-cta, .btn-secondary {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; color: var(--paper); }
.lede { color: var(--muted); font-size: 1.15rem; max-width: 46ch; }

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--edge);
}

/* ---------------- Skip link / focus ---------------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--signal);
  color: var(--ink);
  padding: 10px 16px;
  z-index: 100;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.skip-link:focus {
  left: var(--edge);
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------------- Header / Nav ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--edge);
  max-width: var(--max-w);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--paper);
}

.brand-mark {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 4px;
}

.brand .badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink);
  background: var(--signal);
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.06em;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  transition: color 0.15s ease;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--paper);
  border-bottom-color: var(--signal);
}

.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--paper);
  padding: 9px 16px;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}

.nav-cta:hover { background: var(--signal); transform: translateY(-1px); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover { border-color: var(--signal); color: var(--paper); }
.theme-toggle svg { width: 18px; height: 18px; display: block; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--paper);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 1rem;
}

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-block; }
  .nav-cta { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    padding: 1.2rem var(--edge);
    gap: 1rem;
  }
}

/* ---------------- Hero ---------------- */
.hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem);
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--signal);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1.1rem;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 3px var(--signal-dim);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.8rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--signal);
  color: var(--ink);
}
.btn-primary:hover { transform: translateY(-2px); background: var(--signal-hover); }

.btn-secondary {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--line);
}
.btn-secondary:hover { border-color: var(--signal); transform: translateY(-2px); }

/* --- signature chain diagram --- */
.chain-wrap {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
  padding: 1.6rem;
  box-shadow: var(--card-shadow);
}

.chain-caption {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.9rem;
}

.chain-caption .ok { color: var(--signal); }

.chain-svg .chain-node circle {
  fill: var(--panel);
  stroke: var(--line);
  stroke-width: 1.5;
  transition: stroke 0.4s ease, fill 0.4s ease;
}
.chain-svg .chain-node text {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  transition: fill 0.4s ease;
}
.chain-svg .chain-node.lit circle {
  stroke: var(--signal);
  fill: var(--signal-dim);
}
.chain-svg .chain-node.lit text { fill: var(--paper); }

.chain-svg .chain-edge {
  stroke: var(--line);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
  transition: stroke 0.4s ease;
}
.chain-svg .chain-edge.lit { stroke: var(--signal); }

/* ---------------- Sections ---------------- */
section { padding: clamp(3rem, 7vw, 5rem) 0; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: 2.4rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.4rem;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.section-head-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-icon {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

/* ---------------- Service badge cards ---------------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (max-width: 700px) {
  .services-grid { grid-template-columns: 1fr; }
}

.service-card {
  display: block;
  color: var(--paper);
  text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--signal);
  border-radius: 6px;
  padding: 1.8rem;
  box-shadow: var(--card-shadow);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.service-card:hover {
  border-left-color: var(--flag);
  transform: translateY(-3px);
}

.service-icon {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.service-card .code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink);
  background: var(--muted);
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 1rem;
  letter-spacing: 0.06em;
}

.service-card h3 { margin-bottom: 0.5rem; }
.service-card p { color: var(--muted); margin-bottom: 0; }

/* ---------------- Stat / trust strip ---------------- */
.strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 2.2rem 0;
}

@media (max-width: 700px) {
  .strip { grid-template-columns: 1fr; gap: 1.2rem; }
}

.strip-item .label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--signal);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.4rem;
}

.strip-item p { color: var(--muted); margin: 0; font-size: 0.95rem; }

/* ---------------- Client logos ---------------- */
.client-logos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

@media (max-width: 860px) {
  .client-logos { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .client-logos { grid-template-columns: 1fr; }
}

.client-logo-card {
  /* Deliberately NOT theme variables: these client logos have a dark
     background baked into the image itself (see the light-mode image
     brief), so the card stays dark in both themes to avoid a mismatched
     dark rectangle floating on an otherwise light page. */
  background: #101d2c;
  border: 1px solid #223247;
  border-radius: 8px;
  padding: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.client-logo-card:hover {
  transform: translateY(-3px);
  border-color: var(--signal);
}

.client-logo-card img {
  max-width: 100%;
  max-height: 72px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ---------------- Cards / generic panel ---------------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: var(--card-shadow);
}

/* ---------------- Contact form ---------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(2rem, 5vw, 4rem);
}

@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.field { margin-bottom: 1.3rem; }

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.field input,
.field textarea {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 14px;
  transition: border-color 0.15s ease;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--signal);
  outline: none;
}

.field textarea { resize: vertical; min-height: 140px; }

.form-status {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  min-height: 1.4em;
}

.form-status[data-state="ok"] { color: var(--signal); }
.form-status[data-state="err"] { color: var(--flag); }
.form-status[data-state="sending"] { color: var(--muted); }

.contact-info dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem 1.2rem;
  margin: 1.6rem 0;
}

.contact-info dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  align-self: center;
}

.contact-info dd { margin: 0; }

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.4rem 0;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-grid .mono { font-size: 0.75rem; }

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links a { text-decoration: none; color: var(--muted); }
.footer-links a:hover { color: var(--paper); }

/* ---------------- Page hero (inner pages) ---------------- */
.page-hero {
  padding: clamp(2.4rem, 6vw, 4rem) 0 2rem;
  border-bottom: 1px solid var(--line);
}

.page-hero .lede { max-width: 60ch; }

/* ---------------- About page specifics ---------------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
@media (max-width: 700px) { .pillars { grid-template-columns: 1fr; } }

.pillar {
  border-top: 2px solid var(--flag);
  padding-top: 1rem;
}
.pillar h3 { margin-bottom: 0.4rem; }
.pillar p { color: var(--muted); }

/* ---------------- Chat widget ---------------- */
.chatbot-bubble {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--signal);
  color: var(--ink);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, background 0.15s ease;
}
.chatbot-bubble:hover { transform: translateY(-2px); background: var(--signal-hover); }
.chatbot-bubble svg { width: 24px; height: 24px; }

.chatbot-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 200;
  width: min(360px, calc(100vw - 40px));
  height: min(520px, calc(100vh - 140px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.chatbot-panel.open { display: flex; }

.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--ink);
}
.chatbot-header .title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
}
.chatbot-header .subtitle {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.chatbot-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}
.chatbot-close:hover { color: var(--paper); }

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chatbot-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.chatbot-msg.user {
  align-self: flex-end;
  background: var(--signal-dim);
  border: 1px solid var(--signal);
  color: var(--paper);
}
.chatbot-msg.bot {
  align-self: flex-start;
  background: var(--ink);
  border: 1px solid var(--line);
  color: var(--paper);
}
.chatbot-msg.typing {
  align-self: flex-start;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.chatbot-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}
.chatbot-form textarea {
  flex: 1;
  resize: none;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 9px 11px;
  max-height: 80px;
}
.chatbot-form textarea:focus { border-color: var(--signal); outline: none; }
.chatbot-form button {
  background: var(--signal);
  color: var(--ink);
  border: none;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}
.chatbot-form button:hover:not(:disabled) { background: var(--signal-hover); }
.chatbot-form button:disabled { opacity: 0.5; cursor: not-allowed; }

.chatbot-disclaimer {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  text-align: center;
  padding: 0 12px 10px;
}

@media (max-width: 480px) {
  .chatbot-panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 84px;
  }
  .chatbot-bubble { right: 16px; bottom: 16px; }
}
