/* ============================================
   ESTUDIO FORLINI — Premium Institutional Site
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  --navy: #1B2141;
  --navy-light: #2A305A;
  --navy-mid: #212752;
  --cream: #F5F0EB;
  --gold: #C9A96E;
  --gold-light: #D4BA85;
  --white: #FFFFFF;
  --gray: #8B8FA3;
  --gray-light: #B8BCC8;
  --gray-dark: #5A5E72;

  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --container: 1280px;
  --section-padding: 100px;
  --section-padding: clamp(80px, 12vh, 160px);
  --gap: 24px;
  --gap: clamp(16px, 2vw, 32px);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: auto; /* Lenis handles smooth scroll */
}

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

body {
  font-family: var(--font-sans);
  color: var(--white);
  background-color: var(--navy);
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

/* Hide native cursor only when custom cursor is active (set via JS) */
body.custom-cursor-active,
body.custom-cursor-active a,
body.custom-cursor-active button,
body.custom-cursor-active .form__input {
  cursor: none;
}

@media (hover: none) and (pointer: coarse) {
  body.custom-cursor-active,
  body.custom-cursor-active a,
  body.custom-cursor-active button,
  body.custom-cursor-active .form__input {
    cursor: auto;
  }
  body.custom-cursor-active a { cursor: pointer; }
  body.custom-cursor-active button { cursor: pointer; }
  body.custom-cursor-active .form__input { cursor: text; }
}

img, svg {
  display: block;
  max-width: 100%;
}

ul { list-style: none; }

::selection {
  background-color: var(--gold);
  color: var(--navy);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  padding: 0 clamp(24px, 4vw, 64px);
}

/* ---------- Grain Overlay ---------- */
.grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ---------- Cursor Glow ---------- */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, rgba(201, 169, 110, 0.06) 0%, rgba(201, 169, 110, 0.02) 35%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: opacity 0.4s;
  opacity: 0;
}

.cursor-glow.is-visible {
  opacity: 1;
}

/* Intensify on dark sections */
.cursor-glow.is-dark {
  background: radial-gradient(circle, rgba(201, 169, 110, 0.08) 0%, rgba(201, 169, 110, 0.03) 35%, transparent 70%);
}

@media (hover: none) and (pointer: coarse) {
  .cursor-glow { display: none; }
}

/* ---------- Custom Cursor ---------- */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  pointer-events: none;
}

.cursor__dot {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.25), 0 0 8px rgba(201, 169, 110, 0.3);
  transition: width 0.3s var(--ease-out-expo),
              height 0.3s var(--ease-out-expo),
              background 0.3s,
              box-shadow 0.3s;
}

.cursor__outline {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(201, 169, 110, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s var(--ease-out-expo),
              height 0.4s var(--ease-out-expo),
              border-color 0.3s;
}

.cursor--hover .cursor__dot {
  width: 12px;
  height: 12px;
  background: var(--gold);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.2), 0 0 12px rgba(201, 169, 110, 0.4);
}

.cursor--hover .cursor__outline {
  width: 60px;
  height: 60px;
  border-color: var(--gold);
}

@media (hover: none) and (pointer: coarse) {
  .cursor { display: none; }
}

/* ---------- Loading Screen ---------- */
.loader {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 10001;
  background-color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease-out-expo),
              visibility 0.6s;
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Safety: auto-hide loader after 5s even if JS fails */
.loader {
  animation: loaderSafetyHide 0.001s 5s forwards;
}

