/*
  Denwatech redesign theme layer — tokens match the developer spec
  (Page Spec: HOME, Section 0 — Global Design System).
  Loaded alongside the legacy template CSS (main.css + plugins) so pages
  that haven't been rebuilt yet keep working. Everything here is scoped
  under a "dw-" prefix so it never collides with old template classes.
  No content in this file is DB/admin-panel driven — the site is static.
*/

:root {
  --dw-navy: #0b1c3d;
  --dw-navy-dark: #081428;
  --dw-navy-mid: #132448;
  --dw-navy-chrome: #163770; /* header/footer only — kept on the earlier, brighter navy blue */
  --dw-teal: #00c48c;
  --dw-blue: #1e5eff;
  --dw-blue-dark: #1548c9;
  --dw-white: #ffffff;
  --dw-ink: #0b1c3d;
  --dw-text: #4a5568;
  --dw-text-muted: #a0aec0;
  --dw-border: #e2e8f0;
  --dw-surface: #f5f7fa;

  --dw-font-heading: "Inter", "Figtree", sans-serif;
  --dw-font-body: "Inter", "Figtree", sans-serif;

  --dw-header-height: 64px;
  --dw-container: 1200px;
  --dw-radius-card: 8px;
  --dw-radius-btn: 6px;
}

.dw-container {
  max-width: var(--dw-container);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ============ SHARED COMPONENTS (buttons, links, section scaffolding, stats) ============ */
/* Used across the homepage and inner pages — kept here to avoid duplicating them per page. */

.dw-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--dw-font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  border-radius: var(--dw-radius-btn);
  border: 2px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  text-shadow: none;
}

/* Primary: filled blue */
.dw-btn--primary {
  background: var(--dw-blue);
  border-color: var(--dw-blue);
  color: var(--dw-white);
}

.dw-btn--primary:hover {
  background: var(--dw-blue-dark);
  border-color: var(--dw-blue-dark);
  color: var(--dw-white);
}

/* Filled navy: solid dark button, for use on light backgrounds */
.dw-btn--dark {
  background: var(--dw-navy);
  border-color: var(--dw-navy);
  color: var(--dw-white);
}

.dw-btn--dark:hover {
  background: var(--dw-navy-chrome);
  border-color: var(--dw-navy-chrome);
  color: var(--dw-white);
}

/* Secondary: outlined dark, for use on light backgrounds */
.dw-btn--outline {
  background: transparent;
  border-color: var(--dw-navy);
  color: var(--dw-navy);
}

.dw-btn--outline:hover {
  background: var(--dw-navy);
  color: var(--dw-white);
}

/* Ghost: outlined white, for use on dark backgrounds */
.dw-btn--white {
  background: var(--dw-white);
  border-color: var(--dw-white);
  color: var(--dw-navy);
}

.dw-btn--white:hover {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--dw-white);
}

/* True ghost: transparent with a white border, for a secondary action on dark backgrounds */
.dw-btn--outline-white {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--dw-white);
  color: var(--dw-white);
}

.dw-btn--outline-white:hover {
  background: var(--dw-white);
  border-color: var(--dw-white);
  color: var(--dw-navy);
}

.dw-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--dw-font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--dw-blue);
  text-decoration: none;
}

.dw-link:hover {
  color: var(--dw-navy);
}

/* ---------- Generic section scaffolding ---------- */
.dw-section {
  padding-block: 80px;
}

.dw-section--tight {
  padding-block: 56px;
}

.dw-section__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--dw-font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--dw-teal);
  margin-bottom: 14px;
}

.dw-section__eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--dw-teal);
}

.dw-section__title {
  font-family: var(--dw-font-heading);
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.2;
  font-weight: 700;
  color: var(--dw-ink);
  margin: 0 0 16px;
}

.dw-section__title--onlight {
  color: var(--dw-white);
}

.dw-section__title span,
.dw-hero__title span {
  color: var(--dw-teal);
}

.dw-section__lede {
  max-width: 720px;
  color: var(--dw-text);
  font-size: 16px;
  line-height: 1.7;
  margin: 0;
}

.dw-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.dw-section__head .dw-section__title {
  margin-bottom: 0;
}

/* ---------- Stat blocks (used in Safety, About/Denwatt, etc.) ---------- */
.dw-stats-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.dw-stat {
  padding: 24px 32px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--dw-radius-card);
}

.dw-stat--onlight {
  border-color: var(--dw-border);
}

.dw-stat__value {
  font-family: var(--dw-font-heading);
  font-size: 52px;
  font-weight: 700;
  color: var(--dw-teal);
  line-height: 1;
  margin-bottom: 10px;
}

.dw-stat__label {
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.dw-stat__label--bold {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.dw-stat__label--dark {
  color: var(--dw-text-muted);
}

/* ============ HEADER ============ */
/*
  position:fixed (not sticky) is deliberate: the legacy template CSS sets
  `overflow-x: hidden` on html/body (main.css), which per spec forces
  overflow-y to `auto` on the same element — this breaks `position: sticky`
  in Chromium/WebKit (it starts scrolling away instead of pinning). Fixed
  positioning isn't affected by ancestor overflow, so it sidesteps the bug.
  Body gets matching padding-top below to reserve the space fixed removes
  from normal flow.
*/
.dw-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--dw-white);
  border-bottom: 1px solid var(--dw-border);
  font-family: var(--dw-font-body);
}

