/* =========================
   THEME TOKENS
   ========================= */

:root {

  /* Dark (default) */

  --bg: #0b1324;

  --bg2: #101f3f;



  --panel: #0f1a33;

  --panelStrong: rgba(15, 26, 51, 0.95);

  --panelSoft: rgba(15, 26, 51, 0.60);

  --cardBg: rgba(15, 26, 51, 0.55);



  --text: #e6edf3;

  --muted: #cbd5e1;

  --muted2: #9aa7bd;



  --line: #1f2a44;



  --accent: #8fbaff;

  --accent2: #4ea1ff;



  --btnTextOnGrad: #07101f;



  --shadowCard: rgba(0, 0, 0, 0.40);

  --shadowGlow: rgba(78, 161, 255, 0.35);



  /* Background glows */

  --glow1: rgba(78, 161, 255, 0.22);

  --glow2: rgba(143, 186, 255, 0.14);

  --heroGlow: rgba(78, 161, 255, 0.25);



  color-scheme: dark;

}



/* Light theme override */

:root[data-theme="light"] {

  --bg: #f6f8fc;

  --bg2: #ffffff;



  --panel: #ffffff;



  /* Fully opaque so content stays crisp */

  --panelStrong: rgba(255, 255, 255, 1);

  --panelSoft: rgba(255, 255, 255, 1);

  --cardBg: rgba(255, 255, 255, 1);



  --text: #0b1324;

  --muted: #334155;

  --muted2: #475569;



  --line: #d7e0ec;



  --accent: #2563eb;

  --accent2: #1d4ed8;



  --btnTextOnGrad: #ffffff;



  --shadowCard: rgba(2, 6, 23, 0.14);

  --shadowGlow: rgba(37, 99, 235, 0.25);



  --glow1: rgba(37, 99, 235, 0.10);

  --glow2: rgba(37, 99, 235, 0.06);

  --heroGlow: rgba(37, 99, 235, 0.12);



  color-scheme: light;

}



/* Optional: make theme switching feel smooth */

* {

  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;

}



/* =========================
   BASE / LAYOUT
   ========================= */

/* Prevent horizontal scroll on mobile from glows/blurred elements */

html,

body {

  overflow-x: hidden;

}



/* Background fills full page (DARK default) */

html {

  min-height: 100%;

  background:

    radial-gradient(900px 520px at 12% 5%, var(--glow1) 0%, rgba(0, 0, 0, 0) 60%),

    radial-gradient(700px 420px at 78% 10%, var(--glow2) 0%, rgba(0, 0, 0, 0) 62%),

    radial-gradient(1100px 620px at 20% 0%, var(--bg2) 0%, var(--bg) 58%) no-repeat,

    var(--bg);

}

/* ✅ FIX (correct selector): in light mode, remove the glow stack so it doesn’t look grey */
:root[data-theme="light"] {

  background: var(--bg);

}



body {

  margin: 0;

  min-height: 100vh;

  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;

  color: var(--text);

  background: transparent;

}



.container {

  width: min(1100px, 92%);

  margin: 0 auto;

}



/* =========================
   HEADER
   ========================= */

.site-header {

  background: var(--panelStrong);

  border-bottom: 1px solid var(--line);

  position: sticky;

  top: 0;



  /* Safari/iOS support */

  -webkit-backdrop-filter: blur(8px);

  backdrop-filter: blur(8px);



  z-index: 50;

}



.header-bar {

  display: flex;

  justify-content: space-between;

  align-items: center;

  padding: 14px 0;

  gap: 14px;

  /* helps when wrapping */

  flex-wrap: wrap;

  /* key fix for mobile */

}



.brand {

  display: flex;

  gap: 12px;

  text-decoration: none;

  color: var(--text);

  align-items: center;

  min-width: 220px;

  /* avoids logo crushing */

}



.logo-img {

  height: 42px;

  width: auto;

  border-radius: 6px;

  transition: transform .2s ease, box-shadow .2s ease;

}



.logo-img:hover {

  transform: scale(1.05);

  box-shadow: 0 8px 20px var(--shadowGlow);

}



.brand-name {

  font-weight: 600;

}



.brand-tag {

  font-size: 0.8rem;

  color: var(--muted2);

}



/* =========================
   NAV
   ========================= */

.nav {

  display: flex;

  gap: 12px;

  flex-wrap: wrap;

  /* key fix */

  justify-content: flex-end;

  align-items: center;

}



.nav-link {

  color: var(--muted);

  text-decoration: none;

  padding: 8px 12px;

  border-radius: 10px;

  transition: all .18s ease;

  white-space: nowrap;

  /* keeps each link tidy */

}



.nav-link:hover {

  background: rgba(143, 186, 255, 0.15);

  color: var(--text);

  transform: translateY(-1px);

}



/* Light theme needs a softer hover background */

:root[data-theme="light"] .nav-link:hover {

  background: rgba(37, 99, 235, 0.08);

}



.nav-link.is-active {

  background: rgba(143, 186, 255, 0.2);

  color: var(--text);

}



:root[data-theme="light"] .nav-link.is-active {

  background: rgba(37, 99, 235, 0.12);

}



