/* ========= BILIBOT • Responsive & Soft Animations Rev ========= */

/* Font face (unchanged) */
@font-face{
  font-family: 'Slenco-Black demo';
  src: url('fonts/Slenco-Black demo.otf') format('opentype');
}

/* --------- Design Tokens --------- */
:root{
  --footer-h: clamp(44px, 6vw, 64px);
  --header-h: 72px; /* updated at runtime via JS as well */
  --section-h: min(100svh, 860px);
  --section-pad-block: clamp(32px, 6vw, 96px);

  --bg-1:#9ecae1;
  --bg-2:#c8dbef;
  --surface: #eaf2fbcc;
  --text:#0f172a;
  --white:#ffffff;

  --primary:#4A90E2;
  --primary-700:#2563eb;
  --accent:#61718a;

  --ring:0 0 0 4px rgba(74,144,226,.25);
  --shadow:0 10px 30px rgba(2,8,23,.15);
  --radius:18px;
}

*{ box-sizing:border-box; }

html, body{
  margin:0; padding:0;
  font-family:'Slenco-Black demo', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  letter-spacing:.5px;
  color:#fff;
  scroll-behavior:smooth;
}

body{
  background: linear-gradient(180deg, var(--bg-1) 0%, #a7c9ea 40%, #b9d3ee 100%);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  padding-top: var(--header-h); /* prevent content under fixed header */
}

/* ========= Header & Navigation ========= */
header{
  position:fixed; top:0; left:0; right:0; z-index:1000;
  display:flex; justify-content:space-between; align-items:center;
  padding:8px 16px;
  color:var(--white);
  background:rgba(200,219,239,.75);
  backdrop-filter:saturate(120%) blur(8px);
  box-shadow:0 2px 14px rgba(15,23,42,.15);
  min-height:56px;
}

.logo-container{ display:flex; align-items:center; margin-left:clamp(16px,4vw,100px); }
.logo{ width:clamp(72px,10vw,100px); transition: transform .25s ease; }
.logo:hover, .logo:focus{ transform: translateY(-2px) scale(1.06); outline:none; }

nav{
  display:flex; align-items:center; justify-content:center; flex-grow:1;
  margin-top:6px; flex-wrap: wrap; gap:8px;
  padding-inline: 8px;
}
nav a{
  padding:10px 16px;
  font-size: clamp(14px, 2.2vw, 20px);
  font-weight:700;
  color:#00264d;
  text-decoration:none;
  background: rgba(255,255,255,.7);
  border-radius:999px;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
nav a:hover, nav a:focus{
  background:#deebf7;
  transform: translateY(-1px);
  outline:none;
  box-shadow: var(--shadow);
}
nav a.active-link{
  background: #deebf7;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.social-icons{ display:flex; align-items:center; margin:0 clamp(12px,4vw,65px) 0 auto; gap:8px; }
.social-icon{ display:inline-flex; padding:6px; border-radius:12px; transition: transform .2s ease, background .2s ease; }
.social-icon img{ max-width:50px; height:auto; }
.social-icon:hover, .social-icon:focus{ transform: translateY(-2px); background: rgba(255,255,255,.25); outline:none; }

/* ========= Sections ========= */
section{
  position:relative;
  display:flex; flex-direction:column; justify-content:center; align-items:stretch;
  text-align:start;
  background-size:cover; background-position:center;
  overflow:hidden;
  min-height: var(--section-h);
  padding-block: var(--section-pad-block);
  padding-bottom: calc(var(--section-pad-block) + 28px);
}

.slide{ opacity:0; transition: opacity .5s ease; }
.slide.active{ opacity:1; }

/* Visual separator between sections */
section:not(:first-of-type)::before{
  content:"";
  position:absolute; inset:auto 0 100% 0;
  height:20px; background: var(--bg-1);
  pointer-events:none; z-index:0;
}
.overlay{ position: relative; z-index:1; display:flex; flex-direction:column; justify-content:center; gap:16px; padding-inline: clamp(16px, 6vw, 90px); }
.overlay h1, .overlay button, #desc{}

/* Title image sprite */
.titulo-bilibot{
  color:transparent; text-indent:-9999px; overflow:hidden; white-space:nowrap;
  background:url('images/bilibot-title.png') no-repeat left center / contain;
  width:min(90vw, 650px); aspect-ratio:540 / 122; display:block;
}
@media (max-width:768px){
  .titulo-bilibot{ width:min(90vw, 560px); }
}

/* Typography */
section h1{
  font-size: clamp(32px, 10vw, 120px);
  line-height: 1.05;
  text-shadow: 1px 1px 2px rgba(0,0,0,.3);
  margin:0 0 10px 0;
}
section p, section ul{
  font-size: clamp(16px, 2.8vw, 28px);
  text-shadow: 1px 1px 2px rgba(0,0,0,.2);
  margin: 0 0 24px 0;
}
#sobre #desc { text-shadow: 0 3px 20px rgba(0, 0, 0, 0.50); }

/* ====== Soft Appear Animations (with reduced-motion fallback) ====== */
@keyframes fade-up {
  from { opacity:0; transform: translateY(18px); }
  to   { opacity:1; transform: translateY(0); }
}
@keyframes fade-left {
  from { opacity:0; transform: translateX(-22px); }
  to   { opacity:1; transform: translateX(0); }
}
@keyframes fade-right {
  from { opacity:0; transform: translateX(22px); }
  to   { opacity:1; transform: translateX(0); }
}

/* initial state */
section h1, section p, section ul { opacity: 0; }

/* when section enters view, staggered animations */
section.in-view h1 { animation: fade-up .7s ease forwards; animation-delay: .05s; }
section.in-view p  { animation: fade-left .7s ease forwards; animation-delay: .12s; }
section.in-view ul { animation: fade-right .7s ease forwards; animation-delay: .18s; }

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

/* ========= CTAs ========= */
button, .scroll-button, #back-to-top, .cta-botao, .botao-reservar{
  appearance:none; border:0; cursor:pointer;
  padding:10px 18px; font-size:clamp(14px, 2.2vw, 16px); font-weight:800;
  border-radius:12px; color:#fff;
  background: linear-gradient(180deg, var(--accent) 0%, #7e8ea8 100%);
  box-shadow: 0 6px 16px rgba(2,8,23,.18);
  transition: transform .06s ease, filter .2s ease, box-shadow .2s ease;
}
button:hover, button:focus,
.scroll-button:hover, .scroll-button:focus,
#back-to-top:hover, #back-to-top:focus,
.cta-botao:hover, .cta-botao:focus{
  transform: translateY(-1px);
  filter: brightness(1.03);
  outline:none;
}
.botao-reservar{
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-700) 100%);
  box-shadow: 0 8px 22px rgba(37,99,235,.35);
}

.cta-bloco{ display:flex; flex-direction:column; align-items:flex-start; gap:20px; }
.cta-linha-superior{ display:flex; gap:12px; flex-wrap:wrap; }
.cta-botao{ text-decoration:none; }

/* ========= Back to top ========= */
#back-to-top{
  position: fixed; bottom: 20px; right: 20px; 
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
  z-index: 1100;
}
#back-to-top::before{
  content: "↑";
  font-weight: 900; line-height: 1;
}
#back-to-top.show{
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateY(0);
  transition: opacity .25s ease, transform .25s ease, visibility 0s;
}

