:root {
  --bg: #ffffff;
  --text: rgba(0, 0, 0, 0.8);
  --text-soft: rgba(0, 0, 0, 0.56);
  --line: rgba(0, 0, 0, 0.08);
  --soft: #f5f5f5;
  --max: 1360px;
  --header-h: 78px;
  --transition: 0.28s ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Raleway", sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

button,
input,
textarea {
  font: inherit;
}

.container {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
}

/* =========================
   HEADER
========================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(0, 0, 0, 0.9);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.main-nav a,
.mobile-nav a {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text);
  position: relative;
  padding-bottom: 3px;
}

.main-nav a::after,
.mobile-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.75);
  transition: width var(--transition);
}

.main-nav a:hover::after,
.mobile-nav a:hover::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  position: relative;
}

.menu-toggle span {
  position: absolute;
  left: 9px;
  right: 9px;
  height: 1px;
  background: rgba(0, 0, 0, 0.8);
  transition: var(--transition);
}

.menu-toggle span:nth-child(1) { top: 14px; }
.menu-toggle span:nth-child(2) { top: 21px; }
.menu-toggle span:nth-child(3) { top: 28px; }

.menu-toggle.active span:nth-child(1) {
  top: 21px;
  transform: rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  top: 21px;
  transform: rotate(-45deg);
}

.mobile-nav {
  display: none;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.mobile-nav.open {
  display: block;
}

.mobile-nav .container {
  display: grid;
  gap: 14px;
  padding: 16px 0 20px;
}

/* =========================
   HOME
========================== */
.home {
  padding: 42px 0 70px;
}

.home-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.home-copy {
  padding-top: 10px;
}

.home-title {
  margin: 0 0 12px;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 0.98;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: rgba(0, 0, 0, 0.84);
}

.home-subtitle {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-soft);
  max-width: 260px;
}

.home-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-links a {
  width: fit-content;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.74);
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}

.home-links a:hover {
  border-bottom-color: rgba(0, 0, 0, 0.45);
  color: rgba(0, 0, 0, 0.84);
}

/* =========================
   SLIDER HOME
========================== */
.home-slider-wrap {
  width: 100%;
}

.slider {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 28px;
}

.slides {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.slide.active {
  opacity: 1;
  z-index: 2;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.slider-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  gap: 16px;
}

.slider-caption {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.6);
}

.slider-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  cursor: pointer;
  font-size: 20px;
  color: rgba(0, 0, 0, 0.7);
}

.slider-btn:hover {
  border-color: rgba(0, 0, 0, 0.25);
}

.slider-dots {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.slider-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  min-height: 8px;
  max-width: 8px;
  max-height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 8px;
  display: block;
}

.slider-dot.active {
  background: rgba(0, 0, 0, 0.7);
}

.home-note {
  margin-top: 70px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-soft);
}

/* =========================
   PAGE BASE
========================== */
.page {
  padding: 60px 0 100px;
}

.page-text {
  max-width: 720px;
}

.page-text-wide {
  max-width: 100%;
}

.page-text h1 {
  font-size: 34px;
  font-weight: 300;
  margin: 0 0 40px;
}

.page-text h2 {
  margin: 50px 0 18px;
  font-size: 20px;
  font-weight: 500;
}

.page-text p {
  line-height: 1.7;
  margin-bottom: 18px;
  color: rgba(0, 0, 0, 0.75);
}

.loading-text {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.55);
}

/* =========================
   BIO
========================== */
.cv-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 50px 0;
}

.cv-list li {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.75);
}

/* =========================
   TEXTOS
========================== */
.texto {
  margin-bottom: 40px;
}

.texto-meta {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.5);
  margin-bottom: 10px;
}

/* =========================
   OBRAS
========================== */
.obras-container {
  width: 100%;
}

.decade {
  margin-top: 72px;
}

.decade:first-child {
  margin-top: 0;
}

.decade-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.decade h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.84);
}

.decade-head p {
  margin: 0;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.works-masonry {
  column-count: 4;
  column-gap: 24px;
}

.masonry-item {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin: 0 0 28px;
}

.work-card {
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.work-thumb {
  background: var(--soft);
  border: 1px solid rgba(0, 0, 0, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  transition: border-color var(--transition), transform var(--transition);
}

.work-card:hover .work-thumb {
  border-color: rgba(0, 0, 0, 0.16);
  transform: translateY(-2px);
}

.work-thumb img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.work-caption {
  margin-top: 10px;
}

.work-title {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(0, 0, 0, 0.8);
}

.work-year {
  margin: 0;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.5);
}

/* =========================
   LIGHTBOX
========================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  background: rgba(255, 255, 255, 0.98);
}

.lightbox.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-inner {
  width: min(1200px, calc(100% - 120px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 34px;
  align-items: start;
}

.lightbox-image-wrap {
  background: #f6f6f6;
  border: 1px solid rgba(0, 0, 0, 0.07);
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox-image-wrap img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
}

.lightbox-meta h2 {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
}

.lightbox-meta p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(0, 0, 0, 0.72);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 24px;
  border: 0;
  background: transparent;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.72);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  color: rgba(0, 0, 0, 0.72);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-prev {
  left: 22px;
}

.lightbox-next {
  right: 22px;
}

/* =========================
   RESPONSIVE
========================== */
@media (max-width: 1180px) {
  .works-masonry {
    column-count: 3;
  }

  .lightbox-inner {
    width: min(1000px, calc(100% - 80px));
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .home-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .home-copy {
    max-width: 680px;
  }

  .home-subtitle {
    max-width: 520px;
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 70px;
  }

  .main-nav {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .home {
    padding: 28px 0 54px;
  }

  .page {
    padding: 40px 0 80px;
  }

  .container {
    width: min(var(--max), calc(100% - 28px));
  }

  .slider {
    padding: 16px;
  }

  .slides {
    aspect-ratio: 4 / 5;
    min-height: 420px;
  }

  .slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .slider-info {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .slider-controls {
    width: 100%;
    justify-content: space-between;
  }

  .home-note {
    margin-top: 42px;
  }

  .works-masonry {
    column-count: 2;
    column-gap: 18px;
  }

  .masonry-item {
    margin-bottom: 20px;
  }

  .lightbox {
    align-items: flex-start;
    overflow-y: auto;
    padding: 56px 16px 86px;
  }

  .lightbox-inner {
    width: 100%;
    gap: 18px;
    grid-template-columns: 1fr;
  }

  .lightbox-image-wrap {
    min-height: auto;
    padding: 14px;
  }

  .lightbox-image-wrap img {
    max-height: 64vh;
  }

  .lightbox-meta {
    padding-right: 0;
  }

  .lightbox-close {
    top: 10px;
    right: 14px;
  }

  .lightbox-nav {
    top: auto;
    bottom: 18px;
    transform: none;
    z-index: 10;
  }

  .lightbox-prev {
    left: 16px;
  }

  .lightbox-next {
    right: 16px;
  }
}

@media (max-width: 520px) {
  .home-title {
    font-size: 34px;
  }

  .works-masonry {
    column-count: 1;
  }

  .decade-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .slides {
    min-height: 360px;
  }
}