/* Theme toggle button (we’ll add the HTML next step) */

.theme-toggle {

  border: 1px solid var(--line);

  background: rgba(255, 255, 255, 0.04);

  color: var(--text);

  border-radius: 10px;

  padding: 8px 10px;

  cursor: pointer;

  font-weight: 600;

  display: inline-flex;

  align-items: center;

  gap: 8px;

  -webkit-user-select: none;

  /* Safari/iOS */

  user-select: none;

}



:root[data-theme="light"] .theme-toggle {

  background: rgba(2, 6, 23, 0.03);

}



.theme-toggle:hover {

  transform: translateY(-1px);

  box-shadow: 0 10px 24px var(--shadowCard);

}



.theme-toggle:focus {

  outline: 2px solid rgba(78, 161, 255, 0.35);

  outline-offset: 2px;

}



:root[data-theme="light"] .theme-toggle:focus {

  outline: 2px solid rgba(37, 99, 235, 0.25);

}



/* =========================
   HERO
   ========================= */

.hero {

  position: relative;

  padding: 60px 0 30px;

  isolation: isolate;

  /* prevents blur/glow weirdness */

}



.hero-inner {

  display: grid;

  grid-template-columns: 1.2fr 0.8fr;

  gap: 30px;

}



.hero::before {

  content: "";

  position: absolute;

  width: 600px;

  height: 600px;

  top: -200px;

  left: -150px;

  background: radial-gradient(circle, var(--heroGlow), transparent 70%);

  filter: blur(80px);

  z-index: -1;

  pointer-events: none;

}



.eyebrow {

  color: var(--accent);

  font-weight: 700;

  font-size: 0.8rem;

  letter-spacing: .1em;

  text-transform: uppercase;

}



h1 {

  margin: 12px 0;

  font-size: clamp(1.85rem, 4.6vw, 2.6rem);

  line-height: 1.2;

}



.lede {

  color: var(--muted);

  max-width: 600px;

}



.cta-row {

  margin: 18px 0;

  display: flex;

  gap: 12px;

  flex-wrap: wrap;

  /* key fix */

}



/* =========================
   BUTTONS
   ========================= */

.btn {

  padding: 10px 16px;

  border-radius: 10px;

  text-decoration: none;

  font-weight: 600;

  transition: all .18s ease;

  display: inline-flex;

  align-items: center;

  justify-content: center;

}



.btn-primary {

  background: linear-gradient(135deg, var(--accent2), var(--accent));

  color: var(--btnTextOnGrad);

}



.btn-primary:hover {

  transform: translateY(-2px);

  box-shadow: 0 12px 30px rgba(78, 161, 255, .35);

}



:root[data-theme="light"] .btn-primary:hover {

  box-shadow: 0 12px 30px rgba(37, 99, 235, .22);

}



.btn-ghost {

  border: 1px solid rgba(143, 186, 255, .35);

  color: var(--text);

}



:root[data-theme="light"] .btn-ghost {

  border: 1px solid rgba(37, 99, 235, 0.30);

}



.btn-ghost:hover {

  background: rgba(143, 186, 255, .15);

  transform: translateY(-2px);

}



:root[data-theme="light"] .btn-ghost:hover {

  background: rgba(37, 99, 235, 0.08);

}



/* =========================
   PANEL
   ========================= */

.hero-panel {

  background: var(--panelSoft);

  border: 1px solid var(--line);

  border-radius: 16px;

  padding: 18px;

}



.panel-title {

  font-weight: 700;

  margin-bottom: 10px;

}



.panel-list {

  list-style: disc;

  padding-left: 18px;

  margin: 0;

}



/* =========================
   CARDS / SECTIONS
   ========================= */

.section {

  padding: 40px 0 70px;

}



.grid {

  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 16px;

  margin-top: 18px;

}



.card {

  background: var(--cardBg);

  border: 1px solid var(--line);

  border-radius: 14px;

  padding: 16px;

  transition: all .18s ease;

  cursor: pointer;

}



.card:hover {

  transform: translateY(-6px);

  box-shadow: 0 18px 50px var(--shadowCard);

  border-color: rgba(143, 186, 255, .4);

}



:root[data-theme="light"] .card:hover {

  border-color: rgba(37, 99, 235, 0.25);

}



.card p {

  color: var(--muted);

}



/* =========================
   RESOURCES / GUIDE CARDS
   (fixed bubble size + text clamp + remove underline)
   ========================= */

/* make the whole card clickable link behave like a block (Resources page) */

a.card-link {

  display: block;

  height: 100%;

  color: inherit;

  text-decoration: none;

}



a.card-link:visited,

a.card-link:hover,

a.card-link:active {

  color: inherit;

  text-decoration: none;

}



/* kill underline on any nested links/text inside the clickable card */

a.card-link *,

a.card-link *:visited,

a.card-link *:hover,

a.card-link *:active {

  text-decoration: none !important;

  color: inherit;

}



/* fixed "bubble" height and keep content contained */

a.card-link .card,

