/* =========================================================
   LUCAS URURAHY — Portfolio
   Linguagem: galeria contemporânea. Preto/branco editorial.
   A obra fornece a cor.
   ========================================================= */

:root {
  /* Tipo */
  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  /* Escala de espaço */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
  --space-7: 6rem;
  --space-8: 9rem;

  /* Layout */
  --container: 1440px;
  --container-text: 720px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-slow: 0.9s;
  --dur-med: 0.6s;
  --dur-fast: 0.3s;

  /* Tema claro */
  --bg: #fafaf8;
  --bg-elev: #ffffff;
  --fg: #111111;
  --fg-soft: #555555;
  --fg-faint: #999999;
  --line: #e4e2dd;
  --overlay: rgba(250, 250, 248, 0.92);
}

[data-theme="dark"] {
  --bg: #0c0c0c;
  --bg-elev: #161616;
  --fg: #f2f0eb;
  --fg-soft: #b5b2aa;
  --fg-faint: #6e6c66;
  --line: #262626;
  --overlay: rgba(12, 12, 12, 0.92);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  font-weight: 350;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

::selection { background: var(--fg); color: var(--bg); }

/* =========================================================
   TIPOGRAFIA
   ========================================================= */
.t-display {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.t-label {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--overlay);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-3) var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.logo {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-desktop {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

.nav-desktop a {
  font-size: 0.75rem;
  font-weight: 450;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-soft);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.nav-desktop a:hover { color: var(--fg); }

.nav-desktop a.active {
  color: var(--fg);
  border-bottom-color: var(--fg);
}

.header-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: var(--fg-soft);
  transition: color var(--dur-fast) ease;
}

.btn-icon:hover { color: var(--fg); }

.menu-toggle { display: none; }

/* Nav mobile */
.nav-mobile {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 99;
  padding: calc(var(--space-7) + 60px) var(--gutter) var(--space-6);
  display: none;
  flex-direction: column;
  gap: 0;
}

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

.nav-mobile a {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 300;
  line-height: 1.15;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg-soft);
  transition: color var(--dur-fast) ease, padding-left var(--dur-fast) var(--ease-out);
}

.nav-mobile a:hover, .nav-mobile a.active { color: var(--fg); padding-left: var(--space-2); }

@media (max-width: 1024px) {
  .nav-desktop { display: none; }
  .menu-toggle { display: inline-flex; }
}

/* =========================================================
   HERO (home)
   ========================================================= */
.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-6) var(--gutter) var(--space-6);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-6);
  align-items: start;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3.25rem, 8.5vw, 7.5rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin: var(--space-3) 0 var(--space-4);
}

.hero-sub {
  font-size: 1rem;
  font-weight: 350;
  color: var(--fg-soft);
  max-width: 42ch;
  margin-bottom: var(--space-5);
}

.hero-media { position: relative; }

.hero-media img {
  width: 100%;
  height: auto;
}

/* Flicker — foto base + artes que piscam na mesma silhueta */
.hero-flicker .hero-base {
  position: relative;
  z-index: 1;
}

.hero-flicker .hero-arte {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 100%;
  height: auto;
  opacity: 0;
  pointer-events: none;
  /* troca seca, sem transition — piscada, não fade */
}

.hero-media figcaption {
  margin-top: var(--space-2);
  font-size: 0.75rem;
  color: var(--fg-faint);
  letter-spacing: 0.04em;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: var(--space-6);
    padding-bottom: var(--space-7);
    gap: var(--space-5);
  }
}

/* =========================================================
   LINKS / BOTÕES
   ========================================================= */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--fg);
  transition: gap var(--dur-fast) var(--ease-out), opacity var(--dur-fast) ease;
}

.link-arrow:hover { gap: 1em; opacity: 0.65; }

/* =========================================================
   SEÇÕES
   ========================================================= */
.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-7) var(--gutter);
}

.section-text { max-width: var(--container-text); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 1.05;
}

.rule { border: 0; border-top: 1px solid var(--line); }

/* =========================================================
   GRID DE OBRAS — uniforme, museal
   ========================================================= */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  margin-bottom: var(--space-6);
}

.filter-btn {
  font-size: 0.75rem;
  font-weight: 450;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.filter-btn:hover { color: var(--fg); }

.filter-btn.active { color: var(--fg); border-bottom-color: var(--fg); }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6) var(--space-5);
}

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

@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-5) var(--space-4); }
}

@media (max-width: 600px) {
  .grid, .grid-2 { grid-template-columns: 1fr; }
}

.card { display: block; cursor: pointer; }

.card-img {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/5;
  background: var(--bg-elev);
}

.card-img.landscape { aspect-ratio: 4/3; }
.card-img.square { aspect-ratio: 1/1; }

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.4s var(--ease-out);
}

.card:hover .card-img img { transform: scale(1.035); }

.card-info { padding-top: var(--space-3); }

.card-title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: var(--space-1);
}

.card-meta {
  font-size: 0.78rem;
  color: var(--fg-faint);
  letter-spacing: 0.03em;
  line-height: 1.5;
}

/* =========================================================
   FEATURE — série destacada (imagem grande + texto)
   ========================================================= */
.feature {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: var(--space-6);
  align-items: end;
  padding: var(--space-7) 0;
  border-top: 1px solid var(--line);
}

.feature.reverse { grid-template-columns: 0.75fr 1.25fr; }

.feature.reverse .feature-media { order: 2; }

.feature-media { overflow: hidden; }

