/* Miguel Ángel García Durán — web personal */
:root {
  --paper: #F4F5F2;
  --paper-2: #E9EBE6;
  --ink: #161B24;
  --muted: #586070;
  --line: #CDD1D8;
  --accent: #2443C9;
  --accent-ink: #FFFFFF;
  --todo: #FFE89A;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; display: block; }

.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }

/* Pendientes de rellenar (quitar cuando esté todo) */
.todo { background: var(--todo); color: #3d3200; padding: 0 .25em; border-radius: 3px; font-style: normal; }

/* Cabecera */
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding-block: 22px;
}
.brand { font-family: var(--display); font-weight: 700; text-decoration: none; font-size: 1.05rem; letter-spacing: -.01em; }
.top nav { display: flex; gap: 22px; align-items: center; font-size: .95rem; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--ink); }
.lang { border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; color: var(--ink) !important; }
@media (max-width: 640px) { .top nav .hide-sm { display: none; } }

/* Hero */
.hero { padding-block: clamp(48px, 9vw, 120px) clamp(56px, 8vw, 100px); display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: end; }
.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3rem, 10.5vw, 8.4rem);
  line-height: .9;
  letter-spacing: -.045em;
  margin: 0 0 32px;
}
.hero h1 span { display: block; }
.hero h1 .thin { font-weight: 300; color: var(--muted); }
.lead { font-size: clamp(1.15rem, 2.2vw, 1.45rem); line-height: 1.45; max-width: 34ch; margin: 0 0 32px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block; text-decoration: none; font-weight: 600;
  padding: 13px 22px; border-radius: 999px; border: 1.5px solid var(--ink);
  transition: background .15s, color .15s;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--ink); border-color: var(--ink); }
.btn:not(.primary):hover { background: var(--ink); color: var(--paper); }

.portrait {
  width: clamp(150px, 20vw, 230px); aspect-ratio: 4/5; border-radius: 18px;
  background: var(--paper-2); display: grid; place-items: center; text-align: center;
  color: var(--muted); font-size: .85rem; padding: 12px; overflow: hidden;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .portrait { order: -1; width: 120px; }
}

/* Datos rápidos */
.facts { border-block: 1px solid var(--line); }
.facts ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.facts li { padding: 26px 20px 26px 0; }
.facts li + li { border-left: 1px solid var(--line); padding-left: 24px; }
.facts strong { display: block; font-family: var(--display); font-size: 1.6rem; letter-spacing: -.02em; line-height: 1.1; }
.facts span { color: var(--muted); font-size: .95rem; }
@media (max-width: 640px) {
  .facts ul { grid-template-columns: 1fr; }
  .facts li + li { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
}

/* Secciones */
section.block { padding-block: clamp(64px, 9vw, 112px); display: grid; grid-template-columns: 220px 1fr; gap: 32px; }
section.block > h2 {
  font-family: var(--display); font-weight: 700; font-size: 1.5rem; letter-spacing: -.02em;
  margin: 0; position: sticky; top: 24px; align-self: start;
}
section.block + section.block { border-top: 1px solid var(--line); }
.prose p { max-width: 62ch; margin: 0 0 1em; }
.prose p:first-child { font-size: 1.25rem; line-height: 1.5; }
@media (max-width: 760px) {
  section.block { grid-template-columns: 1fr; gap: 20px; }
  section.block > h2 { position: static; }
}

/* Trayectoria: el hilo (guiño textil a Novofabric) */
.thread { list-style: none; margin: 0; padding: 0 0 0 34px; position: relative; }
.thread::before {
  content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px;
  border-left: 2px dashed var(--accent);
}
.thread li { position: relative; padding-bottom: 44px; }
.thread li:last-child { padding-bottom: 0; }
.thread li::before {
  content: ""; position: absolute; left: -34px; top: 6px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--accent);
}
.thread li.now::before { background: var(--accent); }
.when { color: var(--muted); font-size: .92rem; }
.thread h3 { font-family: var(--display); font-size: 1.35rem; letter-spacing: -.015em; margin: 2px 0 2px; line-height: 1.25; }
.org { font-weight: 600; margin: 0 0 8px; }
.thread p { margin: 0; max-width: 60ch; color: #2c3340; }

/* Formación e idiomas */
.pairs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 40px; }
.pairs h3 { font-family: var(--display); font-size: 1.15rem; margin: 0 0 4px; letter-spacing: -.01em; }
.pairs p { margin: 0; color: var(--muted); }
@media (max-width: 640px) { .pairs { grid-template-columns: 1fr; } }

/* Contacto */
.contact { background: var(--ink); color: var(--paper); }
.contact .wrap { padding-block: clamp(72px, 10vw, 128px); }
.contact h2 {
  font-family: var(--display); font-weight: 800; letter-spacing: -.04em;
  font-size: clamp(2.4rem, 7vw, 5.2rem); line-height: .95; margin: 0 0 24px; max-width: 14ch;
}
.contact p { color: #B8BFCC; max-width: 46ch; margin: 0 0 32px; font-size: 1.15rem; }
.contact .btn { border-color: var(--paper); }
.contact .btn:not(.primary):hover { background: var(--paper); color: var(--ink); }
.contact .btn.primary:hover { background: var(--paper); border-color: var(--paper); color: var(--ink); }

footer { background: var(--ink); color: #7F8798; font-size: .88rem; }
footer .wrap { padding-block: 22px; border-top: 1px solid #2B3240; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
footer a { color: #B8BFCC; }

/* Una sola entrada al cargar: el nombre */
@media (prefers-reduced-motion: no-preference) {
  .hero h1 span { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
  .hero h1 span:nth-child(2) { animation-delay: .08s; }
  .hero h1 span:nth-child(3) { animation-delay: .16s; }
  @keyframes rise { from { opacity: 0; transform: translateY(.35em); } to { opacity: 1; transform: none; } }
}

/* Logros */
.wins { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.wins li { padding: 22px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 140px 1fr; gap: 24px; align-items: baseline; }
.wins li:first-child { border-top: 0; padding-top: 0; }
.wins strong { font-family: var(--display); font-size: 1.9rem; letter-spacing: -.03em; line-height: 1; color: var(--accent); }
.wins p { margin: 0; max-width: 52ch; }
@media (max-width: 640px) { .wins li { grid-template-columns: 1fr; gap: 6px; } }

/* Trayectoria: puestos anteriores más compactos */
.thread li.past h3 { font-size: 1.15rem; }
.thread li.past p { color: var(--muted); }

/* Fotos: si falta el archivo, se ve el hueco con su nombre */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.gallery figure { margin: 0; }
.gallery .frame {
  aspect-ratio: 4/3; border-radius: 14px; background: var(--paper-2); overflow: hidden;
  display: grid; place-items: center; color: var(--muted); font-size: .85rem; text-align: center; padding: 0;
}
.gallery .frame img { width: 100%; height: 100%; object-fit: cover; grid-area: 1/1; }
.gallery .frame .todo { grid-area: 1/1; }
.gallery figcaption { margin-top: 10px; font-size: .95rem; }
.gallery figcaption span { display: block; color: var(--muted); font-size: .88rem; }
@media (max-width: 640px) { .gallery { grid-template-columns: 1fr; } }
.portrait > * { grid-area: 1/1; }
.portrait:has(img) { padding: 0; }
