/* =========================================================
   Perfil · Agustina Suarez · DGPC FADU UBA
   Orden: tokens → base → layout → componentes → responsive
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --bg: #fbfbf8;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .13 0 0 0 0 .18 0 0 0 0 .16 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --surface: #f4f5e8;
  --ink: #222f28;
  --muted: #4d5852;
  --line: rgba(34, 47, 40, 0.16);
  --accent: #2c4a3c;
  --peach: #dfe3a2;
  --sage: #ccd1a8;
  --sage-deep: #8a9b94;
  --peach-hover: #d3d98f;
  --mint: #def1e2;
  --lilac: #eae7f7;
  --yellow: #fcf5dc;
  --pink: #f9e1e2;
  --chip: #f2f2ef;
  --radius: 8px;
  --max: 1192px;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--sage);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
}

[hidden] {
  display: none !important;
}

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

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

.saltar {
  position: absolute;
  top: -100px;
  left: 20px;
  z-index: 40;
  padding: 12px;
  background: var(--surface);
}
.saltar:focus {
  top: 10px;
}

/* ---------- Colores de apoyo ---------- */
.mint { background: var(--mint); }
.lilac { background: var(--lilac); }
.yellow { background: var(--yellow); }
.pink { background: var(--pink); }

/* ---------- Piezas reutilizables ---------- */
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  font-size: 10px;
  background: rgba(44, 74, 60, 0.16);
  border: 1px solid rgba(44, 74, 60, 0.35);
  border-radius: 30px;
}
.pills .pill:nth-child(1) { background: #b7c092; }
.pills .pill:nth-child(2) { background: #a7b98f; }
.pills .pill:nth-child(3) { background: #c4b987; }
.pill-dark,
.pills .pill.pill-dark {
  color: #f1f3de;
  background: var(--accent);
  border-color: var(--accent);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.section-heading h2 {
  margin-bottom: 10px;
  font-size: clamp(38px, 7.2vw, 100px);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.section-heading p {
  font-size: 12px;
  color: var(--muted);
}
.section-kicker {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
}

/* ---------- Encabezado y pie (con textura) ---------- */
.site-header,
.site-footer {
  position: relative;
  isolation: isolate;
  background: var(--peach);
}
.site-header::before,
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--noise);
  mix-blend-mode: multiply;
  opacity: 0.55;
  pointer-events: none;
}
.site-header {
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--max);
  min-height: 80px;
  margin: 0 auto;
  padding: 0 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}
.brand-caption {
  padding-left: 12px;
  font-size: 10px;
  line-height: 1.5;
  border-left: 1px solid var(--ink);
}

.top-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}
.top-nav a {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  font-size: 12px;
  border: 1px solid transparent;
  border-radius: 6px;
}
.top-nav a:hover {
  background: var(--peach-hover);
}
.top-nav .nav-active {
  background: var(--surface);
  border-color: var(--line);
}

.semester {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 30px;
}

/* ---------- Página ---------- */
/* Cada sección es una franja a todo el ancho, con la misma textura y un tono apenas distinto */
.band {
  position: relative;
  isolation: isolate;
  padding-block: 64px;
  background: var(--sage);
}
.band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--noise);
  mix-blend-mode: multiply;
  opacity: 0.55;
  pointer-events: none;
}
/* El ancho se calcula acá, así el contenido nunca queda pegado al borde */
.band-inner {
  width: min(100% - 48px, var(--max));
  margin-inline: auto;
}
#contenido > .band:first-child {
  padding-block: 30px 34px;
}

.breadcrumb {
  margin-bottom: 0;
  font-size: 11px;
  color: var(--muted);
}
.breadcrumb strong {
  font-weight: 500;
  color: var(--ink);
}

