/* ── Design Tokens ── */
:root {
  --mexican-green: #006847;
  --mexican-green-light: #00a868;
  --mexican-red: #ce1126;
  --mexican-white: #ffffff;
  --dark-bg: #1a1a1a;
  --light-bg: #f4f4f4;
  --text-primary: #333333;
  --text-light: #ffffff;
  --accent-red: #ff4d4d;
  --transition-speed: 0.3s;
  --terminal-green: #00ff88;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--dark-bg);
  color: var(--text-light);
  overflow-x: hidden;
  cursor: none;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
p { line-height: 1.7; }

/* ── Custom Cursor ── */
#cursor-dot {
  position: fixed; top: 0; left: 0; width: 8px; height: 8px;
  background: var(--mexican-green); border-radius: 50%;
  pointer-events: none; z-index: 99999;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--mexican-green), 0 0 20px rgba(0, 104, 71, 0.5);
  transition: width 0.2s, height 0.2s, background 0.2s;
}
#cursor-ring {
  position: fixed; top: 0; left: 0; width: 36px; height: 36px;
  border: 2px solid var(--mexican-green); border-radius: 50%;
  pointer-events: none; z-index: 99998;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, border-color 0.3s;
}
#cursor-dot.hovering { width: 14px; height: 14px; background: var(--mexican-red); box-shadow: 0 0 15px var(--mexican-red); }
#cursor-ring.hovering { width: 52px; height: 52px; border-color: var(--mexican-red); }
@media (hover: none) { #cursor-dot, #cursor-ring { display: none; } body { cursor: auto; } }

/* ── Scroll Progress ── */
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--mexican-green), var(--mexican-red));
  z-index: 10000; transition: width 0.1s linear;
}

/* ── Header / Nav ── */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 1.5rem 0;
  transition: all var(--transition-speed);
}
header.scrolled {
  background: rgba(26, 26, 26, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 104, 71, 0.3);
  padding: 1rem 0;
}
nav.container {
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-family: 'Montserrat', sans-serif; font-weight: 900;
  font-size: 1.1rem; letter-spacing: 1px;
}
.logo .green { color: var(--mexican-green); }
.logo .white { color: var(--mexican-white); }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a {
  font-size: 0.9rem; font-weight: 600; color: rgba(255,255,255,0.8);
  transition: color var(--transition-speed);
}
.nav-links a:hover, .nav-links a.active { color: var(--mexican-green); }

/* ── Container ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* ── Buttons ── */
.cta-button {
  display: inline-block; padding: 1rem 2.5rem;
  font-family: 'Montserrat', sans-serif; font-weight: 700;
  font-size: 1rem; letter-spacing: 1.5px; text-transform: uppercase;
  border-radius: 4px; border: none; cursor: pointer;
  transition: all var(--transition-speed);
}
.cta-button.primary {
  background: var(--mexican-green); color: var(--mexican-white);
}
.cta-button.primary:hover {
  background: var(--mexican-red);
  box-shadow: 0 12px 30px rgba(206, 17, 38, 0.4);
  transform: translateY(-2px);
}
.cta-button.secondary {
  background: transparent; color: var(--mexican-white);
  border: 2px solid rgba(255,255,255,0.5);
}
.cta-button.secondary:hover {
  background: var(--mexican-white); color: #000;
  transform: translateY(-2px);
}
.cta-button.large-green {
  box-shadow: 0 0 40px rgba(0, 104, 71, 0.4);
  opacity: 0;
  transform: scale(0.5);
}
.cta-button-small {
  padding: 0.5rem 1.2rem;
  background: var(--mexican-green); color: var(--mexican-white);
  font-size: 0.85rem; font-weight: 700; letter-spacing: 1px;
  border-radius: 4px; text-transform: uppercase;
  transition: background var(--transition-speed);
}
.cta-button-small:hover { background: var(--mexican-red); }

