/* ============================================================
   Squared Agents — Design System
   Pure CSS · No frameworks · Static / S3 + CloudFront ready
   ============================================================ */

/* ── 1. Design Tokens ───────────────────────────────────── */
:root {
  /* ── Brand palette ── */
  --blue:           #1B3A6B;
  --blue-hover:     #142D54;
  --blue-active:    #0E2240;
  --blue-light:     #DDE5F2;
  --blue-pale:      #EEF2F9;

  --green:          #FF7A59;
  --green-hover:    #E05C38;
  --green-light:    #FFE8E2;
  --green-pale:     #FFF4F1;

  /* ── Surfaces ── */
  --bg:             #FFFFFF;
  --bg-section:     #F7F9FC;
  --bg-card:        #EDF2F7;

  /* ── Borders ── */
  --border:         #E5EAF2;
  --border-hover:   #C5D1E8;
  --border-focus:   var(--blue);

  /* ── Text ── */
  --text-primary:   #0A2540;
  --text-secondary: #5A6B82;
  --text-tertiary:  #8696AD;

  /* ── Type scale ── */
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --text-14: 0.875rem;   /* 14px */
  --text-16: 1rem;       /* 16px */
  --text-18: 1.125rem;   /* 18px */
  --text-24: 1.5rem;     /* 24px */
  --text-32: 2rem;       /* 32px */
  --text-48: 3rem;       /* 48px */
  --text-64: 4rem;       /* 64px */

  /* ── Spacing ── */
  --section-y:    96px;
  --max-width:    1200px;
  --px:           24px;       /* container horizontal padding */
  --gutter:       24px;       /* grid gap */
  --header-h:     72px;

  /* ── Radii ── */
  --r-sm:   4px;
  --r:      8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-full: 9999px;

  /* ── Shadows ── */
  --shadow-xs: 0 1px 3px rgba(10, 37, 64, 0.05);
  --shadow-sm: 0 2px 8px rgba(10, 37, 64, 0.06), 0 1px 3px rgba(10, 37, 64, 0.04);
  --shadow-md: 0 4px 24px rgba(10, 37, 64, 0.08), 0 2px 8px rgba(10, 37, 64, 0.04);
  --shadow-lg: 0 12px 48px rgba(10, 37, 64, 0.10), 0 4px 16px rgba(10, 37, 64, 0.06);

  /* ── Transitions ── */
  --t:      200ms ease;
  --t-fast: 150ms ease;
  --t-slow: 300ms ease;

  /* ── Legacy aliases — keep page-level <style> blocks working ── */
  --color-bg:       var(--bg);
  --color-surface:  var(--bg-section);
  --color-border:   var(--border);
  --color-accent:   var(--blue);
  --color-accent-dim: var(--blue-hover);
  --color-text:     var(--text-primary);
  --color-text-muted: var(--text-secondary);
  --color-success:  var(--green);
  --radius:         var(--r);
  --header-height:  var(--header-h);
  --font-sans:      var(--font);
}


/* ── 2. Reset ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: var(--text-16);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

ul, ol {
  list-style: none;
}


/* ── 3. Typography ─────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: var(--text-64); letter-spacing: -0.02em; }
h2 { font-size: var(--text-48); letter-spacing: -0.02em; }
h3 { font-size: var(--text-32); letter-spacing: -0.01em; }
h4 { font-size: var(--text-24); }
h5 { font-size: var(--text-18); }
h6 { font-size: var(--text-16); font-weight: 600; }

p {
  color: var(--text-secondary);
  line-height: 1.6;
}

strong { font-weight: 600; color: var(--text-primary); }

a {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover {
  color: var(--blue-hover);
}


/* ── 4. Layout ─────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--px);
}

/* 12-column grid */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
}

