/* ==========================================================================
   Cortx — base styles: brand tokens, reset, typography, nav, footer, buttons
   Brand kit v1.0: Inter (headings/UI), Source Sans 3 (body), JetBrains Mono (code)
   ========================================================================== */

:root {
  /* Brand palette */
  --cortx-deep: #042C53;      /* Deep ink */
  --cortx-blue: #0C447C;      /* Cortx blue — dominant */
  --cortx-signal: #185FA5;
  --cortx-sky: #378ADD;
  --cortx-mist-light: #85B7EB;
  --cortx-mist: #E6F1FB;
  --cortx-graphite: #0F1419;
  --cortx-slate: #5F5E5A;
  --cortx-bone: #F5F4EF;
  --cortx-pulse: #1D9E75;     /* success / single highlight per surface */
  --white: #FFFFFF;

  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 24px;

  --font-ui: 'Inter', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Source Sans 3', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --nav-h: 80px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  font-family: var(--font-body);
  color: var(--cortx-graphite);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--cortx-signal); }

h1, h2, h3, h4, h5, .ui {
  font-family: var(--font-ui);
  letter-spacing: -0.02em;
  color: var(--cortx-graphite);
}
code, .mono { font-family: var(--font-mono); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
section { padding: 80px 0; }

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--cortx-blue); color: #fff; padding: 8px 14px; border-radius: var(--radius-md);
  font-family: var(--font-ui); font-size: 14px;
}
.skip-link:focus { left: 8px; }

:focus-visible { outline: 2px solid var(--cortx-sky); outline-offset: 3px; border-radius: 4px; }

