/*
  SAI.NZ v2 — shared design system
  Personal, calm, minimal, deliberate, premium
*/

:root {
  --bg: #FAFBFC;
  --bg-alt: #F4F6F8;
  --card: #FFFFFF;
  --card-border: #E8ECF0;
  --surface: #FFFFFF;
  --surface-elevated: #FFFFFF;
  --text: #0D1320;
  --text-secondary: #3D4A5C;
  --muted: #5C6B7E;
  --accent: #1D4ED8;
  --accent-hover: #1639A8;
  --accent-muted: rgba(29, 78, 216, 0.08);
  --accent-focus: rgba(29, 78, 216, 0.15);
  --success: #0F766E;
  --border: #DDE3E9;
  --shadow-sm: 0 1px 3px rgba(13, 19, 32, 0.04);
  --shadow-md: 0 4px 12px rgba(13, 19, 32, 0.06);
  --shadow-card: 0 2px 8px rgba(13, 19, 32, 0.04);
  --input-bg: #FFFFFF;
  --input-border: #CBD5E1;
  --btn-text: #FFFFFF;
  --link: #1D4ED8;
  --link-underline: rgba(29, 78, 216, 0.3);
  --base-font: 17px;
  --line: 1.65;
  --radius: 8px;
  --radius-lg: 14px;
  --radius-sm: 6px;
  --nav-height: 76px;
  --section-padding: 42px;
  --content-max: 800px;
  --content-wide: 960px;
  --content-home: 920px;
  --grid-max: 1320px;
  --banner-bg: #E8ECF0;
  --banner-text: #475569;
}

html[data-theme="dark"] {
  --bg: #0A0E16;
  --bg-alt: #0F141C;
  --card: #121922;
  --card-border: #1E2836;
  --surface: #151D28;
  --surface-elevated: #1A232F;
  --text: #F4F6F9;
  --text-secondary: #B8C4D0;
  --muted: #8896A8;
  --accent: #1D4ED8;
  --accent-hover: #3B82F6;
  --accent-muted: rgba(29, 78, 216, 0.12);
  --accent-focus: rgba(29, 78, 216, 0.2);
  --success: #16A34A;
  --border: #243045;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.2);
  --input-bg: #0E1520;
  --input-border: #2A3548;
  --link: #93C5FD;
  --link-underline: rgba(147, 197, 253, 0.35);
  --banner-bg: #1A2332;
  --banner-text: #94A3B8;
}

html { scroll-behavior: smooth; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: var(--base-font);
  line-height: var(--line);
  transition: background 0.2s ease, color 0.2s ease;
}

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid var(--link-underline);
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
a:hover { opacity: 0.88; }
.inline-link { color: inherit; border-bottom: 1px solid var(--link-underline); }

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

.nav-inner {
  max-width: var(--grid-max);
  margin: 0 auto;
  padding: 0 32px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-logo-link {
  text-decoration: none;
  border: none;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.nav-logo-link:hover { opacity: 0.9; }
.nav-logo-link { order: 1; }
.nav-logo { height: 82px; width: auto; display: block; }

/* Priority links: visible on mobile only (Philosophy, Approach); desktop hidden */
.nav-priority {
  display: none;
  align-items: center;
  gap: 2px;
}
.nav-priority a {
  padding: 6px 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  border: none;
}
.nav-priority a:hover { color: var(--text); }

/* Main nav: desktop = links together; theme on far right via order; mobile = drawer */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  order: 2;
}
.nav-links a {
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  border: none;
}
.nav-links a:hover { color: var(--text); }

/* Partnerships dropdown (desktop) */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.nav-dropdown-trigger:hover { color: var(--text); }
.nav-dropdown-trigger::after {
  content: '';
  display: inline-block;
  margin-left: 4px;
  border: 4px solid transparent;
  border-top-color: currentColor;
  vertical-align: middle;
}
.nav-dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  margin-top: 4px;
  padding: 8px 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 50;
}
.nav-dropdown:hover .nav-dropdown-content,
.nav-dropdown:focus-within .nav-dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown-content a {
  display: block;
  padding: 10px 16px;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
}
.nav-dropdown-content a:hover { background: var(--bg-alt); }

.nav-theme-wrap { flex-shrink: 0; order: 3; }
.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 90px;
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.theme-toggle-btn:hover { border-color: var(--card-border); }
.theme-toggle-btn .theme-sep { color: var(--muted); opacity: 0.6; pointer-events: none; }
.theme-toggle-btn .theme-option { pointer-events: none; }
.theme-toggle-btn .theme-option.active { color: var(--text); font-weight: 600; }