.col-1  { grid-column: span 1; }
.col-2  { grid-column: span 2; }
.col-3  { grid-column: span 3; }
.col-4  { grid-column: span 4; }
.col-5  { grid-column: span 5; }
.col-6  { grid-column: span 6; }
.col-7  { grid-column: span 7; }
.col-8  { grid-column: span 8; }
.col-9  { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

section {
  padding: var(--section-y) 0;
}

.section-alt {
  background: var(--bg-section);
}


/* ── 5. Navigation ─────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t), box-shadow var(--t);
}

header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  transition: opacity var(--t-fast);
}
.logo:hover {
  opacity: 0.75;
  color: var(--text-primary);
}
.logo span {
  color: var(--blue);
}

nav#nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

nav#nav-links a {
  font-size: var(--text-14);
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: color var(--t-fast);
}
nav#nav-links a:hover {
  color: var(--text-primary);
}
nav#nav-links a[aria-current="page"] {
  color: var(--text-primary);
  font-weight: 600;
}

/* Nav CTA button */
.nav-cta {
  display: inline-flex !important;
  align-items: center;
  background: var(--blue) !important;
  color: #fff !important;
  font-size: var(--text-14) !important;
  font-weight: 600 !important;
  padding: 0.5rem 1.125rem !important;
  border-radius: var(--r) !important;
  transition: background var(--t-fast) !important;
  white-space: nowrap;
}
.nav-cta:hover {
  background: var(--blue-hover) !important;
  color: #fff !important;
}

/* Hamburger (hidden on desktop) */
#nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  color: var(--text-primary);
  font-size: 1.125rem;
  line-height: 1;
  transition: border-color var(--t-fast), background var(--t-fast);
}
#nav-toggle:hover {
  background: var(--bg-section);
  border-color: var(--border-hover);
}


/* ── 6. Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-size: var(--text-14);
  font-weight: 600;
  line-height: 1;
  padding: 0.75rem 1.5rem;     /* 12px 24px */
  border-radius: var(--r);     /* 8px */
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background var(--t-fast),
    border-color var(--t-fast),
    color var(--t-fast),
    box-shadow var(--t-fast);
}

/* Primary — filled blue */
.btn-primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.btn-primary:hover {
  background: var(--blue-hover);
  border-color: var(--blue-hover);
  color: #fff;
  text-decoration: none;
}
.btn-primary:active {
  background: var(--blue-active);
  border-color: var(--blue-active);
  box-shadow: none;
}

/* Secondary — outlined blue */
.btn-secondary,
.btn-outline {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}
.btn-secondary:hover,
.btn-outline:hover {
  background: var(--blue-pale);
  color: var(--blue-hover);
  border-color: var(--blue-hover);
  text-decoration: none;
}

/* Ghost — text only */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-card);
  text-decoration: none;
}

/* Size variants */
.btn-sm {
  font-size: 0.8125rem;
  padding: 0.5rem 1rem;
}
.btn-lg {
  font-size: var(--text-16);
  padding: 0.875rem 2rem;
  border-radius: var(--r-md);
}

/* Disabled state */
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}


/* ── 7. Cards ──────────────────────────────────────────── */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);   /* 16px */
  padding: 1.75rem;
  transition: box-shadow var(--t), border-color var(--t);
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.card-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--blue-pale);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--blue);
  flex-shrink: 0;
}

.card h3 {
  font-size: var(--text-18);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}
.card p {
  font-size: var(--text-14);
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Card grid layout */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}


/* ── 8. Hero ───────────────────────────────────────────── */
.hero {
  padding: calc(var(--section-y) * 1.2) 0 var(--section-y);
  text-align: center;
  /* Soft radial gradient: sky blue fading through mint green to white */
  background: var(--bg-section);
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-pale);
  border: 1px solid rgba(0, 102, 255, 0.18);
  padding: 0.3rem 0.85rem;
  border-radius: var(--r-full);
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(var(--text-32), 5.5vw, var(--text-64));
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  max-width: 820px;
  margin: 0 auto 1.25rem;
}

.hero h1 .accent       { color: var(--blue); }
.hero h1 .accent-green { color: var(--green-hover); }

/* Hero body copy — matches direct <p> child inside hero .container */
.hero .container > p,
.hero p.hero-sub {
  font-size: var(--text-18);
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 2.5rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}


/* ── 9. Sections ───────────────────────────────────────── */
.section-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.75rem;
}
.section-label--green {
  color: var(--green-hover);
}

