/* ============================================================
   Carlos Romero Grezzi — portada personal
   Tokens
   ============================================================ */
:root {
  --color-bg: #ffffff;
  --color-ink: #121212;
  --color-body: #4a4a4a;
  --color-muted: #9a9a9a;
  --color-line: #e6e6e4;

  --font-base: 'Neue Haas Grotesk Display Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --edge: clamp(1.5rem, 5vw, 4.5rem);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, p {
  margin: 0;
}

:focus-visible {
  outline: 1px solid var(--color-ink);
  outline-offset: 4px;
}

/* ============================================================
   Layout shell
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--edge);
}

.hero__content {
  max-width: min(30rem, 90vw);
}

/* ============================================================
   Masthead
   ============================================================ */
.mast__name {
  font-family: 'Roboto', var(--font-base);
  font-weight: 500;
  font-size: clamp(2.25rem, 4.6vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  color: var(--color-ink);
}

.mast__tagline {
  margin-top: clamp(1.25rem, 3vh, 2rem);
  font-family: var(--font-base);
  font-weight: 400;
  font-size: clamp(1.25rem, 1.7vw, 1.5rem);
  line-height: 1.5;
  color: var(--color-body);
  max-width: 27rem;
}

/* ============================================================
   Links index (main access points)
   ============================================================ */
.index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: clamp(2rem, 5vh, 3rem);
}

.index__link {
  font-family: var(--font-base);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.005em;
  color: var(--color-body);
  position: relative;
  background-image: linear-gradient(var(--color-ink), var(--color-ink));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 0.35s var(--ease), color 0.35s var(--ease);
  padding-bottom: 0.15em;
}

.index__link:hover,
.index__link:focus-visible {
  color: var(--color-ink);
  background-size: 100% 1px;
}

/* ============================================================
   Portrait
   ============================================================ */
.portrait {
  margin-top: clamp(2.5rem, 6vh, 3.5rem);
  width: min(48%, 240px);
  margin-left: auto;
}

.portrait img {
  width: 100%;
  filter: brightness(1.1);
}

/* ============================================================
   Meta (secondary info)
   ============================================================ */
.meta {
  margin-top: clamp(2.5rem, 6vh, 3.5rem);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-family: var(--font-base);
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.meta__item--link {
  position: relative;
  background-image: linear-gradient(var(--color-muted), var(--color-muted));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 0.3s var(--ease), color 0.3s var(--ease);
  padding-bottom: 0.15em;
}

.meta__item--link:hover,
.meta__item--link:focus-visible {
  color: var(--color-ink);
  background-image: linear-gradient(var(--color-ink), var(--color-ink));
  background-size: 100% 1px;
}

/* ============================================================
   Desktop composition
   ============================================================ */
@media (min-width: 900px) {
  .hero__content {
    max-width: min(44rem, 55vw);
  }

  .mast__tagline {
    max-width: 27rem;
  }

  .index {
    position: absolute;
    top: var(--edge);
    right: var(--edge);
    margin-bottom: 0;
  }

  .portrait {
    position: absolute;
    right: var(--edge);
    bottom: 0;
    margin: 0;
    width: auto;
    height: clamp(288px, 43vh, 496px);
  }

  .portrait img {
    width: auto;
    height: 100%;
  }

  .meta {
    position: absolute;
    left: var(--edge);
    bottom: var(--edge);
    margin-top: 0;
  }
}

/* ============================================================
   Load-in motion
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: reveal 0.7s var(--ease) forwards;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .index__link,
  .meta__item--link {
    transition: none;
  }
}

/* ============================================================
   Placeholder pages (secondary sections)
   ============================================================ */
.stub {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
  padding: var(--edge);
  max-width: 40rem;
}

.stub__title {
  font-family: var(--font-base);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -0.015em;
  line-height: 1;
}

.stub__note {
  font-family: var(--font-base);
  color: var(--color-body);
  font-size: 1.0625rem;
  max-width: 34ch;
}

.stub__back {
  font-family: var(--font-base);
  font-size: 0.8125rem;
  color: var(--color-muted);
  width: fit-content;
  background-image: linear-gradient(var(--color-muted), var(--color-muted));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 0.3s var(--ease), color 0.3s var(--ease);
  padding-bottom: 0.15em;
}

.stub__back:hover,
.stub__back:focus-visible {
  color: var(--color-ink);
  background-image: linear-gradient(var(--color-ink), var(--color-ink));
  background-size: 100% 1px;
}

/* ============================================================
   Recursos — listado
   ============================================================ */
.resources {
  padding: var(--edge);
  max-width: 64rem;
}

.resources > .stub__back,
.doc > .stub__back {
  display: inline-block;
  margin-bottom: clamp(2rem, 5vh, 3rem);
}

.resources__header {
  margin-bottom: clamp(3rem, 8vh, 5rem);
}

.resources__title {
  font-family: var(--font-base);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -0.015em;
  line-height: 1;
  margin-top: 1.5rem;
}

.resources__note {
  margin-top: 1.25rem;
  font-family: var(--font-base);
  color: var(--color-body);
  font-size: 1.0625rem;
  max-width: 40ch;
}

.resource-group {
  margin-bottom: clamp(3rem, 8vh, 4.5rem);
}

.resource-group__title {
  font-family: var(--font-base);
  font-weight: 500;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  padding-bottom: 0.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--color-line);
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 200px));
  gap: 2rem 1.75rem;
}

