:root {
  --color-primary: #1E1B4B;
  --color-secondary: #312E81;
  --color-cta: #CA8A04;
  --color-bg: #0F0F23;
  --color-text: #F8FAFC;
}

/* Global reset - guarantees zero horizontal scroll at every breakpoint */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: hidden; max-width: 100%; }
img, svg, video, iframe { max-width: 100%; }

html { scroll-behavior: smooth; }
body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: 'General Sans', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Satoshi', ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.02em;
  text-wrap: balance;
  -webkit-hyphens: auto; hyphens: auto;
  line-height: 1.1;
}
p, blockquote, li, figcaption { text-wrap: pretty; line-height: 1.55; }

/* Fluid display sizes - per spec */
.h-display-xl { font-size: clamp(2rem, 6vw, 4.5rem); line-height: 1.06; }
.h-display-lg { font-size: clamp(1.5rem, 4vw, 3rem); line-height: 1.12; }
.h-display-md { font-size: clamp(1.25rem, 3vw, 2rem); line-height: 1.2; }

/* Fluid body / lead sizes */
.lead { font-size: clamp(0.875rem, 2.5vw, 1.125rem); line-height: 1.6; }

/* Touch targets - ensure min 44x44 thumb area on mobile controls */
.btn { min-height: 44px; }
.tap { min-height: 44px; min-width: 44px; }

/* Hide scrollbar on horizontal carousels */
.scrollbar-hide { scrollbar-width: none; -ms-overflow-style: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* Ambient cinematic backdrop */
.ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 20% 10%, rgba(76, 70, 182, 0.22), transparent 60%),
    radial-gradient(50% 40% at 85% 20%, rgba(202, 138, 4, 0.18), transparent 65%),
    radial-gradient(70% 60% at 50% 100%, rgba(30, 27, 75, 0.6), transparent 70%);
}

.grain::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none; opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.6'/></svg>");
}

/* Glass cards */
.glass {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}
.glass-strong {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

/* Gold gradient text */
.text-gold-gradient {
  background: linear-gradient(135deg, #FBE192 0%, #E0A622 45%, #CA8A04 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.875rem 1.5rem; border-radius: 9999px; font-weight: 600; cursor: pointer; transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease, color 220ms ease, border-color 220ms ease; }
.btn-primary { background: linear-gradient(135deg, #E0A622 0%, #CA8A04 100%); color: #0F0F23; box-shadow: 0 10px 30px -10px rgba(202, 138, 4, 0.6); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 18px 50px -10px rgba(202, 138, 4, 0.75); }
.btn-ghost { background: rgba(255,255,255,0.04); color: #F8FAFC; border: 1px solid rgba(255,255,255,0.12); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); border-color: rgba(202, 138, 4, 0.4); color: #F0C75B; }
.btn:focus-visible { outline: 2px solid #F0C75B; outline-offset: 3px; }

/* Card hover glow */
.card-glow { position: relative; transition: transform 320ms cubic-bezier(.2,.7,.2,1), box-shadow 320ms ease, border-color 320ms ease; }
.card-glow:hover { transform: translateY(-4px); border-color: rgba(202, 138, 4, 0.35); box-shadow: 0 30px 60px -25px rgba(0,0,0,0.6), 0 0 40px -5px rgba(202, 138, 4, 0.25); }
.card-glow::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, rgba(202,138,4,0.0), rgba(202,138,4,0.4), rgba(76,70,182,0.0));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
  opacity: 0; transition: opacity 320ms ease;
}
.card-glow:hover::before { opacity: 1; }

/* Project tile hover */
.tile { overflow: hidden; position: relative; }
.tile img { transition: transform 700ms cubic-bezier(.2,.7,.2,1), filter 500ms ease; }
.tile:hover img { transform: scale(1.06); filter: brightness(0.7); }
.tile .tile-meta { transform: translateY(8px); opacity: 0; transition: transform 360ms ease, opacity 360ms ease; }
.tile:hover .tile-meta { transform: translateY(0); opacity: 1; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms ease, transform 700ms cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }
.reveal-delay-4 { transition-delay: 320ms; }

/* Subtle marquee */
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee { animation: drift 40s linear infinite; }

/* Navbar link underline */
.nav-link { position: relative; cursor: pointer; }
.nav-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: linear-gradient(90deg, transparent, #E0A622, transparent); transform: scaleX(0); transform-origin: center; transition: transform 260ms ease; }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

/* Inputs */
.field {
  width: 100%; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.10); color: #F8FAFC;
  border-radius: 12px; padding: 0.875rem 1rem; font-size: 1rem; transition: border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
}
.field::placeholder { color: rgba(248,250,252,0.45); }
.field:focus { outline: none; border-color: rgba(224,166,34,0.55); background: rgba(255,255,255,0.05); box-shadow: 0 0 0 3px rgba(202,138,4,0.18); }

/* Pulse dot */
@keyframes ping-soft { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(2.4); opacity: 0; } }
.pulse-dot { position: relative; }
.pulse-dot::before { content: ""; position: absolute; inset: 0; border-radius: 9999px; background: inherit; animation: ping-soft 1800ms cubic-bezier(0,0,0.2,1) infinite; }

/* Section divider line */
.hairline { height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee { animation: none; }
  .pulse-dot::before { animation: none; }
  html { scroll-behavior: auto; }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: hidden; max-width: 100vw; }

h1 { font-size: clamp(2rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 3rem); }
h3 { font-size: clamp(1.1rem, 3vw, 1.75rem); }
p { font-size: clamp(0.875rem, 2.5vw, 1.125rem); line-height: 1.6; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; }

@media (max-width: 768px) {
  .hero .right-panel { display: none; }
  .hero .content { width: 100%; padding: 0 1.25rem; }
  .hero .btn-cta { display: block; width: 100%; margin-bottom: 0.75rem; }
  .hero { min-height: auto; }
  .hero-checklist { flex-direction: column; }
  .hero-checklist-item { width: 100%; text-align: left; padding: 0.25rem 0; }
  section { padding-top: 3rem; padding-bottom: 3rem; padding-left: 1.25rem; padding-right: 1.25rem; }
  .card-grid { grid-template-columns: 1fr; width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: 1fr; }
  .contact-info-block { display: flex; flex-direction: column; margin-bottom: 1rem; }
  .contact-phone, .contact-whatsapp { min-height: 44px; padding: 0.75rem; }
  .contact-form input, .contact-form textarea, .contact-form select { width: 100%; font-size: 16px; }
  .nav-desktop-links { display: none; }
  .nav-hamburger { display: flex; }
  .nav-dropdown { display: block; }
}

@media (min-width: 768px) and (max-width: 1024px) {
  section { padding-top: 4rem; padding-bottom: 4rem; padding-left: 2rem; padding-right: 2rem; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  section { padding-top: 6rem; padding-bottom: 6rem; padding-left: 5rem; padding-right: 5rem; }
  .card-grid, .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

nav#navbar.scrolled nav {
  background: rgba(15,15,35,0.97) !important;
  backdrop-filter: blur(20px) !important;
  box-shadow: 0 1px 0 rgba(201,168,76,0.2);
}
.tile::after {
  content: "View Project →";
  position: absolute; inset: 0;
  background: rgba(201,168,76,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; font-weight: 600; letter-spacing: 0.1em;
  color: #F0C75B; opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.tile:hover::after { opacity: 1; }

/* Tile grid stretch fix */
#work .grid { align-items: stretch; }
#work .grid > a { display: flex; flex-direction: column; }
#work .grid > a > div { flex: 1; }
