:root {
  color-scheme: light;
  --fondo: #f5f1e9;
  --papel: #fff;
  --texto: #202920;
  --secundario: #515952;
  --borde: #deded4;
  --enlace: #255542;
  font-family: system-ui, sans-serif;
  color: var(--texto);
  background: var(--fondo);
}

* {
  box-sizing: border-box;
}

body {
  isolation: isolate;
  min-height: 100svh;
  margin: 0;
  display: grid;
  place-items: center;
}

.fondo {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.fondo::before,
.fondo::after {
  position: absolute;
  content: "";
}

.fondo::before {
  inset: -12%;
  background:
    radial-gradient(ellipse at 50% 40%, #fffcf4, transparent 45%),
    radial-gradient(ellipse at 12% 30%, #bbd9ce, transparent 47%),
    radial-gradient(ellipse at 88% 24%, #c5d7e7, transparent 45%),
    radial-gradient(ellipse at 78% 88%, #eed6b5, transparent 43%);
}

.fondo::after {
  inset: 0;
  background:
    radial-gradient(circle, rgb(35 77 67 / 24%) 0.8px, transparent 1.4px) center / 28px 28px,
    radial-gradient(ellipse 26vw 29vh at 1% 32%, transparent 99%, rgb(35 77 67 / 13%) 99.3% 99.7%, transparent 100%),
    radial-gradient(ellipse 31vw 34vh at 1% 32%, transparent 99%, rgb(35 77 67 / 12%) 99.3% 99.7%, transparent 100%),
    radial-gradient(ellipse 36vw 39vh at 1% 32%, transparent 99%, rgb(35 77 67 / 11%) 99.3% 99.7%, transparent 100%);
  mask-image: radial-gradient(ellipse at center, transparent 28%, #000 91%);
}

.portfolio {
  width: min(100%, 54rem);
  padding: clamp(2.25rem, 6vw, 4.5rem) clamp(1.25rem, 5vw, 3rem);
}

.perfil {
  max-width: 36rem;
  margin: 0 auto clamp(2rem, 5vw, 3rem);
  text-align: center;
}

.perfil-orbita {
  position: relative;
  width: fit-content;
  margin: 0 auto 1.35rem;
}

.perfil-orbita::before,
.perfil-orbita::after {
  position: absolute;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.perfil-orbita::before {
  inset: -7px;
  border: 1px solid rgb(37 85 66 / 25%);
  border-top-color: #548574;
  border-right-color: #548574;
  border-bottom-color: transparent;
}

.perfil-orbita::after {
  inset: -14px;
  border: 1px dashed rgb(37 85 66 / 22%);
}

.perfil-retrato {
  position: relative;
  width: clamp(8.5rem, 15vw, 10.5rem);
  aspect-ratio: 1;
  overflow: hidden;
  border: 4px solid var(--papel);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--borde), 0 8px 24px rgb(37 62 42 / 12%);
}

.perfil-retrato img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 128%;
  height: auto;
  transform: translate(-52%, -60.5%);
}

.perfil h1 {
  margin: 0;
  font: 600 clamp(1.85rem, 4.6vw, 2.625rem)/1.13 Georgia, serif;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.perfil p {
  margin: 0.65rem 0 0;
  color: var(--secundario);
  line-height: 1.55;
  text-wrap: balance;
}

.perfil .perfil-presentacion {
  color: var(--texto);
  font-size: clamp(1rem, 2vw, 1.125rem);
}

h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 650;
}

.aplicaciones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.aplicacion {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: clamp(1.15rem, 3vw, 1.5rem);
  background: var(--papel);
  border: 1px solid var(--borde);
  border-radius: 1.25rem;
  box-shadow: 0 6px 24px rgb(37 62 42 / 5%);
  color: inherit;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.aplicacion-cabecera {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.aplicacion-cabecera img {
  display: block;
  flex: none;
  width: 4rem;
  height: 4rem;
  object-fit: contain;
}

.estado {
  flex: 0 1 auto;
  padding: 0.3rem 0.65rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
}

.estado-produccion {
  color: #2d523e;
  background: #eaf3eb;
}

.estado-prueba {
  color: #664c25;
  background: #f8efdb;
}

.aplicacion h3 {
  margin: 0;
  font-size: 1.375rem;
  line-height: 1.25;
}

.aplicacion p {
  margin: 0.4rem 0 1.25rem;
  color: var(--secundario);
  line-height: 1.5;
}

.aplicacion-enlace {
  margin-top: auto;
  color: var(--enlace);
  font-weight: 650;
}

.contacto {
  margin-top: 1.75rem;
  text-align: center;
}

.contacto a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--secundario);
  font-size: 0.9375rem;
}

a:focus-visible {
  outline: 2px solid var(--enlace);
  outline-offset: 4px;
}

.aplicacion:focus-visible {
  border-color: var(--enlace);
  background: #fdfefc;
}

@media (hover: hover) and (pointer: fine) {
  .aplicacion:hover {
    border-color: var(--enlace);
    background: #fdfefc;
  }

  .contacto a:hover {
    color: var(--enlace);
  }
}

.aplicacion:hover .aplicacion-enlace,
.aplicacion:focus-visible .aplicacion-enlace {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

@media (max-width: 46rem) {
  .aplicaciones {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }

  .contacto {
    margin-top: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aplicacion {
    transition: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .fondo::before {
    animation: deriva-luz 26s ease-in-out infinite alternate;
  }

  .perfil-orbita::before {
    animation: girar-orbita 34s linear infinite;
  }
}

@keyframes deriva-luz {
  from { transform: translate(-2%, -1%); }
  to { transform: translate(3%, 3%) scale(1.12); }
}

@keyframes girar-orbita {
  to { transform: rotate(1turn); }
}