@keyframes loaderSafetyHide {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

.loader__inner {
  text-align: center;
}

.loader__logo {
  width: 200px;
  max-width: 200px;
  height: auto;
  margin: 0 auto 24px;
  opacity: 0;
  animation: fadeIn 1.2s ease 0.3s forwards;
}

.loader__bar {
  width: 120px;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 auto;
  overflow: hidden;
  opacity: 0;
  animation: fadeIn 0.6s ease 0.8s forwards;
}

.loader__bar-fill {
  width: 0%;
  height: 100%;
  background: var(--gold);
  animation: loaderBar 2s var(--ease-in-out) 0.8s forwards;
}

@keyframes loaderCircle {
  to { stroke-dashoffset: 0; }
}

@keyframes loaderLetter {
  to { stroke-dashoffset: 0; }
}

@keyframes loaderBar {
  to { width: 100%; }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* ---------- Navbar ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 20px 0;
  transition: padding 0.4s var(--ease-out-expo),
              background 0.4s;
}

.nav.is-scrolled {
  padding: 12px 0;
  background: rgba(27, 33, 65, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(201, 169, 110, 0.08);
}

.nav__container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  padding: 0 clamp(24px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1001;
}

.nav__logo-img {
  height: 48px;
  width: auto;
  max-height: 48px;
  transition: transform 0.4s var(--ease-out-expo), opacity 0.3s;
}

.nav__logo:hover .nav__logo-img {
  transform: scale(1.05);
  opacity: 0.9;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav__link {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray-light);
  position: relative;
  padding: 4px 0;
  transition: color 0.3s;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 1px;
  background: var(--gold);
  transition: width 0.4s var(--ease-out-expo);
}

.nav__link:hover,
.nav__link.active {
  color: var(--white);
}

.nav__link:hover::after,
.nav__link.active::after {
  width: 100%;
}

.nav__link--cta {
  color: var(--gold);
  border: 1px solid rgba(201, 169, 110, 0.3);
  padding: 8px 20px;
  border-radius: 2px;
  transition: all 0.3s var(--ease-out-expo);
}

.nav__link--cta::after { display: none; }

.nav__link--cta:hover {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}

/* Burger */
.nav__burger {
  display: none;
  flex-direction: column;
  gap: 6px;
  width: 28px;
  padding: 10px 8px;
  z-index: 1001;
}

.nav__burger span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--cream);
  transition: all 0.4s var(--ease-out-expo);
  transform-origin: center;
}

.nav__burger.is-active span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.nav__burger.is-active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav__burger.is-active span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 999;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 48px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease-out-expo),
              visibility 0.5s;
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.mobile-menu__link {
  font-family: var(--font-serif);
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 500;
  color: var(--cream);
  letter-spacing: 2px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s var(--ease-out-expo),
              transform 0.4s var(--ease-out-expo),
              color 0.3s;
}

.mobile-menu.is-open .mobile-menu__link {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu.is-open .mobile-menu__link:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.is-open .mobile-menu__link:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.is-open .mobile-menu__link:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.is-open .mobile-menu__link:nth-child(4) { transition-delay: 0.25s; }
.mobile-menu.is-open .mobile-menu__link:nth-child(5) { transition-delay: 0.3s; }

.mobile-menu__link:hover {
  color: var(--gold);
}

.mobile-menu__footer {
  text-align: center;
  opacity: 0;
  transition: opacity 0.5s 0.35s;
}

.mobile-menu.is-open .mobile-menu__footer {
  opacity: 1;
}

.mobile-menu__footer p {
  font-size: 13px;
  color: var(--gray);
  line-height: 1.8;
}

@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
}

/* ---------- HERO Section ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--navy);
}

.hero__bg {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
}

.hero__bg canvas {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%;
  height: 100%;
}

.hero__gradient {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, transparent 0%, var(--navy) 100%),
    linear-gradient(180deg, rgba(27, 33, 65, 0.3) 0%, var(--navy) 100%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 80px 24px 0;
}

.hero__logo-wrap {
  margin: 0 auto 40px;
  width: 150px;                      /* fallback for browsers that don't support clamp */
  height: 150px;
  width: clamp(100px, 15vw, 150px);
  height: clamp(100px, 15vw, 150px);
  overflow: hidden;
}

.hero__logo {
  width: 100%;
  height: 100%;
  max-width: 150px;
  max-height: 150px;
  object-fit: contain;
}

.js-loaded .hero__logo {
  opacity: 0;
}

.hero__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.hero__line-deco {
  width: clamp(32px, 8vw, 60px);
  height: 1px;
  overflow: hidden;
}

.hero__line-deco span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--gold);
}

.js-loaded .hero__line-deco span {
  transform: translateX(-101%);
}

.hero__title {
  font-family: var(--font-serif);
  color: var(--cream);
  line-height: 1.1;
  overflow: hidden;
}

