/* === VARIABLES DE DISEÑO === */
:root {
  --color-bg:           #F5F0E8;
  --color-bg-card:      #EDE8DC;
  --color-text:         #1A1A1A;
  --color-text-muted:   #5A5450;
  --color-accent:       #8B6F47;
  --color-border:       rgba(0, 0, 0, 0.08);
  --color-border-card:  rgba(0, 0, 0, 0.10);
  --color-blob-accent:  #4A5568;

  --font-heading: 'Syne', sans-serif;
  --font-body:    'Manrope', sans-serif;

  --nav-height:          72px;
  --nav-height-scrolled: 56px;

  --section-padding: clamp(80px, 10vw, 140px);
  --inline-padding:  clamp(24px, 5vw, 80px);
  --max-width:       1280px;

  --radius: 2px;
  --transition: all 0.3s ease;
}


/* === RESET === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1, h2, h3, h4, p {
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}

ul { list-style: none; }

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

button { font-family: inherit; }


/* === COMPONENTES === */
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--inline-padding);
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 64px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--color-text);
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--color-text);
  color: var(--color-bg);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--color-text);
  color: var(--color-bg);
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}


/* === NAVBAR === */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  transition: var(--transition);
  border-bottom: 1px solid transparent;
}

#navbar.scrolled {
  height: var(--nav-height-scrolled);
  background: rgba(245, 240, 232, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--color-border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--inline-padding);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.nav-logo-img {
  height: 36px;
  width: auto;
  display: block;
  transition: opacity 0.3s ease;
}

.nav-logo:hover .nav-logo-img { opacity: 0.75; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--color-text-muted);
  transition: var(--transition);
}

.nav-links a:hover { color: var(--color-text); }

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: var(--transition);
}

.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* === HERO === */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  overflow: hidden;
}

/* Gradiente de luz que sigue al cursor */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at var(--cursor-x, 50%) var(--cursor-y, 40%),
    rgba(200, 170, 120, 0.10),
    transparent 70%
  );
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: clamp(60px, 10vw, 120px) var(--inline-padding);
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  margin-bottom: 28px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(32px, 8vw, 88px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -1.5px;
  margin-bottom: 28px;
  max-width: 900px;
}

.hero-subtitle {
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--color-text-muted);
  margin-bottom: 48px;
  max-width: 500px;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--color-text), transparent);
  animation: scrollDown 2.2s ease-in-out infinite;
  transform-origin: top center;
}

