:root {
  --font-sans: 'Inter', sans-serif;
  --font-grotesk: 'Space Grotesk', sans-serif;
  --color-bg: #F7F3EC;
  --color-text: #232323;
  --color-accent: #B45309;
  font-size: 14px;
}

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

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  margin: 0;
}

.wrap {
  max-width: 640px;
  margin: 2rem auto 0;
  padding: 0 1rem;
}

/* --- TYPOGRAPHIC HIERARCHY --- */

h1 {
  font-family: var(--font-grotesk);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text);
  text-transform: uppercase;
  text-align: center;
}

.main-title {
  margin: 0 0 0.5rem;
  text-align: center;
}

h2 {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 700;
  color: #111;
  border-bottom: 1px solid #EAEAEA;
  padding-bottom: 8px;
  margin-top: 40px;
  margin-bottom: 32px;
}

h3 {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 700;
  color: #111;
}

.bio {
  font-family: var(--font-sans);
  font-size: 20px;
  line-height: 1.6;
  margin: 0;
  color: var(--color-text);
}

.project p, p {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--color-text);
}

.metadata {
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.5;
  color: #666;
}

.project-date {
  font-family: var(--font-sans);
  font-size: 12px !important;
  line-height: 1.5;
  color: #888;
  margin-top: 0;
  margin-bottom: 0.5em;
}

.location {
  font-size: 1.1rem;
  color: #666;
  margin: 0;
}

/* --- VERTICAL RHYTHM & SPACING --- */

.header {
  display: grid;
  grid-template-areas:
    "title title"
    "location location"
    "avatar bio";
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1.5rem;
  align-items: center;
  margin-bottom: 3rem;
}

.main-title { grid-area: title; text-align: center; margin-bottom: 0; }
.location   { grid-area: location; text-align: center; margin-bottom: 1.5rem; }
.avatar     { grid-area: avatar; justify-self: end; }
.bio        { grid-area: bio; text-align: left; margin: 0; }

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
}

/* --- PROYECTOS --- */
.project {
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid #ececec;
}
.project:last-child {
  border-bottom: none;
}
.project h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.35em;
  line-height: 1.2;
}
.project h3 a {
  color: #B45309;
  text-decoration: none;
  transition: color 0.2s;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.project h3 a:hover,
.project h3 a:focus {
  color: #8a3707;
  text-decoration: underline;
}
.project p {
  margin-top: 0;
  margin-bottom: 0.7em;
}
.project .metadata {
  margin-top: 0.2em;
  margin-bottom: 0.5em;
}

.footer {
  text-align: left;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e5e5;
  font-size: 0.9rem;
  color: #6c757d;
}

.separator {
  border: 0;
  border-top: 1px solid #e5e5e5;
  margin: 1.5rem 0;
  width: 100%;
}

.footer p {
  margin: 0 0 8px 0;
}

.social-links a {
  color: var(--color-accent);
  font-weight: 600;
}

section {
  margin-top: 0;
}

p {
  margin-bottom: 1.2em;
}



a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
  transition: color 150ms;
}

a:visited {
  color: var(--color-accent);
}

a:hover, a:active {
  color: #8a3707;
}

strong {
  font-weight: 600;
}

@media (max-width: 640px) {
  .header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
  }
  
  .avatar     { order: 1; }
  .main-title { order: 2; }
  .location   { order: 3; }
  .bio        { order: 4; font-size: 18px; }

  .instagram-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


.footer .avatar {
  display: block;
  margin-left: 0;
  margin-right: auto;
}

/* --- INSTAGRAM GRID --- */
.instagram-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 20px 0;
}

.photo-item {
  aspect-ratio: 4/5;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.photo-item:hover img {
  transform: scale(1.05);
}

/* --- LIGHTBOX --- */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  cursor: pointer;
}

.lightbox img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
}