/* Otonoma — site styles */

:root {
  --navy: #142866;
  --navy-dark: #0e1c48;
  --ink: #1a1a1a;
  --muted: #555;
  --bg: #ffffff;
  --bg-soft: #f5f5f5;
  --bg-card: #ffffff;
  --border: #e3e3e8;
  --radius: 10px;
  --max-width: 1160px;
  --font: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
}

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

a { color: var(--navy); }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 500; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.15rem; }

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

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}

.site-logo img { height: 40px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 4px; }

.site-nav > ul {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 2px;
}

.site-nav a,
.site-nav button.nav-toggle-sub {
  display: block;
  padding: 10px 14px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.site-nav a:hover, .site-nav button.nav-toggle-sub:hover { color: var(--navy); }

.site-nav .active > a { text-decoration: underline; text-underline-offset: 6px; }

.nav-item { position: relative; }

.nav-item .caret { font-size: 0.65em; margin-left: 4px; }

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  list-style: none;
  padding: 8px 0;
}

.nav-item.open .dropdown { display: block; }

.dropdown a { padding: 8px 18px; font-size: 0.92rem; }

.dropdown .dropdown-heading {
  padding: 10px 18px 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

/* Mobile nav */
.nav-burger {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 10px;
}
.nav-burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: transform .2s ease, opacity .2s ease;
}

@media (max-width: 940px) {
  .nav-burger { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 0 20px;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
  }
  .site-nav.open { display: block; }
  .site-nav > ul { flex-direction: column; align-items: stretch; }
  .site-nav a, .site-nav button.nav-toggle-sub {
    padding: 12px 24px;
    width: 100%;
    text-align: left;
    font-size: 1.05rem;
  }
  .dropdown {
    position: static;
    border: 0;
    box-shadow: none;
    padding-left: 16px;
    min-width: 0;
  }
  body.nav-open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open .nav-burger span:nth-child(2) { opacity: 0; }
  body.nav-open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  padding: 14px 28px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s ease;
}
.btn:hover { background: var(--navy-dark); }

/* Busy state — the click has to register instantly even though the request
   takes a couple of seconds. */
.btn:disabled,
.btn.is-busy {
  opacity: .8;
  cursor: not-allowed;
}
.btn:disabled:hover,
.btn.is-busy:hover { background: var(--navy); }

.btn-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 9px;
  vertical-align: -2px;
  border: 2px solid currentColor;   /* inherits the button's text colour */
  border-right-color: transparent;
  border-radius: 50%;
  animation: btnSpin .6s linear infinite;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .btn-spinner { animation-duration: 1.8s; }
}

/* ---------- Sections ---------- */

