/* =====================================================================
   Keel — shared site stylesheet
   ---------------------------------------------------------------------
   CANONICAL HEADER / FOOTER / MARKUP CONVENTIONS (reuse on every page)
   ---------------------------------------------------------------------
   Every page lives at the site root and links assets relatively
   (assets/css/site.css, assets/brand/*). Page skeleton:

     <!doctype html>
     <html lang="en">
     <head>
       ... SEO head ...
       <link rel="stylesheet" href="assets/css/site.css">
     </head>
     <body>
       <a class="skip-link" href="#main">Skip to content</a>
       <header class="site-header"> ...see HEADER below... </header>
       <main id="main"> ...page sections... </main>
       <footer class="site-footer"> ...see FOOTER below... </footer>
       <script> ...nav toggle JS... </script>
     </body>
     </html>

   HEADER (copy verbatim across pages; mark the current page with
   aria-current="page" on its nav link):
     <header class="site-header">
       <div class="container header-inner">
         <a class="brand" href="index.html" aria-label="Keel home">
           <img class="brand-logo" src="assets/brand/keel-logo-navy-light.svg"
                alt="Keel" height="40">
         </a>
         <button class="nav-toggle" type="button" aria-expanded="false"
                 aria-controls="site-nav" aria-label="Toggle navigation">
           <span></span><span></span><span></span>
         </button>
         <nav class="site-nav" id="site-nav" aria-label="Primary">
           <a href="index.html">Home</a>
           <a href="features.html">Features</a>
           <a href="architecture.html">Architecture</a>
           <a href="security.html">Security</a>
           <div class="lang-toggle" role="group" aria-label="Language">
             <a href="index.html" lang="en" hreflang="en" aria-current="true">EN</a>
             <a href="es/index.html" lang="es" hreflang="es">ES</a>
           </div>
           <a class="btn btn-primary" href="get-started.html">Get started</a>
         </nav>
       </div>
     </header>

   LANGUAGES: EN pages live at the repo root; ES pages live in es/ and
   mirror the same file names. Equivalent EN/ES page pairs link each other
   via <link rel="alternate" hreflang="en|es|x-default"> in <head>. The
   language toggle inside .site-nav marks the ACTIVE language with
   aria-current="true" (the ES copy uses ../assets/... paths).

   FOOTER (copy verbatim; dark ground, use the ink-dark logo variant):
     <footer class="site-footer">
       <div class="container footer-inner">
         <div class="footer-brand">
           <a class="brand" href="index.html" aria-label="Keel home">
             <img class="brand-logo" src="assets/brand/keel-logo-ink-dark.svg"
                  alt="Keel" height="40">
           </a>
           <p class="footer-tagline">A governed AI workspace for teams.</p>
         </div>
         <nav class="footer-nav" aria-label="Footer">
           <ul class="footer-links">
             <li><a href="index.html">Home</a></li>
             <li><a href="features.html">Features</a></li>
             <li><a href="architecture.html">Architecture</a></li>
             <li><a href="security.html">Security</a></li>
             <li><a href="get-started.html">Get started</a></li>
             <li><a href="mailto:hello@nesec.ai">hello@nesec.ai</a></li>
           </ul>
         </nav>
       </div>
       <div class="container footer-meta">
         <p>Keel is built by <a href="https://nesec.ai">nesec</a>.</p>
         <p>&copy; 2026 Keel</p>
       </div>
     </footer>

   NAV TOGGLE JS (copy inline before </body> on every page):
     <script>
       (function () {
         var btn = document.querySelector('.nav-toggle');
         var nav = document.getElementById('site-nav');
         if (!btn || !nav) return;
         btn.addEventListener('click', function () {
           var open = btn.getAttribute('aria-expanded') === 'true';
           btn.setAttribute('aria-expanded', String(!open));
           nav.classList.toggle('open', !open);
         });
       })();
     </script>

   KEY CLASS NAMES (use these, do not invent variants):
     Layout:   .container, .section, .section-dark, .section-head, .eyebrow
     Hero:     .hero, .actions (button row), .lead, .hero-chips
     Cards:    .card-grid, .card
     Buttons:  .btn + .btn-primary | .btn-secondary  (light grounds)
               .btn + .btn-inverse | .btn-outline-light  (dark grounds)
     CTA band: .cta-band  (navy, centred)
     Header:   .site-header, .header-inner, .brand, .brand-logo,
               .nav-toggle, .site-nav
     Footer:   .site-footer, .footer-inner, .footer-brand, .footer-tagline,
               .footer-nav, .footer-links, .footer-meta
   ---------------------------------------------------------------------
   Brand rules: navy tile stays navy (never recolour the tile with the
   accent), logo is always the SVG asset (never typed text), min lockup
   width 96px, accent is UI-only (links / highlights / focus rings).
   ===================================================================== */

:root {
  --navy: #1C4F9E;
  --ink: #1a1a1a;
  --ivory: #faf8f5;
  --dark: #14171c;
  --accent: #6AA2E8;

  --line: #e3ded6;
  --muted: #55524d;      /* body copy on light grounds */
  --muted-dark: #c7c4be; /* body copy on dark grounds */

  --font-sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;

  --radius: 14px;
  --radius-btn: 10px;
  --container: 1080px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 16px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink);
}

p { margin: 0 0 1em; }

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

::selection { background: rgba(106, 162, 232, 0.3); }

