/* One ink on tin glaze, like a Luso-Brazilian azulejo panel. */
:root {
  --glaze: #F4F6F8;
  --ink: #1A339E;
  --ink-deep: #0F1F6B;
  --ink-soft: #4B5C9F;
  --grout: #CBD4EA;
  --on-deep-soft: #BCC8EE;
  --grout-deep: #2C3D8C;

  --display: "Libre Caslon Display", "Times New Roman", serif;
  --text: "Libre Franklin", system-ui, sans-serif;

  --pad: clamp(1.25rem, 2.6vw, 2.5rem);
  --header-h: 4rem;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-turn: cubic-bezier(.5, -.15, .15, 1.2);
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--glaze);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, blockquote { margin: 0; padding: 0; font: inherit; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
::selection { background: var(--ink); color: var(--glaze); }

.skip {
  position: fixed; left: var(--pad); top: .6rem; z-index: 20;
  padding: .5rem .9rem; background: var(--ink); color: var(--glaze);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* Page frame: the grout lines that hold every section. */
.row { border-bottom: 1px solid var(--grout); }
.frame {
  max-width: 1440px;
  margin-inline: auto;
  border-inline: 1px solid var(--grout);
}

/* Links: the underline draws in from the left. */
.link {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
  transition: background-size .4s var(--ease);
  padding-bottom: .1em;
}
.link:hover, .link:focus-visible { background-size: 100% 1px; }
.link-strong { background-size: 100% 1px; font-weight: 500; }
.link-strong:hover { animation: redraw .7s var(--ease); }
@keyframes redraw {
  0% { background-size: 100% 1px; background-position: right bottom; }
  45% { background-size: 0 1px; background-position: right bottom; }
  46% { background-size: 0 1px; background-position: left bottom; }
  100% { background-size: 100% 1px; background-position: left bottom; }
}

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--glaze); }
.header-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: stretch;
  height: var(--header-h);
}
.brand {
  display: flex; align-items: center; gap: .7rem;
  padding-inline: var(--pad);
  font-family: "Libre Caslon Text", "Times New Roman", serif;
  font-size: 1.125rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.mark { flex: none; width: 2.5em; height: 1.25em; fill: currentColor; }
.lockup { display: inline-flex; flex-direction: column; align-items: flex-start; gap: .32em; }
.lockup-name { letter-spacing: .07em; }
.lockup-name b { font-weight: 700; }
/* Spaced so ASSOCIAÇÃO ends where SALMO115 ends. */
.lockup-desc { font-size: .64em; letter-spacing: .229em; }
/* The book closes a little and opens again. */
.brand:hover .mark { animation: book .7s var(--ease); }
@keyframes book { 40% { transform: scaleX(.6); } }

.site-nav {
  display: flex; justify-content: flex-end; align-items: center; gap: clamp(1.25rem, 2.4vw, 2.25rem);
  padding-inline: var(--pad);
  font-size: .9375rem;
}

/* Language toggle */
.lang {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 7.5rem;
  border-left: 1px solid var(--grout);
  font-size: .875rem;
  font-weight: 500;
}
.lang button {
  position: relative; z-index: 1;
  transition: color .3s;
}
.lang button[aria-pressed="true"] { color: var(--glaze); }
.lang button:focus-visible { outline-offset: -5px; outline-color: currentColor; }
.lang-thumb {
  position: absolute; inset: 0 auto 0 0; width: 50%;
  background: var(--ink);
  transition: transform .45s var(--ease);
}
[data-lang="en"] .lang-thumb { transform: translateX(100%); }

/* Hero */
.hero-grid { display: grid; grid-template-columns: 1fr auto; }
.hero-text {
  display: flex; flex-direction: column; justify-content: space-between; gap: 3rem;
  min-height: min(calc(100svh - var(--header-h) - 1px), 880px);
  padding: clamp(1.75rem, 3.4vw, 3.25rem) var(--pad) var(--pad);
}
.verse {
  font-family: var(--display);
  font-size: min(7.3vw, 106px);
  line-height: 1.02;
  letter-spacing: -.012em;
}
.line { display: block; overflow: hidden; padding-bottom: .14em; margin-bottom: -.14em; }
.line > span { display: block; white-space: nowrap; }
.js .line > span { animation: rise 1s var(--ease) both; animation-delay: calc(var(--i) * 95ms + 80ms); }
@keyframes rise { from { transform: translateY(112%); } }

.ref { margin-top: 1.5rem; font-size: .875rem; color: var(--ink-soft); }

.hero-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; max-width: 30rem; }
.lede { font-size: clamp(1.25rem, 1.75vw, 1.5rem); line-height: 1.32; text-wrap: balance; }

