/* ---------------------------------------------------------------
   Ana Torres — página personal de una hoja
   Paleta: papel, tinta, cobalto, jade, sol
   Cero red: ni fuentes, ni imágenes, ni scripts externos.
   El grano y las portadas son CSS/SVG inline; la tipografía es
   la del sistema (geométrica para display, serif editorial para texto).
   --------------------------------------------------------------- */

:root {
  --papel: #F3F0E8;
  --papel-hondo: #EAE5D9;
  --tinta: #1C1917;
  --tinta-suave: #57514B;
  --cobalto: #1A4F8B;
  --cobalto-claro: #2E6FB8;
  --jade: #0D6B5C;
  --sol: #E6B422;
  --sol-texto: #8F6200;
  --tarjeta-bg: #FFFDF7;

  /* Display: geométrica de palo seco, con pesos altos disponibles
     (Avenir Next Heavy en macOS/iOS, Segoe UI Black en Windows). */
  --display: 'Avenir Next', Avenir, 'Segoe UI', 'Trebuchet MS', 'Helvetica Neue', system-ui, sans-serif;
  /* Cuerpo: serif editorial de pantalla, no serif de periódico. */
  --cuerpo: Charter, 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;

  --medida: 62ch;
  --borde: 1px solid rgb(28 25 23 / 0.14);
  --paso: clamp(4rem, 9vw, 8.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --papel: #161514;
    --papel-hondo: #22201D;
    --tinta: #F3F0E8;
    --tinta-suave: #BBB5AB;
    --cobalto: #6BA3E8;
    --cobalto-claro: #82B3F0;
    --jade: #38B29F;
    --sol: #F5CC47;
    --sol-texto: #F5CC47;
    --tarjeta-bg: #262422;
    --borde: 1px solid rgb(243 240 232 / 0.16);
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--cuerpo);
  /* Las serif del sistema no traen Light: el peso base es el regular
     y el tamaño baja un punto porque su altura de x es mayor. */
  font-size: clamp(1.02rem, 0.32vw + 0.96rem, 1.14rem);
  font-weight: 400;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Grano: feTurbulence en data-URI, fijo sobre toda la hoja */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.32;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)' opacity='0.42'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  body::after {
    mix-blend-mode: screen;
    opacity: 0.15;
  }
}

main:focus { outline: none; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0;
}

p { margin: 0 0 1rem; max-width: var(--medida); }
/* 700, no 500: las serif del sistema sólo tienen regular y negrita,
   y en 500 el énfasis de «Problema / Criterio / Resultado» desaparecía. */
strong { font-weight: 700; color: var(--tinta); }

a { color: var(--cobalto); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--jade); }

:focus-visible {
  outline: 2px solid var(--cobalto);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 60;
  background: var(--tinta);
  color: var(--papel);
  padding: 0.7rem 1.1rem;
  font-family: var(--display);
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------------------------------------------------------------
   Hero
   --------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: min(100svh, 920px);
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 82% 8%, rgb(26 79 139 / 0.13), transparent 62%),
    linear-gradient(176deg, var(--papel) 18%, var(--papel-hondo));
}

/* Monograma cinético AT — plano de fondo, edge-to-edge */
.monograma {
  position: absolute;
  inset: -4% -6% auto auto;
  width: min(72vw, 760px);
  height: min(80vh, 760px);
  z-index: 0;
  fill: none;
  transform-origin: 70% 40%;
}

/* La rotación al scroll sólo donde hay timeline de scroll; en el resto
   el monograma queda recto, sin fallback roto ni JS. */
@supports (animation-timeline: scroll()) {
  .monograma {
    animation: monograma-gira linear both;
    animation-timeline: scroll(root block);
    animation-range: 0 85vh;
  }
}

.m-bloque {
  fill: var(--cobalto);
  opacity: 0;
  animation: bloque-entra 1.1s cubic-bezier(.2,.7,.3,1) 0.55s both;
}

.m-trazo {
  stroke: var(--cobalto);
  stroke-width: 11;
  stroke-linecap: square;
  stroke-dasharray: 440;
  stroke-dashoffset: 440;
  animation: trazo-dibuja 1.5s cubic-bezier(.65,0,.2,1) both;
}
.m-trazo--1 { animation-delay: 0.15s; }
.m-trazo--2 { animation-delay: 0.65s; stroke: var(--jade); }
.m-trazo--3 { animation-delay: 0.45s; }
.m-trazo--4 { animation-delay: 0.8s; }

.m-arco {
  stroke: var(--sol);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  animation: trazo-dibuja 1.4s cubic-bezier(.65,0,.2,1) 1.15s both;
}

@keyframes trazo-dibuja { to { stroke-dashoffset: 0; } }

@keyframes bloque-entra {
  from { opacity: 0; transform: translateY(26px) scale(0.96); }
  to   { opacity: 0.1; transform: none; }
}