/* ========= Accessibility ========= */
:focus-visible{ outline:none; box-shadow: var(--ring); }

/* ========= First section full-viewport ========= */
section:first-of-type{ min-height: 100svh; }
#sobre{ min-height: 100svh; }

/* ========= Responsive tweaks ========= */
@media (max-width: 1024px){
  .overlay{ padding-inline: clamp(16px, 6vw, 48px); }
}
@media (max-width: 768px){
  header{ flex-direction:column; align-items:flex-start; gap:8px; }
  .logo-container{ margin-left:0; }
  nav{ margin-top:0; }
  .social-icons{ margin:4px 0 0 0; }
}

/* ==== Ajuste: apenas a primeira secção mantém altura total ==== */
section:first-of-type {
  min-height: 100svh;
}

section:not(:first-of-type) {
  min-height: auto;
  height: auto;
  padding-block: clamp(32px, 6vw, 96px);
}

/* Conteúdo das secções seguintes começa mais no topo */
section:not(:first-of-type) .overlay {
  justify-content: flex-start;
  padding-top: 40px;
  padding-bottom: 40px;
}

/* Botão hamburger */
.menu-toggle{
  display:none; /* desktop */
  background: rgba(255,255,255,.7);
  border-radius:12px;
  padding:8px 10px;
  line-height:0;
  box-shadow: var(--shadow);
  border: none;
  cursor: pointer;
}
.menu-toggle .menu-bar{
  display:block; width:22px; height:3px; margin:4px 0;
  background:#0f172a; border-radius:2px;
  transition: transform .2s ease, opacity .2s ease;
}