/* ---------- Portada (a todo el ancho) ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  justify-items: center;
  gap: 28px;
  padding: 44px 24px;
  text-align: center;
  background: var(--sage);
}
/* Textura: ruido fino + luz suave en el centro */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--noise),
    radial-gradient(ellipse at 50% 45%, rgba(255, 255, 255, 0.28), transparent 65%);
  mix-blend-mode: multiply;
  opacity: 0.55;
  pointer-events: none;
}
.hero > * {
  width: 100%;
  max-width: var(--max);
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-stage {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
}
.hero-note {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}
.hero-note span {
  display: block;
  margin-bottom: 8px;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.hero-note em {
  font-size: 18px;
  font-weight: 300;
  font-style: italic;
}
/* El h1 (Nombre) usa exactamente la misma tipografía que "Estudiante de" */
h1.hero-note {
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}
.note-left { text-align: right; }
.note-right { text-align: left; }

.portrait {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(150px, 20vw, 230px);
  aspect-ratio: 1;
  overflow: hidden;
  font-size: 44px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--sage-deep);
  box-shadow: 0 18px 40px -22px rgba(34, 47, 40, 0.6);
}
.portrait-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.portrait img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.portrait.photo-missing img { display: none; }

.hero-hello {
  font-size: 15px;
  font-weight: 500;
}
.hero-label {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* ---------- Resumen ---------- */
.overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 29px 0 0;
}

.stat {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stat-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: var(--radius);
}
/* En el HTML va primero la etiqueta (dt) y después el valor (dd);
   visualmente se muestra al revés. */
.stat-text {
  display: flex;
  flex-direction: column-reverse;
}
.stat dd {
  font-size: 26px;
  font-weight: 500;
  line-height: 1.2;
}
.stat dt {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

/* ---------- Foja académica ---------- */
/* Sin JS no hay filtros: se muestran todas las materias. */
.academic-toolbar {
  display: none;
}
.js-ready .academic-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.tabs {
  display: flex;
  gap: 20px;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 48px;
  padding: 0 0 13px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tab:hover {
  color: var(--ink);
}
.tab[aria-pressed="true"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.tab-count {
  padding: 2px 6px;
  font-size: 10px;
  background: var(--chip);
  border-radius: 4px;
}

.search {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  max-width: 220px;
  padding-bottom: 12px;
  color: var(--muted);
}
.search input {
  width: 100%;
  font-size: 11px;
  background: transparent;
  border: 0;
  outline: 0;
}
.search:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.course-grid > li {
  display: flex;
  min-width: 0;
}

.course {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 158px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.course-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.course-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 7px;
}
.course-status {
  font-size: 9px;
  color: var(--muted);
}
.course h3 {
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}
.course-bottom {
  margin-top: auto;
  font-size: 10px;
  color: var(--muted);
}

.empty-state {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}
.academic-note {
  margin-top: 17px;
  font-size: 10px;
  color: var(--muted);
}

/* ---------- Separadores entre secciones ---------- */
#foja,
#portfolio,
#equipo,
#catedra {
  padding-top: 0;
}
#foja .band-inner,
#portfolio .band-inner,
#equipo .band-inner,
#catedra .band-inner {
  padding-top: 56px;
  border-top: 1px solid rgba(34, 47, 40, 0.28);
}

/* ---------- Portfolio ---------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.video {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.video-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--sage-deep);
}
.video-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.video-frame:hover img { transform: scale(1.05); }
.video-meta {
  padding: 16px 18px 18px;
  background: var(--surface);
}
.video-meta h3 {
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 500;
}
.video-meta p {
  margin-bottom: 12px;
  font-size: 11px;
  color: var(--muted);
}
.video-link {
  font-size: 11px;
  font-weight: 500;
  border-bottom: 1px solid var(--accent);
}

/* ---------- Equipo ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.team-grid > li {
  min-width: 0;
}
.team-card {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.team-card:hover {
  border-color: var(--accent);
}
.team-avatar {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  font-size: 12px;
  border-radius: 50%;
}
.team-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.team-card h3 {
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 500;
  overflow-wrap: break-word;
}
.team-card p {
  font-size: 9px;
  color: var(--muted);
}
.team-arrow {
  margin-left: auto;
}

/* ---------- Institución ---------- */
.institution-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 44px;
}
.institution-title {
  margin-bottom: 11px;
  font-size: 11px;
  font-weight: 600;
}
.institution-title.spaced {
  margin-top: 20px;
}
.institution-grid p {
  font-size: 11px;
  line-height: 1.9;
  color: var(--muted);
}
.institution-grid strong {
  font-weight: 500;
  color: var(--ink);
}

/* ---------- Pie ---------- */
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 26px 24px;
}
.legal-heading {
  margin-bottom: 10px;
  font-size: 10px;
  font-weight: 500;
}
.legal-copy {
  max-width: 980px;
  font-size: 10px;
  line-height: 1.8;
  color: var(--muted);
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  padding-top: 17px;
  font-size: 9px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ---------- Animación de entrada ---------- */
@keyframes reveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (min-width: 900px) {
  .hero-stage { animation: reveal 0.65s ease both; }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .semester { display: none; }
  .course-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .institution-grid { gap: 25px; }
}

@media (max-width: 700px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 20px 8px;
  }
  .brand,
  .top-nav,
  .top-nav ul { width: 100%; }
  .top-nav ul {
    justify-content: space-between;
    gap: 0;
  }
  .top-nav a {
    padding: 9px 7px;
    font-size: 11px;
  }

  .band { padding-block: 40px; }
  #contenido > .band:first-child { padding-block: 24px 24px; }
  #foja,
  #portfolio,
  #equipo,
  #catedra { padding-top: 0; }
  #foja .band-inner,
  #portfolio .band-inner,
  #equipo .band-inner,
  #catedra .band-inner { padding-top: 36px; }
  .band-inner { width: min(100% - 36px, var(--max)); }

  .hero {
    gap: 22px;
    padding: 24px 18px 34px;
  }
  .hero-stage {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }
  .portrait {
    grid-column: 1 / -1;
    order: -1;
    justify-self: center;
  }
  .note-left,
  .note-right { text-align: center; }
  .hero-note em { font-size: 15px; }

  .overview {
    gap: 8px;
    margin: 24px 0 0;
  }
  .stat {
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
    padding: 15px 10px;
  }
  .stat-icon {
    width: 30px;
    height: 30px;
  }
  .stat dd { font-size: 24px; }
  .stat dt { font-size: 9px; }

  .section-kicker { display: none; }

  .js-ready .academic-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .tabs { gap: 18px; }
  .tab {
    height: 36px;
    font-size: 11px;
  }
  .search { max-width: 100%; }

  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .course { padding: 13px; }
  .course h3 { font-size: 12px; }
  .course-status { font-size: 8px; }

  .team-card {
    gap: 8px;
    padding: 12px;
  }
  .team-card h3 { font-size: 10px; }
  .team-avatar {
    width: 30px;
    height: 30px;
    font-size: 10px;
  }
  .team-arrow { display: none; }

  .institution-grid {
    grid-template-columns: 1fr;
    gap: 23px;
  }

  .footer-inner { padding: 23px 18px; }
  .footer-bottom { flex-wrap: wrap; }
  .video-grid { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .video-grid,
  .course-grid,
  .team-grid { grid-template-columns: 1fr; }
}
