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

:root {
  /* COLOR PALETTE & BRAND SHINE (Midnight crimson theme) */
  --color-bg: #1A1A1E;
  --color-bg-alt: #141418;
  --color-bg-card: #2A2B32;
  --color-card-light: #FFFFFF;
  --color-text: #EDEDEF;
  --color-text-muted: #A6A6A9;
  --color-text-on-primary: #FFFFFF;
  --color-border: #3A3A45;
  --color-shadow: rgba(0,0,0,.6);

  --color-primary: #DC143C;       /* Deep crimson */
  --color-secondary: #8B0A2D;     /* Accent deep shade */
  --color-accent: #C0C0C0;          /* Silver */

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --shadow-elev-1: 0 4px 6px rgba(0,0,0,.25);
  --shadow-elev-2: 0 10px 15px rgba(0,0,0,.25);

  /* TYPOGRAPHY SCALE (Inter, clean geometric) */
  --font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --font-size-xs:   0.75rem;   /* captions, labels */
  --font-size-sm:   0.875rem;  /* nav links, small text */
  --font-size-base:  1rem;      /* body text */
  --font-size-md:   1.125rem;  /* lead paragraphs */
  --font-size-lg:   1.25rem;   /* sub-headings, card titles */
  --font-size-xl:   1.5rem;    /* h3 */
  --font-size-2xl:  2rem;      /* h2, section titles */
  --font-size-3xl:  2.75rem;   /* h1 desktop */
  --font-size-hero: 3.5rem;     /* hero headline */
  --line-height-tight: 1.2;
  --line-height-base:  1.6;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold:   700;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { text-decoration: underline; color: var(--color-accent); }

ul, ol { margin: 0; padding: 0; list-style: none; }

/* 1. Layout base */
.container {
  width: 100%;
  margin: 0 auto; /* MUST be centered at every breakpoint */
  padding: 0 1rem;
  box-sizing: border-box;
}

/* 2. Site header & branding */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 64px; /* NOT a fixed height */
  width: 100%;
  background: var(--color-bg);
  overflow: visible; /* for logo overflow handling */
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem; /* mobile padding as required */
  width: 100%;
}

/* Brand logo area */
.site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  overflow: hidden;
}
.site-logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.site-logo img {
  height: 44px;       /* mandatory height constraint */
  width: auto;
  max-width: 160px;   /* mandatory max width constraint */
  object-fit: contain;/* prevent overflow/distortion */
  display: block;       /* mandatory display */
}

/* Hamburger nav toggle (mobile) */
.nav-toggle-input {
  position: absolute;
  opacity: 0;           /* hidden but present for accessibility */
  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;      /* push to the right */
  padding: 0.4rem 0.6rem;
  z-index: 200;
  border-radius: 6px;
  background: rgba(0,0,0,0.45);               /* required visual on any header color */
  border: 1.5px solid rgba(255,255,255,0.7);  /* required visible border */
}
.nav-toggle-label span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #ffffff; /* ALWAYS white for hamburger bars */
  border-radius: 2px;
  transition: 0.2s ease;
}
.site-nav {
  display: none; /* mobile collapsed by default */
  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-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}
.nav-link {
  display: block;
  padding: 0.75rem 1rem;
  font-size: var(--font-size-xs); /* mobile must be small */
  color: var(--color-text);
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-link:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
  text-decoration: underline;
}
.nav-item { list-style: none; }

/* Dropdown in nav (root level) */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  color: var(--color-text);
  padding: 0.5rem 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,.25);
  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-specific adjustments for dropdown inside mobile nav */
@media (max-width: 767px) {
  .nav-dropdown-menu {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
  }
  .nav-dropdown:focus-within > .nav-dropdown-menu {
    display: block;
  }
}

/* Hero block */
.hero {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 50vh;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, rgba(0,0,0,.25), rgba(0,0,0,.0)),
              linear-gradient(135deg, rgba(220,20,60,.25), rgba(0,0,0,0)) ,
              var(--color-primary);
  color: #fff;
}
.hero h1 {
  font-size: var(--font-size-hero);
  line-height: var(--line-height-tight);
  margin: 0;
}
.hero .cta {
  margin-top: 1rem;
}

/* Sections */
.section {
  padding: 2rem 0;
}
.section-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin: 0 0 1rem;
  color: #fff;
}
.section + .section { margin-top: 1rem; }

