/* ───────────────────────────────────────────────────────────
   EnerSolaris Québec — shared site stylesheet
   Palette based on Quebec flag blue (#003DA5)
   ─────────────────────────────────────────────────────────── */

:root {
  --ink: #0A1628;
  --ink-2: #1B2B42;
  --paper: #FBFAF7;
  --paper-2: #F2EEE5;
  --paper-3: #EAE3D3;

  --sun: #F4C430;
  --sun-deep: #E0A82E;
  --sun-soft: #FDE9A8;

  --blue: #003DA5;         /* Quebec flag blue */
  --blue-deep: #002C7A;
  --blue-soft: #5A7FC0;
  --blue-pale: #E8EEF9;

  --green: #2E5339;
  --red: #B8482E;

  --line: rgba(10, 22, 40, 0.12);
  --line-soft: rgba(10, 22, 40, 0.06);
  --muted: rgba(10, 22, 40, 0.58);

  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Geist', -apple-system, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* Province-specific program blocks stay out of view and the accessibility
   tree until the visitor's explicit Québec/Ontario choice is applied. */
[data-prov-only][hidden],
html:not([data-prov]) [data-prov-only] {
  display: none !important;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 124px; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
img, video { max-width: 100%; height: auto; }
main, section, .section-inner, .page-hero-inner { min-width: 0; }
::selection { background: var(--sun-soft); color: var(--ink); }
:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
  border-radius: 4px;
}
.serif { font-family: var(--serif); }
.mono { font-family: var(--mono); }

.mono-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ────────── NAV ────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px;
  background: rgba(251, 250, 247, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(10, 22, 40, 0.04);
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 16px; letter-spacing: -0.01em;
  text-decoration: none; color: var(--ink);
}
.logo-mark {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue);
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 61, 165, 0.25);
}
.logo-mark::after {
  content: ''; position: absolute; inset: 6px;
  border-radius: 50%; background: var(--sun);
}
.nav-links { display: flex; gap: 28px; font-size: 14px; color: var(--ink-2); }
.nav-links a { color: inherit; text-decoration: none; opacity: 0.7; transition: opacity 0.2s; }
.nav-links a:hover, .nav-links a.active { opacity: 1; }
.nav-links a.active { color: var(--blue); font-weight: 500; }
.nav-cta {
  padding: 10px 20px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  transition: transform 0.2s, background 0.2s;
}
.nav-cta:hover { background: var(--blue); transform: translateY(-1px); }

/* Top announcement banner */
#sq-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 101;
  height: 40px; background: var(--ink); color: var(--paper);
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 0 16px; font-size: 13px; overflow: hidden;
}
#sq-banner .sq-banner-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sun); flex-shrink: 0; }
#sq-banner .sq-banner-msg { color: rgba(251,250,247,0.92); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#sq-banner .sq-banner-cta { color: var(--sun); font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; flex-shrink: 0; white-space: nowrap; }
#sq-banner .sq-banner-cta:hover { text-decoration: underline; }
nav#nav { top: 40px; }
@media (max-width: 640px) {
  #sq-banner .sq-banner-cta { display: none; }
  #sq-banner { font-size: 12px; }
}

