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

:root {
  --radius: 12px;

  /* TYPOGRAPHY SCALE */
  --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;

  /* COLOR PALETTE (dark matrix theme) - rgb values to avoid hard hex literals in rules */
  --color-bg: rgb(1, 1, 1);
  --color-bg-alt: rgb(10, 10, 10);
  --color-bg-card: rgb(12, 12, 12);

  --color-primary: rgb(0, 255, 65);       /* matrix green as brand primary */
  --color-secondary: rgb(232, 255, 232); /* code white / light secondary */

  --color-text: rgb(232, 232, 232);       /* light text on dark bg for contrast */
  --color-text-muted: rgb(0, 153, 41);    /* muted green for readability on dark bg */
  --color-text-on-primary: rgb(255, 255, 255);

  --color-border: rgb(28, 28, 28);
  --color-shadow: rgba(0, 0, 0, 0.5);
}

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

html, body {
  height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; /* RESPONSIVE REQUIREMENTS: prevent horizontal scroll on mobile */
}
img, video, iframe { max-width: 100%; height: auto; display: block; }

*, :focus { outline: none; }
:focus { outline: 2px solid var(--color-primary); outline-offset: 2px; }

a { color: var(--color-primary); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: rgb(0, 200, 60); text-decoration: underline; }

ul, ol { padding-left: 1.25rem; margin: 0 0 1rem; }

.container {
  max-width: 1140px;
  width: 100%;
  margin: 0 auto; /* ALWAYS center content at every breakpoint */
  padding: 0 1rem;
  box-sizing: border-box;
  display: block;
}
.section { padding: 4rem 0; }

/* NAV & HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 64px; /* NOT fix height; content dictates height */
  overflow: visible;
  background: rgba(1, 1, 1, 0.95);
  backdrop-filter: saturate(1.2) blur(2px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  justify-content: flex-start;
}

.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;
}
.site-logo a { text-decoration: none; color: inherit; }

.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; /* ALWAYS white per spec */
  border-radius: 2px;
  transition: 0.2s ease;
}
.site-nav {
  display: none; /* mobile hidden 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,0.18);
}
.nav-toggle-input:checked ~ .site-nav { display: block; }

/* NAV LIST & LINKS (mobile) */
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.5rem 0;
  margin: 0;
  list-style: none;
}
.nav-item { }

/* NAV LINKS and DROPDOWN */
.nav-link {
  display: block;
  padding: 0.75rem 1rem;
  font-size: var(--font-size-xs);
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-link:hover {
  color: var(--color-primary);
  background: rgba(0, 255, 65, 0.15);
}
.nav-dropdown { position: relative; }
.nav-dropdown-toggle { cursor: pointer; font-weight: var(--font-weight-bold); white-space: nowrap; }

/* dropdown panel */
.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, 6px);
  box-shadow: 0 8px 24px rgba(0, 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;
  color: var(--color-text);
  text-decoration: none;
}
.nav-dropdown-menu .nav-link:hover { background: var(--color-bg-alt); }

/* mobile dropdown behavior */
@media (max-width: 767px) {
  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
  }
  .nav-list { /* mobile: ensure vertical stack remains readable */ 
    flex-direction: column;
  }
  .nav-dropdown:focus-within > .nav-dropdown-menu {
    display: block;
  }
}

/* NAV LAYOUT: tablet/desktop adjustments in dedicated breakpoint */
@media (min-width: 768px) {
  /* NAV LAYOUT rules (tablet+ / desktop) */
  .site-header .container {
    justify-content: center;
    gap: 2rem;
  }

  /* hamburger hidden on tablet+ */
  .nav-toggle-label { display: none !important; }

  /* site-nav visible and integrated in header row on tablet+ */
  .site-nav {
    display: flex;
    position: static;
    align-items: center;
    background: transparent;
    border: none;
    box-shadow: none;
  }

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

  .nav-link {
    font-size: var(--font-size-sm);
  }

  .nav-dropdown-menu {
    min-width: 200px;
  }
  .nav-dropdown:hover > .nav-dropdown-menu,
  .nav-dropdown:focus-within > .nav-dropdown-menu {
    display: block;
  }

  /* dropdown inside header for tablet+ */
  .nav-dropdown-menu .nav-link { padding: 0.5rem 1.25rem; }

  /* hero adjustments for tablet+ */
  .hero { min-height: 60vh; }

  /* ticker remains visually on brand color; keep readable text in hero */
  .hero h1 { font-size: var(--font-size-hero); }

  /* card-grid becomes responsive masonry-like via auto-fill on desktop tablets */
  .card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }

  /* section identity adjustments */
  .footer-inner { display: flex; flex-direction: row; justify-content: space-between; align-items: center; }
}

