/* ===========================================================
   Canada AI for All — hybrid theme
   Light, official Canadian base + scoped dark "techy" sections
   Canada red + white + maple-leaf motifs
   =========================================================== */

:root {
  /* Canada palette */
  --red:        #d80621;   /* official-leaning Canadian red */
  --red-deep:   #a4001a;
  --red-bright: #ff1f3d;
  --white:      #ffffff;

  /* Techy accents (mainly used in dark sections) */
  --cyan:       #19c7c0;
  --violet:     #6b5cff;

  /* Light base (default) */
  --bg:         #ffffff;
  --bg-2:       #f4f6fc;
  --surface:    #ffffff;
  --surface-2:  #eef2fa;
  --border:     #e2e7f1;
  --text:       #0f1626;
  --muted:      #586074;

  /* Dark tokens (used by .section-dark / footer) */
  --d-bg:       #0a0e1a;
  --d-bg-2:     #0f1424;
  --d-surface:  #141b30;
  --d-surface-2:#1b2440;
  --d-border:   #28324f;
  --d-text:     #eaf0fb;
  --d-muted:    #9aa6c2;

  --glow:   0 10px 30px rgba(216, 6, 33, 0.28);
  --radius: 16px;
  --maxw:   1180px;
  --font:   'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Subtle Canadian wash on the light base */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(800px 380px at 92% -8%, rgba(216, 6, 33, 0.07), transparent 60%),
    radial-gradient(700px 360px at 0% 0%, rgba(107, 92, 255, 0.05), transparent 55%);
}

a { color: inherit; text-decoration: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { line-height: 1.14; font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); }
h3 { font-size: 1.3rem; }
.eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--red); margin-bottom: 14px;
}
.section-dark .eyebrow { color: var(--cyan); }
.gradient-text {
  background: linear-gradient(100deg, var(--red), var(--red-deep) 70%, #7a1030);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.section-dark .gradient-text {
  background: linear-gradient(100deg, var(--red-bright), var(--violet) 55%, var(--cyan));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }

/* ---------- Canada signature bar (injected on every page) ---------- */
.ca-bar {
  background: var(--red);
  color: #fff;
}
.ca-bar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 7px 24px;
  display: flex; align-items: center; gap: 10px;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em;
}
.ca-bar .leaf-mini { width: 16px; height: 16px; flex: none; }
.ca-bar .sep { opacity: 0.55; }
.ca-bar .right { margin-left: auto; opacity: 0.92; }
@media (max-width: 640px) { .ca-bar .right { display: none; } }

/* ---------- Navbar (light/official) ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 1.12rem; color: var(--text); }
.brand .leaf { width: 32px; height: 32px; flex: none; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 9px 14px; border-radius: 10px; font-size: 0.93rem; font-weight: 600;
  color: var(--muted); transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--red); }
.nav-cta {
  background: linear-gradient(100deg, var(--red), var(--red-deep));
  color: #fff !important; box-shadow: var(--glow);
}
.nav-cta:hover { filter: brightness(1.06); }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--border);
  color: var(--text); width: 42px; height: 42px; border-radius: 10px;
  font-size: 1.3rem; cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 26px; border-radius: 12px; font-weight: 700; font-size: 0.98rem;
  cursor: pointer; border: 1px solid transparent;
  transition: transform 0.15s, filter 0.2s, background 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(100deg, var(--red), var(--red-deep)); color: #fff; box-shadow: var(--glow); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--red); color: var(--red); }
.section-dark .btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.section-dark .btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

/* ---------- Sections ---------- */
section { padding: 84px 0; }
.section-head { max-width: 64ch; margin-bottom: 48px; }
.section-tint { background: var(--bg-2); }

/* Scoped dark "techy" sections — override tokens so children adapt */
.section-dark {
  background:
    radial-gradient(700px 420px at 85% -10%, rgba(107,92,255,0.18), transparent 60%),
    radial-gradient(620px 420px at 0% 110%, rgba(25,199,192,0.12), transparent 60%),
    var(--d-bg);
  color: var(--d-text);
  --text: var(--d-text);
  --muted: var(--d-muted);
  --surface: var(--d-surface);
  --surface-2: var(--d-surface-2);
  --bg-2: var(--d-bg-2);
  --border: var(--d-border);
}

/* ---------- Hero ---------- */
.hero { padding: 80px 0 64px; position: relative; }
.hero h1 { margin-bottom: 22px; }
.hero .lead { font-size: 1.26rem; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 15px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); font-size: 0.82rem; font-weight: 700; color: var(--muted);
  margin-bottom: 26px;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 60px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 22px; box-shadow: 0 6px 24px rgba(15,22,38,0.04); }