@keyframes scrollDown {
  0%   { transform: scaleY(0); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}


/* === BLOBS ANIMADOS — HERO === */
.hero-blobs {
  position: absolute;
  inset: 0;
  z-index: 0;
  isolation: isolate;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  will-change: transform;
  transform: translate(var(--blob-tx, 0px), var(--blob-ty, 0px));
}

.blob-1 {
  width: 500px;
  height: 400px;
  top: -8%;
  left: -6%;
  background: radial-gradient(ellipse at 40% 40%, #C8B89A, #A89070 70%);
  filter: blur(55px);
  opacity: 0.62;
  border-radius: 60% 40% 70% 30% / 50% 60% 40% 70%;
  animation: morphBlob1 10s ease-in-out infinite alternate;
}

.blob-2 {
  width: 400px;
  height: 500px;
  top: 12%;
  right: 0%;
  background: radial-gradient(ellipse at 55% 45%, #8B9BAE, #6B7F96 60%);
  filter: blur(55px);
  opacity: 0.58;
  border-radius: 30% 70% 40% 60% / 60% 30% 70% 40%;
  animation: morphBlob2 13s ease-in-out infinite alternate;
}

.blob-3 {
  width: 350px;
  height: 350px;
  bottom: 8%;
  left: 28%;
  background: radial-gradient(ellipse at 50% 50%, #BFB49A, #9E8E74 65%);
  filter: blur(55px);
  opacity: 0.60;
  border-radius: 50% 50% 30% 70% / 40% 60% 50% 60%;
  animation: morphBlob3 17s ease-in-out infinite alternate;
}

.blob-4 {
  width: 200px;
  height: 200px;
  top: 38%;
  left: 48%;
  background: #7A8FA8;
  filter: blur(55px);
  opacity: 0.55;
  border-radius: 40% 60% 55% 45% / 55% 45% 60% 40%;
  animation: morphBlob1 21s ease-in-out infinite alternate-reverse;
}

@keyframes morphBlob1 {
  0%   { border-radius: 60% 40% 70% 30% / 50% 60% 40% 70%; }
  33%  { border-radius: 40% 60% 30% 70% / 70% 30% 60% 40%; }
  66%  { border-radius: 70% 30% 50% 50% / 40% 70% 30% 60%; }
  100% { border-radius: 30% 70% 60% 40% / 60% 40% 70% 30%; }
}

@keyframes morphBlob2 {
  0%   { border-radius: 30% 70% 40% 60% / 60% 30% 70% 40%; }
  33%  { border-radius: 60% 40% 70% 30% / 40% 60% 30% 70%; }
  66%  { border-radius: 40% 60% 30% 70% / 70% 40% 60% 30%; }
  100% { border-radius: 70% 30% 60% 40% / 30% 70% 40% 60%; }
}

@keyframes morphBlob3 {
  0%   { border-radius: 50% 50% 30% 70% / 40% 60% 50% 60%; }
  33%  { border-radius: 30% 70% 60% 40% / 60% 40% 70% 30%; }
  66%  { border-radius: 60% 40% 50% 50% / 30% 70% 40% 60%; }
  100% { border-radius: 40% 60% 70% 30% / 70% 30% 60% 40%; }
}


/* === PROYECTOS === */
.projects {
  padding: var(--section-padding) 0;
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.project-card {
  position: relative;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Línea de acento que se expande al hover */
.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 1px;
  background: var(--color-blob-accent);
  transition: width 0.4s ease;
  z-index: 2;
}

.project-card:hover::before { width: 100%; }

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

/* Número decorativo grande en esquina superior derecha */
.project-num {
  position: absolute;
  top: 20px;
  right: 28px;
  font-family: var(--font-heading);
  font-size: 80px;
  font-weight: 800;
  color: var(--color-text);
  opacity: 0.06;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.project-card-content {
  padding: 48px;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.project-tag {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.project-name {
  font-family: var(--font-heading);
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.project-desc {
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.75;
  margin-bottom: 32px;
  flex: 1;
}

.project-metrics {
  display: flex;
  gap: 32px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.metric-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.metric-label {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  transition: var(--transition);
  width: fit-content;
}

.project-link:hover {
  color: var(--color-accent);
  gap: 14px;
}

.project-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  padding: 6px 14px;
  border: 1px solid var(--color-text-muted);
  color: var(--color-text-muted);
}

.project-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #DDD8CC;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-image img { transform: scale(1.03); }


/* === SOBRE MÍ Y SERVICIOS === */
.about {
  padding: var(--section-padding) 0;
  background: var(--color-bg-card);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

/* Stats counter */
.about-stats {
  display: flex;
  gap: 40px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: #8B8680;
  margin-top: 6px;
  font-weight: 500;
}

.about-text h2 {
  font-family: var(--font-heading);
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 28px;
}

.about-text p {
  font-size: 17px;
  color: var(--color-text-muted);
  line-height: 1.8;
  margin-bottom: 20px;
}

.about-text p:last-child { margin-bottom: 0; }

.credentials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0;
}

.credential {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  padding: 7px 12px;
  border: 1px solid var(--color-border-card);
  color: var(--color-text-muted);
  transition: border-color 0.3s ease, color 0.3s ease;
}

.credential:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.services-list {
  display: flex;
  flex-direction: column;
}

.service-item {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--color-border-card);
  transition: padding-left 0.3s ease;
}

.service-item:first-child { border-top: 1px solid var(--color-border-card); }
.service-item:hover { padding-left: 10px; }

.service-num {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-accent);
  min-width: 28px;
}

.service-name {
  font-size: 18px;
  font-weight: 500;
}


/* === CONTACTO === */
.contact {
  position: relative;
  padding: var(--section-padding) 0;
  background: var(--color-bg-card);
  overflow: hidden;
}

/* Blob estático decorativo en esquina inferior derecha */
.contact-blob {
  position: absolute;
  bottom: -60px;
  right: -60px;
  width: 320px;
  height: 320px;
  background: var(--color-blob-accent);
  opacity: 0.07;
  filter: blur(80px);
  border-radius: 50%;
  pointer-events: none;
}

.contact-subtitle {
  font-size: 18px;
  color: var(--color-text-muted);
  margin-top: -48px;
  margin-bottom: 56px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-bottom: 48px;
}

.contact-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border-card);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
}

a.contact-card { cursor: pointer; }

a.contact-card:hover,
a.contact-card:focus-visible {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}

a.contact-card:hover svg path,
a.contact-card:hover svg rect,
a.contact-card:hover svg circle {
  stroke: var(--color-bg);
}

.contact-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-accent);
}

a.contact-card:hover .contact-label { color: rgba(245, 240, 232, 0.55); }

.contact-value {
  font-family: var(--font-heading);
  font-size: clamp(15px, 2vw, 20px);
  font-weight: 700;
  line-height: 1.2;
}

.contact-note {
  font-size: 15px;
  color: var(--color-text-muted);
  text-align: center;
}


/* === FOOTER === */
.footer {
  border-top: 1px solid var(--color-border-card);
  padding: 32px 0;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--inline-padding);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.footer-copy {
  font-size: 13px;
  color: var(--color-text-muted);
}

.footer-social {
  display: flex;
  gap: 20px;
}

.footer-social a {
  color: var(--color-text-muted);
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.footer-social a:hover { color: var(--color-text); }

.footer-tagline {
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: right;
}


/* === ANIMACIONES DE SCROLL === */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity  0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}


/* === PREFERS-REDUCED-MOTION === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  html { scroll-behavior: auto; }

  .blob { animation: none; }
}


/* === RESPONSIVE — DESKTOP ASIMÉTRICO (1024px+) === */
@media (min-width: 1024px) {
  .projects-grid { grid-template-columns: 3fr 2fr; }
}

/* === RESPONSIVE — TABLETS (max 1024px) === */
@media (max-width: 1024px) {
  .project-card-content { padding: 36px; }
  .about-grid { gap: 56px; }
}


/* === RESPONSIVE — MÓVIL (768px) === */
@media (max-width: 768px) {
  .nav-hamburger { display: flex; }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    flex-direction: column;
    gap: 0;
    padding: 16px 0;
    border-bottom: 1px solid var(--color-border-card);
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    z-index: 99;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav-links li { width: 100%; }

  .nav-links a {
    display: block;
    padding: 16px var(--inline-padding);
    font-size: 16px;
  }

  .hero-title { letter-spacing: -0.5px; }

  .hero-ctas {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .hero-ctas .btn { width: 100%; justify-content: center; }

  /* Blobs más pequeños y menos blur en mobile para rendimiento */
  .blob-1 { width: 300px; height: 240px; filter: blur(35px); }
  .blob-2 { width: 240px; height: 300px; filter: blur(35px); }
  .blob-3 { width: 210px; height: 210px; filter: blur(35px); }
  .blob-4 { width: 120px; height: 120px; filter: blur(35px); }

  .project-card:hover { transform: none; }

  .project-card-content { padding: 24px; }

  .project-num {
    font-size: 48px;
    top: auto;
    bottom: 16px;
    right: 16px;
    opacity: 0.04;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .about-stats { gap: 28px; }

  .contact-grid { grid-template-columns: 1fr; }

  .contact-subtitle {
    margin-top: -40px;
    margin-bottom: 40px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 16px;
  }

  .footer-copy,
  .footer-tagline { text-align: center; }

  .footer-social { justify-content: center; }
}
