/*
  Estilos del portafolio de David Mur Tapia.
  Colores y tamaños reutilizables: bloque :root.
  HTML: index.html · Menú y proyectos: js/main.js y js/proyectos.js.
*/

:root {
  --bg: #f7f2ea;
  --bg-card: #fffdf9;
  --ink: #2c261f;
  --muted: #6e665c;
  --accent: #e07a5f;
  --accent-2: #7d9b76;
  --accent-ink: #fffdf9;
  --line: rgba(44, 38, 31, 0.1);
  --header-h: 76px;
  --radius: 24px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: Outfit, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
}

/* Fondo con manchas de color (solo decoración) */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.55;
}

.orb-a {
  width: 46vw;
  height: 46vw;
  top: -14vw;
  right: -10vw;
  background: radial-gradient(circle, #f3c2b0 0%, transparent 70%);
  animation: drift 18s ease-in-out infinite;
}

.orb-b {
  width: 40vw;
  height: 40vw;
  bottom: 4vh;
  left: -12vw;
  background: radial-gradient(circle, #c9d9c0 0%, transparent 68%);
  animation: drift 22s ease-in-out infinite reverse;
}

.grid-fade {
  display: none;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(3%, 5%) scale(1.06); }
}

.site-header,
.hero,
.section,
.site-footer {
  position: relative;
  z-index: 1;
}

/* Cabecera pegada arriba: logo + menú */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.2rem, 4vw, 3.5rem);
  background: rgba(247, 242, 234, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.logo {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}

.nav {
  display: flex;
  gap: 0.25rem;
}

.nav a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--muted);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
}

.nav a:hover,
.nav a.is-active {
  color: var(--ink);
  background: rgba(224, 122, 95, 0.12);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  margin: 7px 0;
  background: var(--ink);
}

.hero,
.section,
.site-footer {
  width: min(1140px, calc(100% - 2.4rem));
  margin-inline: auto;
}

/* Primera sección: nombre y botones */
.hero {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
  padding: 3.5rem 0 4.5rem;
}

.hero-copy {
  display: grid;
  gap: 1.05rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: fit-content;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(224, 122, 95, 0.18);
}

.hero h1 {
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.hero-lead {
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 400;
  max-width: 38rem;
}

.hero-panel {
  position: relative;
  min-height: 340px;
  display: grid;
  place-items: center;
}

.ring {
  position: absolute;
  width: min(320px, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid rgba(224, 122, 95, 0.4);
  animation: spin 28s linear infinite;
}

.ring::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.ring-2 {
  width: min(220px, 50vw);
  border-color: rgba(125, 155, 118, 0.55);
  animation-direction: reverse;
  animation-duration: 18s;
}

.ring-2::before {
  background: var(--accent-2);
}

.hero-code {
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--ink);
  z-index: 1;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.94rem;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: #d06850;
}

.btn-ghost {
  border-color: var(--line);
  background: var(--bg-card);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: rgba(224, 122, 95, 0.45);
}

/* Bloques numerados (sobre mí, proyectos, etc.) */
.section {
  padding: 4.6rem 0;
}

.section-label {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 1.1rem;
}

.section-kicker {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-label h2 {
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.8rem, 3.6vw, 2.5rem);
  letter-spacing: -0.03em;
  font-weight: 600;
}

.section-intro,
.contact-lead {
  max-width: 40rem;
  color: var(--muted);
  margin-bottom: 1.7rem;
}

/* Texto y ficha de datos */
.about-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem 2.4rem;
  align-items: start;
}

.about-copy {
  display: grid;
  gap: 1rem;
  font-size: 1.05rem;
  color: #514a42;
}

.about-copy strong {
  color: var(--ink);
  font-weight: 600;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.35rem 1.3rem 0.5rem;
  box-shadow: 0 18px 40px rgba(44, 38, 31, 0.06);
}

.about-card div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}

.about-card div:last-child {
  border-bottom: 0;
}

.about-card dt {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.about-card dd {
  font-weight: 600;
  text-align: right;
}

.about-card a {
  color: var(--accent);
  text-decoration: none;
}

.about-card a:hover {
  text-decoration: underline;
}

/* Tarjetas de proyectos (el HTML lo crea JavaScript) */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.project-card,
.skill-grid li {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.2rem;
  box-shadow: 0 12px 30px rgba(44, 38, 31, 0.04);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.project-card:hover,
.skill-grid li:hover {
  transform: translateY(-4px);
  border-color: rgba(224, 122, 95, 0.4);
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 220px;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: attr(data-index);
  position: absolute;
  right: 0.7rem;
  top: 0.35rem;
  font-family: Fraunces, Georgia, serif;
  font-size: 2.8rem;
  font-weight: 600;
  color: rgba(224, 122, 95, 0.16);
  letter-spacing: -0.04em;
}

.project-card h3 {
  font-size: 1.18rem;
  letter-spacing: -0.02em;
  font-weight: 600;
  position: relative;
}

.project-card p {
  color: var(--muted);
  flex: 1;
  position: relative;
}

.project-card .btn {
  align-self: flex-start;
  margin-top: 0.3rem;
}

.btn.is-disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
  transform: none;
}

.skills .section-label,
.skills .section-intro {
  text-align: center;
  margin-inline: auto;
}

/* Lista de herramientas */
.skill-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  max-width: 960px;
  margin-inline: auto;
}

.skill-grid li {
  display: grid;
  gap: 0.4rem;
  min-height: 132px;
  text-align: center;
  justify-items: center;
  align-content: center;
}

.skill-grid strong {
  font-size: 1.05rem;
  font-weight: 600;
}

.skill-grid span:last-child {
  color: var(--muted);
  font-size: 0.92rem;
}

/* Correo y teléfono */
.contact {
  padding-bottom: 4.5rem;
}

.contact-band {
  background: linear-gradient(135deg, rgba(243, 194, 176, 0.45), rgba(201, 217, 192, 0.4));
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: clamp(1.6rem, 4vw, 2.6rem);
}

.contact-details {
  list-style: none;
  display: grid;
  gap: 0.85rem;
  margin: 0 0 1.4rem;
}

.contact-details li {
  display: grid;
  gap: 0.15rem;
}

.contact-details span {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-details a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.contact-details a:hover {
  color: var(--accent);
}

/* Copyright al final de la página */
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 0 2.2rem;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 980px) {
  /* Tablet: dos columnas */
  .hero,
  .about-layout,
  .skill-grid,
  .project-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-panel {
    min-height: 260px;
  }
}

@media (max-width: 720px) {
  /* Móvil: menú en desplegable y una sola columna */
  .nav-toggle {
    display: block;
  }

  .nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: #fffdf9;
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 0;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.85rem 1.4rem;
    border-radius: 0;
  }

  .hero,
  .about-layout,
  .skill-grid,
  .project-grid,
  .site-footer {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero-panel {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .orb,
  .ring,
  .btn,
  .project-card,
  .skill-grid li {
    animation: none;
    transition: none;
  }
}
