/* ============================================
   TRIONEX ENGINEERING LTD. - GLOBAL STYLES
   ============================================ */

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

/* ---- CSS VARIABLES ---- */
:root {
  /* Core Brand Colors (Preserved exactly as requested) */
  --blue-dark:   #0D2B5E;
  --blue-primary:#1A4B8C;
  --blue-mid:    #2563C0;
  --blue-light:  #3A7BD5;
  --blue-pale:   #E8F0FB;
  --white:       #FFFFFF;
  
  /* Greys for professional typography and layout */
  --grey-light:  #F8FAFC;
  --grey-mid:    #E2E8F0;
  --grey-text:   #64748B;
  --text-dark:   #0F172A;
  --text-body:   #334155;
  
  /* Structural Variables */
  --shadow-sm:   0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md:   0 4px 6px -1px rgba(15,23,42,0.08), 0 2px 4px -1px rgba(15,23,42,0.04);
  --shadow-lg:   0 10px 15px -3px rgba(15,23,42,0.08), 0 4px 6px -2px rgba(15,23,42,0.04);
  --radius:      4px;
  --radius-lg:   8px;
  --max-width:   1200px;
  --nav-height:  72px;
  --transition:  0.2s ease-out;
}

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-body);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; transition: color var(--transition); }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* ---- TYPOGRAPHY ---- */
h1, h2, h3, h4, h5 {
  color: var(--text-dark);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
p  { font-size: 1rem; color: var(--text-body); margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ---- LAYOUT ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: 90px 0; }
.section-sm { padding: 60px 0; }
.section-title {
  text-align: center;
  margin-bottom: 48px;
}
.section-title h2 { margin-bottom: 16px; }
.section-title p { color: var(--grey-text); max-width: 680px; margin: 0 auto; font-size: 1.05rem; }
.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-primary);
  background: var(--blue-pale);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--blue-primary);
  color: var(--white);
  border-color: var(--blue-primary);
}
.btn-primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  box-shadow: var(--shadow-md);
}
.btn-outline {
  background: transparent;
  color: var(--blue-primary);
  border-color: var(--blue-primary);
}
.btn-outline:hover {
  background: var(--blue-primary);
  color: var(--white);
}
.btn-white {
  background: var(--white);
  color: var(--blue-primary);
  border-color: var(--white);
}
.btn-white:hover {
  background: var(--grey-light);
  border-color: var(--grey-light);
}
.btn-white-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.8);
}
.btn-white-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--white);
}
.btn-lg { padding: 14px 32px; font-size: 1rem; }

/* ---- NAVIGATION ---- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--white);
  border-bottom: 1px solid var(--grey-mid);
  z-index: 1000;
  transition: box-shadow var(--transition);
}
.navbar.scrolled { box-shadow: var(--shadow-sm); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-logo .logo-icon {
  width: 42px; height: 42px;
  background: var(--blue-primary);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.1rem; font-weight: 800; letter-spacing: -1px;
}
.nav-logo .logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.nav-logo .logo-name { font-size: 1.05rem; font-weight: 800; color: var(--blue-dark); letter-spacing: -0.02em; }
.nav-logo .logo-sub  { font-size: 0.68rem; font-weight: 600; color: var(--grey-text); letter-spacing: 0.05em; text-transform: uppercase; }
.nav-menu { display: flex; align-items: center; gap: 8px; }
.nav-link {
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-body);
  border-radius: var(--radius);
  transition: all var(--transition);
}
.nav-link:hover, .nav-link.active {
  color: var(--blue-primary);
  background: var(--blue-pale);
}
.nav-link.active { font-weight: 600; }
.nav-cta { margin-left: 12px; }
.nav-link.nav-cta { color: var(--white); }
.nav-link.nav-cta:hover { color: var(--white); background: var(--blue-dark); }

/* ---- PAGE HERO (INNER PAGES) ---- */
.page-hero {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-primary) 100%);
  padding: 100px 0 60px;
  margin-top: var(--nav-height);
  color: white;
  position: relative;
  overflow: hidden;
}
.page-hero h1 { color: white; margin-bottom: 16px; font-weight: 800; }
.page-hero p { color: rgba(255,255,255,0.9); font-size: 1.1rem; max-width: 650px; line-height: 1.6; }
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: rgba(255,255,255,0.7);
  margin-bottom: 24px;
}
.breadcrumb a { color: rgba(255,255,255,0.7); font-weight: 500; }
.breadcrumb a:hover { color: white; }
.breadcrumb span { color: rgba(255,255,255,0.4); }

