/* ============================================================
   3HC REDESIGN — DESIGN SYSTEM (Phase 1)
   Source: spec v3.0 §2 — Brand & Design System
   Loaded after legacy CSS so tokens override theme defaults.
   ============================================================ */

:root {
  /* Palette (spec §2.1) */
  --r-navy-900:     #0F2A44;
  --r-steel-700:    #1B4F72;
  --r-orange-500:   #F27A1A;
  --r-orange-600:   #D9650C;
  --r-charcoal-800: #2E3A46;
  --r-grey-50:      #F4F6F8;
  --r-grey-100:     #E6EAEE;
  --r-grey-300:     #B0BEC5;
  --r-grey-700:     #4A5560;
  --r-white:        #FFFFFF;
  --r-overlay-navy: rgba(15, 42, 68, 0.65);

  /* Typography */
  --r-font-display: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --r-font-head:    "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --r-font-body:    "Inter", "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Spacing & layout */
  --r-content-max:  1280px;
  --r-section-py:   100px;
  --r-section-py-m: 60px;

  /* Radius */
  --r-radius-card:  8px;
  --r-radius-btn:   6px;
  --r-radius-input: 6px;

  /* Shadow & motion */
  --r-shadow-card:  0 4px 20px rgba(0,0,0,0.08);
  --r-shadow-hover: 0 8px 28px rgba(15,42,68,0.18);
  --r-transition:   ease-in-out 0.3s;

  /* Header height — used for sticky nav + body offset */
  --r-header-h:     80px;
}

/* ------------------------------------------------------------
   STICKY HEADER (.r-header) — hamburger-only nav (all viewports)
   States:
     - Initial / hero: transparent
     - Scrolled (.r-header--scrolled): solid navy
   ------------------------------------------------------------ */
.r-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1030;
  height: var(--r-header-h);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background-color var(--r-transition), box-shadow var(--r-transition);
}
.r-header--scrolled {
  background: var(--r-navy-900);
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.r-header__inner {
  width: 100%;
  max-width: var(--r-content-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}
.r-header__brand img {
  height: 48px;
  width: auto;
  display: block;
}

/* Hamburger button — visible on all viewports, white circular pill */
.r-header__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  background: var(--r-white);
  border: 0;
  border-radius: 999px;
  color: var(--r-navy-900);
  cursor: pointer;
  line-height: 0;
  box-shadow: 0 4px 14px rgba(15,42,68,0.18);
  transition: transform var(--r-transition), background-color var(--r-transition), color var(--r-transition), box-shadow var(--r-transition);
}
.r-header__toggle:hover,
.r-header__toggle:focus-visible {
  background: var(--r-orange-500);
  color: var(--r-white);
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(242,122,26,0.35);
  outline: none;
}
.r-header__toggle-icon {
  display: block;
  width: 22px;
  height: 16px;
}
/* Hide the page-bar hamburger while drawer is open — the in-drawer X is the close affordance */
body.r-nav-open .r-header__toggle { opacity: 0; pointer-events: none; }

/* Body padding compensates for the fixed header on non-home pages.
   Home page hero is 100vh and intentionally sits behind the transparent header. */
body:not(.page-home) { padding-top: var(--r-header-h); }

/* ------------------------------------------------------------
   DRAWER NAV — right-side panel on all viewports
   ------------------------------------------------------------ */
.r-nav__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 42, 68, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--r-transition);
  z-index: 1035;
  will-change: opacity;
}
body.r-nav-open .r-nav__backdrop {
  opacity: 1;
  pointer-events: auto;
}