@keyframes monograma-gira {
  from { transform: rotate(0deg)   translateY(0); }
  to   { transform: rotate(4deg) translateY(-3%); }
}

.nav {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav__marca {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.22em;
  color: var(--cobalto);
}

.nav ul {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav a {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--tinta-suave);
  display: inline-block;
  padding: 0.5rem 0.25rem;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--tinta); border-bottom-color: var(--sol); }

.hero__texto {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-bottom: clamp(1rem, 5vh, 4rem);
  max-width: 24ch;
  animation: sube 1s cubic-bezier(.2,.7,.3,1) both;
}

.hero h1 {
  font-size: clamp(3.4rem, 13vw, 9.5rem);
  /* Menos negativo que con Syne: las geométricas del sistema vienen
     más anchas y a -0.045em se tocaban la «n» y la «a». */
  letter-spacing: -0.03em;
  margin-bottom: 0.3em;
  /* El nombre tiene que pesar igual que antes: si el sistema sólo
     ofrece Bold en vez de un 800 real, este filo lo recupera. */
  -webkit-text-stroke: 0.013em currentColor;
  paint-order: stroke fill;
}

.hero__oficio {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(0.82rem, 1.3vw, 0.95rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cobalto);
  max-width: none;
  margin-bottom: 1.1rem;
}

.hero__frase {
  font-size: clamp(1.15rem, 2.1vw, 1.5rem);
  font-style: italic;
  color: var(--tinta-suave);
  max-width: 34ch;
  margin-bottom: 2rem;
}

@keyframes sube {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}

.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
  isolation: isolate;
  padding: 0.85rem 1.6rem;
  border: 1px solid var(--tinta);
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--tinta);
  transition: color 0.3s ease;
}

/* El acento sol se desliza bajo el texto al hover */
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--sol);
  transform: translateX(-101%);
  transition: transform 0.42s cubic-bezier(.65,0,.2,1);
}
.cta:hover, .cta:focus-visible { color: #1C1917; }
.cta:hover::before, .cta:focus-visible::before { transform: none; }

.cta__flecha { transition: transform 0.42s cubic-bezier(.65,0,.2,1); }
.cta:hover .cta__flecha { transform: translateX(5px); }

/* ---------------------------------------------------------------
   Secciones
   --------------------------------------------------------------- */

main { position: relative; z-index: 1; }

section {
  padding: var(--paso) clamp(1.25rem, 6vw, 7rem);
  border-top: var(--borde);
}

.seccion__titulo {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--jade);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.seccion__titulo::before {
  content: "";
  display: inline-block;
  width: 2.2rem;
  height: 1px;
  margin-right: 0.9rem;
  vertical-align: 0.3em;
  background: var(--jade);
}

/* Enfoque */

.principios {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(2.5rem, 4vw, 3.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.principio { padding-top: 1.4rem; border-top: 2px solid var(--tinta); }

.principio__num {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.18em;
  color: var(--sol-texto);
  margin-bottom: 1rem;
}

.principio h3 {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  margin-bottom: 0.85rem;
}

.principio p { color: var(--tinta-suave); margin: 0; }

/* Trabajo */

.pieza {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  padding-block: clamp(2.5rem, 5vw, 4rem);
}
.pieza + .pieza { border-top: var(--borde); }

@media (min-width: 52rem) {
  .pieza { grid-template-columns: 1.05fr 1fr; }
  .pieza:nth-child(odd) .portada { order: 2; }
}

.pieza__meta {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--tinta-suave);
  margin-bottom: 0.7rem;
}

.pieza h3 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  margin-bottom: 1rem;
}

.pieza__texto p:not(.pieza__meta):not(.pieza__dato) { color: var(--tinta-suave); }

.pieza__dato {
  margin: 1.4rem 0 0;
  padding-left: 1rem;
  border-left: 3px solid var(--sol);
  font-size: 1.02rem;
  font-style: italic;
  color: var(--tinta);
}

/* --- Portadas dibujadas con CSS (sin imágenes) --- */

.portada {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: var(--borde);
  transition: transform 0.5s cubic-bezier(.2,.7,.3,1);
}
.pieza:hover .portada { transform: translateY(-6px); }

/* 1 — Mercado Ligero: tarjetas de pedido apiladas sobre retícula de abasto */
.portada--mercado {
  background:
    repeating-linear-gradient(90deg, rgb(26 79 139 / 0.1) 0 1px, transparent 1px 2.2rem),
    repeating-linear-gradient(0deg, rgb(26 79 139 / 0.1) 0 1px, transparent 1px 2.2rem),
    linear-gradient(160deg, var(--papel), var(--papel-hondo));
}
.portada--mercado::before,
.portada--mercado::after {
  content: "";
  position: absolute;
  border-radius: 3px;
}
.portada--mercado::before {
  inset: 24% 34% 14% 12%;
  background:
    linear-gradient(var(--tinta) 0 2px, transparent 2px) 0 18% / 56% 2px no-repeat,
    linear-gradient(var(--tinta-suave) 0 2px, transparent 2px) 0 36% / 72% 2px no-repeat,
    linear-gradient(var(--tinta-suave) 0 2px, transparent 2px) 0 54% / 40% 2px no-repeat,
    linear-gradient(var(--jade) 0 2px, transparent 2px) 0 72% / 64% 2px no-repeat,
    var(--tarjeta-bg);
  background-origin: content-box;
  padding: 1.1rem;
  box-shadow: 0 14px 28px -18px rgb(0 0 0 / 0.4);
  transform: rotate(-2.5deg);
}
.portada--mercado::after {
  inset: 16% 10% 30% 42%;
  background: var(--cobalto);
  box-shadow:
    0 16px 30px -18px rgb(0 0 0 / 0.45),
    inset 0 0 0 10px rgb(243 240 232 / 0.14);
  transform: rotate(3.5deg);
}

/* 2 — Nixtamal: círculos concéntricos de token sobre retícula fina */
.portada--nixtamal {
  background:
    repeating-radial-gradient(circle at 62% 46%, transparent 0 2.1rem, rgb(128 128 128 / 0.15) 2.1rem 2.15rem),
    conic-gradient(from 210deg at 62% 46%, var(--cobalto) 0 25%, var(--jade) 0 50%, var(--sol) 0 62%, var(--papel-hondo) 0 100%),
    var(--papel);
}
.portada--nixtamal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 62% 46%, transparent 0 4.4rem, var(--papel) 4.5rem);
}
.portada--nixtamal::after {
  content: "";
  position: absolute;
  left: 8%;
  bottom: 10%;
  width: 46%;
  height: 0.9rem;
  background:
    linear-gradient(90deg,
      var(--cobalto) 0 16.6%,
      var(--cobalto-claro) 0 33.3%,
      var(--jade) 0 50%,
      var(--sol) 0 66.6%,
      var(--tinta) 0 83.3%,
      var(--papel-hondo) 0 100%);
  box-shadow: 0 0 0 1px rgb(28 25 23 / 0.2);
}