/* ---- CARDS & GRIDS ---- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--grey-mid);
  overflow: hidden;
  transition: all var(--transition);
  height: 100%;
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}
.card-body { padding: 32px; }
.card-icon {
  width: 48px; height: 48px;
  background: var(--blue-pale);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  color: var(--blue-primary);
  font-size: 1.25rem;
}
.card-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 12px; color: var(--text-dark); }
.card-text { font-size: 0.95rem; color: var(--text-body); line-height: 1.6; }

.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 32px; }
.team-grid     { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 32px; }
.case-grid     { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 32px; }
.news-grid     { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 32px; }

/* ---- STAT BAR ---- */
.stat-bar {
  background: var(--blue-dark);
  color: white;
  padding: 60px 0;
}
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 40px; text-align: center; }
.stat-item .stat-num { font-size: 2.75rem; font-weight: 800; color: white; line-height: 1.1; margin-bottom: 8px; }
.stat-item .stat-label { font-size: 0.9rem; font-weight: 500; color: rgba(255,255,255,0.8); }

/* ---- TESTIMONIALS ---- */
.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 32px; }
.testimonial-card {
  background: var(--white);
  border: 1px solid var(--grey-mid);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.testimonial-text { font-style: italic; color: var(--text-body); margin-bottom: 24px; font-size: 1.05rem; }
.testimonial-author { display: flex; align-items: center; gap: 16px; border-top: 1px solid var(--grey-mid); padding-top: 20px; }
.testimonial-avatar {
  width: 48px; height: 48px;
  background: var(--blue-primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 1rem;
}
.testimonial-name { font-weight: 700; font-size: 1rem; color: var(--text-dark); margin-bottom: 2px; }
.testimonial-role { font-size: 0.85rem; color: var(--grey-text); }

/* ---- CLIENTS STRIP ---- */
.clients-strip { background: var(--white); border-top: 1px solid var(--grey-mid); border-bottom: 1px solid var(--grey-mid); padding: 40px 0; }
.clients-label { text-align: center; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--grey-text); margin-bottom: 24px; }
.clients-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 32px; }
.client-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 28px;
  background: var(--grey-light);
  border-radius: var(--radius-lg);
  border: 1px solid var(--grey-mid);
  font-weight: 700; font-size: 1rem; color: var(--text-dark);
}
.client-item img { height: 40px; width: auto; object-fit: contain; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 24px; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text-dark); margin-bottom: 8px; }
.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-dark);
  background: var(--white);
  transition: all var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 3px rgba(26,75,140,0.1);
}
textarea.form-control { resize: vertical; min-height: 140px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ---- CTA SECTION ---- */
.cta-section {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-primary) 100%);
  padding: 80px 0;
  text-align: center;
  color: white;
}
.cta-section h2 { color: white; margin-bottom: 16px; }
.cta-section p { color: rgba(255,255,255,0.9); max-width: 600px; margin: 0 auto 36px; font-size: 1.1rem; }
.cta-section .btn-group { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---- CONTACT DETAILS ---- */
.contact-details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.contact-detail-card {
  background: var(--white);
  border: 1px solid var(--grey-mid);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.contact-icon {
  width: 56px; height: 56px;
  background: var(--blue-pale);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  color: var(--blue-primary);
  font-size: 1.5rem;
}
.contact-detail-card h4 { margin-bottom: 12px; font-size: 1.1rem; }
.contact-detail-card p, .contact-detail-card a { color: var(--text-body); font-size: 0.95rem; display: block; margin-bottom: 4px; }
.contact-detail-card a:hover { color: var(--blue-primary); text-decoration: underline; }

/* ---- FOOTER ---- */
.footer {
  background: var(--blue-dark);
  color: rgba(255,255,255,0.8);
  padding: 80px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 48px;
  padding-bottom: 56px;
}
.footer-brand .footer-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.footer-brand .logo-icon { width: 42px; height: 42px; background: var(--blue-mid); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: 1rem; }
.footer-brand .logo-name { font-size: 1.05rem; font-weight: 800; color: white; }
.footer-brand .logo-sub  { font-size: 0.65rem; font-weight: 600; color: rgba(255,255,255,0.6); letter-spacing: 0.05em; text-transform: uppercase; }
.footer-brand p { font-size: 0.95rem; margin-bottom: 20px; color: rgba(255, 255, 255, 0.92); }
.footer-col h5 { color: white; font-size: 0.95rem; font-weight: 700; margin-bottom: 20px; letter-spacing: 0.05em; text-transform: uppercase; }
.footer-links { display: flex; flex-direction: column; gap: 12px; }
.footer-links a { font-size: 0.95rem; color: rgba(255,255,255,0.7); }
.footer-links a:hover { color: white; }
.footer-contact-item { display: flex; gap: 12px; margin-bottom: 16px; font-size: 0.95rem; }
.footer-contact-item .icon { color: var(--blue-light); flex-shrink: 0; margin-top: 2px; }
.footer-contact-item a { color: rgba(255,255,255,0.7); }
.footer-contact-item a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-bottom p { font-size: 0.85rem; color: rgba(255,255,255,0.6); }
.footer-bottom-links { display: flex; gap: 24px; }
.footer-bottom-links a { font-size: 0.85rem; color: rgba(255,255,255,0.6); }
.footer-bottom-links a:hover { color: white; }

/* ---- DIVIDER ---- */
.divider { width: 48px; height: 4px; background: var(--blue-primary); border-radius: 2px; margin: 16px 0 24px; }
.divider-center { margin: 16px auto 24px; }

/* ---- TWO COLUMN SECTION ---- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.two-col.reverse { direction: rtl; }
.two-col.reverse > * { direction: ltr; }
.two-col img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); width: 100%; height: auto; max-height: 480px; object-fit: cover; border: 1px solid var(--grey-mid); }

/* ---- CASE STUDY & NEWS CARDS ---- */
.case-card, .news-card { background: white; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--grey-mid); box-shadow: var(--shadow-sm); transition: all 0.3s ease; height: 100%; display: flex; flex-direction: column; }
.case-card:hover, .news-card:hover { box-shadow: var(--shadow-lg); border-color: transparent; transform: translateY(-4px); }
.case-card-img, .news-card-img { height: 240px; overflow: hidden; border-bottom: 1px solid var(--grey-mid); position: relative; }
.case-card-img img, .news-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.case-card:hover img, .news-card:hover img { transform: scale(1.05); }
.case-card-body, .news-card-body { padding: 32px; flex: 1; display: flex; flex-direction: column; }
.news-card-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 0.8rem; font-weight: 700; color: var(--blue-primary); text-transform: uppercase; letter-spacing: 0.05em; }
.case-card-title, .news-card-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 12px; color: var(--text-dark); line-height: 1.35; }
.case-card-text, .news-card-text { font-size: 0.95rem; color: var(--text-body); line-height: 1.6; margin-bottom: 24px; flex: 1; word-break: break-word; overflow-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
.case-card-link, .news-card-link { font-size: 0.95rem; font-weight: 600; color: var(--blue-primary); display: inline-flex; align-items: center; gap: 6px; margin-top: auto; transition: gap 0.3s ease; }
.case-card:hover .case-card-link, .news-card:hover .news-card-link { gap: 10px; color: var(--blue-dark); }

/* ---- TEAM CARD ---- */
.team-card { background: white; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--grey-mid); box-shadow: var(--shadow-sm); text-align: center; transition: all var(--transition); }
.team-card-img { height: 260px; overflow: hidden; background: var(--grey-light); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--grey-mid); }
.team-card-img img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.team-placeholder { font-size: 4rem; color: var(--grey-mid); }
.team-card-body { padding: 24px; }
.team-card-name { font-size: 1.15rem; font-weight: 700; color: var(--text-dark); margin-bottom: 4px; }
.team-card-role { font-size: 0.9rem; font-weight: 600; color: var(--blue-primary); margin-bottom: 12px; }