.r-nav {
  position: fixed;
  top: 0;
  right: 0;
  width: min(480px, 92vw);
  height: 100vh;
  height: 100dvh;
  background: var(--r-navy-900);
  padding: 96px 48px 40px;
  margin: 0;
  float: none;                       /* override legacy `nav { float:right }` */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  transform: translate3d(100%, 0, 0);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1040;
  box-shadow: -8px 0 24px rgba(0,0,0,0.3);
  will-change: transform;
  contain: layout paint;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
body.r-nav-open .r-nav { transform: translate3d(0, 0, 0); }
body.r-nav-open { overflow: hidden; }

/* Faint logo watermark behind menu items */
.r-nav__watermark {
  position: absolute;
  right: -60px;
  bottom: -40px;
  width: 380px;
  height: auto;
  opacity: 0.07;
  pointer-events: none;
  user-select: none;
}

.r-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 100%;
  position: relative;
  z-index: 1;
}
.r-nav li {
  width: 100%;
  margin: 0;
  display: block;
  opacity: 0;
  transform: translate3d(24px, 0, 0);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
body.r-nav-open .r-nav li { opacity: 1; transform: translate3d(0, 0, 0); }
body.r-nav-open .r-nav li:nth-child(1) { transition-delay: 0.08s; }
body.r-nav-open .r-nav li:nth-child(2) { transition-delay: 0.13s; }
body.r-nav-open .r-nav li:nth-child(3) { transition-delay: 0.18s; }
body.r-nav-open .r-nav li:nth-child(4) { transition-delay: 0.23s; }
body.r-nav-open .r-nav li:nth-child(5) { transition-delay: 0.28s; }
body.r-nav-open .r-nav li:nth-child(6) { transition-delay: 0.33s; }
body.r-nav-open .r-nav li:nth-child(7) { transition-delay: 0.38s; }
body.r-nav-open .r-nav li:nth-child(8) { transition-delay: 0.43s; }
/* Once the entrance animation has finished, drop will-change-like layer hints
   so per-item compositing doesn't keep the layer tree bloated. */
body.r-nav-open .r-nav li {
  will-change: auto;
}

.r-nav ul li a,
.r-nav a {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 14px 0;
  font-family: var(--r-font-display);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.2px;
  color: var(--r-white);
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
  /* Animate transform + color only — no layout properties. */
  transition: color 0.2s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  transform: translate3d(0, 0, 0);
}
/* Kill any inherited underline / bar from legacy CSS */
.r-nav ul li a::before,
.r-nav a::before,
.r-nav ul li a::after,
.r-nav a::after {
  content: none !important;
  display: none !important;
  background: transparent !important;
}
/* Arrow indicator — absolutely positioned so it doesn't change layout on hover */
.r-nav__item-arrow {
  position: absolute;
  left: -1.2em;
  top: 50%;
  width: 1em;
  color: var(--r-orange-500);
  font-weight: 700;
  opacity: 0;
  transform: translate3d(-8px, -50%, 0);
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.r-nav ul li a:hover,
.r-nav ul li a:focus-visible,
.r-nav a:hover,
.r-nav a:focus-visible,
.r-nav li.is-active > a {
  color: var(--r-orange-500);
  transform: translate3d(10px, 0, 0);
  outline: none;
}
.r-nav ul li a:hover .r-nav__item-arrow,
.r-nav ul li a:focus-visible .r-nav__item-arrow,
.r-nav a:hover .r-nav__item-arrow,
.r-nav a:focus-visible .r-nav__item-arrow,
.r-nav li.is-active > a .r-nav__item-arrow {
  opacity: 1;
  transform: translate3d(0, -50%, 0);
}

/* Close (X) — top-left of drawer, white circular pill */
.r-nav__close {
  position: absolute;
  top: 24px;
  left: 24px;
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--r-white);
  border: 0;
  border-radius: 999px;
  color: var(--r-navy-900);
  cursor: pointer;
  padding: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  transition: background-color var(--r-transition), color var(--r-transition), transform var(--r-transition);
  z-index: 2;
}
.r-nav__close:hover,
.r-nav__close:focus-visible {
  background: var(--r-orange-500);
  color: var(--r-white);
  transform: rotate(90deg);
  outline: none;
}
.r-nav__close-icon { display: block; }

/* Hide any legacy CTA pieces — the menu list now carries Contact Us */
.r-header__cta,
.r-nav__cta-mobile,
.r-nav__cta-li { display: none !important; }

/* Compact phone tweaks */
@media (max-width: 480px) {
  .r-nav { padding: 88px 28px 32px; }
  .r-nav ul li a,
  .r-nav a { font-size: 22px; padding: 12px 0; }
  .r-nav__watermark { width: 280px; right: -40px; bottom: -20px; }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .r-nav,
  .r-nav li,
  .r-nav__backdrop,
  .r-header__toggle,
  .r-nav__close,
  .r-nav a,
  .r-nav__item-arrow {
    transition: none !important;
  }
}

/* ------------------------------------------------------------
   HERO OVERLAY (spec §4.2)
   ------------------------------------------------------------ */
.home-layout-hero__overlay,
.r-hero__overlay {
  background: var(--r-overlay-navy);
}

/* Hero text restyling — additive, doesn't fight existing layout */
.home-layout-hero__eyebrow,
.r-hero__eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--r-orange-500);
  font-family: var(--r-font-body);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.home-layout-hero__title,
