/* ==========================================================================
   Impact Hope — Landing Page Exceptional Refugee Students
   ========================================================================== */

/* Tokens
   ========================================================================== */
:root {
  /* Cores */
  --color-bg: #fffaf8;
  --color-text: #1e1713;
  --color-white: #ffffff;
  --color-orange: #ff8e09;
  --color-orange-hover: #d7812f;
  --color-red: #e0572a;
  --color-green: #3c9d5e;
  --color-blue: #18689f;
  --color-navy: #164059;
  --color-overlay: rgba(48, 35, 28, 0.2);
  --color-overlay-soft: rgba(48, 35, 28, 0.1);
  --color-heading: #30231c;
  --color-border: #efe1db;
  --color-muted: #a0b8c6;

  /* Tipografia */
  --font-sans: "Avenir", "Avenir LT Std", "Avenir Next", "Nunito Sans", "Segoe UI", sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-ui: "Inter", system-ui, sans-serif;
  --font-footer: "Poppins", system-ui, sans-serif;

  /* Layout */
  --page-gutter-x: 14px;
  --page-gutter-y: 15px;
  --page-max: 1572px;
  --content-narrow: 531px;
  --section-gap: 75px;
  --radius-lg: 30px;
  --radius-pill: 100px;
}

/* Scroll customizado */
:root {
  --sbw: 8px;
  --sbc: var(--color-orange);
}
html, body { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar,
body::-webkit-scrollbar { width: 0; height: 0; }
#sb {
  position: fixed;
  top: 0;
  right: 2px;
  width: var(--sbw);
  height: 100vh;
  pointer-events: none;
  z-index: 99999;
}
#sb i {
  position: absolute;
  right: 0;
  width: 100%;
  border-radius: 999px;
  background: var(--sbc);
  opacity: 0;
  transition: opacity .35s ease;
}
html.scrolling #sb i { opacity: 1; }
@media (max-width: 1024px) { #sb { display: none; } }

/* Seleção de texto */
::selection      { color: #fff; background-color: var(--color-orange); }
::-moz-selection { color: #fff; background-color: var(--color-orange); }

/* Base
   ========================================================================== */
html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3,
p,
address {
  margin: 0;
}

address {
  font-style: normal;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

strong {
  font-weight: 800;
}

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  max-width: calc(var(--page-max) + var(--page-gutter-x) * 2);
  margin: 0 auto;
  padding: var(--page-gutter-y) var(--page-gutter-x) var(--section-gap);
}

/* Botões
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 16px;
  line-height: 28px;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-pill);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn--primary {
  /* Largura definida pelo conteúdo. Padding lateral de 40px: cerca de 2x o
     respiro vertical do texto (~18px), proporção comum em botões grandes */
  width: auto;
  min-width: 233px;
  max-width: 100%;
  height: 65px;
  padding: 0 40px;
  gap: 10px;
  color: var(--color-white);
  /* Contorno em degradê laranja bem claro: o fundo sólido ocupa a área interna
     (padding-box) e o degradê aparece só na faixa da borda (border-box) */
  --btn-fill: var(--color-orange);
  border: 2px solid transparent;
  background:
    linear-gradient(var(--btn-fill), var(--btn-fill)) padding-box,
    linear-gradient(135deg,
      rgba(255, 241, 224, 0.7) 0%,
      rgba(255, 210, 161, 0.7) 50%,
      rgba(255, 230, 201, 0.7) 100%) border-box;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Hover: botão flutua com sombra suave (sem troca de cor) */
.btn--primary:hover,
.btn--primary:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px -12px rgba(48, 35, 28, 0.22);
}

@media (prefers-reduced-motion: reduce) {
  .btn--primary:hover,
  .btn--primary:focus-visible {
    transform: none;
  }
}


.btn--card {
  width: 184px;
  padding: 10px;
  line-height: 26px;
  color: var(--color-white);
  background: var(--color-orange);
}

.btn--card:hover {
  background: var(--color-orange-hover);
}

/* Seta dos botões dos cards — desliza para a direita no hover */
.btn--card {
  gap: 8px;
}

.btn__arrow {
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn--card:hover .btn__arrow,
.btn--card:focus-visible .btn__arrow {
  transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
  .btn__arrow {
    transition: none;
  }
}

.btn--primary:focus-visible,
.btn--card:focus-visible {
  outline: 3px solid var(--color-blue);
  outline-offset: 3px;
}

/* Hero
   ========================================================================== */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.hero__card {
  position: relative;
  display: flex;
  width: 100%;
  height: 550px;
  margin-bottom: -3px;
  padding: 0 24px 94px 183px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: url("../img/hero-bg.webp") center / cover no-repeat;
}

.hero__card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-overlay);
  pointer-events: none;
}

.hero__content {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 60px;
  width: 525px;
  max-width: 100%;
}

/* Selo do logo (forma branca + logo) */
.hero__badge {
  position: relative;
  display: block;
  width: 174px;
  height: 212px;
  flex-shrink: 0;
}

.hero__badge-shape {
  position: absolute;
  inset: 0;
}

.hero__logo {
  position: absolute;
  top: 57px;
  left: 20px;
  width: 135px;
  height: 136px;
  overflow: hidden;
}

.hero__logo img {
  position: absolute;
  top: -9.64%;
  left: -8.54%;
  width: 118.29%;
  height: 116.87%;
  max-width: none;
}

.hero__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 33px;
}

