@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700;800;900&display=swap');

:root {
  --font-family: 'Montserrat', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  --radius: 12px;
  --gap: 1.5rem;

  /* Color palette (Dark midnight foundation) */
  --color-bg: #04080F;
  --color-bg-alt: #040A14;
  --color-bg-card: rgba(255, 255, 255, 0.05);
  --color-primary: #2B7FFF;
  --color-secondary: #7F8FA3;
  --color-accent: #C0C8D8;

  --color-text: #FFFFFF;
  --color-text-muted: #A0A6B7;
  --color-text-on-primary: #1A1A1A;
  --color-border: rgba(192, 200, 216, 0.35);
  --color-shadow: rgba(0, 0, 0, 0.5);

  /* Typography scale (mandatory) */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-md: 1.125rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 2.75rem;
  --font-size-hero: 3.5rem;

  --line-height-tight: 1.2;
  --line-height-base: 1.6;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
  --container-max: 880px;
}

@media (min-width: 768px) {
  :root {
    --container-max: 960px;
  }
}
@media (min-width: 1024px) {
  :root {
    --container-max: 1200px;
  }
}

/* Global resets / base */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  font-family: var(--font-family);
  font-weight: var(--font-weight-normal);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: var(--line-height-base);
  overflow-x: hidden;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* Typography */
h1, h2, h3, h4 { color: var(--color-text); margin: 0 0 0.25rem; font-weight: 700; }
h1 { font-size: var(--font-size-hero); line-height: var(--line-height-tight); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
p { font-size: var(--font-size-base); margin: 0 0 1rem; color: var(--color-text); }
a { color: var(--color-primary); text-decoration: none; transition: color 0.2s ease; }
a:hover { text-decoration: underline; }
strong { font-weight: var(--font-weight-bold); }

/* Layout utilities and sections */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto; /* mandatory: center content at all breakpoints */
  padding: 0 1rem;
}
.section {
  padding: 5rem 0; /* spacious editorial density */
  background: var(--color-bg);
}
.section-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 0.75rem;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
}
.card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,.35); }
.card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-body { padding: 1rem 1.25rem; } /* essential wrapper for padding */
.card h3, .card h4 { margin-top: 0; margin-bottom: 0.5rem; }
.card p { margin: 0; line-height: var(--line-height-base); color: var(--color-text-muted); }

/* Glassmorphism card content without .card-body wrapper: ensure breathing room for non-img children */
.card > :not(img) { padding: 1rem 1.25rem; }

/* FAQ accordion (CSS-only) */
.faq-section { padding: 5rem 0; background: var(--color-bg); }
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  background: var(--color-bg-card);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.faq-item[open] { border-color: var(--color-primary); box-shadow: 0 2px 12px var(--color-shadow); }
.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-md);
  list-style: none;
  user-select: none;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
  content: "+";
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--color-primary);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.faq-item[open] > .faq-question::after { content: "−"; transform: rotate(0.25turn); }
.faq-answer {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--color-border);
}
.faq-answer p { margin: 0.75rem 0 0; color: var(--color-text-muted); }

/* Hamburger nav (CSS-only) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 64px;
  overflow: visible;
  background: var(--color-bg);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
}
.site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  overflow: hidden;
  max-height: 52px;
  text-decoration: none;
}
.site-logo img {
  height: 44px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}
.nav-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.nav-toggle-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  margin-left: auto;
  padding: 0.4rem 0.6rem;
  z-index: 200;
  border-radius: 6px;
  background: rgba(0,0,0,0.45);
  border: 1.5px solid rgba(255,255,255,0.7);
}
.nav-toggle-label span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #ffffff;
  border-radius: 2px;
  transition: transform 0.2s ease;
}
.site-nav {
  display: none; /* mobile hidden by default; shown on toggle */
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  z-index: 500;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.nav-toggle-input:checked ~ .site-nav { display: block; }
.nav-list {
  display: flex;
  flex-direction: column; /* mobile-first: vertical */
  gap: 0;
  padding: 0.5rem 0;
  margin: 0;
  list-style: none;
}
.nav-link {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--font-size-xs);
  transition: color 0.2s ease, transform 0.2s ease;
  border-bottom: 1px solid var(--color-border);
}
.nav-link:hover { color: #FFFFFF; transform: translateX(2px); }

/* Dropdown nav inside the mobile menu */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle { cursor: pointer; white-space: nowrap; display: block; padding: 0.75rem 1rem; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  z-index: 9999;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  white-space: nowrap;
}
.nav-dropdown:hover > .nav-dropdown-menu,
.nav-dropdown:focus-within > .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-menu .nav-link {
  display: block;
  padding: 0.5rem 1.25rem;
  width: 100%;
  border-bottom: none;
}
.nav-dropdown-menu .nav-link:hover { background: var(--color-bg-alt); }

/* Mobile overrides for dropdown in mobile zone */
@media (max-width: 767px) {
  .nav-dropdown-menu { position: static; box-shadow: none; border: none; padding-left: 1rem; display: none; }
  .nav-dropdown:focus-within > .nav-dropdown-menu { display: block; }
  /* ensure nested dropdown menus are indented */
  .site-nav .nav-dropdown-menu { padding-left: 1rem; }
}
@media (min-width: 768px) {
  /* Tablet and up: show horizontal nav; keep dropdowns on hover */
  .site-nav { position: static; display: flex; align-items: center; background: transparent; border: none; box-shadow: none; }
  .nav-list { flex-direction: row !important; justify-content: flex-end; align-items: center; gap: 1.5rem; padding: 0; }
  .nav-link { font-size: var(--font-size-sm); padding: 0.25rem 0.5rem; border-bottom: none; }
  .nav-toggle-label { display: none !important; } /* hide hamburger on tablet+ */
  .site-header .container { justify-content: space-between; } /* logo-left, nav-right layout */
  .site-nav { margin-left: auto; justify-content: flex-end; }
  .nav-dropdown-menu { position: absolute; top: 100%; left: 0; }
}
@media (min-width: 1024px) {
  /* Additional desktop refinements if needed (kept minimal per spec) */
}

/* Hero section (brand-driven, diagonal variant supported) */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 1rem;
  color: var(--color-text);
  background: linear-gradient(135deg, rgba(2,8,20,0.95) 0%, rgba(2,8,20,0.92) 60%, rgba(43,127,255,0.95) 100%);
  min-height: 50vh;
  overflow: hidden;
}
.hero--diagonal {
  background: var(--color-primary);
  position: relative;
  color: #1A1A1A;
}
.hero--diagonal::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 52%;
  background: var(--color-bg);
  clip-path: polygon(8% 0, 100% 0, 100% 100%, 0 100%);
  z-index: 0;
}
.hero--diagonal .hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: 420px;
}
.hero-text { flex: 1 1 45%; }
.hero-media { flex: 1 1 48%; }
.hero-img { width: 100%; border-radius: var(--radius, 12px); object-fit: cover; max-height: 440px; display: block; }