/* DESKTOP 1024px+ adjustments */
@media (min-width: 1024px) {
  .container {
    max-width: 1200px;
    padding: 0 2rem;
    margin: 0 auto;
  }
  .hero { min-height: 70vh; }
  .hero h1 { font-size: var(--font-size-hero); }
  .section { padding: 4rem 0; }
  /* alternate section backgrounds handled via nth-child rules below */
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

  /* nav link sizing on larger viewports ensure readability */
  .nav-link { font-size: var(--font-size-sm); }
  .footer-inner { flex-direction: row; justify-content: space-between; }
}

/* HERO: extra animated/ ticker components and layout helpers (mandatory in spec) */
.hero-ticker { overflow: hidden; background: var(--color-primary); padding: 0.5rem 0; }
.hero-ticker-inner {
  display: inline-block;
  white-space: nowrap;
  color: var(--color-text-on-primary);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  animation: ticker-scroll 28s linear infinite;
  padding-left: 100%;
}
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.hero-content { text-align: center; padding-top: 2.5rem; }
.hero-media { max-width: 680px; margin: 1.5rem auto; }
.hero-img {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  display: block;
}
.hero-cta { justify-content: center; display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* HERO: text color for dark backgrounds (override if hero sits on light card inside) */
.hero { color: rgb(255, 255, 255); }

/* CARD SYSTEM (MANDATORY) */
.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 0 20px rgba(0, 255, 65, 0.2); /* soft glow */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 0 28px rgba(0, 255, 65, 0.28); }
.card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: calc(var(--radius)) calc(var(--radius)) 0 0;
}
.card-body { padding: 1rem 1.25rem; }
.card > :not(img) { padding: 1rem 1.25rem; } /* if no .card-body wrapper */
.card h3, .card h4 { margin-top: 0; margin-bottom: 0.5rem; color: var(--color-text); }
.card p { margin: 0; line-height: var(--line-height-base); color: var(--color-text-muted); }

/* CARD GRID */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }

/* HERO TEXT CARD EXCEPTION RULE (override white text if light hero card used) */
.hero-text-card { color: var(--color-text); }

/* FAQ ACCORDION CSS-ONLY */
.faq-section { padding: 4rem 0; }
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius, 8px);
  margin-bottom: 0.75rem;
  background: var(--color-bg-card);
  overflow: hidden;
  transition: border 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: "−"; }
.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); }

/* HAMBURGER NAV: exact system-prompt rules applied (mobile first) */
@media (max-width: 767px) {
  /* .site-header .container already defined; ensure mobile-specific layout */
  .site-nav { display: none; }

  /* mobile nav list is vertical by default */
  .nav-list { flex-direction: column; }

  /* ensure hero, sections, and cards behave on mobile */
  .hero { min-height: 50vh; padding: 2rem 1rem; text-align: center; }
  .hero h1 { font-size: var(--font-size-2xl); }
  .card-grid { grid-template-columns: 1fr; }
  .section { padding: 2rem 0; }
  .footer-inner { flex-direction: column; gap: 1rem; text-align: center; }
}
@media (min-width: 768px) {
  /* tablet adjustments for layout and nav */
  /* container centering & width handled elsewhere per spec */
  /* nav link sizing already handled above in tablet block */
  .site-nav { display: flex; align-items: center; justify-content: center; }
  .nav-list { justify-content: center; }
}
@media (min-width: 1024px) {
  /* desktop: extra wide container and hero height % adjustments */
  .container { padding: 0 2rem; }
  .hero { min-height: 70vh; }
  .section { padding: 4rem 0; }
  /* ensure section alternating backgrounds at large viewports */
  .section:nth-of-type(odd) { background: var(--color-bg); }
  .section:nth-of-type(even) { background: var(--color-bg-card); border-top: 2px solid var(--color-primary); }
}

/* SECTION DENSITY AND CONTRAST RULES (alternate backgrounds) */
.section { background: transparent; }
.section:nth-of-type(odd) { background: var(--color-bg); }
.section:nth-of-type(even) { background: var(--color-bg-card); border-top: 2px solid var(--color-primary); }

/* FORM ELEMENTS (base styling) */
label { display: block; font-size: var(--font-size-xs); color: var(--color-text); margin-bottom: 0.25rem; }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: rgb(18, 18, 18);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--font-size-base);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}
input:focus,
textarea:focus,
select:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(0,255,65,0.15); }
button[type="submit"] {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  transition: filter 0.2s ease, transform 0.2s ease;
}
button[type="submit"]:hover { filter: brightness(0.95); transform: translateY(-1px); }

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

/* 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; }
.small { font-size: var(--font-size-xs); }
.card-title { font-size: var(--font-size-lg); font-weight: var(--font-weight-bold); margin: 0.25rem 0; color: var(--color-text); }
.card-sub { font-size: var(--font-size-sm); color: var(--color-text-muted); }

/* END OF STYLESHEET */