.hero__title-top {
  display: block;
  font-size: clamp(16px, 2.5vw, 22px);
  font-weight: 400;
  letter-spacing: 8px;
  text-transform: uppercase;
  color: var(--gray-light);
}

.hero__title-bottom {
  display: block;
  font-size: 72px;
  font-size: clamp(52px, 10vw, 100px);
  font-weight: 700;
  letter-spacing: 4px;
}

.hero__tagline {
  font-family: var(--font-sans);
  font-size: clamp(13px, 1.6vw, 16px);
  font-weight: 300;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gray);
  margin-top: 8px;
}

.hero__tagline .word {
  display: inline-block;
  overflow: hidden;
}

.hero__tagline .char {
  display: inline-block;
}

.js-loaded .hero__tagline .char {
  transform: translateY(100%);
}

/* Scroll indicator */
.hero__scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 2;
}

.hero__scroll-text {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gray);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin-bottom: 8px;
}

.hero__scroll-line {
  width: 1px;
  height: 60px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
}

.hero__scroll-line span {
  display: block;
  width: 100%;
  height: 40%;
  background: var(--gold);
  animation: scrollLine 2s var(--ease-in-out) infinite;
}

@keyframes scrollLine {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(350%); }
}

/* ---------- Sections Base ---------- */
.section {
  position: relative;
  padding: var(--section-padding) 0;
  overflow: hidden;
}

.section--light {
  background: var(--cream);
  color: var(--navy);
}

.section--dark {
  background: var(--navy);
  color: var(--white);
}

.section__header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: clamp(40px, 6vw, 80px);
}

.section__number {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--gold);
  font-weight: 500;
}

.section__line {
  width: 60px;
  height: 1px;
  background: var(--gold);
  opacity: 0.4;
}

.section__label {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gray);
  font-weight: 400;
}

.section--light .section__label {
  color: var(--gray-dark);
}

.section__title {
  font-family: var(--font-serif);
  font-size: 48px;
  font-size: clamp(36px, 5.5vw, 72px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin-bottom: 24px;
}

.section__title--center {
  text-align: center;
}

.section__subtitle {
  text-align: center;
  font-size: 16px;
  color: var(--gray);
  font-weight: 300;
  letter-spacing: 1px;
  margin-bottom: clamp(40px, 6vw, 80px);
}

/* ---------- Decorative Vectors ---------- */
.deco-vector {
  opacity: 0.4;
  pointer-events: none;
}

.js-loaded .deco-vector {
  opacity: 0;
}

.deco-draw {
  stroke-dasharray: 800;
}

.js-loaded .deco-draw {
  stroke-dashoffset: 800;
}

/* Estudio: Balance / Scales of Justice */
.deco-vector--estudio {
  width: clamp(200px, 26vw, 340px);
  margin-top: clamp(40px, 6vw, 80px);
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Diferencial: Shield */
.diferencial__header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
}

.deco-vector--diferencial {
  width: clamp(120px, 16vw, 200px);
  flex-shrink: 0;
  margin-top: 8px;
}

/* Contacto: Connection lines */
.deco-vector--contacto {
  width: clamp(100px, 12vw, 160px);
  margin-bottom: 16px;
  display: block;
}

@media (max-width: 768px) {
  .deco-vector--estudio {
    width: 120px;
    margin: 24px auto 0;
    opacity: 0.12;
  }

  .diferencial__header-row {
    flex-direction: column;
    gap: 16px;
  }

  .deco-vector--diferencial {
    width: 100px;
    opacity: 0.12;
  }

  .deco-vector--contacto {
    width: 100px;
    opacity: 0.12;
  }
}

/* ---------- ESTUDIO Section ---------- */
.estudio__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 100px);
  align-items: start;
}

.estudio__accent-line {
  width: 40px;
  height: 2px;
  background: var(--gold);
  margin-bottom: 32px;
}

.estudio__text {
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.8;
  color: var(--gray-dark);
  margin-bottom: 24px;
  font-weight: 300;
}

/* Office image */
.estudio__image {
  position: relative;
  margin-top: clamp(40px, 5vw, 72px);
  border-radius: 4px;
  overflow: hidden;
  max-height: 420px;
}

