:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #eef4ff;
  --text: #2f3745;
  --muted: #6b7484;
  --primary: #6b8fd6;
  --primary-deep: #4f71b9;
  --lilac: #b7a6d9;
  --lilac-soft: #e9e2f7;
  --border: #d8deea;
  --shadow: 0 12px 30px rgba(69, 87, 122, 0.16);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, rgba(183, 166, 217, 0.28), transparent 35%),
    radial-gradient(circle at 90% 5%, rgba(107, 143, 214, 0.25), transparent 40%),
    linear-gradient(160deg, #f8f9fe 0%, #f3f6fd 45%, #eff3fb 100%);
  line-height: 1.65;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.65rem 0.95rem;
  display: inline-block;
  background: #111;
  color: #fff;
  border-radius: 10px;
  z-index: 999;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

header,
main,
footer {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

header {
  margin-top: 1.25rem;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.84), rgba(238, 244, 255, 0.84));
  backdrop-filter: blur(4px);
  border: 1px solid rgba(216, 222, 234, 0.75);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem;
  display: grid;
  gap: 1rem;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Fraunces", "Georgia", serif;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  color: #293857;
}

header p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-weight: 600;
}

.hero-identity {
  display: flex;
  align-items: center;
  gap: 0.95rem;
}

.hero-avatar {
  width: 119px;
  height: 119px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  border: 3px solid #fff;
  box-shadow: 0 8px 20px rgba(80, 103, 154, 0.24);
  flex-shrink: 0;
}

.side-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}

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

.side-nav {
  position: fixed;
  top: 1rem;
  left: 0.9rem;
  width: 180px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2.9rem 0.6rem 0.6rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
  z-index: 40;
  transform: translateX(-120%);
  transition: transform 0.28s ease;
  scrollbar-width: thin;
  scrollbar-color: #adbbe0 #e8edf8;
}

body.nav-open .side-nav {
  transform: translateX(0);
}

.nav-toggle {
  position: fixed;
  top: 1.25rem;
  left: 1.1rem;
  z-index: 50;
  border: 1px solid #b6c7ea;
  background: linear-gradient(100deg, #5f83cb, #9b88cb);
  color: #fff;
  border-radius: 999px;
  width: 42px;
  height: 42px;
  padding: 0;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(80, 103, 154, 0.25);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.nav-toggle__line {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 999px;
}

body.nav-open .nav-toggle {
  top: 1.35rem;
}

.side-nav::-webkit-scrollbar {
  height: 8px;
}

.side-nav::-webkit-scrollbar-track {
  background: #e8edf8;
  border-radius: 999px;
}

.side-nav::-webkit-scrollbar-thumb {
  background: #adbbe0;
  border-radius: 999px;
}

.side-nav a {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  text-decoration: none;
  color: #2d3f60;
  background: #f3f6fd;
  border: 1px solid var(--border);
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.side-nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--lilac));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}

.side-nav a:hover {
  transform: translateY(-1px);
  background: #e6edfc;
  border-color: #b6c7ea;
  box-shadow: 0 7px 16px rgba(90, 117, 172, 0.22);
}

.side-nav a:hover::after,
.side-nav a:focus-visible::after {
  transform: scaleX(1);
}

@keyframes nav-left-enter {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

main {
  margin-top: 1.25rem;
  display: grid;
  gap: 1rem;
}

section,
aside {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 8px 22px rgba(112, 126, 155, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

section:hover,
aside:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(102, 118, 150, 0.16);
}

#inicio {
  background:
    linear-gradient(145deg, rgba(107, 143, 214, 0.18), rgba(183, 166, 217, 0.14)),
    #ffffff;
}

#inicio p {
  margin-top: 0.7rem;
}

#inicio a {
  display: inline-block;
  margin-top: 0.7rem;
  background: linear-gradient(100deg, var(--primary), var(--lilac));
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border-radius: 12px;
  padding: 0.58rem 0.96rem;
  box-shadow: 0 8px 18px rgba(107, 143, 214, 0.3);
}

#galeria {
  display: grid;
  gap: 1rem;
}

.phone-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.phone-gallery__item {
  margin: 0;
  border: 1px solid #d6deef;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 18px rgba(97, 116, 154, 0.12);
}

.phone-gallery__item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: none;
  border-radius: 0;
}

.phone-gallery__item figcaption {
  margin: 0;
  padding: 0.55rem 0.6rem 0.65rem;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #4e5c79;
  background: #f8faff;
}

figure {
  margin: 0.75rem 0 0;
}

img {
  width: 100%;
  display: block;
  border-radius: 12px;
  border: 1px solid #cfd8eb;
}

figcaption {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.95rem;
}

#proceso ol,
aside ul {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
}

form {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.8rem;
}

label {
  display: inline-block;
  margin-bottom: 0.3rem;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  border: 1px solid #bcc8e1;
  background: #fbfcff;
  border-radius: 10px;
  padding: 0.72rem 0.8rem;
  font: inherit;
  color: inherit;
}

button {
  border: none;
  cursor: pointer;
  border-radius: 10px;
  padding: 0.7rem 0.95rem;
  font-weight: 700;
  background: linear-gradient(100deg, #5f83cb, #9b88cb);
  color: #fff;
  width: fit-content;
}

footer {
  margin: 1.3rem auto 2rem;
  padding: 1rem 0.4rem;
  text-align: center;
  color: #4a566f;
}

a {
  color: #3f5ea0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #ffbf69;
  outline-offset: 2px;
}

@media (min-width: 860px) {
  main {
    grid-template-columns: 1.1fr 1.1fr;
  }

  #inicio,
  #sobre-mi,
  #proceso,
  #contacto,
  footer {
    grid-column: 1 / -1;
  }

  #galeria {
    grid-column: 1 / -1;
    width: min(960px, 100%);
    justify-self: center;
  }

  aside {
    grid-column: 2 / 3;
  }
}

@media (max-width: 520px) {
  header,
  section,
  aside {
    border-radius: 14px;
    padding: 1rem;
  }

  .side-nav a {
    font-size: 0.95rem;
  }

  .hero-avatar {
    width: 101px;
    height: 101px;
  }

  .phone-gallery {
    grid-template-columns: 1fr;
  }
}