/* .hero text inherits color unless overridden by hero background rules */
.hero h1 { font-size: var(--font-size-hero); font-weight: 900; letter-spacing: .3px; margin: 0 0 0.5rem; }
.hero p { color: var(--color-text-muted); margin: 0 0 1rem; }

/* Hero-specific responsive tweaks (basic) */
@media (max-width: 767px) {
  .hero { padding: 3rem 1rem; min-height: 60vh; }
  .hero h1 { font-size: calc(var(--font-size-hero) * 0.9); text-wrap: balance; }
  .hero--diagonal .hero-inner { flex-direction: column; padding: 0 0.5rem; }
  .hero--diagonal { min-height: 60vh; }
  .hero-text, .hero-media { flex: 1 1 auto; width: 100%; }
  .hero-img { max-height: 320px; }
}
@media (min-width: 768px) {
  .hero { min-height: 60vh; }
}

/* Section density adjustments for editorial feel on all viewports */
.section { background: var(--color-bg); }

/* Glassy cards inside editorials or feature sections */
.hero .card { /* optional: if cards appear in hero zone */ }

/* Forms (inputs, textareas, selects, labels, submit buttons) */
form, input, textarea, select, button { font-family: var(--font-family); font-weight: var(--font-weight-normal); color: var(--color-text); }
input, textarea, select {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #1A1A1A;
  width: 100%;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input::placeholder, textarea::placeholder { color: rgba(255,255,255,0.6); }
input:focus, textarea:focus, select:focus { border-color: rgba(43,127,255,0.8); box-shadow: 0 0 0 4px rgba(43,127,255,0.15); }
button {
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  border: 0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}
button:hover { filter: brightness(0.95); transform: translateY(-1px); }
.btn { display: inline-block; padding: 0.75rem 1rem; border-radius: 8px; text-decoration: none; }

/* Primary/Secondary buttons (color usage follows color-text-on-primary rule) */
.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-on-primary);
}
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn + .btn { margin-left: 0.5rem; }

/* Site footer */
.site-footer {
  background: var(--color-bg);
  padding: 2rem 0;
  color: var(--color-text-muted);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
@media (min-width: 768px) {
  .footer-inner { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* Headers and nav text accessibility */
.text-center { text-align: center; }

/* Spacing utilities (mt-*) */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

/* Hidden utility */
.hidden { display: none !important; }

/* Tables (basic) */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem; border-bottom: 1px solid var(--color-border); text-align: left; }

/* Responsive rules (base mobile-first already defined above) */
@media (min-width: 768px) {
  html, body { overflow-x: hidden; } /* ensure clean horizontal behavior on tablet/desktop */
  /* NAV LAYOUT (logo-left, nav-right) */
  .site-header .container { display: flex; justify-content: space-between; align-items: center; }
  .site-nav { display: flex !important; align-items: center; gap: 1rem; position: static; background: transparent; border-top: none; box-shadow: none; }
  .site-nav .nav-list { display: flex; flex-direction: row !important; justify-content: flex-end; gap: 1.5rem; padding: 0; margin: 0; }
  .nav-toggle-label { display: none !important; }
  .nav-link { font-size: var(--font-size-sm); padding: 0.25rem 0.5rem; }
}
@media (min-width: 1024px) {
  /* Desktop refinements (if any extra are needed) */
  .hero { min-height: 70vh; }
  .container { padding: 0 2rem; }
}