/* ==========================================================================
   Nyxlete — styles
   Dark is the default theme; light is a second variable block + toggle,
   switched via [data-theme] on <html> (see assets/js/main.js).
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg-primary: #0B0B0D;
  --bg-surface: #17171A;
  --bg-surface-2: #1E1E22;
  --accent: #E10600;
  --accent-deep: #A50000;
  --accent-glow: rgba(225, 6, 0, 0.35);
  --text-primary: #F5F5F5;
  --text-muted: #9A9A9E;
  --border: #2A2A2E;
  --header-bg: rgba(11, 11, 13, 0.92);
  --radius: 6px;
  --font-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-accent: 'Rajdhani', 'Arial Narrow', sans-serif;
  --container-width: 1180px;
}

[data-theme="light"] {
  --bg-primary: #F7F6F5;
  --bg-surface: #FFFFFF;
  --bg-surface-2: #EFEDEC;
  --accent: #E10600;
  --accent-deep: #A50000;
  --accent-glow: rgba(225, 6, 0, 0.2);
  --text-primary: #17171A;
  --text-muted: #5C5C61;
  --border: #E0DEDC;
  --header-bg: rgba(247, 246, 245, 0.92);
}

/* -------------------------- Reset & base -------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--text-muted); }
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ------------------------------ Buttons ---------------------------------- */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-family: var(--font-accent);
  font-weight: 700;
  text-transform: uppercase;
  font-style: italic;
  letter-spacing: 0.05em;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn--accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn--accent:hover {
  background: var(--accent-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}
.btn--outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-primary);
}
.btn--outline:hover { border-color: var(--accent); }
.btn--lg { padding: 18px 36px; font-size: 1rem; }