.r-hero__title {
  font-family: var(--r-font-display);
  font-weight: 800;
  font-size: clamp(32px, 5vw, 60px);
  line-height: 1.15;
  color: var(--r-white);
  margin: 0 0 16px;
  letter-spacing: -0.5px;
}
.home-layout-hero__subtitle,
.r-hero__subtitle {
  font-family: var(--r-font-head);
  font-weight: 600;
  font-size: clamp(18px, 2.2vw, 24px);
  color: var(--r-orange-500);
  margin: 0 0 16px;
}
.home-layout-hero__description,
.r-hero__description {
  font-family: var(--r-font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--r-white);
  max-width: 720px;
  margin: 0 auto 28px;
}

/* CTAs */
.r-hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 28px;
}
.r-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-family: var(--r-font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: var(--r-radius-btn);
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color var(--r-transition), color var(--r-transition), border-color var(--r-transition);
}
.r-btn--primary {
  background: var(--r-orange-500);
  color: var(--r-white);
  border-color: var(--r-orange-500);
}
.r-btn--primary:hover,
.r-btn--primary:focus {
  background: var(--r-orange-600);
  border-color: var(--r-orange-600);
  color: var(--r-white);
}
.r-btn--ghost {
  background: transparent;
  color: var(--r-white);
  border-color: var(--r-white);
}
.r-btn--ghost:hover,
.r-btn--ghost:focus {
  background: var(--r-white);
  color: var(--r-navy-900);
}

/* Scroll chevron */
.r-hero__chevron {
  position: absolute;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  color: var(--r-white);
  font-size: 28px;
  animation: r-hero-chevron 1.6s ease-in-out infinite;
  opacity: 0.85;
}
@keyframes r-hero-chevron {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.85; }
  50%      { transform: translate(-50%, 8px); opacity: 1; }
}

/* ------------------------------------------------------------
   COMPANY STATS BAR (spec §4.3)
   ------------------------------------------------------------ */
.company-stats-section {
  background: #0F2A44;
  padding: 42px 0;
}
.company-stats-shell {
  max-width: var(--r-content-max);
  margin: 0 auto;
  padding: 0 24px;
}
.company-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
}
.company-stat-block {
  padding: 0 20px;
  text-align: center;
  border-left: 1px solid rgba(242, 122, 26, 0.35);
}
.company-stat-block:first-child {
  border-left: none;
}
.company-stat-number {
  display: inline-block;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 52px;
  line-height: 1;
  color: var(--r-white);
  letter-spacing: -0.03em;
}
.company-stat-number-prefix,
.company-stat-number-suffix {
  display: inline-block;
  font-family: var(--r-font-display);
  font-weight: 700;
  font-size: 14px;
  color: #B0BEC5;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  vertical-align: baseline;
  margin-left: 6px;
}
.company-stat-label {
  margin: 12px auto 0;
  max-width: 220px;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.7;
  color: #B0BEC5;
}
@media (max-width: 980px) {
  .company-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .company-stat-block {
    border-left: none;
    border-top: 1px solid rgba(242, 122, 26, 0.2);
    padding: 24px 16px;
  }
  .company-stat-block:first-child {
    border-top: none;
  }
}
@media (max-width: 640px) {
  .company-stats-section {
    padding: 28px 0;
  }
  .company-stats-grid {
    grid-template-columns: 1fr;
  }
  .company-stat-block {
    padding: 18px 12px;
  }
  .company-stat-number {
    font-size: 44px;
  }
}

