/* ==========================================================================
   SOMA — Institutional page
   1. Design tokens
   ========================================================================== */

:root {
  /* Layout */
  --content-max: 1280px;
  --page-max: 1920px;
  --mobile-max: 560px;

  /* Paleta oficial SOMA */
  --soma-bg: #FFFFFF;
  --soma-contrast: #B59DEA;
  --soma-title: #B59DEA;
  --soma-text: #505050;
  --soma-bg-alt: #B59DEA;
  --soma-on-alt: #FFFFFF;

  /* Aliases usados pelo layout */
  --bg: var(--soma-bg);
  --contrast: var(--soma-contrast);
  --title: var(--soma-title);
  --text: var(--soma-text);
  --bg-alt: var(--soma-bg-alt);
  --on-alt: var(--soma-on-alt);

  /* Derivados neutros */
  --surface: #FAF8FE;
  --hairline: #E7DEF8;
  --muted: #7C7C7C;

  --font-base: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ==========================================================================
   2. Reset e base
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-base);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

figure {
  margin: 0;
}

img {
  max-width: 100%;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--title);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 52px;
}

h2 {
  font-size: 40px;
}

h3 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
}

p {
  margin: 0;
}

p + p {
  margin-top: 16px;
}

/* ==========================================================================
   3. Estrutura
   ========================================================================== */

.page {
  width: min(100%, var(--page-max));
  margin-inline: auto;
  overflow-x: hidden;
}

.section {
  padding-block: 96px;
}

.section--alt {
  background-color: var(--bg-alt);
  color: var(--on-alt);
}

.section--alt h1,
.section--alt h2,
.section--alt h3 {
  color: var(--on-alt);
}

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

/* Dobras com imagem: informacao a esquerda, imagem a direita (52% / 48%) */
.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  grid-template-rows: 1fr auto auto 1fr;
  grid-template-areas:
    ".     media"
    "title media"
    "copy  media"
    ".     media";
  column-gap: 64px;
}

.section-title {
  grid-area: title;
}

.section-copy {
  grid-area: copy;
  margin-top: 24px;
  max-width: 60ch;
}

.section-media {
  grid-area: media;
  align-self: center;
}

/* ==========================================================================
   4. Media
   ========================================================================== */

.media-frame {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  overflow: hidden;
  background-color: var(--surface);
}

.media-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame--contain {
  border: 1px solid var(--hairline);
}

.media-frame--contain img {
  object-fit: contain;
}

/* ==========================================================================
   5. Componentes
   ========================================================================== */

.facts {
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.facts li {
  position: relative;
  padding-left: 28px;
  font-size: 17px;
  line-height: 1.55;
}

.facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--contrast);
}

.section--alt .facts li::before {
  background-color: var(--on-alt);
}

.facts strong {
  font-weight: 600;
}

.product-card {
  margin-top: 32px;
  padding: 28px 32px;
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--contrast);
  border-radius: 16px;
  background-color: var(--surface);
}

.product-card h3 {
  margin-bottom: 12px;
}

.subhead {
  margin: 40px 0 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.cards {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.card {
  padding: 32px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background-color: var(--surface);
}

.card h3 {
  margin-bottom: 12px;
}

.card p {
  font-size: 17px;
}

.lede {
  max-width: 62ch;
  margin-top: 24px;
  font-size: 19px;
}

/* ==========================================================================
   6. Rodape
   ========================================================================== */

.site-footer {
  background-color: var(--bg-alt);
  color: var(--on-alt);
  padding-block: 72px;
}

.footer-logo {
  display: block;
  height: 40px;
  width: auto;
  margin-bottom: 28px;
}

.footer-wordmark {
  display: block;
  margin: 0 0 28px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--on-alt);
}

.footer-legal {
  display: grid;
  gap: 8px;
  font-size: 16px;
  line-height: 1.6;
  font-style: normal;
}

.footer-legal .company {
  font-size: 18px;
  font-weight: 600;
}

.footer-note {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 14px;
  opacity: 0.9;
}

/* ==========================================================================
   7. Responsivo
   ========================================================================== */

/* Tablet / desktop estreito */
@media (max-width: 1023px) {
  h1 { font-size: 42px; }
  h2 { font-size: 34px; }
  h3 { font-size: 22px; }

  body { font-size: 17px; }

  .section { padding-block: 72px; }
  .section-grid { column-gap: 40px; }
  .cards { gap: 20px; }
  .card { padding: 24px; }
}

/* Mobile: uma coluna, ordem titulo > imagem > texto */
@media (max-width: 767px) {
  h1 { font-size: 38px; }
  h2 { font-size: 30px; }
  h3 { font-size: 21px; }

  body { font-size: 16px; }

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

  .section { padding-block: 56px; }

  .section-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "title"
      "media"
      "copy";
    row-gap: 24px;
  }

  .section-title,
  .section-copy {
    text-align: left;
  }

  .section-copy {
    margin-top: 0;
  }

  .cards {
    margin-top: 40px;
    grid-template-columns: 1fr;
  }

  .facts li { font-size: 16px; }
  .lede { font-size: 17px; }
  .product-card { padding: 24px; }
  .site-footer { padding-block: 56px; }
  .footer-logo { height: 34px; }
  .footer-wordmark { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   8. Impressao
   ========================================================================== */

@media print {
  .section,
  .site-footer {
    padding-block: 24px;
  }

  .section--alt,
  .site-footer {
    background-color: #ffffff !important;
    color: #000000 !important;
  }

  .section--alt h1,
  .section--alt h2,
  .section--alt h3,
  .site-footer,
  .footer-wordmark {
    color: #000000 !important;
  }
}

/* ==========================================================================
   9. Faixa de marca (cabecalho)
   ========================================================================== */

.brand-bar {
  width: 100%;
  padding: 20px;
  background-color: var(--contrast);
  text-align: center;
  line-height: 0;
}

.brand-bar__logo {
  display: inline-block;
  height: 34px;
  width: auto;
}

.brand-bar__wordmark {
  margin: 0;
  color: var(--on-alt);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

@media (max-width: 767px) {
  .brand-bar__logo {
    height: 28px;
  }

  .brand-bar__wordmark {
    font-size: 21px;
  }
}

/* ==========================================================================
   10. Revelacao no scroll
   --------------------------------------------------------------------------
   O elemento observado e sempre o wrapper [data-reveal], que nunca recebe
   transform. Quem anima sao os filhos .reveal. Sem JS (ausencia da classe .js)
   ou com prefers-reduced-motion, tudo fica visivel por padrao.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] .reveal {
    opacity: 0;
    transform: translateY(18px);
  }

  .js [data-reveal].is-visible .reveal {
    opacity: 1;
    transform: none;
    transition:
      opacity 0.65s cubic-bezier(0.22, 0.61, 0.36, 1),
      transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1);
    transition-delay: var(--rd, 0s);
  }

  /* Escalonamento dentro das dobras com imagem */
  .js [data-reveal].is-visible .section-media { --rd: 0.09s; }
  .js [data-reveal].is-visible .section-copy  { --rd: 0.18s; }

  /* Dobra sem imagem: texto de apoio entra logo depois do titulo */
  .js [data-reveal].is-visible .lede.reveal { --rd: 0.08s; }

  /* Escalonamento da dobra de cartoes */
  .js [data-reveal].is-visible .cards .reveal:nth-child(1) { --rd: 0.08s; }
  .js [data-reveal].is-visible .cards .reveal:nth-child(2) { --rd: 0.16s; }
  .js [data-reveal].is-visible .cards .reveal:nth-child(3) { --rd: 0.24s; }
}
