/* Stellatus Website Styles */

:root {
  --bg: #222222; /* charcoal */
  --text: #F5F5F5;
  --nav-bg: #FFFFFF;
  --nav-text: #111111;
  --accent: #D4AF37; /* gold */
  --accent-hover: #EACD6F; /* lighter gold */
  --success: #33B87C;
  --danger: #FF6B6B;
  --surface: rgba(255, 255, 255, 0.05);
  --border: #333333; /* container border on charcoal */
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  --radius: 12px;
  --header-height: 72px;
  --container-max: 1200px;
  --transition-fast: 180ms ease;
  --transition: 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Global */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(circle at 50% 10%, rgba(50, 50, 60, 1) 0%, var(--bg) 50%), var(--bg);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: min(92%, var(--container-max));
  margin-inline: auto;
}

/* Accessibility focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Header / Navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--nav-bg);
  color: var(--nav-text);
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 22px;
  color: var(--nav-text);
  letter-spacing: 0.4px;
}

.logo img {
  height: 40px;
  width: auto;
}

.main-nav { display: flex; align-items: center; gap: 8px; }
.nav-link {
  color: var(--nav-text);
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}
.nav-link:hover { background: rgba(0,0,0,0.05); }
.nav-link.active { color: var(--accent); background: rgba(212,175,55,0.12); }

/* Mobile Navigation Toggle */
.mobile-nav-toggle {
  display: none; /* Hidden on desktop */
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001; /* Above nav */
}

.sr-only { /* Screen reader only text */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.hamburger-icon {
  display: block;
  position: relative;
  width: 24px;
  height: 2px;
  background: var(--nav-text);
  transition: all 250ms ease-in-out;
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--nav-text);
  transition: all 250ms ease-in-out;
}

.hamburger-icon::before { top: -8px; }
.hamburger-icon::after { top: 8px; }

/* Animate to 'X' when nav is open */
.nav-open .hamburger-icon { background: transparent; }
.nav-open .hamburger-icon::before { transform: rotate(45deg) translate(5px, 6px); }
.nav-open .hamburger-icon::after { transform: rotate(-45deg) translate(5px, -6px); }

/* Offset anchor scroll for sticky header */
section { scroll-margin-top: calc(var(--header-height) + 16px); }

/* Hero */
.hero-section {
  position: relative;
  min-height: 92vh;
  display: grid;
  place-items: center;
  color: var(--text);
  background: url("images/Future of Mining.png") center/cover no-repeat;
  isolation: isolate;
  overflow: hidden;
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top; /* Aligns video to the top to prevent cropping heads */
  z-index: -2;
}

.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(24,24,32,0.6) 0%, rgba(24,24,32,0.55) 40%, rgba(24,24,32,0.6) 100%);
  z-index: -1;
}
.hero-content { text-align: center; max-width: 900px; padding: 64px 0; }
.hero-content h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: 0.6px;
  text-shadow: 0 0 15px rgba(234, 205, 111, 0.6), 0 0 40px rgba(212, 175, 55, 0.4);
}
.hero-content h2 {
  margin: 0 0 28px;
  font-size: clamp(18px, 2.3vw, 26px);
  font-weight: 600;
  color: #E7E7F2;
  letter-spacing: 0.4px;
}

.hero-content .hero-intro {
  font-size: clamp(16px, 2.1vw, 20px);
  line-height: 1.6;
  color: #EAEAF2;
  max-width: 800px;
  margin: 16px auto 28px;
  text-shadow: 0 0 8px rgba(234, 205, 111, 0.3);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
}
.btn-primary {
  background: var(--accent);
  color: var(--text);
  box-shadow: 0 8px 20px rgba(212,175,55,0.28);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px) scale(1.05); box-shadow: 0 10px 26px rgba(234,205,111,0.36); }
.btn-primary:active { transform: translateY(0) scale(1.01); }

/* Sections */
.section { padding: 80px 0; }
.section h2 {
  margin: 0 0 16px;
  font-size: clamp(24px, 3.2vw, 36px);
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow: 0 0 12px rgba(234, 205, 111, 0.5), 0 0 30px rgba(212, 175, 55, 0.3);
}

#solutions h2,
#approach h2,
#about h2 {
  text-align: center;
}

.section-intro { max-width: 820px; color: #EAEAF2; }

/* Cards / Containers */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    transparent,
    rgba(234, 205, 111, 0.15),
    transparent 20%
  );
  z-index: -1;
  animation: rotate 8s linear infinite;
  opacity: 0;
  transition: opacity 500ms ease-out;
}

.card:hover::before {
  opacity: 1;
}

/* Solutions Layout */
.solution {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr;
  gap: 28px;
  align-items: stretch;
  padding: 18px;
  margin: 28px 0 42px;
}
.solution.reverse { grid-template-columns: 1.4fr 1.2fr; }
.solution-image { overflow: hidden; border-radius: 10px; }
.solution-image img { width: 100%; height: 100%; aspect-ratio: 16/10; object-fit: cover; transform: scale(1.02); transition: transform var(--transition); }
.solution:hover .solution-image img { transform: scale(1.06); }
.solution-content { padding: 8px 6px 8px 6px; }
.solution h3 { margin: 4px 0 10px; font-size: clamp(18px, 2.2vw, 24px); letter-spacing: 0.4px; }
.key-outcomes { margin: 12px 0 0 0; padding-left: 18px; }
.key-outcomes li { margin: 8px 0; }