.section-dark .stat { box-shadow: none; }
.stat .num {
  font-size: 2.1rem; font-weight: 800;
  background: linear-gradient(100deg, var(--red), var(--red-deep));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.section-dark .stat .num { background: linear-gradient(100deg, var(--red-bright), var(--violet)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat .label { font-size: 0.9rem; color: var(--muted); margin-top: 4px; }

/* ---------- Cards grid ---------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative; overflow: hidden;
  box-shadow: 0 8px 28px rgba(15,22,38,0.05);
}
.section-dark .card { background: linear-gradient(180deg, var(--surface), var(--bg-2)); box-shadow: none; }
.card:hover { transform: translateY(-5px); border-color: var(--red); box-shadow: 0 18px 44px rgba(216,6,33,0.14); }
.section-dark .card:hover { box-shadow: 0 18px 50px rgba(0,0,0,0.45); }
.card .icon {
  width: 52px; height: 52px; display: grid; place-items: center;
  border-radius: 13px; background: var(--surface-2); border: 1px solid var(--border);
  margin-bottom: 18px; font-size: 1.5rem;
}
.card h3 { margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 0.97rem; }
.card .tag { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); }
.section-dark .card .tag { color: var(--cyan); }
.card ul { color: var(--muted); }

/* Red top accent strip on featured cards */
.card.accent::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--red), var(--violet));
}