/* Cards & grids */
.card {
  display: flex;
  flex-direction: column; /* MANDATORY */
  background: var(--color-card-light);
  color: var(--color-text);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-elev-1), var(--shadow-elev-2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0,0,0,.28), 0 2px 4px rgba(0,0,0,.22);
}
.card img {
  width: 100%; 
  aspect-ratio: 16/9;
  object-fit: cover;  /* mandatory: rectangle, no distortion */
  display: block;
  /* top corners rounded to match card radius on supported browsers */
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}
.card-content {
  padding: 1rem;
}
.card-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  margin: 0 0 0.25rem;
}
.card-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.card-grid > .card { /* ensure grid items look consistent */
  min-width: 0;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: transform 0.2s ease, filter 0.2s ease;
  text-align: center;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover {
  filter: brightness(0.92);
}
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover {
  background: rgba(255,255,255,.04);
}

/* Footer */
.site-footer {
  background: #0b0b0f;
  color: var(--color-text);
  padding: 2rem 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}
.footer-inner a { color: var(--color-accent); }

/* FAQ Accordion (CSS-only) */
.faq-section {
  padding: 2rem 0; /* same as .section */
}
.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(0deg);
}
.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);
  line-height: var(--line-height-base);
}

/* Form elements */
input,
textarea,
select,
button,
label {
  font-family: var(--font-family);
}
input,
textarea,
select {
  background: #12131a;
  color: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  outline: none;
  transition: border-color 0.2s ease;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--color-primary);
}
label { display: block; font-size: var(--font-size-xs); color: var(--color-text-muted); margin-bottom: 0.25rem; }

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

/* Utilities */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.hidden { display: none !important; }

/* RESPONSIVE REQUIREMENTS */

/* Base styles already define mobile-first. Now adjust for tablet (≥768px) */
@media (min-width: 768px) {
  /* container centers content, max width and padding for tablet */
  .container {
    max-width: 960px;
    padding: 0 1.5rem;
    margin: 0 auto; /* essential centering at tablet */
  }

  /* Hamburger navigation hidden on tablet+; show full nav inline */
  .nav-toggle-label { display: none !important; }

  /* Nav: desktop/tablet horizontal layout */
  .site-nav {
    display: block; /* ensure it's present but in flex row context below */
    position: static;
    width: auto;
    background: transparent;
    border-top: none;
    box-shadow: none;
  }

  .nav-list {
    display: flex !important;           /* tablet/desktop horizontal */
    flex-direction: row !important;
    flex-wrap: nowrap;
    align-items: center;
    gap: 1.5rem;
    padding: 0;
    margin: 0;
  }

  .nav-link {
    font-size: var(--font-size-sm); /* tablet/desktop: small text, not larger than body */
  }

  .site-header .container {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
  }

  .hero {
    min-height: 60vh;
  }
  .hero h1 {
    font-size: var(--font-size-3xl);
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  /* Nav dropdown: desktop behaviour (hover/focus-within) */
  .nav-dropdown:hover > .nav-dropdown-menu,
  .nav-dropdown:focus-within > .nav-dropdown-menu {
    display: block;
  }

  /* Dropdown mobile adjustments overridden here are still effective due to mobile rules above */
  .nav-dropdown-menu {
    position: absolute; /* keep aligned on desktop; original system prompt uses absolute by default */
  }

  /* Ensure container always centered on tablet */
  /* (margin auto already enforced by base) */
}

/* Desktop adjustments (≥1024px) */
@media (min-width: 1024px) {
  /* Page container width and padding for large screens */
  .container {
    max-width: 1200px;
    padding: 0 2rem;
  }

  /* Hero scale for desktop */
  .hero {
    min-height: 70vh;
  }
  .hero h1 {
    font-size: var(--font-size-hero);
  }

  /* Typography tweaks for desktop emphasis */
  h1 { font-weight: var(--font-weight-bold); color: #fff; }
  .section { padding: 4rem 0; }
  .section-title { color: #fff; }

  /* Ensure nav remains horizontal when wide */
  .nav-list { gap: 1.75rem; }

  /* Card grid density on desktop */
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

  /* Footer layout */
  .footer-inner { flex-direction: row; align-items: center; justify-content: space-between; text-align: left; }
}