/* ── Hamburger Button ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid rgba(0, 104, 71, 0.4);
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
  z-index: 1200;
  position: relative;
  transition: border-color 0.3s;
}
.hamburger:hover { border-color: var(--mexican-green); }
.hamburger:focus-visible { outline: 2px solid var(--mexican-green); outline-offset: 3px; }

.ham-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--mexican-white);
  border-radius: 2px;
  transform-origin: center;
}

/* ── Mobile Nav Overlay ── */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 6rem 3rem 4rem;
  background: rgba(10, 10, 10, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.mobile-nav-overlay.is-open { display: flex; }

.mno-flag-bars {
  position: absolute; top: 0; right: 0; bottom: 0; width: 18%;
  display: flex; pointer-events: none;
}
.mno-flag-bar { flex: 1; }
.mno-flag-bar--green { background: var(--mexican-green); opacity: 0.18; }
.mno-flag-bar--white { background: var(--mexican-white); opacity: 0.05; }
.mno-flag-bar--red   { background: var(--mexican-red);   opacity: 0.18; }

.mno-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 104, 71, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 104, 71, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
}

.mno-close {
  position: absolute; top: 1.5rem; right: 1.5rem;
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.6rem; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.3s, color 0.3s;
  opacity: 0;
}
.mno-close:hover { border-color: var(--mexican-red); color: var(--mexican-red); }
.mno-close:focus-visible { outline: 2px solid var(--mexican-green); outline-offset: 3px; }

.mno-nav { width: 100%; max-width: 82%; }
.mno-links { list-style: none; padding: 0; margin: 0; }
.mno-item {
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.mno-item:first-child { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.mno-link {
  display: block;
  padding: 1.1rem 0;
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: clamp(1.6rem, 5vw, 2.8rem);
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  letter-spacing: -0.5px;
  transition: color 0.25s, padding-left 0.25s;
  transform: translateY(100%);
}
.mno-link:hover { color: var(--mexican-green); padding-left: 0.5rem; }
.mno-link.active { color: var(--mexican-green); }
.mno-link--cta {
  color: var(--mexican-green) !important;
  font-size: clamp(1rem, 3vw, 1.25rem) !important;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 1.5rem;
}
.mno-item:has(.mno-link--cta) { border-bottom: none; }

.mno-tagline {
  position: absolute; bottom: 2rem; left: 3rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase;
  opacity: 0;
}
.mno-tagline-green { color: var(--mexican-green); }
.mno-tagline-white { color: rgba(255, 255, 255, 0.25); }

@media (max-width: 992px) {
  .hamburger { display: flex; }
}

/* ── Section Shared ── */
.red-line {
  width: 50px; height: 4px;
  background: var(--mexican-red);
  margin-bottom: 1.5rem;
}
.section-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.5rem; font-weight: 900;
  line-height: 1.1; margin-bottom: 1.5rem;
}
.section-sub {
  font-size: 1.1rem; color: rgba(255,255,255,0.6);
  margin-bottom: 3rem; max-width: 640px;
}
.section-header { margin-bottom: 3.5rem; }

/* ── Grids ── */
.grid-2 {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4rem; align-items: center;
}
.grid-3 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
}
.grid-4 {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem;
}

/* ── SECTION 1: Hero ── */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center;
  background: linear-gradient(135deg, #0d0d0d 0%, #000 100%);
  overflow: hidden; padding: 10rem 0;
}
#hero-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.hero-decoration {
  position: absolute; right: -80px; top: 0; bottom: 0;
  display: flex; gap: 18px;
  transform: skewX(-20deg);
  pointer-events: none;
}
.stripe { width: 60px; height: 100%; }
.stripe-green  { background: rgba(0, 104, 71, 0.25); }
.stripe-white  { background: rgba(255, 255, 255, 0.07); }
.stripe-red    { background: rgba(206, 17, 38, 0.25); }

.hero-content { position: relative; z-index: 2; }

.hero-eyebrow {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 4px;
  text-transform: uppercase; color: var(--mexican-green);
  margin-bottom: 1.5rem; opacity: 0;
}
.hero h1 {
  font-family: 'Montserrat', sans-serif; font-weight: 900;
  font-size: 5.5rem; line-height: 1.05; letter-spacing: -3px;
  margin-bottom: 1.5rem; opacity: 0;
}
.hero-static { color: var(--mexican-white); }
.hero-sub {
  font-size: 1.25rem; color: rgba(255,255,255,0.75);
  max-width: 580px; margin-bottom: 2.5rem; opacity: 0;
}
.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; opacity: 0; }

/* ── SECTION 2: Project Snapshot ── */
.snapshot-section {
  padding: 8rem 0;
  background: var(--light-bg);
  color: var(--text-primary);
}
.snapshot-section .section-title { color: var(--text-primary); }
.snapshot-text p {
  font-size: 1.05rem; color: #555;
  margin-bottom: 1.4rem; max-width: 520px;
}