.hero__title {
  color: var(--color-white);
  font-weight: 400;
  line-height: 44.33px;
}

.hero__title-main {
  display: block;
  font-family: var(--font-sans);
  font-size: 35.464px;
  letter-spacing: -0.7093px;
}

.hero__title-accent {
  display: block;
  font-family: var(--font-serif);
  font-size: 37.237px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.7447px;
  color: var(--color-bg);
}

/* Animação de entrada (fade-up) — título em duas linhas e botão, em sequência */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__title-main,
.hero__title-accent,
.hero .btn--primary {
  /* `backwards`: segura o estado inicial durante o delay e solta o transform
     ao terminar, para o hover do botão conseguir movê-lo */
  animation: fade-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.hero__title-main    { animation-delay: 0.2s; }
.hero__title-accent  { animation-delay: 0.4s; }
.hero .btn--primary  { animation-delay: 0.6s; }

/* Barra de progresso flutuante
   Desktop: começa no hero, encostada na direita e na altura do botão; ao
   rolar, gruda no topo direito da tela. A posição é calculada pelo
   js/script.js — sem JS ela fica fixa no topo direito.
   Mobile: fixa embaixo, centralizada. */
.sponsor-progress {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 360px;
  max-width: calc(100% - var(--page-gutter-x) * 2);
  padding: 16px 22px 18px;
  font-family: var(--font-ui);
  color: var(--color-heading);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  box-shadow: 0 18px 40px -14px rgba(48, 35, 28, 0.28), 0 6px 14px -6px rgba(48, 35, 28, 0.12);
  animation: float-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.75s backwards;
}

/* Ainda dentro do hero: acompanha a página */
.sponsor-progress.is-anchored {
  position: absolute;
}

/* Depois da rolagem: 30% mais estreita para cobrir menos conteúdo */
.sponsor-progress {
  transition: width 0.35s ease, padding 0.35s ease, gap 0.35s ease;
}

.sponsor-progress.is-compact {
  width: min(252px, calc((100vw - var(--page-gutter-x) * 2) * 0.7));
  padding: 12px 16px 14px;
  gap: 8px;
}

.sponsor-progress.is-compact .sponsor-progress__label {
  font-size: 13px;
  line-height: 18px;
}

.sponsor-progress.is-compact .sponsor-progress__track {
  height: 8px;
}

.sponsor-progress__label {
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  white-space: nowrap;
  transition: font-size 0.35s ease, line-height 0.35s ease;
}

.sponsor-progress__label strong {
  font-weight: inherit;
  color: var(--color-orange);
}

.sponsor-progress__track {
  height: 10px;
  transition: height 0.35s ease;
  overflow: hidden;
  background: #ffe6c9;
  border-radius: var(--radius-pill);
}

.sponsor-progress__fill {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: var(--color-orange);
  border-radius: inherit;
  /* Enche a barra depois que ela aparece */
  animation: progress-grow 1.2s cubic-bezier(0.22, 1, 0.36, 1) 1.4s backwards;
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

@keyframes float-in-centered {
  from {
    opacity: 0;
    transform: translate(-50%, 24px);
  }
}

@keyframes progress-grow {
  from { width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__title-main,
  .hero__title-accent,
  .hero .btn--primary,
  .sponsor-progress,
  .sponsor-progress__fill {
    animation: none;
  }
}

/* Barras da marca */
.brand-bars {
  position: relative;
  width: 189px;
  height: 6px;
  flex-shrink: 0;
}

.brand-bars__item {
  position: absolute;
  top: 0;
  width: 50.543px;
  height: 6px;
  border-radius: 10px;
}

.brand-bars__item--orange { left: 0;       background: var(--color-orange); }
.brand-bars__item--red    { left: 45.95px; background: var(--color-red); }
.brand-bars__item--green  { left: 92.51px; background: var(--color-green); }
.brand-bars__item--blue   { left: 138.46px; background: var(--color-blue); }

/* Versão menor (cards de alunos) */
.brand-bars--sm {
  width: 140px;
  height: 8px;
}

.brand-bars--sm .brand-bars__item {
  width: 37.439px;
  height: 8px;
}

.brand-bars--sm .brand-bars__item--red   { left: 34.04px; }
.brand-bars--sm .brand-bars__item--green { left: 68.52px; }
.brand-bars--sm .brand-bars__item--blue  { left: 102.56px; }

/* Campaign
   ========================================================================== */
.campaign {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 91px;
  width: 100%;
  max-width: var(--content-narrow);
}

.campaign__intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 50px;
  width: 100%;
}

.campaign__logo {
  width: 309px;
  height: auto;
}

.campaign__text {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
  font-size: 18px;
  line-height: 28px;
  color: var(--color-text);
}

.campaign__title {
  width: 100%;
  font-size: 25px;
  font-weight: 800;
  line-height: 28px;
  text-align: center;
  color: var(--color-text);
}

/* Students
   ========================================================================== */
.students {
  width: 100%;
  max-width: 1181px;
}

.students__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 377px));
  justify-content: center;
  column-gap: 25px;
  row-gap: 20px;
}