/* 3 — Ruta Clara: líneas de ruta y nodos de transbordo */
.portada--ruta {
  background:
    repeating-linear-gradient(45deg, rgb(26 79 139 / 0.85) 0 0.42rem, transparent 0.42rem 2.6rem),
    repeating-linear-gradient(-45deg, rgb(13 107 92 / 0.7) 0 0.3rem, transparent 0.3rem 3.4rem),
    linear-gradient(200deg, var(--papel), var(--papel-hondo));
}
.portada--ruta::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 26% 34%, var(--papel) 0 0.62rem, var(--tinta) 0.62rem 0.9rem, transparent 0.9rem),
    radial-gradient(circle at 58% 60%, var(--papel) 0 0.62rem, var(--tinta) 0.62rem 0.9rem, transparent 0.9rem),
    radial-gradient(circle at 80% 26%, var(--papel) 0 0.5rem, var(--sol) 0.5rem 0.95rem, transparent 0.95rem);
}
.portada--ruta::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12%;
  height: 0.55rem;
  background: var(--sol);
  box-shadow: 0 -0.95rem 0 0 var(--papel);
}

/* Contacto */

.contacto__frase {
  font-size: clamp(1.3rem, 3vw, 2.1rem);
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  max-width: 24ch;
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.contacto__lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  max-width: 44rem;
}

.contacto__lista li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  border-top: var(--borde);
}
.contacto__lista li:last-child { border-bottom: var(--borde); }

.contacto__lista span:first-child {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tinta-suave);
}

.contacto__lista a,
.contacto__ciudad {
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  text-decoration: none;
  color: var(--cobalto);
  background: linear-gradient(var(--sol), var(--sol)) 0 100% / 0 0.18em no-repeat;
  transition: background-size 0.4s cubic-bezier(.65,0,.2,1), color 0.3s ease;
  padding-bottom: 0.1em;
}
.contacto__ciudad { color: var(--tinta); }
.contacto__lista a:hover,
.contacto__lista a:focus-visible { color: var(--tinta); background-size: 100% 0.18em; }

/* Pie */

.pie {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  justify-content: space-between;
  padding: 2rem clamp(1.25rem, 6vw, 7rem) 3rem;
  border-top: var(--borde);
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tinta-suave);
}

.pie__creditos {
  flex-basis: 100%;
  margin: 0.5rem 0 0;
  max-width: 60ch;
  font-family: var(--cuerpo);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.5;
}

/* ---------------------------------------------------------------
   Preferencias y soportes
   --------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
  .monograma { animation: none; }
  .m-bloque { opacity: 0.1; }
  .m-trazo, .m-arco { stroke-dashoffset: 0; }
}

@media print {
  body::after, .monograma, .nav { display: none; }
  body { background: #fff; }
  section { page-break-inside: avoid; }
}
