/* ===========================================================
   HORNBILL — Computational Intelligence design system
   =========================================================== */

:root {
  /* Core palette */
  --navy-900: #070f18;
  --navy-800: #0f1c29;
  --navy-700: #16293a;
  --navy-600: #1d3244;
  --graphite: #253340;
  --cyan: #18b7e9;
  --cyan-strong: #0e86b4;
  --turquoise: #6fe3d6;

  --off-white: #f4f7fa;
  --paper: #ffffff;
  --light-grey: #edf2f5;
  --border-light: #d8e2e8;

  --ink: #0b1a26;
  --ink-muted: #46596a;
  --ink-faint: #7a8c9b;

  --text-on-dark: #e8eff5;
  --text-muted-on-dark: #93a9ba;
  --text-faint-on-dark: #5e7284;
  --border-dark: #223447;

  --font-display: ui-sans-serif, "Segoe UI Semibold", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-body: ui-sans-serif, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Consolas", "SFMono-Regular", Menlo, monospace;

  --max: 1240px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(11, 26, 38, 0.06), 0 8px 24px rgba(11, 26, 38, 0.06);
}

* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--off-white);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
p { margin: 0 0 1em; max-width: 62ch; }
ul, ol { padding-left: 1.15em; }
li { margin: 0.35em 0; }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.section--tight { padding: 56px 0; }
.section--dark { background: var(--navy-900); color: var(--text-on-dark); }
.section--dark p, .dark-panel p { color: var(--text-muted-on-dark); }
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4,
.dark-panel h1, .dark-panel h2, .dark-panel h3, .dark-panel h4 { color: var(--text-on-dark); }

.dark-panel {
  background: var(--navy-800); border: 1px solid var(--border-dark); border-radius: var(--radius-md);
  padding: 44px 36px; color: var(--text-on-dark);
}
.section--panel { background: var(--paper); }
.section--grey { background: var(--light-grey); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan-strong);
  margin: 0 0 0.9em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section--dark .eyebrow { color: var(--cyan); }
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; opacity: 0.6; }

.lede { font-size: 19px; color: var(--ink-muted); max-width: 62ch; }
.section--dark .lede { color: var(--text-muted-on-dark); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--cyan); color: #06131c; }
.btn-primary:hover { background: var(--turquoise); }
.btn-outline { border-color: var(--border-light); color: var(--ink); background: transparent; }
.btn-outline:hover { border-color: var(--cyan-strong); color: var(--cyan-strong); }
.section--dark .btn-outline { border-color: var(--border-dark); color: var(--text-on-dark); }
.section--dark .btn-outline:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-text { padding: 0; color: var(--cyan-strong); font-weight: 600; }
.btn-text::after { content: "→"; margin-left: 6px; display: inline-block; transition: transform 0.15s ease; }
.btn-text:hover::after { transform: translateX(3px); }
.section--dark .btn-text { color: var(--cyan); }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(244, 247, 250, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--ink); }
.brand .mark { width: 28px; height: 28px; flex-shrink: 0; object-fit: contain; }
.brand .name { letter-spacing: -0.01em; }

.primary-nav { display: flex; align-items: center; gap: 4px; }
.primary-nav > ul { display: flex; list-style: none; margin: 0; padding: 0; gap: 2px; }
.nav-item { position: relative; }
.nav-item > a, .nav-item > button {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 14.5px; font-weight: 600; color: var(--ink-muted);
  padding: 10px 14px; border-radius: var(--radius-sm);
}
.nav-item > a:hover, .nav-item > button:hover, .nav-item.is-open > button { color: var(--ink); background: var(--light-grey); }
.nav-item .chev { font-size: 10px; opacity: 0.6; transition: transform 0.15s ease; }
.nav-item.is-open .chev { transform: rotate(180deg); }