/* Estado "aberto" vira ícone de X */
.menu-toggle.is-open .menu-bar:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.menu-toggle.is-open .menu-bar:nth-child(2){ opacity:0; }
.menu-toggle.is-open .menu-bar:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

/* Dropdown do nav no mobile */
@media (max-width: 768px){
  .menu-toggle{ display:inline-flex; align-items:center; justify-content:center; }

  nav#site-nav{
    position:absolute; top:100%; left:0; right:0;
    display:none; /* fechado por padrão */
    flex-direction:column; gap:6px;
    padding:10px;
    background: rgba(200,219,239,.95);
    backdrop-filter: saturate(120%) blur(8px);
    box-shadow: 0 8px 22px rgba(15,23,42,.25);
  }
  nav#site-nav.is-open{ display:flex; }
  nav#site-nav a{
    width:100%; text-align:center;
    padding:12px 16px;
    font-size: clamp(16px, 4.5vw, 18px);
  }
}

/* Tokens para coerência (seguem o header) */
:root{
  --glass-bg: rgba(200,219,239,.75);    /* igual ao header */
  --glass-bg-strong: rgba(200,219,239,.9);
  --ink: #00264d;                       /* links/ícones escuros, coerente com nav */
  --frost-blur: 8px;                    /* igual ao header */
  --frost-saturate: 120%;
  --border-glow: 0 -4px 18px rgba(15,23,42,.18);
}

/* ===== Footer ===== */
.footer{
  z-index: 1000;
  min-height: var(--footer-h);
  position: fixed; left: 0; right: 0; bottom: 0;
  /* Vidro/blur igual ao header */
  background: var(--glass-bg);
  -webkit-backdrop-filter: saturate(var(--frost-saturate)) blur(var(--frost-blur));
  backdrop-filter: saturate(var(--frost-saturate)) blur(var(--frost-blur));
  /* contorno discreto para separar do conteúdo */
  border-top: 1px solid rgba(255,255,255,.35);
  box-shadow: var(--border-glow);

  color: #0f172a; /* texto principal um pouco mais escuro para contraste */
  text-align: center; padding: 8px 12px;
  font-size: clamp(14px, 2.2vw, 18px);

  /* Animação de entrada (se já houver JS a controlar visibilidade) */
  opacity: 0; transform: translateY(8px);
  transition: opacity .45s ease, transform .45s ease, background .25s ease, backdrop-filter .25s ease;
}
.footer.is-ready{ will-change: opacity, transform; }
.footer.is-visible{ opacity: 1; transform: translateY(0); }

/* Navegação dentro do footer — sem alterar estrutura */
.footer .footer-nav{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  opacity: .95;
}
.footer .footer-nav a{
  padding: 0; margin: 0 .2rem;
  font-size: clamp(12px, 1.6vw, 14px);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  border-radius: 0; box-shadow: none; transform: none;
  transition: color .2s ease, text-shadow .2s ease;
}
.footer .footer-nav a:hover,
.footer .footer-nav a:focus{
  color: #0b3a73;
  text-shadow: 0 0 1px rgba(255,255,255,.45);
  outline: none;
}

/* Ícones sociais — coerentes com o header */
.footer .footer-social{ display:flex; align-items:center; justify-content:center; gap: 10px; }
.footer .footer-social img{
  width: 28px; height: 28px; display:block; object-fit: contain;
  filter: drop-shadow(0 1px 4px rgba(2,8,23,.15));
  transition: transform .2s ease, filter .2s ease;
}
.footer .footer-social a:hover img,
.footer .footer-social a:focus img{
  transform: translateY(-1px) scale(1.03);
  filter: drop-shadow(0 3px 8px rgba(2,8,23,.25));
}
@media (min-width: 768px){
  .footer .footer-social img{ width: 44px; height: 44px; }
}

/* Disclaimer e layout do conteúdo do footer (preserva estrutura) */
.footer .footer-content{
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.footer .footer-disclaimer{
  font-size: clamp(11px, 1.4vw, 13px);
  margin: 0;
  opacity: .95;
}

/* Estado "forte" opcional (ex.: quando o conteúdo por baixo for muito contrastado) */
.footer.is-strong{
  background: var(--glass-bg-strong);
}

/* (Opcional) compensação de layout para conteúdo não ficar escondido pelo footer fixo
   — use apenas se notar sobreposição.  
   body{ padding-bottom: var(--footer-h); } 
*/