.resource-card {
  display: block;
}

.resource-card__cover {
  aspect-ratio: 210 / 297;
  border: 1px solid var(--color-line);
  overflow: hidden;
  transition: border-color 0.3s var(--ease);
}

.resource-card:hover .resource-card__cover,
.resource-card:focus-visible .resource-card__cover {
  border-color: var(--color-ink);
}

.resource-card__cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.resource-card__title {
  margin-top: 0.85rem;
  font-family: var(--font-base);
  font-weight: 500;
  font-size: 0.9375rem;
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: var(--color-ink);
}

.resource-card__meta {
  margin-top: 0.25rem;
  font-family: var(--font-base);
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.resource-card__desc {
  margin-top: 0.25rem;
  font-family: var(--font-base);
  font-size: 0.8125rem;
  color: var(--color-body);
}

/* ============================================================
   Recursos — ficha individual
   ============================================================ */
.doc {
  padding: var(--edge);
  max-width: 40rem;
}

.doc__header {
  margin-bottom: clamp(2.5rem, 6vh, 3.5rem);
}

.doc__eyebrow {
  font-family: var(--font-base);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
}

.doc__title {
  margin-top: 0.75rem;
  font-family: var(--font-base);
  font-weight: 500;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  letter-spacing: -0.015em;
  line-height: 1.05;
}

.doc__dek {
  margin-top: 1rem;
  font-family: var(--font-base);
  font-size: 1.1875rem;
  line-height: 1.5;
  color: var(--color-body);
  max-width: 42ch;
}

.doc__section {
  margin-bottom: clamp(2.5rem, 6vh, 3.5rem);
}

.doc__section h2 {
  font-family: var(--font-base);
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: -0.005em;
  margin: 0 0 1rem;
}

.doc__section p {
  font-family: var(--font-base);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-body);
  max-width: 60ch;
}

.doc__section p + p {
  margin-top: 1rem;
}

.doc__table {
  margin-top: 1.5rem;
  width: 100%;
  max-width: 30rem;
  border-collapse: collapse;
  font-family: var(--font-base);
  font-size: 0.9375rem;
}

.doc__table th,
.doc__table td {
  text-align: left;
  padding: 0.55rem 0.75rem 0.55rem 0;
  border-bottom: 1px solid var(--color-line);
}

.doc__table th {
  font-weight: 500;
  color: var(--color-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.doc__table td:last-child,
.doc__table th:last-child {
  text-align: right;
}

.doc__download {
  padding-top: 2rem;
  border-top: 1px solid var(--color-line);
}

.doc__download-link {
  font-family: var(--font-base);
  font-weight: 500;
  font-size: 1.1875rem;
  color: var(--color-ink);
  position: relative;
  background-image: linear-gradient(var(--color-ink), var(--color-ink));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 0.35s var(--ease);
  padding-bottom: 0.15em;
}

.doc__download-link:hover,
.doc__download-link:focus-visible {
  background-size: 100% 1px;
}

.doc__download-note {
  margin-top: 0.75rem;
  font-family: var(--font-base);
  font-size: 0.875rem;
  color: var(--color-muted);
}