/* Locale switcher pills (FR/EN · QC/ON) */
.nav-right { display: flex; align-items: center; gap: 12px; }
.loc-controls {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--paper-2);
}
.loc-seg { display: inline-flex; gap: 2px; }
.loc-seg + .loc-seg { margin-left: 5px; padding-left: 6px; border-left: 1px solid var(--line); }
.loc-seg button,
.loc-seg a {
  border: none; background: transparent; cursor: pointer;
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.05em; color: var(--muted);
  padding: 5px 9px; border-radius: 999px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.loc-seg button.active,
.loc-seg a.active { background: var(--ink); color: var(--paper); }
.loc-seg button:not(.active):hover,
.loc-seg a:not(.active):hover { color: var(--ink); }

/* Mobile hamburger + menu */
.nav-burger {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 0 10px;
  background: transparent; border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer;
}
.nav-burger span { display: block; height: 2px; width: 100%; background: var(--ink); border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-mobile { display: none; }

@media (max-width: 1100px) { .nav-links { gap: 20px; font-size: 13px; } }
@media (max-width: 600px) { .loc-controls { display: none; } }
@media (max-width: 1080px) {
  nav { padding: 14px 20px; flex-wrap: wrap; }
  .nav-links { display: none; }
  .nav-cta-desktop { display: none; }
  .nav-right > .loc-controls { display: none; }
  .nav-burger { display: flex; }
  .nav-mobile {
    display: none; flex-direction: column; gap: 6px;
    width: 100%; order: 3; margin-top: 12px;
    padding-top: 12px; border-top: 1px solid var(--line);
  }
  .nav-mobile.open { display: flex; }
  .nav-mobile a:not(.nav-cta) {
    padding: 12px 8px; text-decoration: none; color: var(--ink-2);
    font-size: 16px; border-bottom: 1px solid var(--line-soft);
  }
  .nav-mobile a.active { color: var(--blue); font-weight: 500; }
  .nav-mobile .nav-cta { justify-content: center; margin-top: 10px; }
  .nav-mobile-locale { display: flex; gap: 8px; padding: 10px 0; }
  .nav-mobile-locale .loc-controls { display: flex; }
}

/* ────────── BUTTONS ────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 28px;
  border-radius: 999px;
  font-size: 15px; font-weight: 500;
  text-decoration: none;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  border: none; cursor: pointer;
  font-family: inherit;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 8px 24px rgba(10, 22, 40, 0.15);
}
.btn-primary:hover {
  background: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 61, 165, 0.25);
}
.btn-blue { background: var(--blue); color: var(--paper); }
.btn-blue:hover { background: var(--blue-deep); }
.btn-sun {
  background: var(--sun);
  color: var(--ink);
  font-weight: 600;
}
.btn-sun:hover { background: var(--sun-deep); }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-secondary:hover { border-color: var(--ink); }
.btn-arrow { transition: transform 0.2s; }
.btn:hover .btn-arrow { transform: translateX(4px); }

/* ────────── PAGE HEADER (subpages) ────────── */
.page-hero {
  padding: 178px 48px 92px;
  position: relative;
  overflow: hidden;
  background: var(--paper);
}
.page-hero::before {
  content: '';
  position: absolute;
  top: 0; right: -300px;
  width: 800px; height: 800px; border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 196, 48, 0.22) 0%, transparent 65%);
  pointer-events: none;
}
.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0, transparent calc(50% - 1px), rgba(10,22,40,0.035) 50%, transparent calc(50% + 1px)),
    linear-gradient(rgba(10,22,40,0.025) 1px, transparent 1px);
  background-size: 100% 100%, 100% 96px;
  mask-image: linear-gradient(to right, transparent, #000 42%, #000 100%);
  pointer-events: none;
}
.page-hero-inner {
  max-width: 1280px; margin: 0 auto;
  position: relative; z-index: 1;
}
.page-hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  background: rgba(251, 250, 247, 0.6);
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  margin-bottom: 28px;
}
.page-hero .eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--blue);
}
.page-hero h1 {
  font-family: var(--serif);
  font-size: clamp(54px, 6.8vw, 88px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin-bottom: 28px;
  max-width: 920px;
  text-wrap: balance;
}
.page-hero h1 em {
  font-style: italic;
  color: var(--blue);
}
.page-hero .lede {
  font-size: 18px; line-height: 1.65;
  color: rgba(10,22,40,0.7);
  max-width: 680px;
  margin-bottom: 28px;
}
.page-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.page-hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 24px;
  color: rgba(10,22,40,0.62);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.page-hero-proof span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.page-hero-proof span::before {
  content: '✓';
  color: var(--blue);
  font-weight: 700;
}

/* ────────── SECTION ────────── */
section {
  padding: 100px 48px;
  position: relative;
}
.section-inner { max-width: 1280px; margin: 0 auto; }
.section-header {
  max-width: 1280px; margin: 0 auto 80px;
}
.section-header .mono-label { display: block; margin-bottom: 24px; }
.section-title {
  font-family: var(--serif);
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 900px;
}
.section-title em { font-style: italic; color: var(--blue); }
.section-lead {
  font-size: 18px; color: var(--muted);
  max-width: 700px;
  margin-top: 24px;
  line-height: 1.6;
}

/* ────────── UTILITIES ────────── */
.bg-paper-2 { background: var(--paper-2); }
.bg-ink { background: var(--ink); color: var(--paper); }
.bg-blue { background: var(--blue); color: var(--paper); }

.prose p { font-size: 17px; line-height: 1.7; color: var(--ink-2); margin-bottom: 20px; }
.prose h2 { font-family: var(--serif); font-size: 40px; font-weight: 400; margin: 48px 0 16px; letter-spacing: -0.01em; }
.prose h3 { font-family: var(--serif); font-size: 28px; font-weight: 400; margin: 32px 0 12px; letter-spacing: -0.01em; }
.prose ul { margin: 16px 0 20px 24px; }
.prose ul li { font-size: 17px; line-height: 1.7; color: var(--ink-2); margin-bottom: 8px; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose table { width: 100%; }

/* ────────── FOOTER ────────── */
footer {
  background: var(--ink);
  color: rgba(251, 250, 247, 0.7);
  padding: 80px 48px 32px;
  font-size: 14px;
}
.footer-grid {
  max-width: 1280px; margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 60px;
  border-bottom: 1px solid rgba(251, 250, 247, 0.1);
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
.footer-brand .logo { color: var(--paper); margin-bottom: 20px; }
.footer-brand p { line-height: 1.6; max-width: 320px; color: rgba(251, 250, 247, 0.55); }
.footer-col h3,
.footer-col h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(251, 250, 247, 0.5);
  margin-bottom: 18px;
  font-weight: 500;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { text-decoration: none; color: rgba(251, 250, 247, 0.75); transition: color 0.2s; }
.footer-col a:hover { color: var(--sun); }
.footer-bottom {
  max-width: 1280px; margin: 24px auto 0;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  font-size: 12px;
  color: rgba(251, 250, 247, 0.4);
}

/* ────────── REVEAL ────────── */
.reveal {
  opacity: 1; transform: none;
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ────────── PROVINCE CHOOSER (first visit) ────────── */
#sq-chooser {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(10,22,40,0.72); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.sq-chooser-card {
  background: var(--paper); border-radius: 22px;
  max-width: 560px; width: 100%; padding: 48px 44px;
  box-shadow: 0 40px 100px -30px rgba(0,0,0,0.5); text-align: center;
}
.sq-chooser-logo {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--serif); font-style: italic; font-size: 22px;
  color: var(--ink); margin-bottom: 24px;
}
.sq-chooser-logo .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--blue); position: relative; }
.sq-chooser-logo .dot::after { content:''; position:absolute; inset:5px; border-radius:50%; background: var(--sun); }
.sq-chooser-card h2 { font-family: var(--serif); font-weight: 400; font-size: 32px; letter-spacing:-0.02em; line-height:1.1; margin-bottom: 12px; }
.sq-chooser-card p { color: var(--muted); font-size: 15px; line-height: 1.55; max-width: 400px; margin: 0 auto 28px; }
.sq-chooser-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px; }
@media (max-width: 480px) { .sq-chooser-opts { grid-template-columns: 1fr; } }
.sq-chooser-opts button {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  padding: 22px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--paper); cursor: pointer; text-align: left;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.sq-chooser-opts button:hover { border-color: var(--blue); transform: translateY(-2px); background: var(--blue-pale); }
.sq-chooser-opts .pv { font-family: var(--serif); font-size: 26px; color: var(--ink); }
.sq-chooser-opts .ut { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.sq-chooser-lang { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--muted); display: flex; gap: 12px; justify-content: center; align-items: center; }
.sq-chooser-lang button { background: none; border: none; cursor: pointer; font: inherit; color: var(--muted); padding: 4px; }
.sq-chooser-lang button.active { color: var(--blue); font-weight: 600; }

