/* ===== CSS Custom Properties ===== */
:root {
  --bg: #0a0b0d;
  --bg-elev: #14161a;
  --bg-elev-2: #1c1f24;
  --border: #2a2e35;
  --border-strong: #3a3f47;
  --text: #e8e8ea;
  --text-muted: #8a8f96;
  --accent: #f59e0b;
  --accent-dim: #b8730a;
  --green: #22c55e;
  --red: #ef4444;
  --amber-soft: rgba(245, 158, 11, 0.12);
  --green-soft: rgba(34, 197, 94, 0.10);
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --max-width: 1200px;
}

/* ===== Reset / Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

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

/* ===== Background texture ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.03;
  background-image:
    radial-gradient(circle, var(--text-muted) 0.5px, transparent 0.5px);
  background-size: 24px 24px;
  pointer-events: none;
}

/* ===== Utility ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 6rem 0;
}

/* ===== Section index ===== */
.section-index {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.section-index-num {
  color: var(--accent);
}

.section-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
}

.brand-heart {
  color: var(--accent);
  /* Slight scaling so the heart visually balances the heading text without
     dominating it. vertical-align (rather than transform) avoids clashing
     with .reveal.visible rules if this heading ever gets the reveal class. */
  font-size: 0.88em;
  vertical-align: -0.04em;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.7;
}

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Top Nav ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0.75rem 0;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  background-color: transparent;
}