.mega {
  position: absolute; top: calc(100% + 10px); left: 0;
  min-width: 340px; background: var(--paper); border: 1px solid var(--border-light);
  border-radius: var(--radius-md); box-shadow: var(--shadow-1);
  padding: 10px; display: none; z-index: 50;
}
.nav-item.is-open .mega { display: block; }
.mega a { display: block; padding: 12px 14px; border-radius: var(--radius-sm); }
.mega a:hover { background: var(--light-grey); }
.mega .m-title { font-size: 14.5px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.mega .m-desc { font-size: 12.5px; color: var(--ink-faint); margin-top: 2px; }
.mega .m-item.is-pending { padding: 12px 14px; cursor: default; }
.mega .m-item.is-pending:hover { background: none; }
.mega .m-item.is-pending .m-title { color: var(--ink-faint); }
.m-soon { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: #b5721a; background: rgba(232, 162, 58, 0.14); border: 1px solid rgba(232, 162, 58, 0.35); border-radius: var(--radius-pill); padding: 1px 7px; }

.header-cta { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border-light); border-radius: var(--radius-sm); width: 40px; height: 40px; cursor: pointer; }
.nav-toggle span, .nav-toggle::before, .nav-toggle::after { content: ""; display: block; width: 18px; height: 2px; background: var(--ink); margin: 0 auto; }
.nav-toggle::before { margin-bottom: 4px; }
.nav-toggle::after { margin-top: 4px; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-faint); padding: 18px 0 0; }
.breadcrumb a { color: var(--ink-faint); }
.breadcrumb a:hover { color: var(--cyan-strong); }
.section--dark .breadcrumb { color: var(--text-faint-on-dark); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 96px 0 80px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(34px, 4.6vw, 58px); }
.hero .visual { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border-dark); background: var(--navy-800); aspect-ratio: 4/3; }
.section--dark .hero .visual { border-color: var(--border-dark); }
.hero-field { padding-top: 8px; }
.hero-field .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint-on-dark); }
.hero-field .v { font-size: 14px; margin-top: 3px; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.card {
  background: var(--paper); border: 1px solid var(--border-light); border-radius: var(--radius-md);
  padding: 26px 26px; transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--cyan-strong); }
.card h3, .card h4 { font-size: 17px; margin-bottom: 8px; }
.card p { color: var(--ink-muted); font-size: 14.5px; margin-bottom: 0.6em; }
.section--dark .card { background: var(--navy-800); border-color: var(--border-dark); }
.section--dark .card:hover { border-color: var(--cyan); }
.section--dark .card p { color: var(--text-muted-on-dark); }

.card-link { display: block; }
.card-link .btn-text { margin-top: 10px; font-size: 13.5px; }

/* ---------- Capability module (alternating, not a card grid) ---------- */
.module { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; padding: 64px 0; border-top: 1px solid var(--border-dark); }
.module:first-of-type { border-top: none; }
.module.flip .m-copy { order: 2; }
.module.flip .m-visual { order: 1; }
.m-arc { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cyan); display: flex; gap: 10px; margin-bottom: 14px; }
.m-arc span:not(:last-child)::after { content: "→"; margin-left: 10px; color: var(--text-faint-on-dark); }
.module h3 { font-size: 26px; }
.m-visual { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border-dark); background: var(--navy-800); aspect-ratio: 5/4; }

/* Real simulation media (photos/GIFs/PNGs from Assets) sit letterboxed inside the
   dark instrument-panel visuals, alongside the hand-drawn SVG motifs used elsewhere. */
.visual img, .m-visual img {
  width: 100%; height: 100%; object-fit: contain; padding: 20px; box-sizing: border-box;
}
.visual .figcaption, .m-visual .figcaption {
  position: absolute; left: 14px; bottom: 12px; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--turquoise); opacity: 0.85;
  background: rgba(7, 15, 24, 0.55); padding: 3px 8px; border-radius: var(--radius-sm);
}
.visual, .m-visual { position: relative; }

/* ---------- Workflow diagram ---------- */
.workflow { display: flex; gap: 0; overflow-x: auto; padding: 8px 0 18px; margin-top: 32px; }
.wf-node { flex: 1 0 150px; text-align: center; position: relative; padding: 0 10px; }
.wf-node .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--navy-800); border: 2px solid var(--cyan); margin: 0 auto 14px; position: relative; z-index: 2; }
.wf-node .label { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-on-dark); line-height: 1.35; }
.wf-node::before { content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: var(--border-dark); z-index: 1; }
.wf-node:first-child::before { display: none; }
.wf-pulse { position: absolute; top: 5px; left: 0; width: 8px; height: 4px; border-radius: 2px; background: var(--cyan); animation: pulseMove 5s linear infinite; }
@keyframes pulseMove { 0% { left: 0%; opacity: 0; } 5% { opacity: 1; } 95% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wf-pulse { display: none; } }