section { padding: 72px 0; }
section.soft { background: var(--bg-soft); }
section.navy { background: var(--navy); color: #fff; }
section.navy a:not(.btn) { color: #cdd6f4; }

.section-heading { max-width: 800px; margin-bottom: 40px; }
.center { text-align: center; }
.center .section-heading { margin-left: auto; margin-right: auto; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  color: #fff;
  padding: 130px 0 140px;
  background-size: cover;
  background-position: center;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 46, .45);
}
.hero .container { position: relative; }
.hero h1 { max-width: 760px; margin-bottom: 24px; font-weight: 500; }
.hero .lede { max-width: 640px; font-size: 1.15rem; margin-bottom: 36px; }
.hero.short { padding: 90px 0; }

.page-hero {
  background: var(--navy);
  color: #fff;
  padding: 80px 0;
}
.page-hero h1 { max-width: 800px; }
.page-hero p { max-width: 700px; margin-top: 18px; font-size: 1.1rem; }

/* ---------- Cards & grids ---------- */

.grid { display: grid; gap: 28px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 940px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.card h4 { margin-bottom: 12px; }
.card p { font-size: 0.97rem; color: var(--muted); }

.card.media { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card.media img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.card.media .card-body { padding: 24px 28px 28px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card.media .card-body p { flex: 1; }
.card.media a.more { font-size: .95rem; text-decoration: none; font-weight: 500; }
.card.media a.more:hover { text-decoration: underline; }

/* Split (image + text) rows */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.split img { border-radius: var(--radius); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 28px; } }

/* Stat / quote */
blockquote.stat {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 500;
  color: var(--navy);
  margin: 24px 0 6px;
}
blockquote.stat + figcaption { color: var(--muted); }

/* ---------- Forms ---------- */

.form-wrap { max-width: 640px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 620px) { .form-row { grid-template-columns: 1fr; } }

.field { margin-bottom: 20px; }
.field label { display: block; font-size: 0.92rem; font-weight: 500; margin-bottom: 6px; }
.field .req { color: var(--muted); font-weight: 400; }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="url"],
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #c9c9d1;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--navy); outline-offset: 1px; border-color: var(--navy); }
.field.checkbox { display: flex; gap: 10px; align-items: flex-start; }
.field.checkbox input { margin-top: 5px; }
.field.checkbox label { font-weight: 400; margin: 0; }

.form-status { margin-top: 16px; font-weight: 500; display: none; }
.form-status.busy { display: block; color: var(--muted); }
.form-status.ok { display: block; color: #1a7a3c; }
.form-status.err { display: block; color: #b3261e; }

/* Honeypot */
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* ---------- Article / prose ---------- */

.prose { max-width: 760px; margin: 0 auto; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 1.8em; font-size: 1.7rem; }
.prose h3 { margin-top: 1.5em; }
.prose img { border-radius: var(--radius); margin: 2em auto; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose blockquote {
  border-left: 4px solid var(--navy);
  padding-left: 20px;
  color: var(--muted);
  font-style: italic;
}
.article-meta { color: var(--muted); font-size: 0.95rem; margin-top: 10px; }

.video-embed {
  position: relative;
  aspect-ratio: 16/9;
  margin: 2em 0;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius);
}

/* ---------- News listing ---------- */

.news-list { display: grid; gap: 40px; }
.news-item {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  align-items: center;
}
.news-item img { border-radius: var(--radius); aspect-ratio: 16/10; object-fit: cover; }
.news-item h2 { font-size: 1.5rem; margin-bottom: 10px; }
.news-item h2 a { text-decoration: none; color: var(--ink); }
.news-item h2 a:hover { color: var(--navy); }
.news-item p { color: var(--muted); }
@media (max-width: 720px) { .news-item { grid-template-columns: 1fr; gap: 16px; } }

/* ---------- FAQ ---------- */

details.faq {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}
details.faq summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 1.1rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
details.faq summary::after { content: '+'; font-size: 1.4rem; color: var(--navy); }
details.faq[open] summary::after { content: '\2212'; }
details.faq .faq-body { margin-top: 12px; color: var(--muted); }

/* ---------- Comparison table ---------- */

.table-scroll { overflow-x: auto; }
table.compare {
  border-collapse: collapse;
  width: 100%;
  min-width: 760px;
  font-size: 0.95rem;
}
table.compare th, table.compare td {
  border: 1px solid var(--border);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}
table.compare thead th { background: var(--navy); color: #fff; }
table.compare tbody tr:nth-child(even) { background: var(--bg-soft); }
table.compare td:first-child { font-weight: 500; }

/* ---------- Team ---------- */

.person { text-align: center; }
.person img {
  border-radius: 50%;
  width: 180px;
  height: 180px;
  object-fit: cover;
  margin: 0 auto 16px;
}
.person h4 { margin-bottom: 4px; }
.person p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--navy-dark);
  color: #cfd5e8;
  padding: 56px 0 32px;
  margin-top: 0;
}
.site-footer .footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}
.site-footer .footer-logo img { height: 36px; width: auto; }
.site-footer ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.site-footer a { color: #cfd5e8; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-social { display: flex; gap: 16px; }
.footer-social a { display: inline-flex; }
.footer-social svg { width: 22px; height: 22px; fill: #cfd5e8; }
.footer-social a:hover svg { fill: #fff; }
.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.15);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #9aa3c0;
}
.footer-bottom a { color: #9aa3c0; }

/* ---------- Utility ---------- */

.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 32px; }
.muted { color: var(--muted); }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 0.8rem;
  color: var(--navy);
  font-weight: 500;
  margin-bottom: 12px;
}

/* ---------- Regional hub cards ---------- */

/* Stand-in for a hub photo: branded, deliberate-looking, same aspect ratio as
   the real images so swapping in a photo needs no other change. */
.hub-placeholder {
  width: 100%;
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  background: linear-gradient(140deg, var(--navy) 0%, #1e3f8f 100%);
  color: #fff;
}
.hub-net {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  background:
    radial-gradient(120% 100% at 12% 18%, #1c3f8f 0%, transparent 60%),
    linear-gradient(140deg, var(--navy) 0%, #0d1c46 100%);
}
.hub-net svg { width: 100%; height: 100%; display: block; }

/* Links carry the same travelling-dash language as the Goal Trees. */
.hub-net-links path {
  fill: none;
  stroke: #4DA3FF;
  stroke-width: 1.6;
  stroke-dasharray: 7 6;
  opacity: .85;
  animation: hubFlow 1.5s linear infinite;
}
@keyframes hubFlow { to { stroke-dashoffset: -26; } }

.hub-net-halos circle {
  fill: #75C964;
  opacity: .16;
  animation: hubHalo 2.8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes hubHalo {
  0%, 100% { opacity: .16; transform: scale(.85); }
  50% { opacity: .05; transform: scale(1.2); }
}

.hub-net-nodes circle {
  fill: #7ECBFF;
  animation: hubPulse 2.8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
/* Established hubs read as "complete", the rest as active nodes. */
.hub-net-nodes circle.hub { fill: #75C964; }
@keyframes hubPulse {
  0%, 100% { opacity: .75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.25); }
}

@media (prefers-reduced-motion: reduce) {
  .hub-net-links path, .hub-net-nodes circle, .hub-net-halos circle { animation: none; }
}

.hub-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  padding: 0;
}
.hub-chips li {
  font-size: 0.85rem;
  color: var(--navy);
  background: #EAF1FB;
  border: 1px solid #D3E2F7;
  border-radius: 999px;
  padding: 4px 12px 4px 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s ease;
}
/* small live node echoing the graphic above */
.hub-chips li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0099FF;
  flex: 0 0 auto;
}
.hub-chips li:hover { background: #DDE9F9; }
