/* Harbor Security Technologies - Main Styles */
:root {
  --navy: #0f172a;
  --navy-light: #1e293b;
  --slate: #334155;
  --accent: #0ea5e9;
  --accent-hover: #38bdf8;
  --page-bg: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --header-bg: rgba(255, 255, 255, 0.92);
  --surface: #f8fafc;
  --surface-strong: #ffffff;
  --footer-bg: #f8fafc;
  --border: #cbd5e1;
  --input-bg: #ffffff;
  --button-primary-text: #ffffff;
  --accent-subtle: rgba(14, 165, 233, 0.08);
  --accent-border-subtle: rgba(14, 165, 233, 0.18);
  --focus-ring: rgba(14, 165, 233, 0.14);
  --success-bg: rgba(34, 197, 94, 0.1);
  --success-text: #166534;
  --success-border: rgba(34, 197, 94, 0.2);
  --error-bg: rgba(239, 68, 68, 0.08);
  --error-text: #b91c1c;
  --error-border: rgba(239, 68, 68, 0.18);
  --overlay-bg: rgba(15, 23, 42, 0.18);
}

html {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #0f172a;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --header-bg: rgba(15, 23, 42, 0.95);
  --surface: #1e293b;
  --surface-strong: #0f172a;
  --footer-bg: #1e293b;
  --border: #334155;
  --input-bg: #1e293b;
  --button-primary-text: #0f172a;
  --accent-subtle: rgba(14, 165, 233, 0.1);
  --accent-border-subtle: rgba(14, 165, 233, 0.25);
  --focus-ring: rgba(14, 165, 233, 0.2);
  --success-bg: rgba(34, 197, 94, 0.15);
  --success-text: #86efac;
  --success-border: rgba(34, 197, 94, 0.3);
  --error-bg: rgba(239, 68, 68, 0.15);
  --error-text: #fca5a5;
  --error-border: rgba(239, 68, 68, 0.3);
  --overlay-bg: rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1060;
  backdrop-filter: blur(8px);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-toggle-item {
  list-style: none;
  display: flex;
  align-items: center;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.theme-toggle:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.theme-toggle-icon {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: currentColor;
  box-shadow: inset 0 0 0 3px var(--surface);
  flex-shrink: 0;
}

html[data-theme="dark"] .theme-toggle-icon {
  background: linear-gradient(90deg, transparent 50%, currentColor 50%);
  box-shadow: none;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--accent);
}

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

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
  overflow-x: hidden;
}

.hero {
  text-align: center;
  padding: 4rem 2rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero .tagline {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 2rem;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.section {
  padding: 3rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.section h2 {
  color: var(--accent);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  margin: 0 0 1rem;
}

.section p {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: var(--text);
}

.section a {
  color: var(--accent);
  text-decoration: none;
}

.section a:hover {
  text-decoration: underline;
}

.section .btn-primary {
  color: var(--navy);
}

.section .btn-primary:hover {
  color: var(--navy);
}

.section .btn-secondary {
  color: var(--accent);
}

.section-center {
  text-align: center;
}

/* ── Partners page ──────────────────────────────────── */
.partners-intro {
  max-width: 780px;
  margin-left: 0;
  padding-top: 0;
}

.partner-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  max-width: 900px;
}

.partner-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.partner-name-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.partner-name {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.partner-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border-subtle);
  border-radius: 4px;
  padding: 0.2rem 0.6rem;
  width: fit-content;
}

.partner-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-end;
}

.partner-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.partner-link:hover {
  text-decoration: underline;
}

.partner-body p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.75;
}

.partner-body p:last-child {
  margin-bottom: 0;
}

/* Metistry callout */
.metistry-callout {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--accent-subtle);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
}

.callout-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.callout-body {
  color: var(--text-muted);
  margin: 0;
  line-height: 1.65;
}

/* Capability cards */
.capability-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
}

.capability-card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
}

.capability-icon {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.capability-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.5rem;
}

.capability-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

/* Trust architecture strip */
.trust-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 10px;
  flex-wrap: wrap;
}

.trust-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 1.5rem;
  text-align: center;
}

.trust-node--highlight .trust-label {
  color: var(--accent);
}