.grid .card {

  min-height: 210px;

  /* set bubble size */

  display: flex;

  /* allows CTA to sit at bottom */

  flex-direction: column;

  overflow: hidden;

  /* prevents content poking out */

}



/* tidy margins inside cards so the height stays predictable */

.card h3 {

  margin: 0 0 10px;

}



.card p {

  margin: 0 0 12px;

}



/* clamp title + body text so it never overflows the bubble */

.card h3 {

  display: -webkit-box;

  -webkit-box-orient: vertical;

  -webkit-line-clamp: 2;

  line-clamp: 2;

  /* max 2 lines for title */

  overflow: hidden;

  text-overflow: ellipsis;

}



.card p {

  display: -webkit-box;

  -webkit-box-orient: vertical;

  -webkit-line-clamp: 4;

  line-clamp: 4;

  /* max 4 lines for paragraph */

  overflow: hidden;

  text-overflow: ellipsis;

}



/* CTA sits at the bottom and stays neat */

.card .card-cta {

  margin-top: auto;

  color: var(--accent);

  font-weight: 600;



  display: -webkit-box;

  -webkit-box-orient: vertical;

  -webkit-line-clamp: 1;

  line-clamp: 1;

  /* keep it one line */

  overflow: hidden;

  text-overflow: ellipsis;

}



a.card-link:focus {

  outline: 2px solid rgba(78, 161, 255, 0.35);

  outline-offset: 4px;

}



:root[data-theme="light"] a.card-link:focus {

  outline: 2px solid rgba(37, 99, 235, 0.25);

}



/* =========================
   FOOTER
   ========================= */

.site-footer {

  border-top: 1px solid var(--line);

  padding: 20px 0;

  background: transparent;

}



.footer-inner {

  display: flex;

  justify-content: space-between;

  flex-wrap: wrap;

  gap: 10px;

  color: var(--muted2);

}



/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 900px) {

  .hero-inner {

    grid-template-columns: 1fr;

  }



  .grid {

    grid-template-columns: 1fr;

  }



  .hero {

    padding: 44px 0 22px;

  }



  /* slightly taller cards on mobile so clamped text doesn’t feel cramped */

  a.card-link .card,

  .grid .card {

    min-height: 220px;

  }

}



/* Extra small screens */

@media (max-width: 520px) {

  .logo-img {

    height: 36px;

  }



  .brand {

    min-width: 0;

  }



  .nav {

    justify-content: flex-start;

  }



  .nav-link {

    padding: 8px 10px;

  }



  .btn {

    width: 100%;

  }

}



/* =========================
   FORM CONTROLS (GLOBAL)
   Fix native select dropdown readability in dark mode
   ========================= */

/* Ensure the control itself uses your theme tokens */
select,
input,
textarea {
  color: var(--text);
  background: var(--cardBg);
  border: 1px solid var(--line);
}

/* Improve the opened dropdown list colours where the browser allows it */
select option,
select optgroup {
  background: var(--panel);
  color: var(--text);
}

/* Light theme for the same controls */
:root[data-theme="light"] select,
:root[data-theme="light"] input,
:root[data-theme="light"] textarea {
  background: var(--cardBg);
  color: var(--text);
  border: 1px solid var(--line);
}

:root[data-theme="light"] select option,
:root[data-theme="light"] select optgroup {
  background: var(--panel);
  color: var(--text);
}

/* =========================
   CONTACT FORM
   ========================= */

.contact-note {

  margin-top: 10px;

  color: var(--muted2);

}



.contact-form {

  max-width: 640px;

}



.form-grid {

  display: grid;

  gap: 14px;

}



.field label {

  display: block;

  margin: 10px 0 8px;

  font-weight: 600;

}



.req {

  color: var(--accent);

}



.contact-form input,

.contact-form textarea {

  width: 100%;

  box-sizing: border-box;

  padding: 10px 12px;

  border-radius: 10px;

  border: 1px solid var(--line);

  background: var(--cardBg);

  color: var(--text);

  font-family: inherit;

  font-size: 1rem;

  outline: none;

}



.contact-form textarea {

  resize: vertical;

  /* keeps width aligned */

  min-height: 160px;

}



.contact-form input::placeholder,

.contact-form textarea::placeholder {

  color: rgba(203, 213, 225, 0.55);

}



:root[data-theme="light"] .contact-form input::placeholder,

:root[data-theme="light"] .contact-form textarea::placeholder {

  color: rgba(71, 85, 105, 0.65);

}



.form-status {

  margin-top: 10px;

  color: var(--muted2);

}



.form-status.warn {

  color: var(--accent);

}



/* Fix Chrome autofill background/colour */

.contact-form input:-webkit-autofill,

.contact-form textarea:-webkit-autofill,

.contact-form input:-webkit-autofill:hover,

.contact-form textarea:-webkit-autofill:hover,

.contact-form input:-webkit-autofill:focus,

.contact-form textarea:-webkit-autofill:focus {

  -webkit-text-fill-color: var(--text) !important;

  caret-color: var(--text);

  transition: background-color 999999s ease-in-out 0s;

  box-shadow: 0 0 0px 1000px var(--cardBg) inset !important;

  border: 1px solid var(--line);

}