.feature-media img {
  width: 100%;
  height: auto;
  transition: transform 1.6s var(--ease-out);
}

.feature:hover .feature-media img { transform: scale(1.02); }

.feature-body .t-label { margin-bottom: var(--space-3); display: block; }

.feature-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
  margin-bottom: var(--space-3);
}

.feature-text {
  font-size: 0.9375rem;
  color: var(--fg-soft);
  margin-bottom: var(--space-4);
  max-width: 46ch;
}

@media (max-width: 900px) {
  .feature, .feature.reverse { grid-template-columns: 1fr; gap: var(--space-4); align-items: start; }
  .feature.reverse .feature-media { order: 0; }
}

/* =========================================================
   PÁGINA INTERNA — banner
   ========================================================= */
.page-banner {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-7) var(--gutter) var(--space-6);
}

.page-banner .t-label { display: block; margin-bottom: var(--space-3); }

.page-banner h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 1;
  letter-spacing: -0.01em;
}

.page-banner .lead {
  margin-top: var(--space-4);
  font-size: 1.0625rem;
  color: var(--fg-soft);
  max-width: 58ch;
}

/* =========================================================
   PROSE — texto corrido editorial
   ========================================================= */
.prose {
  max-width: var(--container-text);
  font-size: 1.0625rem;
  line-height: 1.8;
  font-weight: 350;
}

.prose p + p { margin-top: var(--space-4); }

.prose h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.75rem;
  margin: var(--space-6) 0 var(--space-3);
}

.prose ul { list-style: none; }

.prose ul li {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-size: 0.9375rem;
}

.prose ul li time {
  color: var(--fg-faint);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

/* =========================================================
   POEMA
   ========================================================= */
.poem {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.375rem, 2.4vw, 1.875rem);
  line-height: 1.5;
  max-width: 34ch;
}

.poem p + p { margin-top: var(--space-4); }

.poem-note {
  margin-top: var(--space-5);
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--fg-faint);
  letter-spacing: 0.08em;
}

/* =========================================================
   QUOTE — citação museal
   ========================================================= */
.quote {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-8) var(--gutter);
  text-align: center;
}

.quote blockquote {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.75rem, 4vw, 3rem);
  line-height: 1.25;
  max-width: 26ch;
  margin: 0 auto;
}

.quote cite {
  display: block;
  margin-top: var(--space-4);
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

/* =========================================================
   LISTA DE INSTITUIÇÕES — marquee discreto
   ========================================================= */
.institutions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  align-items: baseline;
}

.institutions span {
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  color: var(--fg-soft);
  white-space: nowrap;
}

/* =========================================================
   EQUIPE
   ========================================================= */
.team-list { list-style: none; max-width: var(--container-text); }

.team-list li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
  flex-wrap: wrap;
}

.team-list li small {
  color: var(--fg-faint);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}

/* =========================================================
   CONTATO
   ========================================================= */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-7);
}

.contact-item { padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }

.contact-item .t-label { display: block; margin-bottom: var(--space-2); }

.contact-item-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 400; }

.contact-form { display: flex; flex-direction: column; gap: var(--space-4); }

.contact-form .t-label { display: block; margin-bottom: var(--space-2); }

.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 350;
  padding: var(--space-3) 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  transition: border-color var(--dur-fast) ease;
  border-radius: 0;
}

.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-bottom-color: var(--fg); }

.contact-form textarea { min-height: 120px; resize: vertical; }

@media (max-width: 820px) {
  .contact-grid { grid-template-columns: 1fr; gap: var(--space-5); }
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: var(--space-7);
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-6) var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
  align-items: baseline;
}

.footer-brand {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.footer-links { display: flex; gap: var(--space-4); flex-wrap: wrap; }

.footer-links a {
  font-size: 0.8125rem;
  color: var(--fg-soft);
  border-bottom: 1px solid transparent;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.footer-links a:hover { color: var(--fg); border-bottom-color: var(--fg); }

.footer-bottom {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--space-5);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
}

/* =========================================================
   LIGHTBOX — visualização imersiva
   ========================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 8, 8, 0.96);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  animation: lbIn 0.5s var(--ease-out);
}

@keyframes lbIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.lightbox-caption {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(245, 240, 235, 0.75);
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  text-align: center;
  max-width: 80vw;
}

.lightbox-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-5);
  color: rgba(245, 240, 235, 0.7);
  font-size: 1.5rem;
  transition: color var(--dur-fast) ease;
}

.lightbox-close:hover { color: #fff; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(245, 240, 235, 0.55);
  font-size: 2rem;
  padding: var(--space-3);
  transition: color var(--dur-fast) ease;
}

.lightbox-nav:hover { color: #fff; }

.lightbox-prev { left: var(--space-3); }
.lightbox-next { right: var(--space-3); }

/* =========================================================
   ANIMAÇÕES DE ENTRADA — scroll reveal
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}

.reveal.in { opacity: 1; transform: none; }

/* Imagens: máscara que sobe */
.reveal-img {
  position: relative;
  overflow: hidden;
}

.reveal-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg);
  transform: scaleY(1);
  transform-origin: top;
  transition: transform 1.1s var(--ease-out);
}

.reveal-img.in::after { transform: scaleY(0); }

/* Stagger helper */
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }

/* Page fade transition */
body { animation: pageIn 0.55s ease-out; }

@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

body.page-out { opacity: 0; transition: opacity 0.3s ease; }

/* =========================================================
   ACESSIBILIDADE
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal-img::after { opacity: 1 !important; transform: none !important; }
}

:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