/* ---------- Resource list ---------- */
.resource-group { margin-bottom: 52px; }
.resource-group > h3 { margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.resource-group .grp-sub { color: var(--muted); margin-bottom: 22px; font-size: 0.98rem; }
.res-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.res {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: 13px; padding: 20px 22px;
  transition: border-color 0.2s, transform 0.15s, background 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(15,22,38,0.04);
}
.res:hover { border-color: var(--red); transform: translateX(4px); box-shadow: 0 10px 26px rgba(216,6,33,0.1); }
.section-dark .res { box-shadow: none; }
.section-dark .res:hover { border-color: var(--cyan); background: var(--surface-2); }
.res .res-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.res h4 { font-size: 1.02rem; font-weight: 700; }
.res .arrow { color: var(--red); font-size: 1.1rem; flex: none; }
.section-dark .res .arrow { color: var(--cyan); }
.res p { color: var(--muted); font-size: 0.9rem; margin-top: 6px; }
.res .src { font-size: 0.74rem; color: var(--violet); font-weight: 700; margin-top: 10px; display: inline-block; }

/* ---------- Pills ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { padding: 7px 15px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 0.85rem; color: var(--muted); }

/* ---------- Steps ---------- */
.steps { counter-reset: step; display: grid; gap: 18px; }
.step {
  display: grid; grid-template-columns: 56px 1fr; gap: 20px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px;
}
.step::before {
  counter-increment: step; content: counter(step);
  width: 56px; height: 56px; display: grid; place-items: center;
  border-radius: 14px; font-size: 1.4rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
}
.section-dark .step::before { background: linear-gradient(135deg, var(--red-bright), var(--violet)); }
.step h3 { margin-bottom: 6px; }
.step p { color: var(--muted); }

/* ---------- Banner ---------- */
.banner {
  background: linear-gradient(110deg, rgba(216,6,33,0.08), rgba(107,92,255,0.08));
  border: 1px solid var(--border); border-radius: 22px; padding: 52px; text-align: center;
}
.section-dark .banner { background: linear-gradient(110deg, rgba(255,31,61,0.16), rgba(25,199,192,0.12)); }
.banner h2 { margin-bottom: 14px; }
.banner p { color: var(--muted); max-width: 56ch; margin: 0 auto 26px; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; max-width: 640px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label { display: block; font-size: 0.86rem; font-weight: 700; margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 11px; padding: 13px 15px; color: var(--text); font-family: inherit; font-size: 0.96rem;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(216,6,33,0.16);
}
.field textarea { resize: vertical; min-height: 130px; }
.form-note { font-size: 0.84rem; color: var(--muted); }

/* ---------- Contact methods ---------- */
.contact-methods { display: grid; gap: 16px; }
.cmethod { display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 20px; }
.cmethod .ic { font-size: 1.4rem; }
.cmethod h4 { margin-bottom: 3px; }
.cmethod p, .cmethod a { color: var(--muted); font-size: 0.94rem; }
.cmethod a:hover { color: var(--red); }

/* ---------- News feed ---------- */
.news-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.news-tab {
  padding: 9px 18px; border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); border-radius: 999px; font-family: inherit; font-size: 0.9rem; font-weight: 700;
  cursor: pointer; transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.news-tab:hover { color: var(--text); border-color: var(--red); }
.news-tab.active { color: #fff; background: linear-gradient(100deg, var(--red), var(--red-deep)); border-color: transparent; }
.section-dark .news-tab.active { background: linear-gradient(100deg, var(--red-bright), var(--violet)); }
.news-feed { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.news-card h4 { font-size: 1.0rem; line-height: 1.35; }
.news-status { grid-column: 1 / -1; padding: 18px 0; }
.news-live {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.05em; color: var(--red); margin-bottom: 14px;
}
.section-dark .news-live { color: var(--cyan); }
.news-live .pulse { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 rgba(216,6,33,0.5); animation: pulse 1.8s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(216,6,33,0.5); }
  70% { box-shadow: 0 0 0 9px rgba(216,6,33,0); }
  100% { box-shadow: 0 0 0 0 rgba(216,6,33,0); }
}

/* Compact single-line news strip (injected under the header on every page) */
.news-strip { background: var(--bg-2); border-bottom: 1px solid var(--border); }
.news-strip-inner { display: flex; align-items: center; gap: 14px; padding: 9px 0; }
.news-strip .news-live { margin: 0; flex: none; }
.news-strip .news-seeall { flex: none; font-size: 0.82rem; font-weight: 800; color: var(--red); white-space: nowrap; }
.news-strip .news-seeall:hover { text-decoration: underline; }

.news-row {
  display: flex; gap: 10px; flex: 1 1 auto; min-width: 0;
  overflow-x: auto; scroll-snap-type: x proximity;
  padding-bottom: 2px; -webkit-overflow-scrolling: touch;
}
.news-row::-webkit-scrollbar { height: 6px; }
.news-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.news-row .res {
  flex: 0 0 215px; min-width: 215px; padding: 10px 13px;
  scroll-snap-align: start; box-shadow: none;
}
.news-row .res:hover { transform: none; border-color: var(--red); box-shadow: none; }
.news-row .res .arrow { display: none; }
.news-row .res .res-top { display: block; }
.news-row .res h4 {
  font-size: 0.82rem; line-height: 1.3; font-weight: 700;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-row .res .src { font-size: 0.68rem; margin-top: 5px; }
.news-row .news-status { white-space: nowrap; align-self: center; }
@media (max-width: 600px) {
  .news-feed { grid-template-columns: 1fr; }
  .news-strip .news-seeall { display: none; }
  .news-row .res { flex-basis: 200px; min-width: 200px; }
}

/* ---------- Disclaimer ---------- */
.disclaimer {
  font-size: 0.82rem; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--red); border-radius: 10px; padding: 16px 20px; margin-top: 28px;
}
.section-dark .disclaimer { border-left-color: var(--cyan); }

/* ---------- Footer (always dark / techy) ---------- */
.footer {
  border-top: 3px solid var(--red);
  padding: 56px 0 32px;
  background: var(--d-bg);
  color: var(--d-text);
  --text: var(--d-text); --muted: var(--d-muted); --border: var(--d-border);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.footer h5 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 16px; }
.footer a { display: block; color: var(--muted); font-size: 0.93rem; padding: 5px 0; }
.footer a:hover { color: var(--text); }
.footer .brand { margin-bottom: 14px; color: var(--d-text); }
.footer .blurb { color: var(--muted); font-size: 0.93rem; max-width: 34ch; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--border); padding-top: 24px; flex-wrap: wrap; gap: 12px;
  font-size: 0.85rem; color: var(--muted);
}

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .res-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--white); border-bottom: 1px solid var(--border); padding: 14px 24px; gap: 4px;
    transform: translateY(-160%); transition: transform 0.3s; max-height: calc(100vh - 72px); overflow-y: auto;
    box-shadow: 0 20px 40px rgba(15,22,38,0.12);
  }
  .nav-links.open { transform: none; }
  .nav-links a { padding: 13px 12px; }
  .nav-toggle { display: grid; place-items: center; }
  .form-row { grid-template-columns: 1fr; }
  .banner { padding: 36px 24px; }
  section { padding: 60px 0; }
}
@media (max-width: 640px) {
  .ca-bar-inner { font-size: 0.72rem; gap: 7px; padding: 6px 18px; }
  .container { padding: 0 18px; }
  .nav-inner { height: 64px; }
  .brand { font-size: 1rem; gap: 9px; }
  .brand .leaf { width: 28px; height: 28px; }
  .nav-links { inset: 64px 0 auto 0; }
  .hero { padding: 48px 0 40px; }
  .hero .lead { font-size: 1.1rem; }
  .card { padding: 24px; }
  .banner { padding: 32px 20px; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