.section-title {
  font-size: clamp(var(--text-24), 3.5vw, var(--text-48));
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.section-sub {
  font-size: var(--text-18);
  color: var(--text-secondary);
  max-width: 520px;
  line-height: 1.65;
}


/* ── 10. Divider ───────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
}


/* ── 11. Footer ────────────────────────────────────────── */
footer {
  background: var(--bg-section);
  border-top: 1px solid var(--border);
  padding: 64px 0;
}

.footer-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.footer-brand {
  flex-shrink: 0;
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin: 0.625rem 0 0;
}

.footer-cols {
  display: flex;
  gap: 3rem;
}

.footer-col h4 {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.footer-col a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color var(--t-fast);
}

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-copy {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  align-self: flex-start;
}


/* ── 12. Forms ─────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group label {
  font-size: var(--text-14);
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  font-family: var(--font);
  font-size: var(--text-14);
  color: var(--text-primary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.625rem 0.875rem;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-tertiary);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: var(--border-hover);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.form-status {
  font-size: var(--text-14);
  padding: 0.625rem 1rem;
  border-radius: var(--r);
  display: none;
}
.form-status.success {
  display: block;
  background: rgba(0, 201, 167, 0.08);
  border: 1px solid rgba(0, 201, 167, 0.25);
  color: var(--green-hover);
}
.form-status.error {
  display: block;
  background: #FFF5F5;
  border: 1px solid #FEB2B2;
  color: #C53030;
}


/* ── 13. Scroll-reveal animation ───────────────────────── */
/* Applied only when user has no motion preference. JS adds .revealed via IntersectionObserver. */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
  }
  [data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ── 14. Utilities ─────────────────────────────────────── */
.text-primary   { color: var(--text-primary)   !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted,
.text-tertiary  { color: var(--text-tertiary)  !important; }
.text-blue      { color: var(--blue)           !important; }
.text-green     { color: var(--green-hover)    !important; }

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.text-sm { font-size: var(--text-14); }
.text-md { font-size: var(--text-18); }
.text-lg { font-size: var(--text-24); }

/* Spacing */
.mt-0  { margin-top: 0;      }
.mt-1  { margin-top: 0.25rem; }
.mt-2  { margin-top: 0.5rem;  }
.mt-3  { margin-top: 0.75rem; }
.mt-4  { margin-top: 1rem;    }
.mt-6  { margin-top: 1.5rem;  }
.mt-8  { margin-top: 2rem;    }
.mt-12 { margin-top: 3rem;    }

.mb-0  { margin-bottom: 0;      }
.mb-1  { margin-bottom: 0.25rem; }
.mb-2  { margin-bottom: 0.5rem;  }
.mb-3  { margin-bottom: 0.75rem; }
.mb-4  { margin-bottom: 1rem;    }
.mb-6  { margin-bottom: 1.5rem;  }
.mb-8  { margin-bottom: 2rem;    }
.mb-12 { margin-bottom: 3rem;    }

.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-sm  { max-width: 480px; }
.max-w-md  { max-width: 640px; }
.max-w-lg  { max-width: 820px; }
.w-full    { width: 100%; }


/* ── 15. Accessibility ─────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--px);
  background: var(--blue);
  color: #fff;
  font-size: var(--text-14);
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--r);
  z-index: 200;
}
.skip-link:focus {
  top: var(--px);
}

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


/* ── 16. Responsive — 768px breakpoint ─────────────────── */
@media (max-width: 768px) {

  /* Tokens */
  :root {
    --section-y: 48px;
    --px:        20px;
    --gutter:    16px;
  }

  /* Type scale */
  h1 { font-size: var(--text-48); }
  h2 { font-size: var(--text-32); }
  h3 { font-size: var(--text-24); }

  /* ── Navigation ── */
  #nav-toggle {
    display: flex;
  }

  /* Slide-down mobile menu */
  nav#nav-links {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 0.5rem 0 1rem;
    z-index: 99;
  }

  nav#nav-links.open {
    display: flex;
  }

  nav#nav-links a {
    width: 100%;
    padding: 0.75rem var(--px);
    border-radius: 0;
    font-size: var(--text-16);
  }
  nav#nav-links a:hover {
    background: var(--bg-section);
  }

  .nav-cta {
    margin: 0.5rem var(--px) 0 !important;
    width: calc(100% - var(--px) * 2) !important;
    justify-content: center;
    display: flex !important;
  }

  /* ── Hero ── */
  .hero {
    text-align: left;
    padding: 56px 0 48px;
  }

  .hero h1 {
    font-size: clamp(var(--text-24), 9vw, var(--text-48));
    margin-left: 0;
    margin-right: 0;
  }

  .hero .container > p,
  .hero p.hero-sub {
    font-size: var(--text-16);
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .hero-label {
    margin-bottom: 1.25rem;
  }

  /* ── Sections ── */
  .section-sub {
    font-size: var(--text-16);
    max-width: 100%;
  }

  /* ── Grid ── */
  .grid {
    grid-template-columns: 1fr;
  }

  [class^="col-"],
  [class*=" col-"] {
    grid-column: span 1;
  }

  /* ── Cards ── */
  .card-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* ── Buttons ── */
  .btn-lg {
    width: 100%;
  }

  /* ── Footer ── */
  .footer-main {
    flex-direction: column;
    gap: 2rem;
  }

  .footer-cols {
    flex-wrap: wrap;
    gap: 1.5rem;
  }

  .footer-copy {
    white-space: normal;
  }
}