.student-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  border-radius: 20px;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Hover: card flutua com sombra suave */
.student-card:hover,
.student-card:focus-within {
  transform: translateY(-8px);
  box-shadow: 0 18px 40px -12px rgba(48, 35, 28, 0.18),
              0 6px 14px -6px rgba(48, 35, 28, 0.10);
}

@media (prefers-reduced-motion: reduce) {
  .student-card {
    transition: box-shadow 0.2s ease;
  }

  .student-card:hover,
  .student-card:focus-within {
    transform: none;
  }
}

.student-card__media {
  position: relative;
  aspect-ratio: 377 / 252;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
}

.student-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}


.student-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-overlay-soft);
}

.student-card__body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 19px;
  height: 179px;
  margin-top: -24px;
  padding-top: 39px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 20px;
}

.student-card__body .brand-bars {
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
}

/* Estado "sponsored": aluno já recebeu doação
   - botão verde com o texto "Sponsored!", sem link e sem hover
   - card não flutua no hover */
.student-card--sponsored:hover,
.student-card--sponsored:focus-within {
  transform: none;
  box-shadow: none;
}

.student-card--sponsored .btn--card,
.student-card--sponsored .btn--card:hover {
  color: var(--color-white);
  background: var(--color-green);
  cursor: default;
}

.student-card--sponsored .btn__arrow {
  display: none;
}

/* Check verde dentro de uma bolinha branca */
.btn__check {
  flex-shrink: 0;
  box-sizing: content-box;
  width: 12px;
  height: 12px;
  padding: 4px;
  color: var(--color-green);
  background: var(--color-white);
  border-radius: 50%;
}

.student-card__name {
  max-width: 217px;
  font-size: 20px;
  font-weight: 800;
  line-height: 28px;
  text-align: center;
  color: var(--color-heading);
}

/* Footer
   ========================================================================== */
.footer {
  width: calc(100% - var(--page-gutter-x) * 2);
  max-width: var(--page-max);
  min-height: 404px;
  margin: 0 auto var(--page-gutter-y);
  padding: 88px 24px 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: var(--color-navy);
  border-radius: var(--radius-lg);
  font-family: var(--font-footer);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 71px;
  width: 100%;
  max-width: 1279px;
}

.footer__info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 39px;
}

.footer__contacts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px 41px;
}

.footer__contact {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 16px;
  font-weight: 500;
  line-height: 23px;
  color: var(--color-white);
  text-decoration: none;
}

.footer__contact img {
  flex-shrink: 0;
}

.footer__contact--mail    { gap: 11px; }
.footer__contact--address { gap: 9px; }

a.footer__contact:hover span {
  text-decoration: underline;
}

.footer__legal {
  font-size: 16px;
  font-weight: 400;
  line-height: 26px;
  text-align: center;
  color: var(--color-muted);
}

.nowrap {
  white-space: nowrap;
}

/* Quebra de linha que só vale no mobile */
.br-mobile {
  display: none;
}