.estudio__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  display: block;
  filter: saturate(0.85) contrast(1.05);
}

.estudio__image-overlay {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(
    180deg,
    rgba(27, 33, 65, 0.05) 0%,
    rgba(27, 33, 65, 0) 50%,
    rgba(27, 33, 65, 0.15) 85%,
    rgba(27, 33, 65, 0.5) 100%
  );
  z-index: 1;
  pointer-events: none;
}

@media (max-width: 768px) {
  .estudio__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .estudio__image {
    max-height: 280px;
  }
}

/* ---------- SERVICIOS Section ---------- */
.servicios__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}

.service-card {
  position: relative;
  padding: 1px;
  border-radius: 4px;
  overflow: hidden;
}

.service-card__glow {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  opacity: 0;
  transition: opacity 0.5s;
  border-radius: 4px;
  background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(201, 169, 110, 0.12), transparent 40%);
}

.service-card:hover .service-card__glow {
  opacity: 1;
}

.service-card__border {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.4s;
  pointer-events: none;
}

.service-card:hover .service-card__border {
  border-color: rgba(201, 169, 110, 0.2);
}

.service-card__content {
  position: relative;
  padding: clamp(32px, 3vw, 48px);
  background: rgba(42, 48, 90, 0.3);
  border-radius: 3px;
  height: 100%;
  transition: background 0.4s;
}

.service-card:hover .service-card__content {
  background: rgba(42, 48, 90, 0.5);
}

.service-card__icon {
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  color: var(--gold);
  transition: transform 0.4s var(--ease-out-expo);
}

.service-card:hover .service-card__icon {
  transform: translateY(-4px);
}

.service-card__icon svg {
  width: 100%;
  height: 100%;
}

.service-card__title {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--cream);
  transition: color 0.3s;
}

.service-card:hover .service-card__title {
  color: var(--white);
}

.service-card__text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--gray);
  font-weight: 300;
}

.service-card__line {
  width: 0;
  height: 1px;
  background: var(--gold);
  margin-top: 24px;
  transition: width 0.6s var(--ease-out-expo);
}

.service-card:hover .service-card__line {
  width: 60px;
}

@media (max-width: 768px) {
  .servicios__grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- DIFERENCIAL Section ---------- */
.diferencial__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}

.diferencial__item {
  padding: clamp(32px, 4vw, 56px);
  position: relative;
  display: flex;
  gap: 24px;
  align-items: flex-start;
  border-bottom: 1px solid rgba(27, 33, 65, 0.08);
  transition: background 0.4s;
}

.diferencial__item:nth-child(odd) {
  border-right: 1px solid rgba(27, 33, 65, 0.08);
}

.diferencial__item:nth-child(3),
.diferencial__item:nth-child(4) {
  border-bottom: none;
}

.diferencial__item:hover {
  background: rgba(27, 33, 65, 0.02);
}

.diferencial__number {
  font-family: var(--font-serif);
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 700;
  color: rgba(201, 169, 110, 0.15);
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.4s;
}

.diferencial__item:hover .diferencial__number {
  color: rgba(201, 169, 110, 0.3);
}

.diferencial__content {
  padding-top: 8px;
}

.diferencial__title {
  font-family: var(--font-serif);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 12px;
}

.diferencial__text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--gray-dark);
  font-weight: 300;
}

.diferencial__line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.6s var(--ease-out-expo);
}

.diferencial__item:hover .diferencial__line {
  width: 60px;
}

@media (max-width: 768px) {
  .diferencial__grid {
    grid-template-columns: 1fr;
  }
  .diferencial__item:nth-child(odd) {
    border-right: none;
  }
  .diferencial__item:nth-child(3) {
    border-bottom: 1px solid rgba(27, 33, 65, 0.08);
  }
}

/* ---------- CONTACTO Section ---------- */
.contacto__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 100px);
  margin-bottom: clamp(40px, 6vw, 80px);
}

