:root {
  --bg: #f8f7f3;
  --panel: #ffffff;
  --text: #111111;
  --muted: #74726e;
  --line: #dedbd3;
  --soft-line: #ece9e1;
  --pad: clamp(22px, 4vw, 56px);
  --max: 1180px;
  --thumb-size: 184px;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  letter-spacing: .005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--sans); font-weight: 400; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* Header */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px var(--pad);
  color: var(--text);
  background: rgba(248, 247, 243, .88);
  border-bottom: 1px solid rgba(17, 17, 17, .08);
  backdrop-filter: blur(14px);
}

.brand {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 13px;
  line-height: 1;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.site-nav a { opacity: .72; transition: opacity .18s ease; }
.site-nav a:hover { opacity: 1; }

.menu-toggle {
  display: none;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Language switch */

.language-switch {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: 2px;
}

.language-switch button {
  appearance: none;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: inherit;
  padding: 0 0 2px;
  font: inherit;
  font-size: 12px;
  letter-spacing: .08em;
  cursor: pointer;
  opacity: .55;
}

.language-switch button.is-active {
  border-bottom-color: currentColor;
  opacity: 1;
}

.language-switch span { opacity: .35; }

/* Home */

.home-hero {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 118px var(--pad) 74px;
  min-height: 100vh;
}

.home-hero-duo {
  width: min(100%, 1180px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(220px, .78fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

.home-feature {
  margin: 0;
  display: block;
  min-width: 0;
}

.home-feature-artwork {
  color: inherit;
  text-decoration: none;
}

.hero-image {
  width: min(100%, 820px);
  height: auto;
  display: block;
  margin: 0 auto;
  object-fit: contain;
  box-shadow: 0 22px 70px rgba(17, 17, 17, .08);
}

.home-artwork-switcher {
  position: relative;
  display: block;
  width: min(100%, 430px);
  aspect-ratio: 1122 / 1402;
  margin: 0 auto;
}

.home-artwork-switcher .hero-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-artwork-view {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: homeArtworkFade 8s infinite;
}

.home-artwork-view-frontal { animation-delay: 0s; }
.home-artwork-view-lateral { animation-delay: 4s; }

.home-feature-caption {
  display: block;
  margin-top: 18px;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
  opacity: .62;
}

@keyframes homeArtworkFade {
  0%, 43% { opacity: 1; }
  50%, 93% { opacity: 0; }
  100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .home-artwork-view { animation: none; }
  .home-artwork-view-frontal { opacity: 1; }
  .home-artwork-view-lateral { opacity: 0; }
}

/* Pages */

.page {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 132px var(--pad) 84px;
  min-height: 100vh;
}

.page-heading {
  display: grid;
  grid-template-columns: minmax(120px, 190px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  margin-bottom: 70px;
}

.page-heading p,
.artwork-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.page-heading h1,
.artwork-header h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(30px, 4.2vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

/* Works */

.works-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(42px, 6vw, 84px);
  align-items: start;
}

.works-primary-column,
.works-secondary-column { min-width: 0; }

.works-column-title {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 300;
}

.series-list {
  border-top: 1px solid var(--line);
}

.series-row {
  display: grid;
  grid-template-columns: var(--thumb-size) minmax(0, 1fr);
  gap: clamp(18px, 2.8vw, 36px);
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--soft-line);
  transition: opacity .18s ease, transform .18s ease;
}

.series-row img {
  width: var(--thumb-size);
  height: calc(var(--thumb-size) * .72);
  object-fit: cover;
  display: block;
  background: #e9e6df;
  filter: saturate(.96);
}

.series-row h2 {
  font-weight: 400;
  font-size: clamp(19px, 2vw, 26px);
  margin: 0;
  letter-spacing: -0.018em;
  line-height: 1.1;
}

.series-row p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.series-row:hover {
  opacity: .72;
  transform: translateX(3px);
}

/* Hidden legacy studies styles kept only for old standalone pages */
.study-list { border-top: 1px solid var(--line); }
.study-row {
  display: grid;
  grid-template-columns: var(--thumb-size) 1fr;
  gap: clamp(18px, 3vw, 42px);
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--soft-line);
}
.study-row img {
  width: var(--thumb-size);
  height: calc(var(--thumb-size) * .72);
  object-fit: cover;
  display: block;
  background: #e9e6df;
}
.study-row h2 { margin: 0; font-size: clamp(19px, 2vw, 26px); font-weight: 400; letter-spacing: -0.018em; }
.study-row p { margin: 6px 0 0; color: var(--muted); }

/* Artwork pages */

.back-link {
  display: inline-block;
  margin-bottom: 52px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.artwork-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 50px;
  margin-bottom: 70px;
}

.artwork-meta a { text-decoration: underline; text-underline-offset: 4px; }

.artwork-feature { margin-bottom: 32px; text-align: center; }
.artwork-feature img { max-height: 82vh; width: auto; cursor: zoom-in; }
.placeholder-feature img { width: 100%; max-height: 520px; object-fit: contain; background: #f1f1f1; }

.artwork-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.artwork-grid img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  cursor: zoom-in;
  background: #eee;
}

/* Artwork detail layout */

.artwork-detail-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: clamp(44px, 7vw, 96px);
  align-items: start;
}

.artwork-info-panel {
  position: sticky;
  top: 120px;
}

.artwork-info-panel h1 {
  margin: 0 0 28px;
  font-size: clamp(28px, 2.8vw, 38px);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.1;
}

.artwork-info-panel p {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.7;
}

.artwork-info-panel hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 36px 0;
}

.enquire-button {
  display: inline-block;
  margin-top: 38px;
  padding: 12px 30px;
  border: 1px solid var(--text);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.enquire-button:hover { background: var(--text); color: var(--bg); }

.artwork-gallery-panel { min-width: 0; }
.main-artwork-image { width: 100%; max-height: 72vh; object-fit: contain; display: block; cursor: zoom-in; background: #f1f1f1; }
.artwork-ratio-frame {
  overflow: hidden;
  background: #f1f1f1;
}
.artwork-ratio-50-65 {
  width: min(100%, calc(72vh * 50 / 65));
  aspect-ratio: 50 / 65;
}
.artwork-ratio-frame .main-artwork-image {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  background: transparent;
}

.thumbnail-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.thumbnail-button {
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  opacity: .58;
}

.thumbnail-button:hover,
.thumbnail-button.active-thumb { opacity: 1; border-color: var(--text); }
.thumbnail-button img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }

/* Text pages */

.text-page { max-width: 980px; }
.bio-text {
  max-width: 720px;
  margin: 0 auto;
  text-align: left;
  font-size: 15px;
  line-height: 1.95;
}
.bio-text p { margin: 0 0 1.9em; }

/* CV */

.cv-list {
  max-width: 760px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}

.cv-list div {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 30px;
  border-bottom: 1px solid var(--soft-line);
  padding: 26px 0;
}

.cv-list span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.cv-list p { margin: 0; line-height: 1.75; }

/* Contact */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: clamp(40px, 7vw, 80px);
}

.contact-grid p { margin: 0 0 12px; }
.contact-grid form { display: grid; gap: 16px; }
.contact-grid input,
.contact-grid textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  font: inherit;
  color: var(--text);
}
.contact-grid button {
  justify-self: start;
  background: #111;
  color: #fff;
  border: 0;
  padding: 13px 28px;
  font: inherit;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}

/* Footer */

.site-footer {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 26px var(--pad);
  font-size: 12px;
  color: var(--muted);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 50px;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 90vh; object-fit: contain; }
.lightbox button { position: absolute; background: transparent; border: 0; color: #fff; font-size: 42px; cursor: pointer; }
.lightbox-close { top: 24px; right: 34px; }
.lightbox-prev { left: 28px; }
.lightbox-next { right: 28px; }

/* Mobile */

@media (max-width: 900px) {
  .artwork-detail-layout { grid-template-columns: 1fr; gap: 36px; }
  .artwork-info-panel { position: static; }
  .thumbnail-row { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}

@media (max-width: 820px) {
  .site-header {
    position: static;
    background: var(--bg);
    backdrop-filter: none;
    align-items: center;
  }
  .menu-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg);
    padding: 20px var(--pad);
    flex-direction: column;
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
  }
  .site-nav.is-open { display: flex; }
  .home-hero { padding: 44px 24px 40px; min-height: auto; }
  .home-hero-duo { grid-template-columns: 1fr; gap: 34px; }
  .hero-image { width: 100%; box-shadow: none; }
  .home-artwork-switcher { width: min(100%, 360px); }
  .page-heading, .artwork-header, .contact-grid, .cv-list div { grid-template-columns: 1fr; display: grid; gap: 28px; }
  .works-columns { grid-template-columns: 1fr; gap: 52px; }
  .page { padding-top: 58px; }
  .artwork-grid { grid-template-columns: 1fr; }
  .lightbox-prev, .lightbox-next { font-size: 30px; }
}

@media (max-width: 560px) {
  :root { --pad: 18px; --thumb-size: 78px; }
  .site-header { padding-top: 18px; padding-bottom: 18px; }
  .brand { font-size: 12px; }
  .page { padding-bottom: 52px; }
  .page-heading { margin-bottom: 44px; }
  .series-row, .study-row { grid-template-columns: var(--thumb-size) 1fr; gap: 16px; padding: 18px 0; }
  .series-row img, .study-row img { width: var(--thumb-size); height: calc(var(--thumb-size) * .72); }
  .series-row h2, .study-row h2 { font-size: 18px; }
  .thumbnail-row { grid-template-columns: repeat(2, 1fr); }
  .lightbox { padding: 20px; }
}

/* Professional legal/footer additions */
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
  border-top: 1px solid var(--soft-line);
  padding-top: 22px;
}
.site-footer p { margin: 0; line-height: 1.7; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px 20px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.footer-links a { opacity: .72; }
.footer-links a:hover { opacity: 1; }
.legal-page { max-width: 980px; }
.legal-text {
  max-width: 760px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.9;
}
.legal-text h2 {
  margin: 2.4em 0 .7em;
  font-size: 18px;
  letter-spacing: -.01em;
}
.legal-text p { margin: 0 0 1.25em; }
.legal-text a,
.form-note a { text-decoration: underline; text-underline-offset: 4px; }
.legal-note,
.form-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.form-note { margin-top: 4px; }
@media (max-width: 820px) {
  .footer-inner { flex-direction: column; }
  .footer-links { justify-content: flex-start; }
}


/* Expanded artwork gallery refinement */
body.lightbox-open { overflow: hidden; }
.gallery-help {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.main-artwork-image:hover { opacity: .96; }
.lightbox {
  background: rgba(7, 7, 7, .96);
  padding: 34px;
  z-index: 9999;
}
.lightbox.is-open { display: flex; }
.lightbox-figure {
  margin: 0;
  width: min(94vw, 1500px);
  height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-figure img,
.lightbox img {
  max-width: 100%;
  max-height: 86vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background: transparent;
}
.lightbox-caption {
  position: absolute;
  left: 34px;
  bottom: 28px;
  max-width: 56vw;
  color: rgba(255,255,255,.78);
  font-size: 12px;
  line-height: 1.5;
}
.lightbox-counter {
  position: absolute;
  right: 34px;
  bottom: 28px;
  color: rgba(255,255,255,.72);
  font-size: 12px;
  letter-spacing: .08em;
}
.lightbox button {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 44px;
  line-height: 1;
  transition: background .18s ease, opacity .18s ease;
}
.lightbox button:hover { background: rgba(255,255,255,.16); }
.lightbox-close { top: 22px; right: 28px; font-size: 32px !important; }
.lightbox-prev { left: 28px; }
.lightbox-next { right: 28px; }
.lightbox-prev[hidden],
.lightbox-next[hidden] { display: none; }
@media (max-width: 820px) {
  .lightbox { padding: 18px; }
  .lightbox button { width: 44px; height: 44px; font-size: 34px; }
  .lightbox-close { top: 14px; right: 14px; }
  .lightbox-prev { left: 12px; }
  .lightbox-next { right: 12px; }
  .lightbox-caption { left: 18px; bottom: 18px; max-width: 70vw; }
  .lightbox-counter { right: 18px; bottom: 18px; }
}


/* Corrected artwork lightbox behaviour */
.lightbox {
  position: fixed !important;
  inset: 0 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(7, 7, 7, .96) !important;
  z-index: 99999 !important;
  padding: 34px !important;
}
.lightbox.is-open { display: flex !important; }
.lightbox[aria-hidden="true"] { display: none !important; }
.lightbox-figure {
  margin: 0 !important;
  width: min(94vw, 1600px) !important;
  height: 88vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.lightbox-figure img,
.lightbox img {
  max-width: 94vw !important;
  max-height: 88vh !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  background: transparent !important;
  box-shadow: none !important;
}
.lightbox button {
  position: absolute !important;
  border: 0 !important;
  cursor: pointer !important;
}
.thumbnail-button { cursor: zoom-in; }
.thumbnail-button img { pointer-events: none; }
.main-artwork-image { cursor: zoom-in; }

/* Museum-grade mosaic + subtle motion refinement */
@media (min-width: 761px) {
  .works-columns { display: block; }
  .works-primary-column { width: 100%; }
  .works-column-title { margin-bottom: 28px; }

  .series-list {
    border-top: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(18px, 2vw, 30px);
    align-items: stretch;
  }

  .series-row,
  html[data-page="studies"] .series-row {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: clamp(285px, 26vw, 445px);
    gap: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: #ece9e1;
    isolation: isolate;
    opacity: 1;
    transform: translateY(0);
    transition: transform .9s cubic-bezier(.19,1,.22,1), opacity .9s ease, filter .7s ease;
  }

  body.jc-motion-ready .series-row { opacity: 0; transform: translateY(18px); }
  body.jc-motion-ready .series-row.is-visible { opacity: 1; transform: translateY(0); }
  .series-row:hover { opacity: 1; transform: translateY(-3px); }

  .series-row img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(.88) contrast(1.02);
    transform: scale(1.01);
    transition: transform 1.15s cubic-bezier(.19,1,.22,1), filter .85s ease;
    z-index: -2;
  }

  .series-row::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(248,247,243,0) 42%, rgba(12,12,11,.46) 100%);
    opacity: .78;
    z-index: -1;
    transition: opacity .7s ease;
  }

  .series-row:hover img { transform: scale(1.032) translateY(-3px); filter: saturate(.94) contrast(1.055); }
  .series-row:hover::after { opacity: .62; }

  .series-row > div {
    padding: clamp(16px, 1.85vw, 28px);
    color: #fff;
    transform: translateY(3px);
    transition: transform .7s cubic-bezier(.19,1,.22,1), opacity .7s ease;
  }

  .series-row:hover > div { transform: translateY(0); }
  .series-row h2 { font-size: clamp(19px, 2.05vw, 30px); letter-spacing: -.048em; color: #fff; }
  .series-row p { color: rgba(255,255,255,.72); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
}

@media (min-width: 761px) and (max-width: 1080px) {
  .series-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .series-row,
  html[data-page="studies"] .series-row { min-height: clamp(320px, 48vw, 520px); }
}

@media (max-width: 760px) {
  .series-list { border-top: 0; display: grid; gap: 18px; }
  .series-row {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0 0 22px;
    opacity: 1;
    transform: none;
    transition: transform .7s cubic-bezier(.19,1,.22,1), opacity .7s ease;
  }
  body.jc-motion-ready .series-row { opacity: 0; transform: translateY(12px); }
  body.jc-motion-ready .series-row.is-visible { transform: translateY(0); opacity: 1; }
  .series-row img { width: 100%; height: auto; aspect-ratio: 4 / 3; }
}

@media (hover: hover) and (pointer: fine) {
  body.jc-cursor-enabled,
  body.jc-cursor-enabled a,
  body.jc-cursor-enabled button,
  body.jc-cursor-enabled input,
  body.jc-cursor-enabled textarea,
  body.jc-cursor-enabled select { cursor: none; }

  .jc-cursor-dot { display: none; }

  .jc-cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 14px;
    height: 14px;
    pointer-events: none;
    z-index: 2147483647;
    border: 1px solid rgba(255,255,255,.82);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    box-shadow: 0 0 0 1px rgba(0,0,0,.08) inset;
    mix-blend-mode: difference;
    opacity: .88;
    transform: translate3d(var(--cursor-x, -100px), var(--cursor-y, -100px), 0) translate(-50%,-50%) scale(1);
    transition: width .18s cubic-bezier(.19,1,.22,1), height .18s cubic-bezier(.19,1,.22,1), opacity .16s ease, background .18s ease;
    animation: jcCursorBreathe 3.6s ease-in-out infinite;
  }

  body.jc-cursor-active .jc-cursor-ring {
    width: 18px;
    height: 18px;
    background: rgba(255,255,255,.12);
  }

  body.jc-cursor-hidden .jc-cursor-ring { opacity: 0; }

  body.jc-lightbox-open .jc-cursor-ring,
  body.lightbox-open .jc-cursor-ring {
    z-index: 2147483647;
    opacity: .92;
  }
}

@keyframes jcCursorBreathe {
  0%, 100% { transform: translate3d(var(--cursor-x, -100px), var(--cursor-y, -100px), 0) translate(-50%,-50%) scale(.985); }
  50% { transform: translate3d(var(--cursor-x, -100px), var(--cursor-y, -100px), 0) translate(-50%,-50%) scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .series-row, .series-row img, .series-row > div, .jc-cursor-ring { transition: none !important; animation: none !important; transform: none !important; opacity: 1 !important; }
}


/* Biografia justificada */
.bio-text p {
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}