.nav-menu-btn {
  display: none;
  order: 4;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-menu-btn:hover { background: var(--bg-alt); }
.nav-menu-icon { position: relative; width: 20px; height: 14px; }
.nav-menu-icon::before,
.nav-menu-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.25s ease;
}
.nav-menu-icon::before { top: 0; }
.nav-menu-icon::after { bottom: 0; }
.nav-menu-btn[aria-expanded="true"] .nav-menu-icon::before { transform: translateY(6px) rotate(45deg); }
.nav-menu-btn[aria-expanded="true"] .nav-menu-icon::after { transform: translateY(-6px) rotate(-45deg); }

/* Section layout */
.page-section {
  padding: var(--section-padding) 32px;
  max-width: var(--grid-max);
  margin: 0 auto;
}

/* Typography: section-title (largest) → eyebrow (readable, subordinate) → body (smallest). Do not shrink everything. */
.page-title {
  font-size: 3rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.section-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 5px 0;
}
.section-title {
  font-size: 2.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px 0;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.section-lead {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0 0 8px 0;
  max-width: var(--content-max);
  line-height: var(--line);
}
.body-text {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: var(--line);
  margin: 0 0 8px 0;
  max-width: var(--content-max);
}
.body-text.muted { color: var(--muted); font-size: 0.875rem; }

/* Homepage: wider content for balance, less dead space on right */
.home-page .page-section .section-lead,
.home-page .page-section .body-text,
.home-page .page-section .recognition-block,
.home-page .page-section .recognition-block p { max-width: var(--content-home); }
.home-page .page-section .invitation-form { max-width: 520px; }

/* Wide content for satellite pages */
.content-wide { max-width: var(--content-wide); }
.content-wide .section-lead,
.content-wide .body-text { max-width: none; }
/* Tighter spacing between philosophy/approach blocks */
.phil-block + .phil-block,
.how-block + .how-block { margin-top: 20px; }
.phil-two-col { gap: 24px; margin-top: 20px; }
.phil-block h2,
.how-block .section-title { margin-top: 0; }

/* Satellite page hero (small, with image placeholder) */
.satellite-hero {
  position: relative;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 32px;
  text-align: center;
  background-color: var(--bg-alt);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border);
}
.satellite-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10,14,22,0.4) 0%, rgba(10,14,22,0.2) 100%);
  pointer-events: none;
}
html[data-theme="light"] .satellite-hero::before {
  background: linear-gradient(
    to bottom,
    rgba(10, 14, 22, 0.18) 0%,
    rgba(10, 14, 22, 0.10) 100%
  );
}
.satellite-hero-inner { position: relative; z-index: 1; }
.satellite-hero .section-eyebrow { margin-bottom: 5px; }
.satellite-hero .page-title { margin-bottom: 0; font-size: 2.25rem; }
.proof-block .proof-card h3 { font-size: 0.75rem; }

/* Unified satellite hero typography (Approach as source of truth) */
body .satellite-hero.hero-unified .page-title,
body .satellite-hero.hero-unified .section-eyebrow,
body .satellite-hero.hero-unified .hero-intro {
  color: #ffffff;
}
body .satellite-hero.hero-unified .page-title { margin-bottom: 24px; }
body .satellite-hero.hero-unified .section-eyebrow {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-top: 18px;
  margin-bottom: 26px;
}
body .satellite-hero.hero-unified .hero-intro {
  max-width: 860px;
  margin: 18px auto 0;
  line-height: 1.75;
}
/* Light theme readability: subtle premium shadow behind white hero text */
html[data-theme="light"] body .satellite-hero.hero-unified .page-title {
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.75),
    0 2px 8px rgba(0, 0, 0, 0.28);
}

html[data-theme="light"] body .satellite-hero.hero-unified .section-eyebrow,
html[data-theme="light"] body .satellite-hero.hero-unified .hero-intro {
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.7),
    0 2px 6px rgba(0, 0, 0, 0.22);
}

/* Dark theme readability: stronger black outline behind white hero text */
html[data-theme="dark"] body .satellite-hero.hero-unified .page-title {
  text-shadow:
    1px 1px 0 rgba(0, 0, 0, 0.9),
    -1px 1px 0 rgba(0, 0, 0, 0.9),
    1px -1px 0 rgba(0, 0, 0, 0.9),
    -1px -1px 0 rgba(0, 0, 0, 0.9),
    0 3px 10px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] body .satellite-hero.hero-unified .section-eyebrow,