body {
  padding-top: var(--dw-header-height);
}

.dw-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--dw-header-height);
}

.dw-header__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.dw-header__logo img {
  height: 52px;
  width: auto;
  display: block;
}

.dw-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dw-nav > li {
  position: relative;
}

.dw-nav > li > a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--dw-text);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.dw-nav > li > a:hover,
.dw-nav > li.dw-nav--active > a {
  color: var(--dw-navy);
}

.dw-nav__caret {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
}

.dw-nav__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: var(--dw-white);
  border: 1px solid var(--dw-border);
  box-shadow: 0 16px 32px -12px rgba(11, 28, 61, 0.28);
  border-radius: var(--dw-radius-card);
  list-style: none;
  margin: 0;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.dw-nav > li:hover > .dw-nav__dropdown,
.dw-nav > li:focus-within > .dw-nav__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dw-nav__dropdown a {
  display: block;
  padding: 9px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--dw-text);
  text-decoration: none;
}

.dw-nav__dropdown a:hover {
  background: var(--dw-surface);
  color: var(--dw-navy);
}

.dw-header__cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--dw-blue);
  color: var(--dw-white);
  font-family: var(--dw-font-body);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 11px 20px;
  border-radius: var(--dw-radius-btn);
  transition: background 0.15s ease;
}

.dw-header__cta:hover {
  background: var(--dw-blue-dark);
  color: var(--dw-white);
}

.dw-header__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--dw-border);
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
}

.dw-header__toggle span {
  display: block;
  height: 2px;
  width: 20px;
  margin-inline: auto;
  background: var(--dw-navy);
}

/* ============ MOBILE NAV ============ */
.dw-mobile-nav {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(340px, 88vw);
  height: 100vh;
  background: var(--dw-white);
  box-shadow: -16px 0 40px rgba(11, 28, 61, 0.25);
  z-index: 1200;
  padding: 24px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.dw-mobile-nav.is-open {
  transform: translateX(0);
}

.dw-mobile-nav__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.dw-mobile-nav__close {
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--dw-navy);
  cursor: pointer;
}

.dw-mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dw-mobile-nav > ul > li {
  border-bottom: 1px solid var(--dw-border);
}

.dw-mobile-nav > ul > li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 4px;
  font-family: var(--dw-font-body);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--dw-ink);
  text-decoration: none;
}

.dw-mobile-nav__sub {
  display: none;
  padding: 0 0 12px 12px;
}

.dw-mobile-nav__sub a {
  display: block;
  padding: 8px 4px;
  font-size: 13px;
  color: var(--dw-text);
  text-decoration: none;
}

.dw-mobile-nav > ul > li.is-expanded .dw-mobile-nav__sub {
  display: block;
}

.dw-mobile-nav__cta {
  display: block;
  text-align: center;
  margin-top: 20px;
  background: var(--dw-blue);
  color: var(--dw-white);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  padding: 14px;
  border-radius: var(--dw-radius-btn);
}

.dw-mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 28, 61, 0.45);
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.dw-mobile-nav-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 1100px) {
  .dw-nav,
  .dw-header__cta {
    display: none;
  }

  .dw-header__toggle {
    display: flex;
  }
}

/* ============ FOOTER ============ */
.dw-footer {
  background: var(--dw-navy-chrome);
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--dw-font-body);
  padding-top: 64px;
}

.dw-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.dw-footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.dw-footer__brand img {
  height: 26px;
  width: auto;
}

.dw-footer__tagline {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.65);
  max-width: 320px;
}

.dw-footer__sep {
  color: var(--dw-teal);
  margin: 0 2px;
}

/*
  Specificity note: .dw-footer__col ul (below) sets flex-direction: column
  for the link lists in the other footer columns. That selector is more
  specific than .dw-footer__social alone, so it was silently winning and
  stacking these icons vertically. Qualifying with .dw-footer__col here
  raises the specificity enough to win instead.
*/
.dw-footer__col .dw-footer__social {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
}

.dw-footer__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--dw-white);
  text-decoration: none;
  transition: background 0.15s ease;
}

.dw-footer__social a:hover {
  background: var(--dw-teal);
  color: var(--dw-navy-dark);
}

.dw-footer__heading {
  font-family: var(--dw-font-heading);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dw-white);
  margin: 0 0 18px;
}

.dw-footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dw-footer__col a {
  color: rgba(255, 255, 255, 0.68);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s ease;
}

.dw-footer__col a:hover {
  color: var(--dw-teal);
}

.dw-footer__hq-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.68);
  margin-bottom: 16px;
}

.dw-footer__hq-item i {
  color: var(--dw-teal);
  margin-top: 3px;
  width: 14px;
  flex-shrink: 0;
}

.dw-footer__hq-item a {
  color: inherit;
  text-decoration: none;
}

.dw-footer__hq-item a:hover {
  color: var(--dw-teal);
}

.dw-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  flex-wrap: wrap;
}

.dw-footer__bottom-links {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dw-footer__bottom-links a {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
}

.dw-footer__bottom-links a:hover {
  color: var(--dw-teal);
}

@media (max-width: 900px) {
  .dw-footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .dw-footer__grid {
    grid-template-columns: 1fr;
  }

  .dw-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