.trust-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.trust-sublabel {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.trust-arrow {
  color: var(--accent);
  font-size: 1.25rem;
  padding: 0 0.25rem;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .capability-cards {
    grid-template-columns: 1fr;
  }

  .trust-strip {
    flex-direction: column;
    gap: 0.5rem;
  }

  .trust-arrow {
    transform: rotate(90deg);
  }

  .partner-header {
    flex-direction: column;
  }

  .partner-links {
    align-items: flex-start;
  }
}

.disclaimer {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2rem;
}

.disclaimer p {
  margin-bottom: 0.5rem;
}

.cta-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn-primary {
  background: var(--accent);
  color: var(--button-primary-text);
}

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

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-secondary:hover {
  background: var(--accent);
  color: var(--button-primary-text);
}

.page-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.page-subtitle {
  color: var(--text-muted);
  margin: 0 0 2rem;
}

.products-grid {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  display: grid;
  gap: 1rem;
}

.product-card-title {
  margin: 0 0 0.25rem;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.product-card-tagline {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: var(--text);
  font-weight: 500;
}

.product-card p {
  margin: 0;
  color: var(--text-muted);
}

.product-demo {
  margin-top: 3rem;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.demo-layout {
  display: flex;
  align-items: center;
  gap: 3rem;
  text-align: left;
}

.demo-text {
  flex: 1;
  min-width: 0;
}

.demo-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.7;
}

.demo-text p:last-child {
  margin-bottom: 0;
}

.demo-title {
  font-size: 1.5rem;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.demo-caption {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.video-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.product-video {
  width: 100%;
  max-height: 70vh;
  display: block;
  vertical-align: top;
}

/* Live interactive demo */
.demo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem 1rem;
}

.app-demo-frame {
  width: 380px;
  height: 800px;
  border: none;
  background: transparent;
  display: block;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  width: 100%;
  max-width: 100%;
}

@media (min-width: 1000px) {
  .team-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .team-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.08);
  transition: box-shadow 0.2s;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.team-card:hover {
  box-shadow: 0 0 24px rgba(14, 165, 233, 0.15);
}

.team-photo-wrap {
  width: 140px;
  height: 140px;
  min-width: 140px;
  min-height: 140px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.2);
  flex-shrink: 0;
}

.team-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.team-photo-fallback {
  position: absolute;
  inset: 0;
  background: var(--slate);
  color: var(--accent);
  font-size: 2rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 0;
}

.team-photo-fallback.show {
  display: flex;
}

.team-photo-wrap .team-photo {
  z-index: 1;
}

.team-card .avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--slate);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.team-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.team-card .role {
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.team-card > p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 100%;
}

.contact-wrap {
  max-width: 560px;
  margin-top: 2rem;
}

.form-feedback {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
}

.form-feedback.success {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.form-feedback.error {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid var(--error-border);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

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

.contact-info {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.contact-info p {
  margin: 0.5rem 0;
  color: var(--text-muted);
}

.contact-info a {
  color: var(--accent);
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

.site-footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--border);
  padding: 2rem;
  margin-top: auto;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.site-footer .logo {
  font-size: 1rem;
}

.site-footer .nav-links {
  gap: 1.5rem;
}

.site-footer small {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ── Hamburger nav toggle ───────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  position: relative;
  z-index: 1100;
  touch-action: manipulation;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Responsive breakpoints ─────────────────────────── */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .site-header nav {
    position: fixed;
    top: 0;
    right: 0;
    transform: translateX(100%);
    width: 75%;
    max-width: 300px;
    height: 100dvh;
    background: var(--footer-bg);
    border-left: 1px solid var(--border);
    padding: 5rem 2rem 2rem;
    transition: transform 0.3s ease;
    z-index: 1050;
    box-shadow: -4px 0 24px rgba(0,0,0,0.4);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .site-header nav.open {
    transform: translateX(0);
  }

  .nav-links {
    flex-direction: column;
    gap: 0;
  }

  .nav-links li {
    border-bottom: 1px solid var(--border);
  }

  .nav-links a {
    display: block;
    padding: 1rem 0;
    font-size: 1.1rem;
  }

  .theme-toggle-item {
    border-bottom: none !important;
    padding-top: 0.75rem;
  }

  /* Overlay behind open nav */
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    z-index: 1040;
  }
  .nav-overlay.open {
    display: block;
  }

  /* Lock body scroll when nav is open */
  body.nav-open {
    overflow: hidden;
    touch-action: none;
  }

  main {
    padding: 1rem;
  }

  .hero {
    padding: 2.5rem 1rem;
  }

  .section {
    padding: 2rem 1rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .site-footer .nav-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .site-footer .nav-links li {
    border-bottom: none;
  }

  .site-footer .nav-links a {
    padding: 0;
    font-size: 0.9rem;
  }

  .product-card {
    padding: 1.5rem;
  }

  .product-card-title {
    font-size: 1.75rem;
  }

  .contact-wrap {
    max-width: 100%;
  }

  .theme-toggle {
    padding: 0.45rem 0.75rem;
  }
}

@media (max-width: 640px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .cta-group {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }

  .section h2 {
    font-size: 1.4rem;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .video-wrap {
    border-radius: 8px;
  }

  .app-demo-frame {
    width: 320px;
    height: 760px;
  }

  .demo-layout {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .demo-text {
    text-align: center;
  }

  .theme-toggle-item {
    border-bottom: none !important;
    padding-top: 0.5rem;
  }

  .theme-toggle {
    padding: 0.55rem 0.85rem;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1rem;
  }

  .team-photo-wrap {
    width: 110px;
    height: 110px;
    min-width: 110px;
    min-height: 110px;
  }
}
