/* ============================================
   CUBIKO3D — FIXED & SOLID Design
   High Contrast + Safe Animations
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* --- Tokens --- */
:root {
  --bg: #ffffff;
  --bg-section: #f3f4f6;
  /* Gray-100 */
  --bg-dark: #111827;
  /* Gray-900 */

  --text: #0f172a;
  /* High Contrast Slate-900 */
  --text-sub: #334155;
  /* Slate-700 */
  --text-muted: #64748b;
  /* Slate-500 */

  --green: #16a34a;
  /* Green-600 */
  --green-dark: #14532d;
  --green-bg: #dcfce7;

  --border: #e2e8f0;
  /* Slate-200 */

  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --radius: 8px;

  --font-h: 'Space Grotesk', sans-serif;
  --font-b: 'Inter', sans-serif;

  --max-w: 1200px;
}

/* --- Reset --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-b);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  font-size: 16px;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Particles Canvas --- */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  /* Always behind content */
  pointer-events: none;
  opacity: 0.6;
  /* Ensure it's subtle */
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-h);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 0.5em;
}

p {
  margin-bottom: 1em;
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 0;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
}

.navbar.scrolled {
  padding: 0.75rem 0;
  box-shadow: var(--shadow);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-h);
  font-weight: 700;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.logo span {
  color: var(--green);
}

.nav-menu {
  display: none;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  font-weight: 500;
  color: var(--text-sub);
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--text);
}

@media (min-width: 768px) {
  .nav-menu {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }
}

.menu-toggle {
  background: none;
  border: none;
  padding: 5px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text);
  border-radius: 2px;
}

/* Mobile Nav */
.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: white;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.mobile-nav.active {
  transform: translateY(0);
}

.mobile-nav a {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-green {
  background: var(--green);
  color: white;
}

.btn-green:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--text);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--text);
  color: white;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* FAB */
.whatsapp-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 60px;
  height: 60px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  transition: transform 0.3s;
}

.whatsapp-fab:hover {
  transform: scale(1.1);
}

.whatsapp-fab svg {
  width: 32px;
  height: 32px;
  fill: white;
}

/* --- Sections --- */
section {
  padding: 5rem 0;
  position: relative;
}

/* --- HERO --- */
.hero {
  padding-top: 140px;
  min-height: 90vh;
  display: flex;
  align-items: center;
  background: var(--bg);
  /* Solid white, safe */
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-content h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 1rem;
}

.hero-content .accent {
  color: var(--green);
}

.hero-content .lead {
  font-size: 1.125rem;
  color: var(--text-sub);
  margin-bottom: 2rem;
  max-width: 500px;
}

.hero-stats {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 2rem;
}

.stat h4 {
  font-size: 2rem;
  margin-bottom: 0;
}

.stat span {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* CUBE VISUAL - CSS Only */
.cube-wrapper {
  display: flex;
  justify-content: center;
}

.cube-container {
  width: 300px;
  height: 300px;
  perspective: 1000px;
}

.cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: spin 15s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotateX(-20deg) rotateY(0deg);
  }

  100% {
    transform: rotateX(-20deg) rotateY(360deg);
  }
}

.face {
  position: absolute;
  width: 200px;
  height: 200px;
  left: 50px;
  top: 50px;
  border: 2px solid var(--text);
  background: rgba(255, 255, 255, 0.95);
  /* High opacity */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.front {
  transform: translateZ(100px);
}

.back {
  transform: rotateY(180deg) translateZ(100px);
  background: #eee;
}

.right {
  transform: rotateY(90deg) translateZ(100px);
  background: var(--green-bg);
  color: var(--green-dark);
}

.left {
  transform: rotateY(-90deg) translateZ(100px);
  background: var(--text);
  color: white;
}

.top {
  transform: rotateX(90deg) translateZ(100px);
  background: var(--green);
  color: white;
}

.bottom {
  transform: rotateX(-90deg) translateZ(100px);
  background: #111;
  color: var(--green);
}

@media (min-width: 992px) {
  .hero .container {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- TRUST BAR --- */
.trust-bar {
  padding: 2rem 0;
  background: var(--bg-section);
  border-bottom: 1px solid var(--border);
}

.trust-items {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-sub);
}

/* --- SOLUTIONS GRID --- */
.solutions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.solution-card {
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  transition: all 0.3s;
}

.solution-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--green);
}

.solution-card.featured {
  border: 2px solid var(--green);
  background: #f0fdf4;
}

.sol-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.solution-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.solution-card p {
  color: var(--text-sub);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --- MATERIALS GRID --- */
.materials-strip {
  background: var(--bg-dark);
  color: white;
}

.materials-strip h2,
.materials-strip p {
  color: white;
}

.materials-strip .text-sub {
  color: #9ca3af;
}

.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 3rem;
}

.mat-cell {
  background: #1f2937;
  padding: 1.5rem;
  color: white;
  transition: background 0.2s;
}

.mat-cell:hover {
  background: #374151;
}

.mat-cell h4 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  color: white;
}

.mat-cell span {
  font-size: 0.8rem;
  color: #9ca3af;
}

.mat-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

/* --- PROCESS --- */
.process-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
  counter-reset: step;
}

.process-step {
  position: relative;
  padding-top: 3rem;
}

.process-step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: 0;
  left: 0;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--border);
  font-family: var(--font-h);
}

/* --- PORTFOLIO --- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.portfolio-item {
  aspect-ratio: 4/3;
  background: var(--bg-section);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.portfolio-item:hover .overlay {
  opacity: 1;
}

.overlay-text h4 {
  color: white;
  font-size: 1.1rem;
  margin: 0;
}

.overlay-text span {
  color: #ccc;
  font-size: 0.9rem;
}

.cta-banner {
  margin-top: 4rem;
  padding: 3rem;
  background: var(--text);
  color: white;
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.cta-banner h3 {
  color: white;
  margin: 0;
  font-size: 1.5rem;
}

.cta-banner p {
  color: #9ca3af;
  margin: 0.5rem 0 0;
}

/* --- CONTACT --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin-top: 3rem;
}

@media (min-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-info .info-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.info-icon {
  font-size: 1.5rem;
}

.contact-form {
  padding: 2rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
}

.form-group input:focus {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 3px var(--green-bg);
}

/* --- FOOTER --- */
footer {
  background: var(--bg-dark);
  color: #9ca3af;
  padding: 4rem 0 2rem;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

footer h5 {
  color: white;
  margin-bottom: 1rem;
  font-size: 1rem;
}

footer a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 2rem;
  text-align: center;
  font-size: 0.8rem;
}

/* --- UTILITIES --- */
/* Simple Fade In - No JS dependency for initial visibility */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  animation: safeFadeIn 0.8s forwards;
}

/* Stagger is tricky without JS, so let's keep it simple or default to visible */
@keyframes safeFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* If JS fails, content is still visible eventually */
.visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}