/* ---- SCROLL ANIMATIONS ---- */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ---- RESPONSIVE DESIGN (MOBILE & TABLET) ---- */
@media (max-width: 1024px) {
  .two-col { gap: 48px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .section { padding: 70px 0; }
  .page-hero { padding: 80px 0 50px; }
}

@media (max-width: 768px) {
  .section { padding: 50px 0; }
  .section-sm { padding: 40px 0; }
  .two-col { grid-template-columns: 1fr; gap: 40px; }
  .two-col.reverse { direction: ltr; }
  .two-col img { max-height: 350px; }
  
  /* Typography Adjustments */
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  p { font-size: 1rem; }
  
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .stats-row { grid-template-columns: 1fr 1fr; gap: 32px; }
  .clients-row { gap: 16px; }
  
  /* Mobile Navigation */
  .nav-menu .nav-link, .nav-cta { display: none; }
  .nav-hamburger { display: flex; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .case-grid, .news-grid, .services-grid, .team-grid { grid-template-columns: 1fr; }
}

/* Mobile Menu Implementation */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  padding: 8px;
  border: none;
  background: none;
}
.nav-hamburger span { 
  display: block; width: 24px; height: 2px; 
  background: var(--text-dark); border-radius: 2px; 
  transition: transform 0.3s, opacity 0.3s; 
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-menu {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--grey-mid);
  padding: 0;
  max-height: 0;
  overflow: hidden;
  z-index: 999;
  box-shadow: var(--shadow-md);
  transition: max-height 0.3s ease-out;
}
.mobile-menu.open { max-height: 400px; padding: 16px 24px 24px; }
.mobile-menu a { 
  display: block; padding: 14px 0; font-weight: 600; 
  color: var(--text-dark); border-bottom: 1px solid var(--grey-light); 
  font-size: 1.05rem;
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: var(--blue-primary); }

/* ---- HERO SLIDES / OVERVIEW (HOME PAGE) ---- */
.service-slides { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin-top: 48px; }
.slide-card {
  border-radius: var(--radius-lg); overflow: hidden; position: relative; height: 320px; cursor: pointer; border: 1px solid var(--grey-mid);
}
.slide-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.slide-card:hover img { transform: scale(1.05); }
.slide-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13,43,94,0.95) 0%, rgba(13,43,94,0.4) 50%, transparent 100%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 24px; color: white;
}
.slide-num { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; color: rgba(255,255,255,0.7); margin-bottom: 8px; }
.slide-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
.slide-text { font-size: 0.9rem; color: rgba(255,255,255,0.85); line-height: 1.5; margin-bottom: 16px; }

.overview-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin-top: 48px; }
.overview-card { border-radius: var(--radius-lg); overflow: hidden; position: relative; height: 260px; text-decoration: none; border: 1px solid var(--grey-mid); }
.overview-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.overview-card:hover img { transform: scale(1.04); }
.overview-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13,43,94,0.95) 0%, rgba(13,43,94,0.2) 100%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 24px; color: white;
}
.overview-overlay h3 { font-size: 1.15rem; margin-bottom: 8px; font-weight: 700; }
.overview-overlay p { font-size: 0.9rem; color: rgba(255,255,255,0.85); line-height: 1.5; }