/* Tile field */
.field {
  position: relative;
  display: grid;
  border-left: 1px solid var(--grout);
  margin-right: -1px;
  overflow: hidden;
  touch-action: pan-y;
}
.tile {
  aspect-ratio: 1;
  border-right: 1px solid var(--grout);
  border-bottom: 1px solid var(--grout);
  overflow: hidden;
}
.tile svg {
  display: block; width: 100%; height: 100%;
  fill: var(--ink);
  transition: transform .75s var(--ease-turn);
}

/* Split rows: a narrow title column beside the content. */
.split {
  display: grid;
  grid-template-columns: minmax(10rem, 25%) 1fr;
}
.side-title {
  padding: clamp(2rem, 4vw, 3.5rem) var(--pad);
  font-size: .9375rem;
  font-weight: 500;
}
.about, .contact {
  padding: clamp(2rem, 4vw, 3.5rem) var(--pad) clamp(3rem, 7vw, 6.5rem);
  border-left: 1px solid var(--grout);
}
.statement {
  max-width: 21em;
  font-family: var(--display);
  font-size: clamp(1.875rem, 3.5vw, 3.125rem);
  line-height: 1.12;
  letter-spacing: -.006em;
}
.body-note { max-width: 34em; margin-top: 2rem; color: var(--ink-soft); }

/* Pillars */
.work-title { padding-bottom: clamp(1.5rem, 2.5vw, 2rem); border-bottom: 1px solid var(--grout); }
.pillars { display: grid; grid-template-columns: 1fr 1fr; }
.pillar { padding: clamp(1.75rem, 3.4vw, 3rem) var(--pad) clamp(2.5rem, 5vw, 4.5rem); }
.pillar + .pillar { border-left: 1px solid var(--grout); }
.pillar-title {
  font-family: var(--display);
  font-size: clamp(2.75rem, 5.6vw, 5rem);
  line-height: 1;
  letter-spacing: -.01em;
}
.pillar-intro { max-width: 26em; min-height: 3.1em; margin-top: 1.25rem; color: var(--ink-soft); }

.items { margin-top: clamp(2rem, 3.5vw, 3rem); }
.item { position: relative; border-top: 1px solid var(--grout); }
.item:last-child { border-bottom: 1px solid var(--grout); }
.item::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px;
  background: var(--ink);
  transform: scaleX(0); transform-origin: left;
  transition: transform .5s var(--ease);
}
.item:hover::before, .item.open::before { transform: scaleX(1); }

.item-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: 100%; padding: 1rem 0;
  text-align: left; font-weight: 500;
}
.item-btn:focus-visible { outline-offset: -2px; }
.plus { position: relative; flex: none; width: .85rem; height: .85rem; }
.plus::before, .plus::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; margin-top: -.75px;
  background: currentColor;
  transition: transform .45s var(--ease);
}
.plus::after { transform: rotate(90deg); }
.open .plus::before { transform: rotate(180deg); }
.open .plus::after { transform: rotate(180deg); }