.nav.scrolled {
  background-color: rgba(10, 11, 13, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.nav-brand-mark {
  width: 32px;
  height: 32px;
  background-color: var(--bg-elev);
  border: 1.5px solid var(--border-strong);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
  position: relative;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
}

.nav-avail {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  white-space: nowrap;
}

.nav-avail-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  color: var(--text);
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}
.nav-hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile nav dropdown */
.nav-mobile-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  flex-direction: column;
  gap: 0.75rem;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.nav-mobile-dropdown.open {
  opacity: 1;
  transform: translateY(0);
}

.nav-mobile-dropdown a {
  font-size: 1rem;
  padding: 0.5rem 0;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  border: 1.5px solid transparent;
  line-height: 1;
}

.btn-primary {
  background-color: var(--accent);
  color: #0a0b0d;
  border-color: var(--accent);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  border-color: var(--text-muted);
  background: var(--bg-elev);
}

:where(.btn, .btn-primary, .btn-ghost, .nav-hamburger, a):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ===== Services ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.service-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-top-color: var(--border-strong);
  border-radius: 12px;
  padding: 1.75rem;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.service-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.service-card-num {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.service-card-logo {
  display: inline-block;
  vertical-align: -0.2em;
  width: 1.2em;
  height: 1.2em;
  margin-left: 0.5rem;
  object-fit: contain;
  filter: grayscale(1) brightness(0.95) opacity(0.7);
  transition: filter 200ms ease;
}

.service-card:hover .service-card-logo {
  filter: grayscale(0) brightness(1) opacity(1);
}

.service-card-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.service-card-desc {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.service-card-bullets {
  list-style: none;
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.service-card-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.service-card-bullets li::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 0.55rem;
  flex-shrink: 0;
}

/* ===== First section offset (sticky nav) ===== */
.section-first {
  padding-top: calc(80px + 4rem);
}

/* ===== Two-column section layout ===== */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 2.5rem;
  align-items: start;
}

.two-col-text .service-card-bullets {
  gap: 0.75rem;
}

.two-col-text .service-card-bullets li {
  font-size: 0.95rem;
}

/* ===== Terminal ===== */
.terminal-window {
  background: #08090a;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.825rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.terminal-titlebar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.9rem;
  background: var(--bg-elev-2);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-filename {
  flex: 1;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-right: 2.5rem;
}

.terminal-body {
  padding: 1rem 1.2rem;
  height: 360px;
  overflow-y: auto;
  color: var(--green);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal-line {
  margin-bottom: 0.15rem;
}

.terminal-line.prompt::before {
  content: 'sam@noc:~$ ';
  color: var(--accent);
}

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

.terminal-caret {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--green);
  vertical-align: text-bottom;
  animation: blink-caret 0.7s step-end infinite;
}

@keyframes blink-caret {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Dashboard */
.dashboard-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev-2);
}

.dashboard-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.dashboard-live-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green);
  background: var(--green-soft);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.dashboard-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.metric-tile {
  padding: 1rem 0.9rem;
  text-align: center;
  border-right: 1px solid var(--border);
}

.metric-tile:last-child {
  border-right: none;
}

.metric-label {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.metric-unit {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.metric-spark {
  margin-top: 0.45rem;
  display: flex;
  justify-content: center;
}

.dashboard-agents {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.dashboard-section-label {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.agent-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.agent-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.agent-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.agent-dot.working {
  background: var(--accent);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

.agent-dot.idle {
  background: var(--green);
}

.agent-name {
  font-family: var(--font-mono);
  font-weight: 500;
  min-width: 110px;
}

.agent-task {
  color: var(--text-muted);
  font-size: 0.74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-feed {
  padding: 0.75rem 1.25rem;
  max-height: 160px;
  overflow-y: auto;
}

.feed-line {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(42, 46, 53, 0.5);
  display: flex;
  gap: 0.4rem;
  animation: feed-slide-in 0.3s ease;
}

.feed-line:last-child {
  border-bottom: none;
}

@keyframes feed-slide-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feed-time {
  color: var(--accent-dim);
  flex-shrink: 0;
}

.feed-agent {
  color: var(--text);
  font-weight: 500;
  flex-shrink: 0;
}

/* ===== Sub-services pills ===== */
.subservices-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.subservice-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-elev);
  transition: border-color 0.2s ease, color 0.2s ease;
  cursor: default;
}

.subservice-pill:hover {
  border-color: var(--accent);
  color: var(--text);
}

.subservice-pill strong {
  font-weight: 600;
  color: var(--text);
}

/* ===== Logo marquee ===== */
.marquee {
  width: 100%;
  overflow: hidden;
  margin-top: 2.5rem;
  padding: 1.5rem 0;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  /* 6 identical sets; shifting by -100%/6 (= one set width) resets seamlessly.
     Per set: 8 * 80 + 7 * 80 gap + 80 right padding = 1280px.
     Track = 6 * 1280 = 7680px. Viewport coverage up to 5 * 1280 = 4480px.
     Mobile: 8 * 56 + 7 * 56 + 56 = 896px per set, coverage 5 * 896 = 4480px. */
  animation: marquee-scroll 10s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-set {
  display: flex;
  align-items: center;
  gap: 80px;
  flex-shrink: 0;
  padding-right: 80px;
}

.marquee-logo {
  /* SVGs ship with viewBox but no width/height attrs, so we must pin both.
     All 8 source SVGs are square (24x24), so equal values preserve aspect ratio. */
  height: 80px;
  width: 80px;
  object-fit: contain;
  filter: grayscale(1) brightness(0.85) opacity(0.55);
  transition: filter 200ms ease, opacity 200ms ease;
  flex-shrink: 0;
  user-select: none;
}

.marquee-logo:hover {
  filter: grayscale(0) brightness(1) opacity(1);
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-16.6667%); }
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 3rem;
  margin-top: 3rem;
  align-items: start;
}

.about-photo-wrap {
  width: 100%;
}

.about-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  border-radius: 12px;
}

.about-bio p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.about-bio p:last-child {
  margin-bottom: 0;
}

.about-details {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.about-detail {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.5rem;
}

.about-detail strong {
  color: var(--text);
  font-weight: 500;
  min-width: 90px;
}

/* ===== Contact ===== */
.contact-band {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3rem;
  text-align: center;
  margin-top: 2rem;
}

.contact-band-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.contact-band-text {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.contact-methods {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.contact-method {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.contact-method-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.contact-method-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

.contact-method-signal .signal-open-link {
  color: var(--text);
  border-bottom: 1px dotted var(--border-strong);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.signal-open-link:hover,
.signal-open-link:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.signal-qr-link {
  display: block;
  padding: 6px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  line-height: 0;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.signal-qr-link:hover,
.signal-qr-link:focus-visible {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.signal-qr {
  display: block;
  width: 116px;
  height: 116px;
  border-radius: 6px;
}

.email-noscript {
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-top: 1rem;
}

/* ===== Footer ===== */
.footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  margin-top: 6rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-muted);
}

.footer-brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
}

.footer-info {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-info a {
  transition: color 0.2s ease;
}

.footer-info a:hover {
  color: var(--text);
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

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

  .dashboard-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-tile:nth-child(2) {
    border-right: none;
  }
}

@media (max-width: 768px) {
  .section {
    padding: 4rem 0;
  }

  .section-first {
    padding-top: calc(80px + 3rem);
  }

  .two-col-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

  .nav-links {
    display: none;
  }

  .nav-hamburger {
    display: block;
  }

  .nav-mobile-dropdown {
    display: flex;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-photo-wrap {
    max-width: 240px;
    margin: 0 auto;
  }

  .contact-band {
    padding: 2rem 1.5rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-info {
    justify-content: center;
  }

}

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

  .metric-value {
    font-size: 1.6rem;
  }

  .contact-methods {
    gap: 1.25rem;
  }

  .signal-qr {
    width: 96px;
    height: 96px;
  }

  .marquee-logo {
    height: 56px;
    width: 56px;
  }

  .marquee-set {
    gap: 56px;
    padding-right: 56px;
  }

  .subservices-list {
    gap: 0.5rem;
  }

  .subservice-pill {
    font-size: 0.78rem;
    padding: 0.4rem 0.8rem;
  }

  .agent-name {
    min-width: 90px;
    font-size: 0.72rem;
  }

  .agent-task {
    font-size: 0.7rem;
  }
}