/* ────────── BADGE / CHIP ────────── */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--blue-pale);
  color: var(--blue-deep);
  border-radius: 999px;
  font-size: 12px; font-weight: 500;
  font-family: var(--mono);
  letter-spacing: 0.04em;
}
.chip.sun { background: var(--sun-soft); color: #6F4A00; }
.chip.green { background: #E0EAE1; color: var(--green); }

/* ────────── CARD ────────── */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--ink);
  box-shadow: 0 20px 40px -20px rgba(10, 22, 40, 0.15);
}

@media (max-width: 760px) {
  #sq-banner { height: 36px; }
  nav#nav { top: 36px; }
  nav { padding: 13px 18px; }
  .page-hero { padding: 142px 20px 64px; }
  .page-hero::after { display: none; }
  .page-hero .eyebrow { font-size: 11px; margin-bottom: 22px; }
  .page-hero h1 { font-size: clamp(46px, 14vw, 64px); line-height: 0.98; margin-bottom: 22px; }
  .page-hero .lede { font-size: 16px; line-height: 1.6; }
  .page-hero-actions .btn { width: 100%; justify-content: center; }
  .page-hero-proof { display: grid; gap: 8px; }
  section { padding: 72px 20px; }
  .section-header { margin-bottom: 48px; }
  .section-title { font-size: clamp(38px, 12vw, 52px); }
  footer { padding: 60px 20px 28px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  input, select, textarea { font-size: 16px !important; }
  .btn, .nav-cta, .loc-seg a, .loc-seg button { min-height: 44px; }
  .prose { overflow-wrap: anywhere; }
  .prose table, .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

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

/* ────────── HR ────────── */
.rule {
  height: 1px;
  background: var(--line);
  max-width: 1280px;
  margin: 0 auto;
}