/* Initial animation states */
.snapshot-text h2 { opacity: 0; transform: translateX(-40px); }
.snapshot-text p   { opacity: 0; }

/* Project card */
.project-card {
  background: #0a0a0a;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35), 0 0 0 1px rgba(0, 255, 136, 0.08);
  font-family: 'Courier New', Courier, monospace;
  opacity: 0;
  transform: scale(0.85);
}
.project-card-bar {
  display: flex; align-items: center; gap: 0.5rem;
  background: #1a1a1a; padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-red    { background: #ff5f57; }
.dot-yellow { background: #ffbd2e; }
.dot-green-dot { background: #28c840; }
.project-card-title {
  font-size: 0.75rem; color: rgba(255,255,255,0.4);
  margin-left: 0.5rem; font-family: 'Inter', sans-serif;
}

.project-meta { width: 100%; }
.meta-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.meta-row:last-child { border-bottom: none; }
.meta-row dt {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: rgba(255,255,255,0.35);
}
.meta-row dd {
  color: var(--terminal-green);
  font-size: 0.9rem;
}
.status-live {
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--mexican-green-light);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--mexican-green-light);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.4); }
}

/* ── SECTION 3: The Architecture ── */
.arch-section {
  padding: 8rem 0;
  background: #111;
  background-image:
    linear-gradient(rgba(0, 104, 71, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 104, 71, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}
.arch-section .section-title { color: var(--text-light); }
.arch-section .section-sub   { color: rgba(255,255,255,0.5); }

.arch-card {
  background: rgba(255,255,255,0.04);
  border-top: 4px solid var(--mexican-green);
  padding: 2rem 1.75rem;
  border-radius: 4px;
  transition: background var(--transition-speed), box-shadow var(--transition-speed), transform var(--transition-speed);
  position: relative; overflow: hidden;
  opacity: 0; transform: translateY(60px);
}
.arch-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(0,104,71,0.12) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.3s;
}
.arch-card:hover::before { opacity: 1; }
.arch-card:hover {
  background: rgba(255,255,255,0.08);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.arch-card .card-icon {
  font-size: 2rem; color: var(--mexican-green); margin-bottom: 1rem;
}
.arch-card h3 {
  font-family: 'Montserrat', sans-serif; font-weight: 700;
  font-size: 1.1rem; color: var(--text-light);
  margin-bottom: 0.75rem;
}
.arch-card p { font-size: 0.9rem; color: rgba(255,255,255,0.6); line-height: 1.6; }
.arch-card code {
  font-family: 'Courier New', monospace;
  color: var(--terminal-green); font-size: 0.85em;
  background: rgba(0,255,136,0.08); padding: 1px 4px; border-radius: 3px;
}

/* Advantage strip */
.advantage-strip {
  margin-top: 3.5rem;
  background: rgba(0, 104, 71, 0.1);
  border: 1px solid rgba(0, 104, 71, 0.25);
  border-radius: 6px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 2.5rem 2rem;
  opacity: 0; transform: translateY(30px);
}
.advantage-divider {
  width: 1px; height: 3rem;
  background: rgba(0, 104, 71, 0.3);
}
.advantage-item { text-align: center; }
.advantage-number {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.8rem; font-weight: 900;
  color: var(--mexican-green);
  display: block; line-height: 1;
}
.advantage-label {
  display: block; margin-top: 0.5rem;
  font-size: 0.75rem; font-weight: 600;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase; letter-spacing: 2px;
}

/* ── SECTION 4: Velocity ── */
.velocity-section {
  padding: 8rem 0;
  background: var(--light-bg);
  color: var(--text-primary);
}
.velocity-section .section-title { color: var(--text-primary); }
.velocity-text p {
  font-size: 1.05rem; color: #555;
  margin-bottom: 1.4rem; max-width: 520px;
}
.velocity-text strong { color: var(--mexican-green); }
.velocity-text code {
  font-family: 'Courier New', monospace;
  font-size: 0.9em; background: rgba(0,104,71,0.1);
  color: #006847; padding: 1px 5px; border-radius: 3px;
}

/* Initial states */
.velocity-text h2 { opacity: 0; transform: translateX(-40px); }
.velocity-text p   { opacity: 0; }

.velocity-stats {
  display: flex; flex-direction: column; gap: 2.5rem;
}
.velocity-stat {
  display: flex; align-items: flex-start; gap: 1.25rem;
  opacity: 0; transform: translateX(40px);
}
.velocity-number {
  font-family: 'Montserrat', sans-serif;
  font-size: 3rem; font-weight: 900;
  color: var(--mexican-green);
  line-height: 1; flex-shrink: 0;
  min-width: 4.5rem;
}
.velocity-label {
  font-size: 0.95rem; color: #555;
  max-width: 220px; line-height: 1.5;
  padding-top: 0.4rem;
}
.velocity-label strong { color: var(--text-primary); display: block; font-size: 1rem; margin-bottom: 0.2rem; }

/* ── SECTION 5: Security ── */
.security-section {
  padding: 8rem 0;
  background: var(--dark-bg);
}
.security-section .section-title { color: var(--text-light); }
.security-section .section-sub   { color: rgba(255,255,255,0.5); }

.security-panel {
  padding: 2.75rem;
  border: 1px solid rgba(0, 104, 71, 0.2);
  border-top: 4px solid var(--mexican-green);
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
  transition: background var(--transition-speed), box-shadow var(--transition-speed);
  opacity: 0; transform: translateY(40px);
}
.security-panel:hover {
  background: rgba(255,255,255,0.06);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.security-panel-icon {
  font-size: 2.2rem; color: var(--mexican-green);
  margin-bottom: 1.25rem;
}
.security-panel h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.4rem; font-weight: 700;
  color: var(--text-light);
  margin-bottom: 1rem;
}
.security-panel p {
  font-size: 0.95rem; color: rgba(255,255,255,0.65);
  line-height: 1.7; margin-bottom: 1.25rem;
}
.security-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--mexican-green);
  border-radius: 2px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 2px;
  color: var(--mexican-green); text-transform: uppercase;
  font-family: 'Montserrat', sans-serif;
}
.security-badge::before {
  content: '●'; font-size: 0.5rem;
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ── SECTION 6: Contact ── */
.contact-section {
  padding: 8rem 0;
  background: radial-gradient(ellipse at center, #111 0%, #0a0a0a 100%);
  position: relative; text-align: center; overflow: hidden;
}
.contact-glow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(0,104,71,0.2) 0%, transparent 70%);
  pointer-events: none;
}
.contact-content { position: relative; z-index: 2; }
.contact-manifesto {
  font-size: 1rem; color: rgba(255,255,255,0.4);
  font-style: italic; letter-spacing: 1px;
  margin-bottom: 1.5rem; opacity: 0;
}
.contact-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 3.5rem; font-weight: 900;
  margin-bottom: 1.25rem; opacity: 0;
}
.contact-sub {
  font-size: 1.1rem; color: rgba(255,255,255,0.55);
  max-width: 540px; margin: 0 auto 3rem;
  opacity: 0;
}

