/* ============================================================
   PORTAFOLIO — Hoja de estilos principal
   Estética: editorial oscuro · dorado · serif + sans
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

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

ul,
ol {
  list-style: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

/* ---------- 2. VARIABLES ---------- */
:root {
  /* Colores */
  --bg: #0e0e10;
  --surface: #1a1a1e;
  --surface-2: #222228;
  --gold: #c9a96e;
  --gold-soft: rgba(201, 169, 110, 0.15);
  --text: #f5f2ed;
  --muted: #9a958d;
  --border: #2a2a30;

  /* Tipografía */
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Espaciado */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 7rem;
  --max-width: 1180px;

  /* Radios y sombras */
  --radius: 12px;
  --radius-pill: 999px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.35);

  /* Transiciones */
  --t-fast: 0.2s ease;
  --t-med: 0.4s ease;
  --t-slow: 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 3. BASE ---------- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Fondo con sutil textura de gradiente radial */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(201, 169, 110, 0.08), transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(201, 169, 110, 0.05), transparent 55%);
  pointer-events: none;
  z-index: -1;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

p {
  color: var(--muted);
}

/* Selección de texto */
::selection {
  background: var(--gold);
  color: var(--bg);
}

/* Foco accesible */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Scrollbar personalizada (WebKit) */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* ---------- 4. CONTENEDOR ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

/* ---------- 5. NAVEGACIÓN ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1.25rem, 4vw, 2.5rem);
  background: rgba(14, 14, 16, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav__logo {
  font-family: var(--serif);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.nav__logo span {
  color: var(--gold);
}

.nav__links {
  display: flex;
  gap: 2rem;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav__links a {
  color: var(--muted);
  transition: color var(--t-fast);
  position: relative;
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width var(--t-med);
}

.nav__links a:hover {
  color: var(--text);
}
.nav__links a:hover::after {
  width: 100%;
}

/* ---------- 6. HERO ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-xl) var(--space-sm);
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: grayscale(100%) brightness(0.4);
  opacity: 0.45;
  z-index: -1;
}

.hero__content {
  max-width: 820px;
  animation: fadeUp 1s var(--t-slow) both;
}

.hero__eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.hero__title {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  margin-bottom: 1.5rem;
}

.hero__title em {
  font-style: italic;
  color: var(--gold);
}

.hero__subtitle {
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

.hero__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- 7. BOTONES ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  background: var(--gold);
  color: var(--bg);
  border: 1px solid var(--gold);
  transition: transform var(--t-fast), box-shadow var(--t-med), filter var(--t-fast), background var(--t-fast);
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px var(--gold-soft);
  filter: brightness(1.08);
}

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

.btn--ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: none;
}

/* ---------- 8. SECCIONES ---------- */
.section {
  padding: var(--space-xl) 0;
}

.section__head {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.section__eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
}

.section-title em {
  font-style: italic;
  color: var(--gold);
}

/* ---------- 9. PROYECTOS ---------- */
.projects {
  display: flex;
  flex-direction: column;
  gap: clamp(4rem, 8vw, 7rem);
}

.project {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.project--reverse .project__media {
  order: 2;
}

.project__media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
  background: var(--surface);
}

.project__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}

.project__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(14, 14, 16, 0.4));
  pointer-events: none;
}

.project:hover .project__media img {
  transform: scale(1.05);
}

.project__tag {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.project h3 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 1rem;
}

.project p {
  margin-bottom: 1.25rem;
}

.project__tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.project__tags li {
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.85rem;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  transition: border-color var(--t-fast), color var(--t-fast);
}

.project:hover .project__tags li {
  border-color: var(--gold);
  color: var(--gold);
}

/* ---------- 10. FILOSOFÍA / SOBRE MÍ ---------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}

.pillar {
  padding: 2.25rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--t-med), transform var(--t-med);
}

.pillar:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
}

.pillar__icon {
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 1rem;
}

.pillar h3 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.pillar p {
  font-size: 0.95rem;
}

/* ---------- 11. PROCESO ---------- */
.process {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 2rem 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  counter-increment: step;
}

.step::before {
  content: "0" counter(step);
  font-family: var(--serif);
  font-size: 2.5rem;
  color: var(--gold);
  opacity: 0.35;
  display: block;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.step h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.step p {
  font-size: 0.9rem;
}

/* ---------- 12. CONTACTO ---------- */
.contact {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
}

.contact h2 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  margin-bottom: 1rem;
}

.contact p {
  margin-bottom: 2rem;
}

.contact__form {
  display: grid;
  gap: 1rem;
  text-align: left;
  margin-top: 2.5rem;
}

.contact__form input,
.contact__form textarea {
  width: 100%;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  transition: border-color var(--t-fast), background var(--t-fast);
}

.contact__form input:focus,
.contact__form textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--surface-2);
}

.contact__form textarea {
  min-height: 140px;
  resize: vertical;
}

.contact__form .btn {
  justify-self: start;
}

/* ---------- 13. FOOTER ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer a {
  color: var(--gold);
  transition: opacity var(--t-fast);
}

.footer a:hover {
  opacity: 0.75;
}

/* ---------- 14. ANIMACIONES ---------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Revelado al hacer scroll (requiere pequeño JS con IntersectionObserver) */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--t-slow), transform 0.8s var(--t-slow);
  will-change: opacity, transform;
}

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

/* ---------- 15. RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .project {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .project--reverse .project__media {
    order: 0;
  }
  .project__media {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 768px) {
  :root {
    --space-xl: 5rem;
    --space-lg: 2.5rem;
  }

  .nav__links {
    gap: 1.25rem;
    font-size: 0.8rem;
  }

  .hero {
    min-height: 80vh;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__actions .btn {
    justify-content: center;
  }

  .project h3 {
    font-size: 1.75rem;
  }

  .pillar,
  .step {
    padding: 1.75rem 1.25rem;
  }
}

@media (max-width: 480px) {
  .nav {
    flex-direction: column;
    gap: 0.75rem;
  }

  .nav__links {
    gap: 1rem;
  }

  .section {
    padding: 4rem 0;
  }

  .project__media {
    aspect-ratio: 4 / 3;
  }
}

/* ---------- 16. PREFERENCIAS DE MOVIMIENTO ---------- */
@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;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 17. IMPRESIÓN ---------- */
@media print {
  body {
    background: #fff;
    color: #000;
  }
  .nav,
  .hero__actions,
  .contact__form,
  .footer {
    display: none;
  }
  .project {
    grid-template-columns: 1fr;
  }
  a::after {
    content: " (" attr(href) ")";
    font-size: 0.75em;
    color: #666;
  }
}