/* ============================================================
   RHEINORIX INDUSTRIES — Main Stylesheet
   Brand primary: #1d3f7a (navy blue)
   Accent: #2196d9 (circuit blue)
   Steel: #5a6e82
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Brand */
  --color-primary:        #1d3f7a;
  --color-primary-dark:   #142d5a;
  --color-primary-light:  #254e99;
  --color-accent:         #2196d9;
  --color-accent-dark:    #1677b0;
  --color-steel:          #5a6e82;
  --color-steel-light:    #8fa0b0;

  /* Neutrals */
  --color-dark:           #1a1f2b;
  --color-dark-alt:       #243044;
  --color-text:           #2c3340;
  --color-text-muted:     #5a6472;
  --color-border:         #d4dae2;
  --color-bg:             #ffffff;
  --color-bg-light:       #f4f6f9;
  --color-bg-section:     #eef1f5;

  /* Status */
  --color-success:        #2e7d4f;
  --color-warning:        #b86a00;
  --color-error:          #b32020;

  /* Typography */
  --font-body:   'Open Sans', Arial, sans-serif;
  --font-heading:'Roboto Condensed', Arial Narrow, Arial, sans-serif;

  /* Spacing (8px base) */
  --space-1:  8px;
  --space-2:  16px;
  --space-3:  24px;
  --space-4:  32px;
  --space-5:  40px;
  --space-6:  48px;
  --space-8:  64px;
  --space-10: 80px;
  --space-12: 96px;

  /* Layout */
  --container-max: 1200px;
  --header-height: 72px;

  /* Transitions */
  --transition: 0.2s ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent);
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

ul, ol {
  list-style: none;
}

address {
  font-style: normal;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  color: var(--color-primary);
}

/* ---------- Container ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 14px 36px;
  border-radius: 2px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  text-align: center;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}

.btn-outline-light {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.7);
}

.btn-outline-light:hover {
  background: rgba(255,255,255,0.12);
  border-color: #fff;
  color: #fff;
}

/* ---------- Section Shared ---------- */
.section {
  padding: var(--space-12) 0;
}

.bg-light {
  background: var(--color-bg-light);
}

.bg-dark {
  background: var(--color-dark-alt);
}

.section-label {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}

.section-label--light {
  color: var(--color-accent);
  opacity: 0.9;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
  max-width: 720px;
}

.section-title--light {
  color: #fff;
}

.section-intro {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 680px;
  margin-bottom: var(--space-6);
  line-height: 1.7;
}

.section-intro--light {
  color: rgba(255,255,255,0.75);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: var(--header-height);
  background: rgba(255,255,255,0.97);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition), background var(--transition);
}

.site-header.scrolled {
  box-shadow: 0 2px 16px rgba(0,0,0,0.10);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.header-logo {
  height: 48px;
  width: auto;
  display: block;
}

.logo-link {
  flex-shrink: 0;
}

/* Nav */
.main-nav {}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-link {
  display: block;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
  padding: 6px 14px;
  border-radius: 2px;
  transition: color var(--transition), background var(--transition);
  letter-spacing: 0.02em;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-primary);
}

.nav-link.nav-cta {
  background: var(--color-primary);
  color: #fff;
  padding: 8px 20px;
  margin-left: var(--space-1);
}

.nav-link.nav-cta:hover {
  background: var(--color-primary-light);
  color: #fff;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background-image: url('/images/pexels-photo-236698.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  padding-top: var(--header-height);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(15, 28, 55, 0.88) 0%,
    rgba(20, 42, 80, 0.80) 60%,
    rgba(15, 28, 55, 0.55) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

.hero-logo {
  width: 240px;
  height: auto;
  margin-bottom: var(--space-5);
  filter: brightness(0) invert(1);
}

/* When PNG is NOT available the <img> fallback is the SVG — remove invert filter */
.hero-logo[src$=".svg"] {
  filter: brightness(0) invert(1);
}

.hero-headline {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.18;
  margin-bottom: var(--space-3);
}

.br-desktop {
  display: block;
}

.hero-sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.82);
  line-height: 1.7;
  margin-bottom: var(--space-5);
  max-width: 600px;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: start;
}