/* ── Footer ── */
footer {
  background: #0a0a0a;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 2rem 0;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.85rem; color: rgba(255,255,255,0.35);
}

/* ── Utilities ── */
.highlight {
  background: linear-gradient(135deg, var(--mexican-green) 0%, var(--mexican-green-light) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 992px) {
  .hero h1 { font-size: 3.2rem; }
  .hero { padding: 8rem 0 6rem; }
  .grid-2 { grid-template-columns: 1fr; gap: 3rem; }
  .hero-decoration { display: none; }
  .nav-links { display: none; }
  body { cursor: auto; }
  #cursor-dot, #cursor-ring { display: none; }
  .advantage-strip { flex-direction: column; gap: 2rem; }
  .advantage-divider { width: 3rem; height: 1px; }
}
@media (max-width: 600px) {
  .hero h1 { font-size: 2.6rem; letter-spacing: -2px; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .contact-title { font-size: 2.5rem; }
  .footer-inner { flex-direction: column; gap: 0.5rem; text-align: center; }
}

/* ── Particle Engine ── */
.cursor-trail-particle {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  z-index: 9997;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
  opacity: 0;
}
.ambient-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.ambient-particle { position: absolute; border-radius: 50%; pointer-events: none; will-change: transform, opacity; opacity: 0; }
@keyframes ambient-float {
  0%   { transform: translateY(0) scale(1);        opacity: 0; }
  15%  { opacity: var(--ap-alpha, 0.18); }
  85%  { opacity: var(--ap-alpha, 0.18); }
  100% { transform: translateY(-110vh) scale(0.5); opacity: 0; }
}