.item-body {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .45s var(--ease);
}
.item-inner {
  min-height: 0; overflow: hidden;
  visibility: hidden; opacity: 0;
  transition: opacity .3s, visibility .45s;
}
.item-inner p { max-width: 32em; padding-bottom: 1.25rem; color: var(--ink-soft); }
.open .item-body { grid-template-rows: 1fr; }
.open .item-inner { visibility: visible; opacity: 1; }
html:not(.js) .item-body { grid-template-rows: 1fr; }
html:not(.js) .item-inner { visibility: visible; opacity: 1; }

/* Band: the verse says small and great, so the type does too. */
.band { background: var(--ink-deep); color: var(--glaze); border-bottom-color: var(--ink-deep); }
.band .frame { border-color: var(--grout-deep); }
.band-inner { padding: clamp(3rem, 7vw, 6.5rem) var(--pad) var(--pad); overflow: hidden; }
.scale-verse { font-family: var(--display); }
.scale-small { display: block; font-size: clamp(1.25rem, 2vw, 1.75rem); line-height: 1.2; }
.scale-big {
  display: block;
  font-size: min(16.2vw, 190px);
  line-height: 1;
  letter-spacing: -.016em;
  white-space: nowrap;
  transform-origin: left 78%;
}
.js .scale-verse.armed .scale-big { transform: scale(.128); }
.js .scale-verse.grown .scale-big { transform: none; transition: transform 1.5s var(--ease); }

.band-foot {
  display: grid; grid-template-columns: minmax(10rem, 25%) 1fr; gap: 0 var(--pad);
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
  padding-top: var(--pad);
  border-top: 1px solid var(--grout-deep);
}
.band .ref { margin: 0; color: var(--on-deep-soft); }
.band-text { max-width: 30em; font-size: clamp(1.125rem, 1.5vw, 1.3125rem); line-height: 1.4; }

/* Contact */
.contact-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem;
  margin-top: clamp(2rem, 4vw, 3.25rem);
}
.email { font-size: clamp(1.125rem, 1.7vw, 1.375rem); font-weight: 500; background-size: 100% 1px; }
.email:hover { animation: redraw .7s var(--ease); }
.copy {
  display: inline-flex; align-items: center;
  padding: .35rem .8rem;
  border: 1px solid var(--grout);
  font-size: .875rem;
  transition: border-color .25s, background-color .25s, color .25s;
}
.copy:hover { border-color: var(--ink); }
.copy.done { background: var(--ink); border-color: var(--ink); color: var(--glaze); }
.copy-check {
  width: 0; height: .7rem; overflow: hidden; opacity: 0;
  transition: width .3s var(--ease), margin .3s var(--ease), opacity .2s;
}
.copy-check::before {
  content: ""; display: block; width: .36rem; height: .64rem;
  margin-left: .12rem;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: rotate(40deg) translate(-1px, -2px);
}
.copy.done .copy-check { width: .7rem; margin-right: .45rem; opacity: 1; }

/* Footer */
.site-footer { border-bottom: 0; font-size: .875rem; color: var(--ink-soft); }
.footer-grid {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .35rem 2rem;
  padding: 1.25rem var(--pad);
}

/* Narrow screens */
@media (max-width: 820px) {
  :root { --header-h: 3.5rem; }
  .site-nav { display: none; }
  .header-grid { grid-template-columns: 1fr auto; }
  .lang { width: clamp(5rem, 24vw, 6rem); }

  .hero-grid { grid-template-columns: 1fr; }
  .hero-text { min-height: 0; gap: 2.25rem; }
  .verse { font-size: 11.6vw; }
  .field { border-left: 0; border-top: 1px solid var(--grout); margin-bottom: -1px; }

  .split { grid-template-columns: 1fr; }
  .side-title { padding-bottom: 0; }
  .about, .contact { border-left: 0; padding-top: 1rem; }
  .work-title { padding-bottom: 1.25rem; }

  .pillars { grid-template-columns: 1fr; }
  .pillar + .pillar { border-left: 0; border-top: 1px solid var(--grout); }
  .pillar-intro { min-height: 0; }

  .band-foot { grid-template-columns: 1fr; gap: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
  }
}
