/* =========================================================
   Sanctum AI — sanctumai.ca
   Stylesheet
   ========================================================= */

:root {
  /* Brand palette (deep blues from pitch deck) */
  --c-ink:        #0A1628;   /* deepest navy */
  --c-deep:       #112240;
  --c-mid:        #162B4A;
  --c-steel:      #2A4A70;
  --c-slate:      #334155;
  --c-muted:      #5A6B85;
  --c-line:       #E2E8F0;
  --c-bg:         #F4F8FF;   /* page background tint */
  --c-paper:      #FFFFFF;

  /* Accents */
  --c-accent:     #4F9CF9;   /* electric blue */
  --c-accent-2:   #A8D0FF;
  --c-accent-3:   #DDECFF;
  --c-green:      #00C896;   /* local / sustainable */
  --c-green-soft: #E8F8F2;
  --c-warm:       #FFBE3D;

  /* Type */
  --f-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, sans-serif;
  --f-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;

  /* Spacing & radius */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(10,22,40,.06), 0 2px 8px rgba(10,22,40,.04);
  --shadow-md: 0 8px 24px rgba(10,22,40,.08);
  --shadow-lg: 0 20px 60px rgba(10,22,40,.18);

  --container: 1200px;
}

/* ---------- Base ---------- */
*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--c-ink);
  background: var(--c-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--c-accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--c-deep); }

h1,h2,h3,h4 {
  font-family: var(--f-display);
  color: var(--c-ink);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
  font-weight: 700;
}
h1 { font-size: clamp(2.4rem, 5.2vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.05rem; }
p  { margin: 0 0 1em; color: var(--c-slate); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-block;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-accent);
  font-weight: 600;
  margin-bottom: .9rem;
}
.eyebrow.on-dark { color: var(--c-accent-2); }

.lede {
  font-size: 1.18rem;
  color: var(--c-slate);
  max-width: 60ch;
}
.lede.on-dark { color: rgba(255,255,255,.78); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .98rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--c-accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(79,156,249,.35);
}
.btn-primary:hover { background: #3A86E8; color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-ink);
}
.btn-ghost.on-dark { color: #fff; border-color: rgba(255,255,255,.6); }
.btn-ghost.on-dark:hover { background: rgba(255,255,255,.08); color: #fff; }
.btn-ghost:hover { background: var(--c-ink); color: #fff; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(10,22,40,.06);
}
.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 72px;
  position: relative;
}
.nav .brand { margin-right: auto; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  color: var(--c-ink);
  letter-spacing: .02em;
  font-size: 1.05rem;
}
.brand svg { width: 28px; height: 28px; }
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  color: var(--c-ink);
  font-weight: 500;
  font-size: .96rem;
  position: relative;
  padding: .4rem 0;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--c-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .2s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }
/* nav-panel: transparent passthrough on desktop, collapsible drawer on mobile */
.nav-panel { display: contents; }
.nav-cta { display: inline-flex; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px; background: var(--c-ink);
  margin: 5px 0; transition: transform .2s ease, opacity .2s ease;
}

/* Language switch — pill toggle that matches the brand palette */
.lang-switch {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  background: rgba(10, 22, 40, .05);
  border: 1px solid rgba(10, 22, 40, .10);
  border-radius: 999px;
  padding: 3px;
  line-height: 1;
}
.lang-switch button,
.lang-switch button:focus,
.lang-switch button:active {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 0;
  background: transparent;
  color: var(--c-slate);
  padding: 6px 12px;
  min-width: 36px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
  outline: none;
}
.lang-switch button:hover { color: var(--c-ink); }
.lang-switch button:focus-visible {
  box-shadow: 0 0 0 2px var(--c-accent);
}
.lang-switch button.active {
  background: var(--c-ink);
  color: #fff;
  box-shadow: 0 1px 2px rgba(10, 22, 40, .15);
}

