:root {
  --teal: #56AFA0;
  --teal-d: #3E8F81;
  --mint: #D4EAE7;
  --mint-l: #EEF7F5;
  --ink: #1F3A36;

  --surface: #FFFFFF;
  --on-teal: #FFFFFF;
  --btn-bg: var(--teal);
  --btn-hover: var(--teal-d);
  --final-bg: var(--teal);
  --warn-bg: #FFF4E5;
  --shadow: rgba(62, 143, 129, .15);

  /* Caixa "Próxima edição": usa a paleta do tema oposto, para destacar */
  --edicao-bg: #1D3C39;
  --edicao-fg: #E8E6E3;

  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;

  --anim-distance: 24px;
  --anim-time: .8s;
  --anim-ease: cubic-bezier(.22, .61, .36, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --teal-d: #77C4B7;
  --mint: #1D3C39;
  --mint-l: #152D29;
  --ink: #E8E6E3;

  --surface: #181A1B;
  --on-teal: #E8E6E3;
  --btn-bg: #40887F;
  --btn-hover: #4E9C90;
  --final-bg: #40887F;
  --warn-bg: #3A2F1B;
  --shadow: rgba(0, 0, 0, .40);

  --edicao-bg: #D4EAE7;
  --edicao-fg: #1F3A36;
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--sans); color: var(--ink); line-height: 1.6; }
img { display: block; max-width: 100%; height: auto; }

.eyebrow {
  color: var(--teal);
  font-size: .75rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: .8rem;
}

.btn {
  display: inline-block;
  background: var(--btn-bg);
  color: var(--on-teal);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: .85rem;
  padding: 1.05rem 2.8rem;
  border-radius: 999px;
  text-decoration: none;
  transition: background .25s, transform .25s;
}
.btn:hover { background: var(--btn-hover); transform: translateY(-2px); }

.edicao {
  display: inline-block;
  padding: .45rem 1.1rem;
  border: 1px solid var(--edicao-bg);
  border-radius: 999px;
  font-size: .75rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  background: var(--edicao-bg);
  color: var(--edicao-fg);
  font-weight: 500;
}
.edicao:empty { display: none; }

.tema-switch {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 20;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tema-switch[hidden] { display: none; }

.tema-switch .trilho {
  position: relative;
  display: block;
  width: 64px;
  height: 34px;
  border-radius: 999px;
  background: var(--mint);
  border: 1px solid var(--teal);
  box-shadow: 0 4px 14px var(--shadow);
  transition: background-color .4s, border-color .4s;
}

.tema-switch .trilho > svg {
  position: absolute;
  top: 50%;
  width: 15px;
  height: 15px;
  margin-top: -7.5px;
  color: var(--teal-d);
  opacity: .6;
}
.tema-switch .fundo-sol { left: 9px; }
.tema-switch .fundo-lua { right: 9px; }

.tema-switch .bolinha {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--btn-bg);
  color: var(--on-teal);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .22);
  transition: transform .45s cubic-bezier(.34, 1.3, .64, 1), background-color .4s;
}
.tema-switch .bolinha svg {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 15px;
  height: 15px;
  transition: opacity .3s, transform .45s;
}

.tema-switch .bolinha .i-lua { opacity: 0; transform: rotate(-90deg) scale(.5); }

:root[data-theme="dark"] .tema-switch .bolinha { transform: translateX(30px); }
:root[data-theme="dark"] .tema-switch .bolinha .i-sol { opacity: 0; transform: rotate(90deg) scale(.5); }
:root[data-theme="dark"] .tema-switch .bolinha .i-lua { opacity: 1; transform: none; }

.tema-switch:hover .bolinha { filter: brightness(1.1); }
.tema-switch:active .bolinha { width: 30px; }
:root[data-theme="dark"] .tema-switch:active .bolinha { transform: translateX(26px); }

.trocando-tema, .trocando-tema *:not(.reveal):not(.tema-switch):not(.tema-switch *) {
  transition: background-color .4s, color .4s, border-color .4s, box-shadow .4s !important;
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--teal-d);
  outline-offset: 3px;
}

.rise {
  animation: subir var(--anim-time) var(--anim-ease) backwards;
}

.js .reveal {
  opacity: 0;
  transform: translateY(var(--anim-distance));
  transition: opacity var(--anim-time) var(--anim-ease), transform var(--anim-time) var(--anim-ease);
  transition-delay: var(--delay, 0s);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.d1 { --delay: .10s; animation-delay: .10s; }
.d2 { --delay: .20s; animation-delay: .20s; }
.d3 { --delay: .30s; animation-delay: .30s; }
.d4 { --delay: .40s; animation-delay: .40s; }
.d5 { --delay: .50s; animation-delay: .50s; }

@keyframes subir {
  from { opacity: 0; transform: translateY(var(--anim-distance)); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .trocando-tema, .trocando-tema *:not(.reveal) { transition: none !important; }
  .tema-switch .trilho, .tema-switch .bolinha, .tema-switch .bolinha svg { transition: none; }
  .rise { animation-name: aparecer; }
  .carrossel-faixa { scroll-behavior: auto; }
  .js .reveal { transform: none; transition-property: opacity; }
}
@keyframes aparecer {
  from { opacity: 0; }
  to { opacity: 1; }
}