.about-text p {
  margin-bottom: var(--space-3);
  line-height: 1.75;
  color: var(--color-text);
  font-size: 1rem;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-highlights {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.highlight-item {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.highlight-icon {
  color: var(--color-accent);
  font-size: 0.6rem;
  margin-top: 6px;
  flex-shrink: 0;
}

.highlight-item strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-primary);
  margin-bottom: 4px;
  font-weight: 700;
}

.highlight-item p {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0;
}

/* ---------- Products ---------- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.product-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-primary);
  padding: var(--space-4);
  transition: box-shadow var(--transition), border-top-color var(--transition);
}

.product-card:hover {
  box-shadow: 0 4px 20px rgba(29, 63, 122, 0.10);
  border-top-color: var(--color-accent);
}

.product-card-icon {
  width: 40px;
  height: 40px;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
  transition: color var(--transition);
}

.product-card:hover .product-card-icon {
  color: var(--color-accent);
}

.product-card-icon svg {
  width: 100%;
  height: 100%;
}

.product-card h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-1);
}

.product-card p {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0;
}

.products-cta {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.products-cta p {
  color: var(--color-text-muted);
  font-size: 1rem;
  margin: 0;
  max-width: 600px;
}

/* ---------- Industries ---------- */
.industries-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.industry-item {
  position: relative;
  overflow: hidden;
}

.industry-img-wrap {
  aspect-ratio: 4/3;
  overflow: hidden;
}

.industry-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.industry-item:hover .industry-img-wrap img {
  transform: scale(1.04);
}

.industry-label {
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  padding: 10px 16px;
  text-align: center;
  transition: background var(--transition);
}

.industry-item:hover .industry-label {
  background: var(--color-primary-light);
}

/* ---------- Why Rheinorix ---------- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.why-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: var(--space-4);
  position: relative;
  transition: box-shadow var(--transition);
}

.why-card:hover {
  box-shadow: 0 4px 20px rgba(29, 63, 122, 0.08);
}

.why-number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-border);
  line-height: 1;
  margin-bottom: var(--space-2);
  user-select: none;
}

.why-card h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-1);
}

.why-card p {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  margin: 0;
}

/* ---------- Values ---------- */
.values-section {
  background: var(--color-primary);
}

.values-section .section-label {
  color: rgba(255,255,255,0.6);
}

.values-section .section-title {
  color: #fff;
}

.values-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.value-item {
  flex: 1;
  padding: 0 var(--space-4);
}

.value-item:first-child {
  padding-left: 0;
}

.value-item:last-child {
  padding-right: 0;
}

.value-divider {
  width: 1px;
  min-height: 120px;
  background: rgba(255,255,255,0.18);
  flex-shrink: 0;
  align-self: stretch;
}

.value-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: var(--space-1);
  letter-spacing: 0.02em;
}

.value-item p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.72);
  line-height: 1.65;
  margin: 0;
}

/* ---------- Contact ---------- */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--space-8);
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.contact-block-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 6px;
}

.contact-value {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.9);
  line-height: 1.6;
}

.contact-value--link {
  color: #fff;
  transition: color var(--transition);
}

.contact-value--link:hover {
  color: var(--color-accent);
}

.contact-address {
  font-style: normal;
  color: rgba(255,255,255,0.9);
  font-size: 1.05rem;
  line-height: 1.7;
}

.contact-map iframe {
  display: block;
  width: 100%;
  min-height: 360px;
  border: 0;
  filter: grayscale(20%);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-dark);
  color: rgba(255,255,255,0.65);
  padding: var(--space-10) 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 1.2fr;
  gap: var(--space-6);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-logo {
  height: 50px;
  width: auto;
  margin-bottom: var(--space-3);
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.footer-logo[src$=".svg"] {
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

.footer-tagline {
  font-size: 0.88rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.55);
  max-width: 280px;
}

.footer-nav-title {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: var(--space-2);
}

.footer-nav ul,
.footer-contact ul,
.footer-products ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-nav a,
.footer-contact a,
.footer-products a {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.6);
  transition: color var(--transition);
}

.footer-nav a:hover,
.footer-contact a:hover,
.footer-products a:hover {
  color: #fff;
}

.footer-address {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.7;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  gap: var(--space-3);
}

.footer-copy {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.35);
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.footer-legal a {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.35);
  transition: color var(--transition);
}

.footer-legal a:hover {
  color: rgba(255,255,255,0.75);
}

.footer-sep {
  color: rgba(255,255,255,0.2);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* --- Tablet (max 1024px) --- */
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .industries-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
  }

  .values-row {
    flex-wrap: wrap;
    gap: var(--space-4);
  }

  .value-divider {
    display: none;
  }

  .value-item {
    flex: 1 1 calc(50% - 16px);
    padding: 0;
  }
}

/* --- Tablet portrait (max 768px) --- */
@media (max-width: 768px) {
  :root {
    --space-12: 64px;
    --space-10: 56px;
  }

  .nav-toggle {
    display: flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--color-border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    z-index: 800;
    padding: var(--space-2) 0;
  }

  .main-nav.open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-link {
    padding: 12px var(--space-3);
    border-radius: 0;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--color-bg-light);
  }

  .nav-link.nav-cta {
    margin: var(--space-2) var(--space-3);
    border-radius: 2px;
    text-align: center;
  }

  .hero-headline {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
  }

  .br-desktop {
    display: none;
  }

  .industries-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-layout {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .products-cta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .value-item {
    flex: 1 1 100%;
  }
}

/* --- Mobile (max 480px) --- */
@media (max-width: 480px) {
  :root {
    --space-12: 48px;
    --space-10: 40px;
  }

  .hero {
    background-attachment: scroll;
  }

  .hero-logo {
    width: 180px;
  }

  .products-grid,
  .why-grid {
    grid-template-columns: 1fr;
  }

  .industries-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }

  .section-title {
    font-size: 1.5rem;
  }

  .container {
    padding: 0 var(--space-2);
  }
}

/* ---------- Scroll reveal helper (JS adds class) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ---------- Active nav link ---------- */
.nav-link.active {
  color: var(--color-primary);
}

/* ---------- Nav toggle animated state ---------- */
.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Print styles ---------- */
@media print {
  .site-header, .hero, .contact-map, .site-footer { display: none; }
  .section { padding: 20pt 0; }
}