@media (max-width: 860px) {
  /* Hide the panel and toggle toggle visibility */
  .nav-panel { display: none; }
  .nav-toggle { display: inline-block; }
  .lang-switch { margin-left: auto; }

  /* Open state — slide the panel down below the header */
  .nav.open .nav-panel {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px; left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--c-line);
    box-shadow: 0 8px 20px rgba(10,22,40,.08);
    padding: 0 24px 20px;
    z-index: 40;
  }

  /* Vertical nav links */
  .nav.open .nav-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    list-style: none;
    margin: 0; padding: 0;
  }
  .nav.open .nav-links a {
    display: block;
    padding: 15px 0;
    border-bottom: 1px solid var(--c-line);
    font-size: 1rem;
  }
  /* Suppress the desktop hover/active underline in vertical context */
  .nav.open .nav-links a::after { display: none; }

  /* CTA button at bottom of panel */
  .nav.open .nav-cta {
    display: flex;
    justify-content: center;
    margin-top: 18px;
    width: 100%;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 80% 10%, rgba(79,156,249,.18), transparent 55%),
    radial-gradient(ellipse at 10% 90%, rgba(0,200,150,.10), transparent 55%),
    linear-gradient(180deg, #0A1628 0%, #112240 60%, #162B4A 100%);
  color: #fff;
  padding: clamp(80px, 12vw, 140px) 0 clamp(80px, 12vw, 140px);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 64px;
  align-items: center;
}
.hero h1 { color: #fff; }
.hero h1 .accent { color: var(--c-accent-2); }
.hero p { color: rgba(255,255,255,.78); font-size: 1.18rem; max-width: 56ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid; place-items: center;
}
.hero-visual svg { width: 100%; height: auto; filter: drop-shadow(0 30px 60px rgba(0,0,0,.4)); }

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 28px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.hero-meta div { color: rgba(255,255,255,.7); font-size: .88rem; }
.hero-meta strong { display: block; color: #fff; font-size: 1.4rem; font-weight: 700; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-visual { max-width: 360px; margin: 0 auto; }
}

/* ---------- Sections ---------- */
section { padding: clamp(72px, 10vw, 120px) 0; }
.section-head { max-width: 760px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.bg-tint { background: var(--c-bg); }
.bg-dark {
  background:
    radial-gradient(ellipse at 80% 0%, rgba(79,156,249,.18), transparent 55%),
    linear-gradient(180deg, #0A1628 0%, #112240 100%);
  color: #fff;
}
.bg-dark h2, .bg-dark h3 { color: #fff; }
.bg-dark p { color: rgba(255,255,255,.78); }

/* ---------- Cards / Grids ---------- */
.grid { display: grid; gap: 24px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  padding: 32px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: transparent; }
.card .icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  background: var(--c-accent-3);
  color: var(--c-accent);
  border-radius: 12px;
  margin-bottom: 18px;
}
.card .icon svg { width: 24px; height: 24px; }
.card h3 { margin-bottom: 8px; }
.card p { margin-bottom: 0; }

.bg-dark .card {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.08);
}
.bg-dark .card h3 { color: #fff; }
.bg-dark .card p { color: rgba(255,255,255,.72); }
.bg-dark .card .icon { background: rgba(79,156,249,.18); color: var(--c-accent-2); }

/* ---------- Feature row (image + text) ---------- */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.feature.flip { direction: rtl; }
.feature.flip > * { direction: ltr; }
.feature-media {
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4/3;
}
.feature-media img { width:100%; height:100%; object-fit: cover; }
@media (max-width: 900px) {
  .feature, .feature.flip { grid-template-columns: 1fr; gap: 32px; direction: ltr; }
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: left;
}
.stat .num {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 800;
  color: var(--c-accent);
  letter-spacing: -.03em;
  line-height: 1;
}
.bg-dark .stat .num { color: var(--c-accent-2); }
.stat .label { color: var(--c-muted); font-size: .95rem; margin-top: 8px; }
.bg-dark .stat .label { color: rgba(255,255,255,.7); }
@media (max-width: 800px) { .stats { grid-template-columns: repeat(2,1fr); } }

/* ---------- Comparison table ---------- */
.compare {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--c-line);
}
.compare th, .compare td {
  padding: 16px 18px;
  text-align: center;
  font-size: .95rem;
  border-bottom: 1px solid var(--c-line);
}
.compare th { background: var(--c-bg); font-weight: 600; color: var(--c-ink); }
.compare td:first-child, .compare th:first-child { text-align: left; font-weight: 500; }
.compare .col-us { background: rgba(79,156,249,.06); }
.compare tr:last-child td { border-bottom: 0; }
.compare .yes { color: var(--c-green); font-weight: 700; }
.compare .no  { color: #C44; font-weight: 700; }
.compare .meh { color: var(--c-muted); }

/* ---------- CTA banner ---------- */
.cta-banner {
  border-radius: var(--r-xl);
  padding: clamp(40px, 6vw, 64px);
  background:
    radial-gradient(ellipse at 80% 0%, rgba(79,156,249,.25), transparent 55%),
    linear-gradient(135deg, #0A1628, #1B3A6B);
  color: #fff;
  display: grid;
  grid-template-columns: 1.4fr auto;
  gap: 32px;
  align-items: center;
}
.cta-banner h2 { color: #fff; margin: 0; }
.cta-banner p { color: rgba(255,255,255,.78); margin: 8px 0 0; }
@media (max-width: 800px) { .cta-banner { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer {
  background: #07101E;
  color: rgba(255,255,255,.7);
  padding: 64px 0 32px;
  font-size: .92rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
}
.site-footer h4 { color: #fff; font-size: .9rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 14px; }
.site-footer a { color: rgba(255,255,255,.7); }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: 4px 0; }
.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-size: .85rem; color: rgba(255,255,255,.5);
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Page header (interior pages) ---------- */
.page-hero {
  background:
    radial-gradient(ellipse at 90% 10%, rgba(79,156,249,.22), transparent 55%),
    linear-gradient(180deg, #0A1628 0%, #162B4A 100%);
  color: #fff;
  padding: clamp(100px, 12vw, 160px) 0 clamp(60px, 8vw, 90px);
}
.page-hero h1 { color: #fff; max-width: 18ch; }
.page-hero p  { color: rgba(255,255,255,.78); max-width: 60ch; font-size: 1.18rem; }

/* ---------- Prose / long-form ---------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; color: var(--c-deep); }
.prose ul { padding-left: 1.2em; color: var(--c-slate); }
.prose ul li { margin-bottom: .4em; }
.prose blockquote {
  margin: 1.6em 0;
  padding: 18px 24px;
  border-left: 4px solid var(--c-accent);
  background: var(--c-bg);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--c-deep);
  font-size: 1.05rem;
}
.prose .source-list {
  margin-top: 3em;
  padding-top: 1.4em;
  border-top: 1px solid var(--c-line);
  font-size: .92rem;
}
.prose .source-list ol { padding-left: 1.4em; }
.prose .source-list li { margin-bottom: .7em; color: var(--c-muted); }
.prose .source-list a { word-break: break-word; }

/* ---------- Form ---------- */
.form-wrap {
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--r-xl);
  padding: clamp(28px, 5vw, 48px);
  box-shadow: var(--shadow-md);
}
.form-row { display: grid; gap: 18px; }
.form-row.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .form-row.two { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: .92rem; color: var(--c-deep); }
.field .hint { font-size: .82rem; color: var(--c-muted); }
.field input,
.field select,
.field textarea {
  font: inherit;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--c-line);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--c-ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 0;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 4px rgba(79,156,249,.15);
}
.field.error input,
.field.error select,
.field.error textarea { border-color: #C44; }
.field .err-msg { color: #C44; font-size: .85rem; display: none; }
.field.error .err-msg { display: block; }

.form-foot {
  margin-top: 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  flex-wrap: wrap;
}
.form-status {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  font-size: .95rem;
  display: none;
}
.form-status.success { display: block; background: var(--c-green-soft); color: #056b4a; border: 1px solid #b8ecd6; }
.form-status.error   { display: block; background: #FDECEC; color: #8a1f1f; border: 1px solid #f5c2c2; }

/* ---------- Contact aside ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.info-card {
  background: var(--c-bg);
  border-radius: var(--r-lg);
  padding: 28px;
  border: 1px solid var(--c-line);
}
.info-card h3 { margin-top: 0; }
.info-card .info-row { display: flex; gap: 12px; align-items: flex-start; margin: 14px 0; }
.info-card .info-row svg { width: 22px; height: 22px; color: var(--c-accent); flex-shrink: 0; margin-top: 2px; }
.info-card .info-row span { color: var(--c-slate); }

/* ---------- Misc ---------- */
.pill {
  display: inline-block;
  padding: 4px 12px;
  background: var(--c-green-soft);
  color: #056b4a;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.pill.blue { background: var(--c-accent-3); color: var(--c-deep); }

/* fade-in on scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* selection */
::selection { background: var(--c-accent); color: #fff; }