html[data-theme="dark"] body .satellite-hero.hero-unified .hero-intro {
  text-shadow:
    1px 1px 0 rgba(0, 0, 0, 0.8),
    -1px 1px 0 rgba(0, 0, 0, 0.8),
    1px -1px 0 rgba(0, 0, 0, 0.8),
    -1px -1px 0 rgba(0, 0, 0, 0.8),
    0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--btn-text);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  border-bottom: none;
  transition: background 0.15s ease;
}
.btn-primary:hover { background: var(--accent-hover); opacity: 1; }

/* Forms */
.sainz-form label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 14px 0 5px 0;
}
.sainz-form label:first-of-type { margin-top: 0; }
.sainz-form input,
.sainz-form textarea,
.sainz-form select {
  display: block;
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.sainz-form input:focus,
.sainz-form textarea:focus,
.sainz-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-focus);
}
.sainz-form input::placeholder,
.sainz-form textarea::placeholder { color: var(--muted); opacity: 0.8; }
.sainz-form button[type="submit"] {
  margin-top: 20px;
  padding: 14px 28px;
  background: var(--accent);
  color: var(--btn-text);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.sainz-form button[type="submit"]:hover { background: var(--accent-hover); }

/* Footer */
.site-footer {
  padding: 24px 32px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}

.seo-hidden { display: none; }

/* Pricing table / list (lighter treatment) */
.pricing-list { list-style: none; padding: 0; margin: 12px 0 0 0; }
.pricing-list li {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 4px;
  background: var(--card);
  border: 1px solid var(--card-border);
}
.pricing-list li:last-child { margin-bottom: 0; }
.pricing-list .pricing-name { font-weight: 600; font-size: 0.9375rem; margin-bottom: 4px; }
.pricing-list .pricing-desc { font-size: 0.875rem; color: var(--text-secondary); margin: 0 0 6px 0; }
.pricing-list .pricing-amount { font-size: 0.8125rem; color: var(--muted); font-style: italic; }

/* ========== MOBILE ========== */
@media (max-width: 768px) {
  .nav-inner { padding: 0 12px; height: 60px; gap: 4px; min-width: 0; }
  .nav-logo { height: 64px; }

  /* Mobile bar: logo | Philosophy | Approach | (push) | theme | menu */
  .nav-priority { display: flex !important; order: 2; flex-shrink: 0; }
  .nav-theme-wrap { margin-left: auto; flex-shrink: 0; }
  .theme-toggle-btn { min-width: 78px; padding: 0 8px; font-size: 0.75rem; }
  .nav-menu-btn { width: 44px; height: 44px; flex-shrink: 0; }
  .nav-links {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--card);
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 0;
    padding: 80px 24px 40px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 99;
    overflow-y: auto;
  }
  .nav-links.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  /* Keep header bar (logo, priority links, theme, menu button) above overlay so menu button stays visible */
  .nav-logo-link,
  .nav-priority,
  .nav-theme-wrap,
  .nav-menu-btn { position: relative; z-index: 101; }
  /* Partnerships as grouped item: label + sub-links */
  .nav-links .nav-dropdown { display: block; width: 100%; }
  .nav-links .nav-dropdown-trigger {
    display: flex;
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    cursor: default;
    pointer-events: none;
    font-family: inherit;
  }
  .nav-links .nav-dropdown-trigger::after { display: none; }
  .nav-links .nav-dropdown-content {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: var(--bg-alt);
    padding: 8px 0 12px 16px;
    margin: 0 0 8px 0;
    border-radius: var(--radius-sm);
  }
  .nav-links .nav-dropdown-content a {
    display: flex;
    padding: 12px 16px;
    font-size: 0.95rem;
    min-height: 48px;
    align-items: center;
  }
  .nav-links > a {
    padding: 14px 20px;
    font-size: 1rem;
    min-height: 48px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
  }
  .nav-menu-btn { display: flex; }
  .page-section { padding: 34px 20px; }
  .page-title { font-size: 1.9rem; }
  .section-title { font-size: 1.75rem; }
  .section-eyebrow { font-size: 0.75rem; }
  .section-lead { font-size: 0.9375rem; }
  .body-text { font-size: 0.9rem; }
  .sainz-form input,
  .sainz-form textarea { min-height: 48px; }
  .satellite-hero { min-height: 128px; padding: 26px 20px; }
  .satellite-hero .page-title { font-size: 1.6rem; }
  .phil-block + .phil-block,
  .how-block + .how-block { margin-top: 16px; }
  .phil-two-col { gap: 20px; margin-top: 16px; }
}

