/* ---------- Tokens ---------- */
:root {
  --color-primary: #0F4068;
  --color-primary-dark: #0A2D4A;
  --color-primary-light: #E6EDF2;
  --color-accent: #9B1364;
  --color-accent-dark: #7A0E4E;
  --color-accent-light: #E056A0;
  --color-accent-blue: #5AABED;
  --color-on-accent: #FFFFFF;
  --color-bg: #E4F2FE;
  --color-bg-alt: #EEF2F5;
  --color-surface: #FFFFFF;
  --color-text: #1A2833;
  --color-text-muted: #5B6A77;
  --color-border: #E1E7EC;
  --font-heading: "Source Serif 4", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 14px;
  --shadow-sm: 0 1px 3px rgba(15, 20, 30, 0.08);
  --shadow-md: 0 8px 24px rgba(15, 20, 30, 0.10);
  --max-width: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; line-height: 1.2; margin: 0 0 0.5em; color: var(--color-primary-dark); }
p { margin: 0 0 1em; }
img { max-width: 100%; display: block; }
a { color: var(--color-primary); }
ul { padding-left: 1.2em; }

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

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--color-primary); color: #fff; padding: 10px 16px; z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #023F70; /* matches the light logo's background exactly */
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-alt { height: 44px; width: auto; display: block; }
.logo-full { width: 160px; height: 160px; max-width: 100%; border-radius: 50%; background: #023F70; padding: 14px; box-sizing: border-box; object-fit: contain; }

.main-nav > ul { list-style: none; display: flex; align-items: center; gap: 32px; margin: 0; padding: 0; }
.main-nav a, .dropdown-toggle { text-decoration: none; color: rgba(255, 255, 255, 0.92); font-weight: 500; font-size: 0.96rem; }
.main-nav a:hover, .main-nav a[aria-current="page"], .dropdown-toggle:hover, .dropdown-toggle.is-current { color: var(--color-accent-light); }
.main-nav a[aria-current="page"], .dropdown-toggle.is-current { font-weight: 700; }

/* Devices dropdown */
.has-dropdown { position: relative; }
.dropdown-toggle { background: none; border: none; padding: 0; font-family: inherit; cursor: pointer; display: inline-flex; align-items: center; }
.caret { width: 7px; height: 7px; margin-left: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
.has-dropdown.open .caret { transform: rotate(45deg); }
.dropdown {
  list-style: none; margin: 0; padding: 8px; position: absolute; top: calc(100% + 14px); left: -16px; min-width: 165px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; box-shadow: var(--shadow-md); z-index: 110;
  /* grows out from the "Devices" word */
  transform-origin: 58px -14px;
  opacity: 0; visibility: hidden; transform: scale(0.55) translateY(-8px);
  transition: opacity 0.2s ease, transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1), visibility 0s linear 0.28s;
}
.dropdown::before { content: ""; position: absolute; top: -14px; left: 0; right: 0; height: 14px; }
.has-dropdown.open .dropdown { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.dropdown a { display: block; padding: 10px 14px; border-radius: 8px; white-space: nowrap; }
.dropdown a:hover { background: var(--color-primary-light); }
/* the panel is white, so its links keep dark text */
.main-nav .dropdown a { color: var(--color-text); }
.main-nav .dropdown a:hover, .main-nav .dropdown a[aria-current="page"] { color: var(--color-primary); }
@media (hover: hover) and (min-width: 641px) {
  .has-dropdown:hover .caret { transform: rotate(45deg); }
  .has-dropdown:hover .dropdown { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
}
@media (prefers-reduced-motion: reduce) {
  .caret, .dropdown { transition-duration: 0.01s; }
}

.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 40px; background: none; border: none; cursor: pointer; }
.nav-toggle span { width: 22px; height: 2px; background: #fff; display: block; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 88vh; display: flex; align-items: flex-end; color: #fff; overflow: hidden; }
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,20,38,0.55) 0%, rgba(8,20,38,0.55) 40%, rgba(6,14,28,0.92) 100%); }
.hero-content { position: relative; z-index: 1; padding-bottom: 72px; padding-top: 120px; max-width: 780px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.8rem; font-weight: 700; color: var(--color-accent-light); margin-bottom: 14px; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); color: #fff; margin-bottom: 24px; }
.hero h1 .hl { color: var(--color-accent-blue); }
.hero h1::after { content: ""; display: block; width: 56px; height: 3px; border-radius: 2px; background: var(--color-accent-light); margin-top: 24px; }
.hero-sub { font-size: 1.1rem; color: rgba(255,255,255,0.9); max-width: 620px; margin-bottom: 0; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--color-bg-alt); }
.kicker { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; font-weight: 700; color: var(--color-accent-dark); margin-bottom: 10px; }
.section h1, .section h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); max-width: 780px; }
.section-intro { max-width: 700px; color: var(--color-text-muted); font-size: 1.08rem; }