/* ------------------------------- Header ---------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand__mark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.03em;
  color: var(--text-primary);
}
.site-nav { display: flex; align-items: center; gap: 32px; }
.site-nav ul { display: flex; gap: 28px; }
.site-nav a {
  font-family: var(--font-accent);
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.site-nav a:hover { color: var(--text-primary); }
.has-dropdown { position: relative; }
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 220px;
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 4px;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown { display: flex; }
.dropdown a { display: block; padding: 10px 12px; border-radius: 4px; }
.dropdown a:hover { background: var(--bg-surface-2); }

/* ------------------------------- Mega menu --------------------------------- */
.mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 48px));
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: none;
  gap: 32px;
}
.has-mega-menu:hover .mega-menu,
.has-mega-menu:focus-within .mega-menu { display: flex; }
.mega-menu__groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  flex: 1;
}
.mega-menu__group h4 {
  font-family: var(--font-body);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 12px;
}
.mega-menu__group ul { display: flex; flex-direction: column; gap: 2px; }
.mega-menu__group a {
  display: block;
  padding: 8px 10px;
  border-radius: 4px;
  margin: 0 -10px;
}
.mega-menu__group a:hover { background: var(--bg-surface-2); }
.mega-menu__item-name { display: block; font-weight: 600; font-size: 0.9rem; color: var(--text-primary); text-transform: none; letter-spacing: normal; }
.mega-menu__item-blurb { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.mega-menu__feature {
  width: 200px;
  flex-shrink: 0;
  padding-left: 28px;
  border-left: 1px solid var(--border);
}
.mega-menu__feature h4 { color: var(--text-primary); font-size: 0.95rem; margin-bottom: 8px; text-transform: none; }
.mega-menu__feature p { font-size: 0.85rem; margin-bottom: 12px; }
.mega-menu__feature .card-link { color: var(--accent); font-weight: 700; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.04em; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--text-primary); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle__icon--moon { display: none; }
[data-theme="light"] .theme-toggle__icon--sun { display: none; }
[data-theme="light"] .theme-toggle__icon--moon { display: inline; }

/* -------------------------------- Hero ------------------------------------ */
.page-hero {
  padding: 96px 0 72px;
  background:
    radial-gradient(circle at 85% 20%, var(--accent-glow), transparent 45%),
    var(--bg-primary);
  border-bottom: 1px solid var(--border);
}
.page-hero--home { text-align: left; padding: 120px 0 96px; }
.page-hero--category, .page-hero--simple { text-align: left; }
.eyebrow {
  color: var(--accent);
  font-family: var(--font-accent);
  font-weight: 700;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.lede { font-size: 1.15rem; max-width: 640px; margin-bottom: 32px; }

/* ------------------------------ Sections ----------------------------------- */
.section { padding: 72px 0; }
.section--alt {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  clip-path: polygon(0 24px, 100% 0, 100% calc(100% - 24px), 0 100%);
}
.section--cta {
  text-align: center;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #fff;
}
.section--cta h2 { color: #fff; }
.section--cta p { color: rgba(255,255,255,0.85); max-width: 520px; margin-left: auto; margin-right: auto; }
.section--cta .btn--accent { background: #fff; color: var(--accent-deep); }
.section--cta .btn--accent:hover { background: #f0f0f0; }

/* --------------------------- Stat tiles / rows ----------------------------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px;
  text-align: center;
}
.stat-tile__num {
  display: block;
  font-family: var(--font-display);
  font-size: 2.25rem;
  color: var(--accent);
}
.stat-tile__label {
  display: block;
  font-family: var(--font-accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 6px;
}
.card-link,
.blog-item time {
  font-family: var(--font-accent);
  font-weight: 700;
}

/* ------------------------------ Card grids --------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-4px); }
.card h3 { margin-bottom: 8px; }
.card a.card-link { display: inline-block; margin-top: 12px; color: var(--accent); font-weight: 700; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.04em; }

/* -------------------------------- Lists ------------------------------------- */
.checklist li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------------------------- Process steps --------------------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  counter-reset: step;
}
.step { position: relative; padding-top: 8px; }
.step::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 16px;
}

/* ------------------------------- Gallery ------------------------------------ */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.gallery-placeholder {
  aspect-ratio: 4/3;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: var(--bg-surface);
}

/* -------------------------------- Forms -------------------------------------- */
.form-section-heading { font-size: 0.85rem; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 20px; }
.form { max-width: 620px; }
.form-row { margin-bottom: 20px; }
.form-row label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-note { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; }
.form-note a { color: var(--accent); text-decoration: underline; }
.form-success, .form-error {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 24px;
}
.form-success { background: rgba(46, 204, 113, 0.12); border: 1px solid #2ecc71; color: #2ecc71; }
.form-error { background: rgba(225, 6, 0, 0.12); border: 1px solid var(--accent); color: var(--accent); }
/* honeypot field — hidden from real users, catches bots */
.hp-field { position: absolute; left: -9999px; top: -9999px; }

/* ------------------------------- FAQ ------------------------------------------ */
.faq-item { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq-item h2 { margin-bottom: 8px; color: var(--text-primary); font-size: 1.25rem; }

/* -------------------------------- Footer --------------------------------------- */
.site-footer { background: var(--bg-surface); border-top: 1px solid var(--border); padding-top: 56px; }
.footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 40px;
}
.footer__brand p { margin-top: 12px; font-size: 0.9rem; }
.footer__col h3 {
  font-family: var(--font-body);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.footer__col li { margin-bottom: 10px; }
.footer__col a { font-size: 0.9rem; }
.footer__col a:hover { color: var(--accent); }
.footer__bottom {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.footer__bottom--split {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
}
.footer__bottom--split p { margin: 0; }
.footer__legal-links { display: flex; gap: 20px; }
.footer__legal-links a:hover { color: var(--accent); }
.footer__credit {
  text-align: center;
  padding: 0 24px 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.footer__credit p { margin: 0; }
.footer__credit a:hover { color: var(--accent); }

/* --------------------------------- Blog ----------------------------------------- */
.blog-list { display: grid; gap: 24px; }
.blog-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.blog-item time { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.blog-post { max-width: 720px; }
.blog-post p { color: var(--text-primary); }
.blog-post h2 { margin-top: 1.5em; }

/* ------------------------------- Responsive -------------------------------------- */
/* Nav collapses at 1024px, not the more typical 760px: with 7 top-level
   items (Home/About/Products/Markets/Portfolio/Blog/FAQ) plus the theme
   toggle and the "Get a Quote" button, the desktop nav row needs ~988px to
   lay out on one line without wrapping or overflowing — measured directly,
   not guessed. Below that it silently pushed the whole page wider and
   caused horizontal scroll site-wide, so the breakpoint has to sit above
   that measured width, with margin for a real (currently-placeholder)
   brand name. */
@media (max-width: 1024px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    max-height: calc(100vh - 76px);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 24px;
    gap: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* translateY uses a viewport unit, not a percentage of the nav's own
       height, so it can't get caught in a circular height/transform
       dependency now that height comes from max-height, not top+bottom. */
    transform: translateY(-110vh);
    transition: transform 0.2s ease;
  }
  .site-nav.is-open { transform: translateY(0); }
  .site-nav ul { flex-direction: column; gap: 4px; }
  .theme-toggle { align-self: flex-start; }
  .dropdown { position: static; display: flex; background: none; border: none; padding-left: 12px; }
  .has-dropdown:hover .dropdown { display: none; }
  .has-dropdown.is-open .dropdown { display: flex; }

  /* Mega menu collapses to a plain stacked list on mobile — no grid,
     no side panel, just grouped headings tapped open like any dropdown. */
  .mega-menu {
    position: static;
    display: none;
    width: auto;
    transform: none;
    flex-direction: column;
    gap: 20px;
    padding: 12px 0 12px 12px;
    border: none;
    background: none;
  }
  .has-mega-menu:hover .mega-menu { display: none; }
  .has-mega-menu.is-open .mega-menu { display: flex; }
  .mega-menu__groups { grid-template-columns: 1fr; gap: 16px; }
  .mega-menu__feature { width: auto; padding-left: 0; border-left: none; border-top: 1px solid var(--border); padding-top: 16px; }
}
@media (max-width: 900px) {
  .footer__inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .footer__inner { grid-template-columns: 1fr; }
}