/* ---------- Section headings ---------- */
.section-label {
  display: inline-block;
  font-family: var(--font-ui); font-size: 12px; font-weight: 500;
  color: var(--cortx-signal); letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 12px;
}
.section-title {
  font-size: clamp(30px, 3.5vw, 42px); font-weight: 600;
  color: var(--cortx-deep); margin-bottom: 16px; max-width: 720px; line-height: 1.15;
}
.section-sub {
  font-size: 18px; color: var(--cortx-slate); max-width: 640px;
  margin-bottom: 48px; line-height: 1.55;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-ui); font-size: 14px; font-weight: 500;
  padding: 10px 18px; border-radius: var(--radius-md);
  text-decoration: none; transition: background 0.15s, color 0.15s, transform 0.15s;
  border: 1px solid transparent; cursor: pointer;
}
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-primary { background: var(--cortx-blue); color: #fff; }
.btn-primary:hover { background: var(--cortx-deep); }
.btn-ghost { color: var(--cortx-blue); border-color: var(--cortx-mist); background: #fff; }
.btn-ghost:hover { background: var(--cortx-mist); }
.btn-light { background: #fff; color: var(--cortx-deep); }
.btn-light:hover { background: var(--cortx-mist); }

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .mark { width: 42px; height: 42px; transition: transform 0.7s cubic-bezier(.3,.7,.2,1); }
.brand:hover .mark, .brand:focus-visible .mark { transform: rotate(360deg); }
.brand .wordmark {
  font-family: var(--font-ui); font-size: 28px; font-weight: 500;
  color: var(--cortx-blue); letter-spacing: -0.03em; /* master logo: −1.5 at 54px */
}

.nav-links { display: flex; gap: 28px; align-items: center; list-style: none; }
.nav-links a:not(.btn), .nav-dropdown > button {
  font-family: var(--font-ui); font-size: 14px; font-weight: 500;
  color: var(--cortx-graphite); text-decoration: none; opacity: 0.75;
  transition: opacity 0.15s; background: none; border: 0; cursor: pointer; padding: 0;
}
.nav-links a:not(.btn):hover, .nav-dropdown > button:hover,
.nav-links a[aria-current="page"], .nav-dropdown.has-current > button { opacity: 1; }
.nav-links a[aria-current="page"]:not(.btn) { color: var(--cortx-blue); }

.nav-dropdown { position: relative; }
.nav-dropdown > button::after {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.dropdown-menu {
  position: absolute; top: calc(100% + 14px); left: -16px; min-width: 230px;
  background: #fff; border: 1px solid rgba(12,68,124,0.1); border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(4,44,83,0.12); padding: 8px; list-style: none;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu,
.nav-dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
/* hover bridge so the menu doesn't close while crossing the gap */
.nav-dropdown::before { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 16px; }
.nav-links .dropdown-menu a:not(.btn) {
  display: block; padding: 10px 14px; border-radius: var(--radius-md); opacity: 1 !important; font-size: 14px; line-height: 1.3;
}
.nav-links .dropdown-menu a[aria-current="page"]:not(.btn) { color: var(--cortx-blue); background: var(--cortx-mist); }
.nav-links .dropdown-menu a:not(.btn):hover { background: var(--cortx-mist); }

/* EN / FR toggle: a sliding switch, kept apart from the menu links */
.nav-links { margin-left: auto; }
.nav-tools { display: flex; align-items: center; gap: 10px; margin-left: 24px; }
.lang-toggle {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr;
  padding: 2px; border-radius: 999px; background: var(--cortx-mist); border: 1px solid rgba(12,68,124,0.12);
}
.lang-toggle::before {
  content: ""; position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc(50% - 2px);
  border-radius: 999px; background: var(--cortx-blue); box-shadow: 0 1px 4px rgba(4,44,83,0.25);
  transition: transform 0.25s cubic-bezier(.3,.7,.2,1);
}
.lang-toggle[data-active="fr"]::before { transform: translateX(100%); }
.lang-toggle a {
  position: relative; z-index: 1; min-width: 30px; text-align: center; padding: 3px 7px;
  font-family: var(--font-ui); font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--cortx-blue); text-decoration: none; transition: color 0.2s;
}
.lang-toggle a[aria-current] { color: #fff; }
.lang-toggle a:not([aria-current]):hover { color: var(--cortx-deep); }

.nav-toggle {
  display: none; width: 40px; height: 40px; border: 1px solid var(--cortx-mist);
  border-radius: var(--radius-md); background: #fff; cursor: pointer; position: relative;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  position: absolute; left: 50%; top: 50%; width: 18px; height: 2px; margin-left: -9px;
  background: var(--cortx-blue); content: ""; transition: transform 0.2s, background 0.2s;
}
.nav-toggle span::before { transform: translateY(-6px); }
.nav-toggle span::after { transform: translateY(6px); }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: rotate(-45deg); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--cortx-graphite); color: rgba(255,255,255,0.7);
  padding: 56px 0 32px; font-size: 14px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1.4fr 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.footer-brand { margin-bottom: 16px; }
.footer-brand .wordmark { color: #fff; font-size: 22px; }
.footer-brand .mark { width: 32px; height: 32px; }
.site-footer h5 {
  font-size: 13px; color: #fff; margin-bottom: 14px; text-transform: uppercase;
  letter-spacing: 0.08em; font-weight: 500;
}
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: rgba(255,255,255,0.7); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-family: var(--font-mono); font-size: 12px; color: rgba(255,255,255,0.5);
}

/* ---------- Shared CTA band ---------- */
.cta-section { text-align: center; padding: 96px 0; }
.cta-section h2 { font-size: clamp(32px, 4vw, 48px); margin-bottom: 20px; color: var(--cortx-deep); }
.cta-section p { font-size: 18px; color: var(--cortx-slate); margin: 0 auto 32px; max-width: 560px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-tools { margin-left: auto; }
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid rgba(0,0,0,0.08); padding: 8px 24px 20px;
    max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links > li { border-bottom: 1px solid rgba(0,0,0,0.05); }
  .nav-links > li:last-child { border: 0; }
  .brand .mark { width: 36px; height: 36px; }
  .brand .wordmark { font-size: 24px; }

  .nav-links a:not(.btn), .nav-dropdown > button { display: block; width: 100%; text-align: left; padding: 14px 0; font-size: 16px; }
  .nav-links .btn { text-align: center; display: block; }
  .nav-dropdown::before { display: none; }
  .dropdown-menu {
    position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none;
    border: 0; padding: 0 0 8px 12px; min-width: 0; display: none;
  }
  .nav-dropdown.open .dropdown-menu { display: block; }
  .nav-dropdown:hover .dropdown-menu { display: none; }
  .nav-dropdown.open:hover .dropdown-menu { display: block; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  section { padding: 56px 0; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}