@media (max-width: 768px) {
  .br-mobile {
    display: inline;
  }
}

.footer__bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 50px;
  width: 100%;
}

.footer__divider {
  width: 100%;
  height: 1px;
}

.footer__copy {
  font-size: 14px;
  line-height: 22px;
  text-align: center;
  color: var(--color-muted);
}

/* Smooth scroll — desliga o nativo para quem prefere menos movimento
   (precisa ficar DEPOIS de `html { scroll-behavior: smooth }`) */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Responsivo
   ========================================================================== */
@media (max-width: 1024px) {
  .students__grid {
    grid-template-columns: repeat(2, minmax(0, 377px));
  }
}
@media (max-width: 1024px) {
  .hero__card {
    padding-left: 64px;
  }
}

@media (max-width: 768px) {
  :root {
    --section-gap: 56px;
  }

  /* Hero mobile: foto vertical ancorada embaixo, infos acima da cabeça.
     A cabeça começa em ~45% da altura da foto; o padding-bottom reserva os
     ~55% de baixo (menina + mesa) e o topo se estende com a cor da parede. */
  .hero__card {
    --hero-img-ratio: calc(1661 / 1080);   /* altura / largura da foto */
    height: auto;
    min-height: 0;
    padding: 0 24px calc((100vw - var(--page-gutter-x) * 2) * var(--hero-img-ratio) * 0.62);
    background: #fdb150 url("../img/hero-bg-mobile.webp") center bottom / 100% auto no-repeat;
  }

  .hero__card::before {
    background: linear-gradient(180deg, rgba(48, 35, 28, 0.16) 0%, rgba(48, 35, 28, 0.06) 45%, rgba(48, 35, 28, 0) 70%);
  }

  .hero__content {
    gap: 40px;
    align-items: center;
    margin: 0 auto;
    text-align: center;
  }

  .hero__badge {
    width: 130px;
    height: 158px;
  }

  .hero__badge-shape {
    width: 100%;
    height: 100%;
  }

  .hero__logo {
    top: 42px;
    left: 15px;
    width: 100px;
    height: 101px;
  }

  .hero__title {
    line-height: 1.25;
  }

  .hero__title-main {
    font-size: 28px;
  }

  .hero__title-accent {
    font-size: 29px;
  }

  .hero__text {
    gap: 24px;
    align-items: center;
  }

  /* Mobile: fixa embaixo, centralizada */
  .sponsor-progress {
    position: fixed;
    top: auto;
    right: auto;
    bottom: 12px;
    left: 50%;
    width: calc(100vw - var(--page-gutter-x) * 2 - 32px);
    padding: 12px 18px 14px;
    gap: 8px;
    transform: translateX(-50%);
    animation-name: float-in-centered;
  }

  /* Sempre fixa: no topo da página o JS sobe o `bottom` até a base do hero
     (sobre a foto); ao rolar ele volta a 12px. A transição do `bottom`
     junto com a largura faz o box deslizar e encolher sem salto. */
  .sponsor-progress {
    transition: bottom 0.45s cubic-bezier(0.22, 1, 0.36, 1),
                width 0.45s cubic-bezier(0.22, 1, 0.36, 1),
                padding 0.45s cubic-bezier(0.22, 1, 0.36, 1),
                gap 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .sponsor-progress.is-compact {
    padding: 10px 16px 12px;
  }

  /* Espaço extra no fim da página para a barra não cobrir o rodapé */
  body {
    padding-bottom: 110px;
  }

  .sponsor-progress__label {
    font-size: 14px;
  }

  .campaign {
    gap: 56px;
    padding: 0 8px;
  }

  .campaign__intro {
    gap: 36px;
  }

  .campaign__logo {
    width: 260px;
  }

  .campaign__text {
    font-size: 17px;
  }

  .campaign__title {
    font-size: 22px;
    text-align: left;
  }

  .footer {
    min-height: 0;
    padding: 56px 30px 40px;
  }

  .footer__inner {
    gap: 48px;
  }

  .footer__info {
    gap: 28px;
  }

  .footer__contacts {
    flex-direction: column;
    gap: 35px;
  }

  /* Ícone acima do texto */
  .footer__contact,
  .footer__contact--mail,
  .footer__contact--address {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .footer__legal {
    font-size: 13px;
    line-height: 22px;
  }

  .footer__legal br {
    display: none;
  }

  .footer__bottom {
    gap: 32px;
  }
}

@media (max-width: 640px) {
  .students__grid {
    grid-template-columns: minmax(0, 377px);
  }
}
