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

:root {
  /* COLOR PALETTE (Dark, bold brand mood for 666D) */
  --color-bg: #0A0A0A;
  --color-bg-alt: #0F0F0F;
  --color-bg-card: #141414;
  --color-border: #2A2A2A;
  --color-shadow: rgba(0,0,0,0.6);

  --color-text: #E8E8E8;          /* DARK BG text: bright for contrast */
  --color-text-muted: #A0A0A0;     /* Muted text on dark bg */
  --color-text-on-primary: #111111;/* Text on primary (EAB308 is light) */

  --color-primary: #EAB308;        /* Electric yellow brand color */
  --color-secondary: #1A1A1A;

  --radius: 12px;

  /* TYPOGRAPHY SCALE (Inter) */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  --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;
  
  /* Utility (shadow) */
  --color-bg-gradient: linear-gradient(135deg, rgba(234,179,8,0.15), rgba(0,0,0,0.15));
  --shadow-strong: 0 6px 20px rgba(0,0,0,.25);
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* TYPOGRAPHY (h1–h4, p, a, strong, em, lists) */
h1, h2, h3, h4 { margin: 0 0 0.5rem 0; font-weight: var(--font-weight-bold); color: var(--color-text); }
h1 { font-size: var(--font-size-3xl); line-height: var(--line-height-tight); }
h2 { font-size: var(--font-size-2xl); line-height: var(--line-height-tight); }
h3 { font-size: var(--font-size-xl); line-height: var(--line-height-base); }
h4 { font-size: var(--font-size-lg); line-height: var(--line-height-base); }
p { font-size: var(--font-size-base); line-height: var(--line-height-base); margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: var(--font-weight-bold); }
em { font-style: italic; }
ul, ol { padding-left: 1.25rem; margin: 0 0 1rem 0; }
li { margin: 0.25rem 0; }

/* LAYOUT UTILITIES & BASE STRUCTURE */
.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

.section { padding: 2rem 0; }
.section-title { font-size: var(--font-size-2xl); margin: 0 0 0.75rem; }

/* HERO (full-width, bold, centered) */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1rem;
  min-height: 50vh;
  color: #fff;
  background: linear-gradient(135deg, rgba(234,179,8,0.15) 0%, rgba(0,0,0,0.5) 100%), var(--color-bg);
  background-blend-mode: overlay;
  /* gradient/brand color emphasis suitable for dark bg */
  background-attachment: fixed;
}
.hero h1 { color: #fff; }

/* CARD COMPONENTS */
.card {
  display: flex;
  flex-direction: column; /* MANDATORY per spec */
  border-radius: var(--radius);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-strong);
  overflow: hidden;
}
.card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block; /* MANDATORY: ensures rectangle images */
}
.card-content { padding: 1rem; }

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

/* BUTTONS */
.btn { display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 1rem; border-radius: 999px; border: none;
  font-size: var(--font-size-sm); font-weight: var(--font-weight-bold);
  text-decoration: none; cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-on-primary);
}
.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  padding: 0.65rem 1rem;
}
.btn:hover { transform: translateY(-1px); filter: brightness(0.98); }

/* SITE HEADER + NAV (sticky, top, responsive, hamburger) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 64px; /* DO NOT set a fixed height */
  overflow: visible;
  background: var(--color-bg);
  box-shadow: 0 1px 6px rgba(0,0,0,0.25);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem; /* mobile padding */
  width: 100%;
}
.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; /* MANDATORY: prevent overflow */
}

/* Mobile nav toggle (checkbox) */
.nav-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* Hamburger label (3 bars) */
.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); /* required per spec */
}
.nav-toggle-label span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #ffffff; /* ALWAYS white bars */
  border-radius: 2px;
  transition: 0.2s ease;
}

/* Mobile navigation panel (dropdown from header) */
.site-nav {
  display: none;
  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; }

/* Mobile nav list */
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.5rem 0;
  margin: 0;
  list-style: none;
}
.nav-link {
  display: block;
  padding: 0.75rem 1rem;
  font-size: var(--font-size-xs); /* mobile: small text */
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  position: relative;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.05); }

/* Underline slide effect for nav links (hover) */
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--color-primary);
  transition: width 0.2s ease;
}
.nav-link:hover::after { width: 100%; }

/* Focus styling (accessibility) */
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* Dropdown nav (desktop/tablet) */
.nav-dropdown { position: relative; }

/* Trigger for dropdown in nav (label) */
.nav-dropdown-toggle { cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; padding: 0.5rem 0.75rem; }

/* 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);
  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; }

/* Dropdown items in panel (desktop) */
.nav-dropdown-menu .nav-link {
  display: block;
  padding: 0.5rem 1rem;
  width: 100%;
  border-bottom: none;
}
.nav-dropdown-menu .nav-link:hover { background: var(--color-bg-alt); }

/* Tablet/Desktop adjustments for dropdown (explicitly ensure horizontal nav layout) */
@media (min-width: 768px) {
  /* Hide hamburger on tablet/desktop */
  .nav-toggle-label { display: none; }

  /* Show desktop nav inline, in header row */
  .site-nav { display: flex; position: static; width: auto; background: transparent; border-top: none; box-shadow: none; }

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

  /* Desktop nav link sizing */
  .nav-link {
    font-size: var(--font-size-sm); /* tablet/desktop: small text, not headings */
    padding: 0.4rem 0.75rem;
    border-bottom: none;
    white-space: nowrap;
  }

  /* Dropdown behavior: always-on hover/focus for desktop */
  .nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
  }

  /* Dropdown panel visuals on tablet/desktop */
  .nav-dropdown-menu { background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); }
  .nav-dropdown:hover > .nav-dropdown-menu { display: block; }
  .nav-dropdown:focus-within > .nav-dropdown-menu { display: block; }

  /* Mobile-like dropdown adjustments on tablet/desktop (indented feel) */
  .site-header .container { padding: 0 1.5rem; }
  .container { margin: 0 auto; } /* ensure centering at all breakpoints (redundant but explicit) */

  /* Card grid adjustments on tablet/desktop */
  .hero { min-height: 60vh; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .section { padding: 3rem 0; }

  /* Ensure the container remains centered across breakpoints */
  .container { margin: 0 auto; max-width: 960px; padding: 0 1.5rem; }
  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
  .section-title { font-size: var(--font-size-2xl); }
  .nav-link { color: var(--color-text); }
}

/* Desktop adjustments (1024px+) */
@media (min-width: 1024px) {
  .container { max-width: 1200px; padding: 0 2rem; }
  .hero { min-height: 70vh; }
  .hero h1 { font-size: var(--font-size-hero); }
  .section { padding: 4rem 0; }
  .card-grid { gap: 1.75rem; }
  .footer-inner { flex-direction: row; justify-content: space-between; }
}

/* FORMS (inputs, textarea, select, label, button[type=submit]) */
input,
textarea,
select {
  font-family: inherit;
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: #111;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  width: 100%;
}
textarea { min-height: 120px; resize: vertical; }

/* Labels */
label { display: block; margin-bottom: .25rem; font-size: var(--font-size-sm); color: var(--color-text); }

/* Submit button specificity */
button[type="submit"] { cursor: pointer; }

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

/* UTILITIES */
.text-center { text-align: center; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.hidden { display: none !important; }