/* ============================================================
   WUSTA — COSMOGONIAS DESOBEDIENTES
   Arquivo editorial branco · linhas 1px · sem sombras
   Tipografia (Velvetyne, SIL OFL):
   · Terminal Grotesque — todos os títulos (logo, seções, obras, números)
   · Compagnon — máquina de escrever de arquivo (corpo, fichas, metadados)
   ============================================================ */

@font-face {
  font-family: "Terminal Grotesque";
  src: url("assets/fonts/TerminalGrotesque.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Compagnon";
  src: url("assets/fonts/Compagnon-Light.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Compagnon";
  src: url("assets/fonts/Compagnon-Roman.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Compagnon";
  src: url("assets/fonts/Compagnon-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Compagnon";
  src: url("assets/fonts/Compagnon-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Compagnon";
  src: url("assets/fonts/Compagnon-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --ink: #111111;
  --line: #111111;
  --sidebar-w: 218px;
  --pad-x: 48px;
  --display: "Terminal Grotesque", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font: "Compagnon", "Courier New", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
}

h1, h2, h3 { font-family: var(--display); font-weight: 400; }

button {
  font-family: var(--font);
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

a { color: var(--ink); }

code {
  font-family: var(--font);
  font-weight: 500;
  letter-spacing: 0.08em;
  font-size: 11px;
}

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

/* ---------- Sidebar ---------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  padding: 34px 28px 24px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 40;
  background: var(--bg);
  overflow-y: auto;
}

.logo {
  font-family: var(--display);
  font-weight: 400;
  font-size: 36px;
  letter-spacing: 0.01em;
  text-decoration: none;
  margin-bottom: 56px;
}

.sidebar nav { display: grid; gap: 14px; }

.sidebar nav a {
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.1em;
  width: max-content;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.sidebar nav a:hover,
.sidebar nav a.active { border-bottom-color: var(--ink); }

.sidebar-mark {
  font-size: 18px;
  line-height: 1.1;
  margin: 42px 0 0;
}

.sidebar-note {
  margin: auto 0 26px;
  font-size: 11px;
  line-height: 1.7;
}

.langs {
  display: flex;
  gap: 0;
  border: 1px solid var(--line);
  width: max-content;
  margin-bottom: 20px;
}

.lang-link {
  text-decoration: none;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 6px 12px;
}

.lang-link + .lang-link { border-left: 1px solid var(--line); }

.lang-link.active { background: var(--ink); color: var(--bg); }

.sidebar footer {
  font-size: 10px;
  letter-spacing: 0.1em;
  line-height: 1.8;
  font-weight: 500;
}

.mobile-menu { display: none; }

/* ---------- Layout ---------- */

main { margin-left: var(--sidebar-w); }

.section-pad {
  padding: 56px var(--pad-x) 72px;
  border-bottom: 1px solid var(--line);
}

.kicker {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
  margin: 0 0 18px;
}

.mini-head {
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.16em;
  margin: 0 0 10px;
}

.section-text {
  max-width: 62ch;
  margin: 18px 0 0;
}

/* grade com linhas 1px entre células */
.frame-grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.frame-cell { background: var(--bg); padding: 28px; min-width: 0; }

.frame-grid-3 { grid-template-columns: 2fr 1fr; }

/* ---------- Hero ---------- */

.hero { display: flex; flex-direction: column; gap: 48px; }

.hero-grid { grid-template-columns: 1fr 260px; }

.hero-title { padding: 44px 40px; }

.hero h1 {
  font-weight: 400;
  font-size: clamp(30px, 4vw, 78px);
  letter-spacing: 0.01em;
  line-height: 1.04;
  overflow-wrap: break-word;
}

.lead {
  font-weight: 300;
  font-size: 17px;
  max-width: 48ch;
  margin: 26px 0 0;
  line-height: 1.6;
}

.stat-cell, .stat-compact {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.stat-number {
  font-family: var(--display);
  font-weight: 400;
  font-size: 80px;
  line-height: 1;
  margin: 0;
  letter-spacing: 0;
}

.stat-number.small { font-size: 52px; }

.stat-label {
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.14em;
  margin: 10px 0 0;
  line-height: 1.5;
}

.stat-sub {
  font-size: 11px;
  letter-spacing: 0.06em;
  margin: 14px 0 0;
  line-height: 1.7;
}

.home-painting-band { border: 1px solid var(--line); }

.band-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}

.band-head a {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.band-head a:hover { border-bottom: 1px solid var(--ink); }

.hero-strip {
  display: flex;
  gap: 1px;
  background: var(--line);
  overflow-x: auto;
}

.hero-strip button {
  flex: 0 0 auto;
  background: var(--bg);
  padding: 18px;
  display: flex;
  align-items: center;
}

.hero-strip img {
  height: 240px;
  width: auto;
  object-fit: contain;
}

/* ---------- Section header ---------- */

.section-header { margin-bottom: 40px; }

.section-header h2 {
  font-weight: 400;
  font-size: clamp(26px, 3.2vw, 48px);
  letter-spacing: 0.01em;
  line-height: 1.1;
}

/* ---------- Toolbar ---------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  padding: 14px 20px;
  margin: 0 0 1px;
}

.toolbar label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
}

.toolbar input {
  font-family: var(--font);
  font-size: 13px;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 4px 2px;
  min-width: 220px;
  outline: none;
  background: var(--bg);
  color: var(--ink);
}

.filter-row { display: flex; gap: 0; border: 1px solid var(--line); overflow-x: auto; }

.filter-row button {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 8px 14px;
  white-space: nowrap;
}

.filter-row button + button { border-left: 1px solid var(--line); }

.filter-row button.active { background: var(--ink); color: var(--bg); }

.toolbar > span {
  margin-left: auto;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
}

/* ---------- Grades de obras ---------- */

.catalog-grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  align-items: start;
}

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

.featured-grid:empty { display: none; }

/* objetos: menores e mais compactos que as pinturas */
.object-grid { grid-template-columns: repeat(5, 1fr); }

.card { background: var(--bg); display: flex; height: 100%; }

.card > button {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.card figure {
  margin: 0 0 16px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.object-grid .card > button { padding: 14px; }

/* ---------- Efeito expandir: pinturas ---------- */

.works-grid .card figure,
.featured-grid .card figure,
.hero-strip button { overflow: hidden; }

.works-grid .card img,
.featured-grid .card img,
.hero-strip img {
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: center;
}

.works-grid .card > button:hover img,
.works-grid .card > button:focus-visible img,
.featured-grid .card > button:hover img,
.featured-grid .card > button:focus-visible img { transform: scale(1.1); }

.hero-strip button:hover img,
.hero-strip button:focus-visible img { transform: scale(1.08); }

@media (prefers-reduced-motion: reduce) {
  .works-grid .card img,
  .featured-grid .card img,
  .hero-strip img { transition: none; }
}

.card-copy { border-top: 1px solid var(--line); padding-top: 12px; width: 100%; }

.card-copy code { display: block; margin-bottom: 6px; }

.card-copy h3 {
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.01em;
  line-height: 1.32;
  margin: 0 0 8px;
}

.object-grid .card-copy h3 { font-size: 12px; }

.card-copy p {
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
}

.object-grid .card-copy p { font-size: 11px; }

.card-copy .tag {
  display: block;
  margin-top: 10px;
  font-weight: 500;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  border: 1px solid var(--line);
  padding: 4px 8px;
  width: max-content;
  max-width: 100%;
}

.card > button:hover .card-copy h3 { text-decoration: underline; }

.load-more {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-top: none;
  padding: 16px;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.14em;
}

.load-more:hover { background: var(--ink); color: var(--bg); }

/* ---------- Textos ---------- */

.intro-card { margin-bottom: 1px; }

.intro-card.frame-grid { grid-template-columns: 160px 1fr; }

.intro-card .intro-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
}

.intro-card h3 {
  font-weight: 400;
  font-size: clamp(20px, 2.4vw, 30px);
  margin: 0 0 16px;
  letter-spacing: 0;
  line-height: 1.2;
}

.intro-card button,
.text-card button {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 3px;
  margin-top: 18px;
}

.intro-card button:hover,
.text-card button:hover { background: var(--ink); color: var(--bg); }

.text-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.text-card {
  background: var(--bg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.text-card .symbol { font-size: 26px; margin-bottom: 20px; }

.text-card h3 {
  font-weight: 400;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: 0;
  margin: 0 0 12px;
}

.text-card p { font-size: 13px; margin: 0 0 4px; }

.text-card button { margin-top: auto; padding-top: 16px; }

/* ---------- Criações especulativas ---------- */

.spec-line {
  border: 1px solid var(--line);
  padding: 14px 20px;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
  margin: 0 0 1px;
  line-height: 1.7;
}

/* ---------- Manifesto ---------- */

.manifesto-body {
  border: 1px solid var(--line);
  padding: 40px;
  columns: 2;
  column-gap: 56px;
  column-rule: 1px solid var(--line);
  margin-bottom: 1px;
}

.manifesto-body p {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.7;
}

.manifesto-footer { font-size: 13px; line-height: 1.65; }

.manifesto-footer .frame-cell { display: flex; align-items: center; }

/* ---------- Trilha sonora ---------- */

.sound-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.sound-section h2 { font-weight: 400; font-size: clamp(24px, 3vw, 44px); }

.player {
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--line);
  padding: 18px 22px;
}

.player > div {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.player button {
  font-size: 16px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  flex: 0 0 auto;
}

.player button:hover { background: var(--ink); color: var(--bg); }

.player span {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  min-width: 42px;
}

.player input[type="range"] {
  flex: 1;
  min-width: 0;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 1px;
  background: var(--ink);
  outline: none;
}

.player input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  background: var(--ink);
  border-radius: 0;
  cursor: pointer;
}

.player input[type="range"]::-moz-range-thumb {
  width: 11px;
  height: 11px;
  background: var(--ink);
  border: none;
  border-radius: 0;
  cursor: pointer;
}

/* ---------- Rodapé ---------- */

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px var(--pad-x);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
}

.site-footer b { font-family: var(--display); font-weight: 400; font-size: 18px; letter-spacing: 0.01em; }

/* ---------- Modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  display: none;
}

.modal.open { display: flex; }

.modal-close {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 26px;
  line-height: 1;
  z-index: 102;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.modal-close:hover { background: var(--ink); color: var(--bg); }

.modal-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  background: var(--bg);
  z-index: 102;
}

.modal-nav:hover { background: var(--ink); color: var(--bg); }

.modal-nav.prev { left: 18px; }
.modal-nav.next { right: 22px; }

.modal.text-only .modal-nav { display: none; }

.modal-content {
  display: grid;
  grid-template-columns: 3fr 2fr;
  width: 100%;
  height: 100%;
}

.modal-image {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 72px;
  border-right: 1px solid var(--line);
  min-height: 0;
}

.modal.text-only .modal-image { display: none; }

.modal.text-only .modal-content { grid-template-columns: 1fr; }

.modal.text-only .modal-content article {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.modal-image img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* expansão da obra ao abrir o modal */
.modal.open .modal-image img { animation: expand-in 0.45s cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes expand-in {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .modal.open .modal-image img { animation: none; }
}

.modal-content article {
  padding: 72px 56px 24px;
  overflow-y: auto;
}

.modal-content h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(20px, 2.2vw, 30px);
  letter-spacing: 0;
  line-height: 1.22;
  margin: 0 0 24px;
}

#modalText { white-space: pre-line; font-size: 15px; line-height: 1.7; }

/* fica ancorado no rodapé do modal: textos longos não o empurram para fora da vista */
#modalPdf {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: inline-block;
  margin-top: 28px;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 12px 18px;
  background: var(--bg);
  outline: 10px solid var(--bg);
}

#modalPdf:hover { background: var(--ink); color: var(--bg); }

.modal-note {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.1em;
  border: 1px solid var(--line);
  padding: 8px 12px;
  width: max-content;
  max-width: 100%;
  margin: 0 0 20px;
}

/* ============================================================
   Responsivo
   ============================================================ */

@media (max-width: 1180px) {
  :root { --pad-x: 32px; }
  .works-grid { grid-template-columns: repeat(2, 1fr); }
  .object-grid { grid-template-columns: repeat(3, 1fr); }
  .text-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr 220px; }
  .modal-content { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  :root { --pad-x: 16px; }

  body { font-size: 14px; }

  /* gaveta móvel */
  .mobile-menu {
    display: block;
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 60;
    border: 1px solid var(--line);
    background: var(--bg);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.14em;
    padding: 10px 14px;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: min(78vw, 300px);
  }

  .sidebar.open { transform: translateX(0); }

  main { margin-left: 0; }

  .section-pad { padding-top: 64px; padding-bottom: 56px; }

  .hero-grid,
  .frame-grid-3,
  .intro-card.frame-grid { grid-template-columns: 1fr; }

  .hero-title { padding: 28px 22px; }

  .hero h1 { font-size: clamp(24px, 7vw, 44px); }

  .stat-number { font-size: 64px; }

  .hero-strip img { height: 170px; }

  .toolbar { gap: 14px; }
  .toolbar input { min-width: 0; flex: 1; }
  .toolbar label { flex: 1 1 100%; }
  .toolbar > span { margin-left: 0; }
  .filter-row { max-width: 100%; -webkit-overflow-scrolling: touch; }

  /* pinturas em 1 coluna, objetos em 2 */
  .works-grid { grid-template-columns: 1fr; }
  .object-grid { grid-template-columns: repeat(2, 1fr); }
  .text-grid { grid-template-columns: 1fr; }

  .manifesto-body { columns: 1; padding: 24px 20px; }

  .sound-section { grid-template-columns: 1fr; gap: 24px; }

  /* player compacto */
  .player { gap: 10px; padding: 12px 14px; flex-wrap: wrap; }
  .player button { width: 36px; height: 36px; font-size: 14px; }
  .player span { min-width: 36px; font-size: 10px; }

  /* modal vertical: imagem no topo, texto abaixo */
  .modal.open { display: block; overflow-y: auto; }

  .modal-content {
    display: block;
    height: auto;
    min-height: 100%;
  }

  .modal-image {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 64px 20px 24px;
    max-height: 62vh;
  }

  .modal-image img { max-height: 52vh; }

  .modal-content article { padding: 28px 20px 96px; overflow: visible; }

  .modal-nav {
    top: auto;
    bottom: 16px;
    transform: none;
  }

  .modal-nav.prev { left: 16px; }
  .modal-nav.next { right: 16px; }

  .site-footer { flex-direction: column; gap: 10px; text-align: center; }
}

@media (max-width: 430px) {
  :root { --pad-x: 14px; }

  .object-grid { grid-template-columns: 1fr; }

  .hero h1 { font-size: clamp(22px, 8.5vw, 34px); }

  .stat-number { font-size: 52px; }

  .hero-strip img { height: 140px; }

  .frame-cell { padding: 20px 16px; }

  .card > button { padding: 16px 14px; }
}