/* ------------------------------------------------------------
   FOOTER (.r-footer) — spec §4.14
   ------------------------------------------------------------ */
.r-footer {
  background: var(--r-navy-900);
  color: var(--r-grey-300);
  padding: 72px 0 0;
  font-family: var(--r-font-body);
  font-size: 14px;
  line-height: 1.7;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.r-footer__inner {
  max-width: var(--r-content-max);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}
@media (max-width: 900px) {
  .r-footer__inner { grid-template-columns: repeat(2, 1fr); gap: 32px; }
}
@media (max-width: 540px) {
  .r-footer__inner { grid-template-columns: 1fr; gap: 28px; }
}
.r-footer__col h3 {
  font-family: var(--r-font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--r-white);
  margin: 0 0 18px;
}
.r-footer__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.r-footer__col li { margin: 6px 0; }
.r-footer__col a {
  color: var(--r-grey-300);
  text-decoration: none;
  transition: color var(--r-transition);
}
.r-footer__col a:hover,
.r-footer__col a:focus { color: var(--r-white); }
.r-footer__brand img {
  height: 52px;
  width: auto;
  margin-bottom: 16px;
}
.r-footer__tagline {
  color: var(--r-grey-300);
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.7;
}
.r-footer__social {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
}
.r-footer__social a {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: var(--r-white);
  text-decoration: none;
  transition: background-color var(--r-transition), color var(--r-transition);
}
.r-footer__social a:hover,
.r-footer__social a:focus {
  background: var(--r-orange-500);
  color: var(--r-white);
}
.r-footer__contact {
  font-style: normal;
}
.r-footer__contact span { display: block; margin-bottom: 6px; }
.r-footer__contact strong {
  color: var(--r-white);
  letter-spacing: 0.5px;
  margin-right: 4px;
}
.r-footer__bottom {
  margin-top: 56px;
  padding: 20px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  font-size: 13px;
  color: var(--r-grey-300);
}
.r-footer__bottom a {
  color: var(--r-grey-300);
  text-decoration: none;
  border-bottom: 1px dotted var(--r-grey-300);
}
.r-footer__bottom a:hover { color: var(--r-white); border-bottom-color: var(--r-white); }

/* Hide legacy footer chunks once the new footer is live */
section.subfooter,
.subnav { /* legacy top sub-nav band */
  display: none !important;
}

/* ------------------------------------------------------------
   BUTTON / SECTION HEADING TOKENS (for use in later phases)
   ------------------------------------------------------------ */
.r-eyebrow {
  display: inline-block;
  color: var(--r-orange-500);
  font-family: var(--r-font-body);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.r-section-title {
  font-family: var(--r-font-display);
  font-weight: 700;
  font-size: clamp(26px, 3.5vw, 42px);
  color: var(--r-navy-900);
  margin: 0 0 16px;
  letter-spacing: -0.3px;
}

/* ------------------------------------------------------------
   Base body adjustments — opt-in via class on <body>
   ------------------------------------------------------------ */
body { font-family: var(--r-font-body); }

/* Make sure hero content is centered vertically against 100vh */
.home-layout-hero,
.r-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.home-layout-hero__content-wrap,
.r-hero__content-wrap {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  max-width: var(--r-content-max);
  padding: 0 24px;
}
.home-layout-hero__bg,
.r-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.home-layout-hero__bg video,
.home-layout-hero__bg img,
.r-hero__bg video,
.r-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-layout-hero__overlay,
.r-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}