/* ---------------------------------------------------------------- layout */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 32px);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--navy);
  color: var(--ivory);
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 245, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  display: block;
  height: 40px; /* ~97px wide lockup — keeps the 96px minimum */
  width: auto;
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin-inline: auto;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.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); }

.site-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 12px clamp(20px, 4vw, 32px) 22px;
  background: var(--ivory);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 24px rgba(20, 23, 28, 0.06);
}
.site-nav.open { display: flex; }

.site-nav > a:not(.btn) {
  display: block;
  padding: 12px 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
}
.site-nav > a:not(.btn):hover { color: var(--navy); }
.site-nav > a[aria-current="page"] { color: var(--navy); }
.site-nav .btn { margin-top: 10px; width: 100%; }

@media (min-width: 840px) {
  .nav-toggle { display: none; }
  .site-nav {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 28px;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  .site-nav > a:not(.btn) { padding: 0; font-size: 15px; }
  .site-nav .btn { width: auto; margin-top: 0; }
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary { background: var(--navy); color: var(--ivory); border-color: var(--navy); }
.btn-primary:hover { background: #173f80; border-color: #173f80; }

.btn-secondary { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover { background: rgba(28, 79, 158, 0.07); }

.btn-inverse { background: var(--ivory); color: var(--ink); border-color: var(--ivory); }
.btn-inverse:hover { background: #fff; border-color: #fff; }

.btn-outline-light { background: transparent; color: var(--ivory); border-color: rgba(250, 248, 245, 0.55); }
.btn-outline-light:hover { background: rgba(250, 248, 245, 0.1); border-color: var(--ivory); }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

/* ---------------------------------------------------------------- hero */

.hero {
  padding: clamp(64px, 10vw, 104px) 0 clamp(56px, 8vw, 88px);
  text-align: center;
}
.hero h1 {
  font-size: clamp(2.15rem, 5.4vw, 3.5rem);
  max-width: 20ch;
  margin: 0 auto 22px;
}
.hero .lead {
  max-width: 60ch;
  margin: 0 auto 34px;
  color: var(--muted);
  font-size: clamp(1.06rem, 1.6vw, 1.22rem);
}
.hero .actions { justify-content: center; }

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
}
.hero-chips li {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 15px;
}
.hero-chips li::before {
  content: "\2713"; /* check */
  color: var(--navy);
  font-weight: 700;
  margin-right: 7px;
}

/* ---------------------------------------------------------------- sections */

.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  margin: 0 0 16px;
}

.section { padding: clamp(56px, 9vw, 88px) 0; }

.section-head {
  max-width: 700px;
  margin: 0 auto clamp(34px, 5vw, 48px);
  text-align: center;
}
.section-head h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.35rem);
  margin: 0 0 16px;
}
.section-head > p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.1rem);
}

/* ---------------------------------------------------------------- cards */

.card-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 3vw, 30px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card h3 { font-size: 1.18rem; margin: 0; }
.card p { margin: 0; color: var(--muted); font-size: 0.98rem; line-height: 1.55; }

/* ---------------------------------------------------------------- dark section */

.section-dark {
  background: var(--dark);
  color: var(--ivory);
}
.section-dark h2 { color: var(--ivory); }
.section-dark .eyebrow { color: var(--accent); }
.section-dark .section-head > p:not(.eyebrow) { color: var(--muted-dark); }
.section-dark .card { background: #1b1f26; border-color: #2b3038; }
.section-dark .card h3 { color: var(--ivory); }
.section-dark .card p { color: var(--muted-dark); }

/* ---------------------------------------------------------------- CTA band */

.cta-band {
  background: var(--navy);
  color: var(--ivory);
  text-align: center;
  padding: clamp(64px, 10vw, 96px) 0;
}
.cta-band h2 {
  color: var(--ivory);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  max-width: 18ch;
  margin: 0 auto 16px;
}
.cta-band p {
  color: rgba(250, 248, 245, 0.82);
  font-size: clamp(1.02rem, 1.6vw, 1.15rem);
  max-width: 56ch;
  margin: 0 auto 32px;
}
.cta-band .actions { justify-content: center; }

/* ---------------------------------------------------------------- footer */

.site-footer {
  background: var(--dark);
  color: var(--ivory);
  padding: clamp(48px, 7vw, 64px) 0 clamp(32px, 5vw, 40px);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}

.footer-brand { max-width: 320px; }
.footer-brand .brand-logo { height: 40px; }
.footer-tagline { margin: 16px 0 0; color: var(--muted-dark); font-size: 15px; }

.footer-nav { flex: 1 1 auto; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-links a { color: var(--muted-dark); text-decoration: none; font-size: 15px; }
.footer-links a:hover { color: var(--ivory); }

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: clamp(32px, 5vw, 44px);
  padding-top: 24px;
  border-top: 1px solid rgba(250, 248, 245, 0.14);
  color: #9a968f;
  font-size: 14px;
}
.footer-meta p { margin: 0; }
.footer-meta a {
  color: var(--ivory);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------------------------------------------------------------- focus */

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* -- Language toggle -------------------------------------------------- */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.lang-toggle a {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.lang-toggle a + a { border-left: 1px solid var(--line); }
.lang-toggle a[aria-current="true"] { background: var(--navy); color: var(--ivory); }
.lang-toggle a:hover:not([aria-current="true"]) { color: var(--navy); }
@media (prefers-reduced-motion: reduce) { /* nothing animated, but keep rule style consistent */ }