/* ---------- Spec block ---------- */
.spec-block { font-family: var(--font-mono); font-size: 13.5px; background: var(--navy-800); border: 1px solid var(--border-dark); border-radius: var(--radius-md); padding: 20px 24px; }
.spec-row { display: flex; justify-content: space-between; gap: 20px; padding: 9px 0; border-bottom: 1px solid var(--border-dark); }
.spec-row:last-child { border-bottom: none; }
.spec-row .k { color: var(--text-faint-on-dark); }
.spec-row .v { color: var(--turquoise); text-align: right; }

.metric-placeholder {
  font-family: var(--font-mono); font-size: 12px; color: #e8a23a;
  border: 1px dashed rgba(232, 162, 58, 0.5); background: rgba(232, 162, 58, 0.08);
  border-radius: var(--radius-sm); padding: 6px 10px; display: inline-block;
}

/* ---------- Reveal on scroll ----------
   Visible by default (progressive enhancement): JS only opts an element
   into the pending/hidden state once it has confirmed it can also reveal
   it again, so content never gets stuck invisible if JS fails to run. */
.reveal { transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-pending { opacity: 0; transform: translateY(14px); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; transition: none; } }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; padding: 80px 0; }
.cta-band h2 { font-size: clamp(26px, 3.6vw, 40px); max-width: 20ch; margin: 0 auto 0.5em; }
.cta-band .btn-row { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: var(--text-muted-on-dark); padding: 64px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
.footer-grid h5 { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint-on-dark); margin: 0 0 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 8px 0; }
.footer-grid a { color: var(--text-muted-on-dark); font-size: 14px; }
.footer-grid a:hover { color: var(--cyan); }
.footer-brand p { color: var(--text-faint-on-dark); font-size: 13.5px; max-width: 32ch; }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border-dark); font-size: 12.5px; color: var(--text-faint-on-dark); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- Forms ---------- */
.form-field { margin-bottom: 20px; }
.form-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.section--dark .form-field label { color: var(--text-on-dark); }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; font-family: var(--font-body); font-size: 15px; padding: 12px 14px;
  border: 1px solid var(--border-light); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink);
}
.form-field textarea { min-height: 130px; resize: vertical; }
.form-field .hint { font-size: 12.5px; color: var(--ink-faint); margin-top: 5px; }
.section--dark .form-field .hint { color: var(--text-faint-on-dark); }

.form-status {
  background: var(--paper); border: 1px solid var(--border-light); border-left: 3px solid var(--cyan-strong);
  border-radius: var(--radius-md); padding: 22px 24px;
}
.form-status h3 { font-size: 17px; margin-bottom: 6px; }
.form-status p { color: var(--ink-muted); margin-bottom: 0; }

/* ---------- Two-col layout ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }

/* ---------- Utilities ---------- */
.tag { font-family: var(--font-mono); font-size: 11.5px; padding: 4px 10px; border-radius: var(--radius-pill); border: 1px solid var(--border-light); color: var(--ink-muted); }
.section--dark .tag { border-color: var(--border-dark); color: var(--text-muted-on-dark); }
.mt-0 { margin-top: 0 !important; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .module, .two-col { grid-template-columns: 1fr; }
  .module.flip .m-copy, .module.flip .m-visual { order: unset; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 780px) {
  .primary-nav { position: fixed; top: 72px; left: 0; width: 100%; height: calc(100vh - 72px); height: calc(100dvh - 72px);
    background: var(--paper); flex-direction: column;
    align-items: stretch; padding: 20px; overflow-y: auto; transform: translateX(100%); transition: transform 0.2s ease; }
  .primary-nav.is-open { transform: translateX(0); }
  .primary-nav > ul { flex-direction: column; width: 100%; }
  .nav-item { width: 100%; }
  .nav-item > a, .nav-item > button { width: 100%; justify-content: space-between; font-size: 16px; padding: 14px 10px; }
  .mega { position: static; box-shadow: none; margin-top: 4px; }
  .nav-toggle { display: block; }
  .header-cta .btn-outline { display: none; }
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
}