.contacto__details {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.contacto__detail {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.contacto__detail-icon {
  width: 20px;
  height: 20px;
  color: var(--gold);
  flex-shrink: 0;
  margin-top: 2px;
}

.contacto__detail-icon svg {
  width: 100%;
  height: 100%;
}

.contacto__detail-label {
  display: block;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 4px;
  font-weight: 400;
}

.contacto__detail-value {
  font-size: 15px;
  color: var(--cream);
  font-weight: 400;
  transition: color 0.3s;
}

a.contacto__detail-value:hover {
  color: var(--gold);
}

/* Form */
.contacto__form-wrap {
  background: rgba(42, 48, 90, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: clamp(32px, 3vw, 48px);
}

.contacto__form {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.form__group {
  position: relative;
}

.form__input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 0;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--white);
  outline: none;
  transition: border-color 0.3s;
}

.form__input:focus {
  border-color: var(--gold);
}

.form__label {
  position: absolute;
  left: 0;
  top: 12px;
  font-size: 14px;
  color: var(--gray);
  pointer-events: none;
  transition: all 0.3s var(--ease-out-expo);
  font-weight: 300;
}

.form__input:focus ~ .form__label,
.form__input:not(:placeholder-shown) ~ .form__label {
  top: -12px;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--gold);
}

.form__line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.4s var(--ease-out-expo);
}

.form__input:focus ~ .form__line {
  width: 100%;
}

.form__textarea {
  resize: vertical;
  min-height: 100px;
}

.form__submit {
  position: relative;
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 36px;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 500;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 2px;
  overflow: hidden;
  transition: all 0.4s var(--ease-out-expo);
  margin-top: 8px;
}

.form__submit:hover {
  background: var(--gold);
  color: var(--navy);
}

.form__submit-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: left 0.6s;
}

.form__submit:hover .form__submit-shimmer {
  left: 100%;
}

.form__submit-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.3s var(--ease-out-expo);
}

.form__submit:hover .form__submit-arrow {
  transform: translateX(4px);
}

.form__success {
  display: none;
  text-align: center;
  padding: 32px;
  gap: 16px;
  flex-direction: column;
  align-items: center;
}

.form__success.is-visible {
  display: flex;
}

.form__success svg {
  width: 48px;
  height: 48px;
}

.form__success p {
  font-size: 15px;
  color: var(--cream);
  line-height: 1.8;
}

@media (max-width: 768px) {
  .contacto__grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

/* ---------- FOOTER ---------- */
.footer {
  padding: 40px 0;
  background: var(--navy);
  position: relative;
}

.footer__line {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.2;
  margin-bottom: 40px;
}

.footer__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.footer__logo-img {
  height: 50px;
  width: auto;
  max-height: 50px;
  opacity: 0.6;
}

.footer__nav {
  display: flex;
  gap: 24px;
}

.footer__nav a {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray);
  transition: color 0.3s;
  padding: 8px 4px;
}

.footer__nav a:hover {
  color: var(--gold);
}

.footer__copy {
  font-size: 12px;
  color: var(--gray);
}

@media (max-width: 768px) {
  .footer__container {
    flex-direction: column;
    text-align: center;
  }
}

/* ---------- Animation classes ---------- */
/* Hidden states only apply when JS has loaded successfully */
.js-loaded .reveal-text .line {
  overflow: hidden;
}

.js-loaded .reveal-text .line .word {
  display: inline-block;
  transform: translateY(105%);
  will-change: transform;
}

.js-loaded .reveal-up {
  opacity: 0;
  transform: translateY(40px);
  will-change: opacity, transform;
}

/* ---------- Responsive: Tablets (769px–1024px) ---------- */
@media (min-width: 769px) and (max-width: 1024px) {
  .nav__links {
    gap: 20px;
  }

  .nav__link {
    font-size: 12px;
    letter-spacing: 0.5px;
  }

  .nav__link--cta {
    padding: 6px 14px;
  }

  .estudio__grid {
    gap: 40px;
  }

  .servicios__grid {
    gap: clamp(12px, 2vw, 20px);
  }

  .service-card__content {
    padding: 28px;
  }

  .diferencial__item {
    padding: 28px;
  }

  .contacto__grid {
    gap: 40px;
  }

  .deco-vector--estudio {
    width: clamp(140px, 20vw, 220px);
  }

  .deco-vector--diferencial {
    width: clamp(100px, 14vw, 160px);
  }
}