/* Alternating content order */
@media (min-width: 900px) {
  .solution.reverse .solution-image { order: 2; }
  .solution.reverse .solution-content { order: 1; }
}

/* Approach cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 18px;
}
.feature { padding: 22px; text-align: left; }
.feature .icon { color: var(--accent); margin-bottom: 12px; }
.feature h3 { margin: 6px 0 8px; font-size: 18px; letter-spacing: 0.3px; }
.feature p { margin: 0; color: #EDEDF6; }

/* About */
.about-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 48px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.about-image {
  flex-shrink: 0;
}

.about-image img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  aspect-ratio: 3/4;
  object-fit: cover;
  width: 280px;
  height: auto;
}

.about-content {
  max-width: 720px;
  text-align: left;
}

.about-content p { margin: 10px 0; }

/* Contact Form */
/* Center the contact section */
#contact .container { display: flex; flex-direction: column; align-items: center; }
#contact h2, #contact .section-intro { text-align: center; }
form { width: 100%; max-width: 500px; margin: 18px auto 0; }
.form-row { display: grid; gap: 8px; margin-bottom: 14px; }
label { font-weight: 600; letter-spacing: 0.2px; }
input, textarea {
  width: 100%;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
input::placeholder, textarea::placeholder { color: rgba(245,245,245,0.65); }
input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(212,175,55,0.22);
}
.form-status { margin-top: 10px; font-weight: 600; letter-spacing: 0.2px; }
.form-status.success { color: var(--success); }
.form-status.error { color: var(--danger); }

/* Footer */
.site-footer { background: #2E2E3A; color: #EAEAF3; padding: 10px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.back-to-top { color: var(--accent); font-weight: 700; }
.back-to-top:hover { color: var(--accent-hover); }

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Scroll Reveal Animations */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms ease, transform 700ms ease; }
.reveal.reveal-visible { opacity: 1; transform: translateY(0); }

/* Mobile fallback for reveal animations */
@media (max-width: 768px) {
  .reveal {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  .btn, .solution-image img { transition: none !important; }
  html { scroll-behavior: auto; }
}

/* Typography Tuning */
h1, h2, h3 {
  font-family: 'Exo 2', sans-serif;
  letter-spacing: 0.4px;
}
p { font-size: 16px; }

/* Responsive */
@media (max-width: 1100px) {
  .solution { 
    grid-template-columns: 1fr; 
    gap: 20px;
  }
  .solution.reverse { 
    grid-template-columns: 1fr; 
  }
  
  /* Ensure proper stacking on mobile */
  .solution-image { order: 1; }
  .solution-content { order: 2; }
  .solution.reverse .solution-image { order: 1; }
  .solution.reverse .solution-content { order: 2; }
}

@media (max-width: 980px) {
  .about-grid {
    gap: 32px;
  }
  .about-content {
    text-align: center;
  }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile Navigation Breakpoint */
@media (max-width: 768px) {
  .mobile-nav-toggle { display: block; }
  
  .main-nav {
    position: fixed;
    inset: 0 0 0 35%; /* Slide in from right */
    flex-direction: column;
    padding: min(20vh, 8rem) 2rem;
    gap: 2.5rem;
    background: hsla(0, 0%, 100%, 0.95);
    backdrop-filter: blur(8px);
    transform: translateX(100%);
    transition: transform 350ms ease-out;
  }

  .main-nav.active { transform: translateX(0); }
  .nav-open { overflow: hidden; } /* Prevent scrolling when nav is open */

  .nav-link { font-size: 1.25rem; }
  
  /* Improve solutions section on mobile */
  .solution {
    margin: 20px 0 32px;
    padding: 16px;
  }
  
  .solution-content {
    padding: 12px 8px;
  }
  
  .solution h3 {
    font-size: clamp(16px, 4vw, 20px);
    margin: 8px 0 12px;
  }
  
  .key-outcomes {
    margin: 16px 0 0 0;
    padding-left: 16px;
  }
  
  .key-outcomes li {
    margin: 6px 0;
    font-size: 14px;
    line-height: 1.5;
  }
}

@media (max-width: 640px) {
  :root { --header-height: 64px; }
  .header-inner { height: var(--header-height); }
  
  .hero-section { min-height: 85vh; }
  .hero-content { padding: 48px 0; }
  .hero-content h1 { font-size: clamp(28px, 8vw, 40px); }
  .hero-content .hero-intro { font-size: clamp(15px, 4vw, 18px); }
  
  .cards-grid { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .section h2 { font-size: clamp(22px, 6vw, 28px); }
  
  /* Enhanced mobile solutions styling */
  .solution { 
    padding: 12px;
    margin: 16px 0 28px;
    gap: 16px;
  }
  
  .solution-content {
    padding: 8px 4px;
  }
  
  .solution h3 {
    font-size: clamp(15px, 4.5vw, 18px);
    line-height: 1.3;
    margin: 4px 0 8px;
  }
  
  .solution p {
    font-size: 14px;
    line-height: 1.5;
    margin: 8px 0;
  }
  
  .key-outcomes {
    margin: 12px 0 0 0;
    padding-left: 14px;
  }
  
  .key-outcomes li {
    margin: 4px 0;
    font-size: 13px;
    line-height: 1.4;
  }
}

/* iPhone specific fixes */
@media (max-width: 480px) {
  .solution-image img {
    aspect-ratio: 16/9; /* Better aspect ratio for small screens */
  }
  
  .solution {
    border-radius: 8px; /* Smaller radius for mobile */
  }
  
  .solution-content {
    padding: 6px 2px;
  }
}