@media (max-width: 480px) {
  .nav-inner { padding: 0 16px; height: 60px; }
  .nav-logo { height: 60px; }
  .nav-links a,
  .nav-links .nav-dropdown-content a { font-size: 0.95rem; padding: 12px 16px; min-width: 160px; }
  .theme-toggle-btn { min-width: 90px; font-size: 0.75rem; }
  .page-section { padding: 38px 16px; }
  .sainz-form input,
  .sainz-form textarea { min-height: 48px; }
}

/* SF page: shared layout, local content uses design tokens */
.sf-wrap { max-width: var(--grid-max); margin: 0 auto; padding: 24px; }
.sf-hero { padding: 16px 0; }
.sf-hero-inner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px; align-items: start; }
.sf-hero h1 { font-size: clamp(1.75rem, 2.5vw, 2.5rem); font-weight: 600; line-height: 1.25; margin: 0 0 10px 0; color: var(--text); letter-spacing: -0.02em; }
.sf-hero .hero-subhead { font-size: 1rem; line-height: 1.4; margin: 0 0 10px 0; max-width: 62ch; font-weight: 600; color: var(--text-secondary); }
.sf-hero .body-copy { font-size: 0.9375rem; line-height: var(--line); margin: 0 0 8px 0; max-width: 72ch; color: var(--text-secondary); }
.sf-hero .subhead { font-size: 0.9375rem; font-weight: 600; margin: 16px 0 5px 0; color: var(--text); }
.sf-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-card); }
.sf-card h2 { font-size: 1.1rem; margin: 0 0 8px 0; color: var(--text); }
.sf-card p { margin: 0 0 12px 0; font-size: 0.9375rem; color: var(--text-secondary); }
.sf-card label { display: block; font-size: 0.88rem; font-weight: 500; color: var(--text-secondary); margin: 14px 0 6px 0; }
.sf-card input, .sf-card select, .sf-card textarea { width: 100%; padding: 12px 14px; font-size: 1rem; border: 1px solid var(--input-border); border-radius: var(--radius); background: var(--input-bg); color: var(--text); outline: none; }
.sf-card input:focus, .sf-card select:focus, .sf-card textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-focus); }
.sf-btn { display: inline-flex; align-items: center; justify-content: center; padding: 14px 24px; font-size: 1rem; font-weight: 600; color: var(--btn-text); background: var(--accent); border: none; border-radius: var(--radius); cursor: pointer; margin-top: 14px; }
.sf-btn:hover { background: var(--accent-hover); }
.sf-logos, .sf-certs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-top: 10px; }
.sf-logos img, .sf-certs img { width: 100%; height: 100px; object-fit: contain; background: var(--card); padding: 8px; border-radius: var(--radius); border: 1px solid var(--card-border); }
.sf-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 0.9rem; }
.sf-table th, .sf-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.sf-table th { font-weight: 600; color: var(--text); }
.sf-table td { color: var(--text-secondary); }
.sf-mobile-cta { position: fixed; left: 0; right: 0; bottom: 0; padding: 14px 20px; background: var(--card); border-top: 1px solid var(--border); z-index: 90; display: none; transition: transform 0.25s ease, opacity 0.25s ease; }
.sf-mobile-cta button { width: 100%; padding: 14px 20px; font-size: 1rem; font-weight: 600; color: var(--btn-text); background: var(--accent); border: none; border-radius: var(--radius); cursor: pointer; }
.sf-mobile-cta button:hover { background: var(--accent-hover); }
.sf-mobile-cta.hidden { transform: translateY(100%); opacity: 0; pointer-events: none; }
@media (max-width: 880px) {
  .sf-hero-inner { grid-template-columns: 1fr; }
  .sf-desktop-only { display: none !important; }
  .sf-mobile-only { display: block !important; }
  .sf-mobile-cta { display: block; }
}
.sf-mobile-only { display: none; }
.sf-mobile-form { padding: 20px 0; }
.sf-footer { padding: 24px 0; font-size: 0.9rem; color: var(--muted); }