/* ---------- Mission ---------- */
.mission-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; }
.mission-text p:not(.kicker) { color: var(--color-text-muted); font-size: 1.05rem; }
.mission-figure { margin: 0; }
.mission-figure img { border-radius: var(--radius); box-shadow: var(--shadow-md); }
.mission-figure figcaption { font-size: 0.85rem; color: var(--color-text-muted); margin-top: 10px; }

/* ---------- Stats ---------- */
.problem-group {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 36px 40px 40px;
  margin-bottom: 32px;
}
.problem-group:last-child { margin-bottom: 0; }
.problem-group--gap { border-top-color: var(--color-accent); }
.problem-group-title { font-family: var(--font-heading); font-size: 1.3rem; color: var(--color-primary); margin: 0 0 4px; }

.stat-bubble {
  border-radius: 18px;
  display: flex; flex-direction: column; align-items: stretch; justify-content: center;
  text-align: center;
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
}
.stat-bubble .stat-number { font-family: var(--font-heading); font-weight: 700; font-size: 2.1rem; color: var(--color-primary); margin: 0; line-height: 1; }
.stat-bubble .stat-plus { font-size: 0.6em; }
.stat-bubble .stat-label { width: 100%; font-size: 0.88rem; color: var(--color-text); margin: 10px 0 8px; line-height: 1.3; }
.stat-bubble .stat-source { width: 100%; font-size: 0.74rem; color: var(--color-text-muted); margin: 0; font-style: italic; }
.stat-bubble--highlight { background: var(--color-primary); border-color: var(--color-primary); }
.stat-bubble--highlight .stat-number, .stat-bubble--highlight .stat-label, .stat-bubble--highlight .stat-source { color: #fff; }
.stat-bubble--gap { background: var(--color-accent); border-color: var(--color-accent); }
.stat-bubble--gap .stat-number, .stat-bubble--gap .stat-label, .stat-bubble--gap .stat-source { color: #fff; }

/* Scale: a clean, even, horizontal row */
.bubble-cluster { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 28px; }

/* Solution / Gap: one card paired with an organic blob of context */
.problem-pair { display: flex; align-items: center; gap: 36px; margin-top: 28px; }
.problem-pair .stat-bubble { flex: 0 0 220px; }
.problem-blob { flex: 1; }
.problem-blob p { color: var(--color-text-muted); font-size: 1.05rem; margin: 0; }

/* ---------- Devices ---------- */
.device-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 48px; align-items: start; }
.device-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.device-image { aspect-ratio: 4 / 3; background: #fff; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--color-border); }
.device-image img { width: 100%; height: 100%; object-fit: contain; padding: 20px; box-sizing: border-box; display: block; }
.device-image--fill img { object-fit: cover; padding: 0; }
.device-body { padding: 28px 28px 34px; }
.device-card h3 { font-size: 2rem; color: var(--color-accent); margin-bottom: 10px; }
.btn { display: inline-block; margin-top: 10px; padding: 12px 28px; border-radius: 999px; background: var(--color-accent); color: var(--color-on-accent); font-weight: 600; font-size: 0.95rem; text-decoration: none; transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease; }
.btn:hover { background: var(--color-accent-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.device-name-placeholder { color: var(--color-text-muted); }
.device-subtitle { color: var(--color-text-muted); font-weight: 500; margin-top: -6px; margin-bottom: 20px; }
.device-body h4 { font-family: var(--font-body); font-size: 0.95rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-primary); margin-top: 28px; margin-bottom: 10px; }
.feature-list { margin: 0 0 1em; padding-left: 1.2em; }
.feature-list li { margin-bottom: 6px; }
.placeholder-note { color: var(--color-text-muted); font-style: italic; }

/* Individual device pages */
.device-page { padding-top: 40px; }
.device-page h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); max-width: none; margin-bottom: 8px; }
.device-page .section-intro { margin-bottom: 0; }
.device-page-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: start; margin-top: 36px; }
.device-page .device-image { border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
.device-page .device-body { padding: 0; }
.device-page .device-body h4:first-child { margin-top: 0; }

.placeholder-image {
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(135deg, var(--color-bg-alt), var(--color-bg-alt) 10px, #E0E7EC 10px, #E0E7EC 20px);
  color: var(--color-text-muted); font-size: 0.9rem; font-weight: 600;
  border-bottom: 1px solid var(--color-border);
}

/* ---------- Team ---------- */
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; margin-top: 48px; }
.team-card { text-align: center; }
.team-photo { width: 100%; aspect-ratio: 1 / 1; border-radius: 50%; margin-bottom: 18px; font-size: 0.85rem; overflow: hidden; }
.team-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.team-card h3 { font-size: 1.15rem; margin-bottom: 2px; }
.team-role { color: var(--color-accent-dark); font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; }
.team-affiliation { color: var(--color-text-muted); font-size: 0.9rem; }

/* ---------- Footer ---------- */
.site-footer { background: #023F70; color: rgba(255,255,255,0.85); padding: 64px 0 24px; }
.footer-inner { display: grid; grid-template-columns: 0.8fr 2fr; gap: 48px; }
.footer-brand { display: flex; align-items: center; gap: 12px; height: fit-content; }
.footer-brand p { margin: 0; font-family: var(--font-heading); font-size: 1.2rem; color: #fff; }
.footer-credits h4 { color: #fff; font-family: var(--font-body); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 22px; margin-bottom: 10px; }
.footer-credits h4:first-child { margin-top: 0; }
.footer-credits ul { list-style: none; padding: 0; margin: 0; }
.footer-credits li { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-bottom: 8px; line-height: 1.5; }
.footer-credits a { color: rgba(255,255,255,0.9); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); margin-top: 40px; padding-top: 20px; }
.footer-bottom p { margin: 0; font-size: 0.82rem; color: rgba(255,255,255,0.55); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .mission-grid { grid-template-columns: 1fr; }
  .mission-figure { order: -1; }
  .problem-group { padding: 28px 28px 32px; }
  .bubble-cluster { grid-template-columns: repeat(2, 1fr); }
  .problem-pair { flex-direction: column; align-items: stretch; }
  .problem-pair .stat-bubble { flex: none; }
  .device-grid { grid-template-columns: 1fr; }
  .device-page-grid { grid-template-columns: 1fr; gap: 32px; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .header-inner { height: 64px; }
  .nav-toggle { display: flex; }
  .main-nav > ul {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; background: #023F70;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 12px 24px 24px; gap: 4px;
    display: none;
  }
  .main-nav > ul.open { display: flex; }
  .main-nav a { display: block; padding: 10px 0; }
  .dropdown-toggle { width: 100%; justify-content: space-between; padding: 10px 0; }
  .dropdown { position: static; min-width: 0; padding: 0 0 4px 16px; border: none; box-shadow: none; background: none; display: none; opacity: 1; visibility: visible; transform: none; transition: none; }
  .has-dropdown.open .dropdown { display: block; }
  .dropdown::before { display: none; }
  .dropdown a { padding: 10px 0; white-space: normal; }
  .dropdown a:hover { background: none; }
  .main-nav .dropdown a { color: rgba(255, 255, 255, 0.85); }
  .main-nav .dropdown a:hover, .main-nav .dropdown a[aria-current="page"] { color: var(--color-accent-light); }
  .hero { min-height: 82vh; }
  .hero-content { padding-top: 100px; padding-bottom: 48px; }
  .section { padding: 64px 0; }
  .bubble-cluster { grid-template-columns: 1fr; gap: 14px; }
  .team-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}