/* ---------- Responsive: Small phones (max-width: 480px) ---------- */
@media (max-width: 480px) {
  .nav__logo-img {
    height: 38px;
  }

  .hero__scroll {
    bottom: 24px;
  }

  .hero__scroll-line {
    height: 40px;
  }

  .hero__scroll-text {
    font-size: 9px;
    letter-spacing: 2px;
  }

  .section__header {
    gap: 12px;
  }

  .section__line {
    width: 32px;
  }

  .section__label {
    font-size: 11px;
    letter-spacing: 2px;
  }

  .diferencial__item {
    padding: 24px 16px;
    gap: 16px;
  }

  .diferencial__number {
    font-size: 32px;
  }

  .contacto__detail-label {
    font-size: 10px;
  }

  .contacto__detail-value {
    font-size: 14px;
  }

  .contacto__form-wrap {
    padding: 24px 20px;
  }

  .form__submit {
    width: 100%;
    justify-content: center;
    padding: 16px 24px;
  }

  .footer__nav {
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .mobile-menu__footer p {
    font-size: 12px;
  }
}

/* ---------- Responsive: Short viewports (laptops ~768px height) ---------- */
@media (max-height: 750px) {
  .hero__logo-wrap {
    width: 110px;
    height: 110px;
    width: clamp(80px, 12vw, 110px);
    height: clamp(80px, 12vw, 110px);
    margin-bottom: 24px;
  }

  .hero__logo {
    max-width: 110px;
    max-height: 110px;
  }

  .hero__text {
    gap: 10px;
  }

  .hero__title-bottom {
    font-size: clamp(44px, 8vw, 72px);
  }

  .hero__scroll {
    bottom: 24px;
  }

  .hero__scroll-line {
    height: 40px;
  }
}

/* ---------- Responsive: Very short viewports ---------- */
@media (max-height: 600px) {
  .hero__scroll {
    display: none;
  }

  .hero__logo-wrap {
    width: 72px;
    height: 72px;
    margin-bottom: 16px;
  }

  .hero__text {
    gap: 8px;
  }
}

/* ---------- Responsive: Landscape phones ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: 80px 0 40px;
  }

  .hero__logo-wrap {
    width: 72px;
    height: 72px;
    margin-bottom: 16px;
  }

  .hero__scroll {
    display: none;
  }

  .mobile-menu__links {
    gap: 16px;
  }

  .mobile-menu__link {
    font-size: clamp(20px, 4vw, 28px);
  }
}

/* ---------- Responsive: Form touch targets ---------- */
@media (hover: none) and (pointer: coarse) {
  .form__input {
    padding: 14px 0;
    font-size: 16px;
  }

  .form__label {
    top: 14px;
  }

  .form__input:focus ~ .form__label,
  .form__input:not(:placeholder-shown) ~ .form__label {
    top: -14px;
    font-size: 12px;
  }

  .form__textarea {
    min-height: 120px;
  }

  .contacto__detail {
    padding: 4px 0;
  }

  .footer__nav a {
    padding: 10px 8px;
  }

  .nav__link--cta {
    padding: 10px 20px;
  }
}

/* ---------- Responsive: Large screens (1440px+) ---------- */
@media (min-width: 1440px) {
  .service-card__icon {
    width: 56px;
    height: 56px;
  }

  .contacto__detail-icon {
    width: 24px;
    height: 24px;
  }
}

/* ---------- Prefers Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .grain { display: none; }
  .cursor { display: none; }

  .js-loaded .hero__logo {
    opacity: 1;
  }

  .js-loaded .hero__tagline .char {
    transform: none;
  }

  .js-loaded .hero__line-deco span {
    transform: none;
  }

  .js-loaded .reveal-up {
    opacity: 1;
    transform: none;
  }

  .js-loaded .reveal-text .line .word {
    transform: none;
  }

  .js-loaded .deco-vector {
    opacity: 0.4;
  }

  .js-loaded .deco-draw {
    stroke-dashoffset: 0;
  }
}
