/* ReBing Engine — rebing.com.br */
:root {
  --bg-top: #F8F6F1;
  --bg-mid: #F1EFE9;
  --bg-end: #E3E0D9;
  --surface: #FCFBF8;
  --surface-2: #F4F2ED;
  --line: rgba(18, 19, 24, .08);
  --line-strong: rgba(18, 19, 24, .14);
  --ink: #15161B;
  --ink-2: #4A4C55;
  --ink-3: #80828B;
  --ember: #FF6A1A;
  --ember-soft: rgba(255, 106, 26, .10);
  --ok: #2F8F5B;
  --ok-soft: rgba(47, 143, 91, .10);
  --wip: #B7791F;
  --wip-soft: rgba(183, 121, 31, .12);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(20, 18, 14, .04), 0 2px 8px rgba(20, 18, 14, .04);
  --shadow: 0 1px 2px rgba(20, 18, 14, .04), 0 8px 24px rgba(20, 18, 14, .06);
  --shadow-lg: 0 2px 6px rgba(20, 18, 14, .05), 0 18px 48px rgba(20, 18, 14, .10);
  --header-h: 68px;
  --footer-h: 46px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg-end); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 55%, var(--bg-end) 100%) fixed;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--footer-h);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 6px; }

.container { width: min(1120px, 100% - 48px); margin-inline: auto; }

/* ---------- Intro ---------- */
.intro {
  position: fixed; inset: 0; z-index: 100;
  display: none; place-items: center;
  background: linear-gradient(180deg, var(--bg-top), var(--bg-mid));
  transition: opacity .6s var(--ease), visibility .6s;
}
.intro.is-on { display: grid; }
.intro.is-out { opacity: 0; visibility: hidden; }
.intro img { width: min(560px, 82vw); height: auto; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(248, 246, 241, .78);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header__inner {
  height: 100%;
  width: min(1120px, 100% - 48px); margin-inline: auto;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}
.brand { display: inline-flex; }
.brand img { height: 42px; width: auto; }
.nav { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; }
.nav a {
  padding: 7px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: background .2s, color .2s, box-shadow .2s;
}
.nav a:hover { color: var(--ink); }
.nav a.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.header__end { justify-self: end; display: flex; align-items: center; gap: 10px; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface-2); }
.lang a {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--ink-3);
}
.lang a.is-active { background: var(--ink); color: #fff; }
.burger { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); position: relative; }
.burger span { position: absolute; left: 11px; right: 11px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .25s var(--ease), top .25s var(--ease); }
.burger span:first-child { top: 15px; }
.burger span:last-child { top: 23px; }
.burger[aria-expanded="true"] span:first-child { top: 19px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { top: 19px; transform: rotate(-45deg); }

/* ---------- Main / sections ---------- */
.main { outline: none; min-height: calc(100vh - var(--header-h) - var(--footer-h)); padding-bottom: 72px; }
.view { animation: fadeUp .5s var(--ease) both; }
.view--static { animation: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.section { padding-top: 64px; }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 4px var(--ember-soft); }
h1, h2, h3 { margin: 0; letter-spacing: -.025em; line-height: 1.15; }
h2 { font-size: clamp(24px, 3vw, 30px); font-weight: 600; margin-top: 8px; }
.muted { color: var(--ink-2); }
.inline-link { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--ember); text-underline-offset: 3px; }
.link { font-size: 14px; font-weight: 600; color: var(--ink); display: inline-flex; gap: 6px; align-items: center; }
.link:hover { color: var(--ember); }
.link span { transition: transform .2s var(--ease); }
.link:hover span { transform: translateX(3px); }

/* Hero */
.hero { padding-top: 72px; display: grid; grid-template-columns: 1.25fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(36px, 5.2vw, 58px); font-weight: 650; letter-spacing: -.035em; margin: 18px 0 18px; }
.hero h1 em { font-style: normal; color: var(--ember); }
.hero p { font-size: 18px; color: var(--ink-2); max-width: 56ch; margin: 0; }
.hero__cta { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 999px;
  font-size: 15px; font-weight: 600; border: 1px solid transparent;
  transition: transform .2s var(--ease), box-shadow .2s, background .2s;
}
.btn--dark { background: var(--ink); color: #fff; box-shadow: var(--shadow); }
.btn--dark:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn--ghost { background: var(--surface); border-color: var(--line-strong); }
.btn--ghost:hover { background: #fff; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.status {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 24px; box-shadow: var(--shadow-lg); padding: 26px;
}
.status__top { display: flex; align-items: center; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.status__top img { width: 56px; height: 56px; }
.status__top strong { display: block; font-size: 16px; }
.status__top small { color: var(--ink-3); font-size: 13px; }
.live { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ok); background: var(--ok-soft); padding: 5px 10px; border-radius: 999px; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.status__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; padding-top: 20px; }
.stat small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.stat b { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }

/* Cards de changelog */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.card__thumb { aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; border-bottom: 1px solid var(--line); }
.card__thumb { display: grid; place-items: center; }
.card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.card__thumb img.ph, .row__thumb img.ph { width: 44px; height: auto; object-fit: contain; opacity: .22; }
.card__body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); }
.card h3 { font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.card p { margin: 0; font-size: 14px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__foot { margin-top: auto; padding-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge--release { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge--develop { background: var(--ember-soft); color: #C2480A; border-color: transparent; }
.badge--version { font-variant-numeric: tabular-nums; }
.badge--done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge--wip { background: var(--wip-soft); color: var(--wip); border-color: transparent; }
.chip { font-size: 12px; color: var(--ink-3); }
.chip b { color: var(--ink-2); font-weight: 600; }

/* Features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.feature__head { display: flex; justify-content: space-between; gap: 10px; align-items: start; margin-bottom: 8px; }
.feature h3 { font-size: 16px; font-weight: 600; }
.feature p { margin: 0; font-size: 14px; color: var(--ink-2); }

/* Página changelogs */
.page-head { padding-top: 56px; }
.page-head h1 { font-size: clamp(32px, 4vw, 44px); font-weight: 650; margin-top: 12px; letter-spacing: -.03em; }
.page-head p { color: var(--ink-2); margin: 12px 0 0; max-width: 60ch; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 30px 0 18px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.seg button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.search { height: 40px; min-width: 240px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font: inherit; font-size: 14px; color: var(--ink); }
.search:focus { outline: none; border-color: var(--ember); box-shadow: 0 0 0 4px var(--ember-soft); }

.list { display: flex; flex-direction: column; gap: 12px; }
.row {
  display: grid; grid-template-columns: 132px 1fr auto; gap: 22px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px 16px 16px; box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.row:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.row__thumb { width: 132px; aspect-ratio: 16/10; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; }
.row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.row h3 { font-size: 16.5px; font-weight: 600; margin: 6px 0 4px; }
.row p { margin: 0; font-size: 14px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row__arrow { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink-2); transition: background .2s, color .2s; }
.row:hover .row__arrow { background: var(--ink); color: #fff; }
.more { display: flex; justify-content: center; margin-top: 22px; }

/* Detalhe */
.back { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 500; color: var(--ink-2); margin-top: 40px; }
.back:hover { color: var(--ink); }
.detail { display: grid; grid-template-columns: 1fr 300px; gap: 32px; margin-top: 22px; align-items: start; }
.detail__main, .detail__side { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.detail__main { padding: 32px; }
.detail__main h1 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 650; letter-spacing: -.03em; margin: 14px 0 10px; }
.detail__summary { color: var(--ink-2); font-size: 16.5px; margin: 0; }
.detail__side { padding: 22px; position: sticky; top: calc(var(--header-h) + 20px); }
.meta-list { display: grid; gap: 14px; margin: 0; }
.meta-list dt { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.meta-list dd { margin: 2px 0 0; font-weight: 600; font-size: 14.5px; word-break: break-word; }
.meta-list code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 26px; }
.gallery button { padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface-2); aspect-ratio: 16/9; }
.gallery button:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.gallery button:hover img { transform: scale(1.03); }

.group { margin-top: 30px; }
.group h2 { font-size: 15px; font-weight: 600; letter-spacing: 0; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.group h2 .count { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.commits { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.commits li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: baseline; padding: 12px 16px; font-size: 14.5px; border-top: 1px solid var(--line); background: var(--surface); }
.commits li:first-child { border-top: 0; }
.commits .scope { font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); padding: 1px 8px; border-radius: 6px; }
.commits .noscope { width: 0; }
.commits code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--ink-3); }

/* About / Download */
.prose { max-width: 720px; }
.prose p { color: var(--ink-2); font-size: 17px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 36px; box-shadow: var(--shadow); margin-top: 30px; }
.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 30px; }
.download { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.download img { width: 112px; height: 112px; }
.download h2 { margin-top: 0; }
.soon { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px; }

.empty { text-align: center; padding: 48px 24px; color: var(--ink-3); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.noscript { padding: 40px 0; }
.skeleton { height: 220px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Footer (fixo) ---------- */
.footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: var(--footer-h);
  background: rgba(241, 239, 233, .85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-3);
}
.footer__inner { height: 100%; width: min(1120px, 100% - 48px); margin-inline: auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.footer a { color: var(--ink-2); font-weight: 600; }
.footer a:hover { color: var(--ember); }

/* ---------- Lightbox ---------- */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(14, 14, 18, .82); backdrop-filter: blur(6px); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: min(1400px, 92vw); max-height: 86vh; border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.lightbox__close, .lightbox__nav { position: fixed; border: 0; background: rgba(255,255,255,.12); color: #fff; width: 46px; height: 46px; border-radius: 50%; font-size: 26px; line-height: 1; display: grid; place-items: center; }
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255,255,255,.22); }
.lightbox__close { top: 20px; right: 20px; }
.lightbox__nav--prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: 20px; top: 50%; transform: translateY(-50%); }

/* ---------- Responsivo ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 48px; }
  .grid, .features, .about-grid { grid-template-columns: 1fr 1fr; }
  .detail { grid-template-columns: 1fr; }
  .detail__side { position: static; }
}
@media (max-width: 760px) {
  :root { --header-h: 62px; }
  .brand img { height: 36px; }
  .status { padding: 20px; }
  .status__top img { width: 44px; height: 44px; }
  .status__top > div { flex: 1; min-width: 0; }
  .status__top small { display: none; }
  .stat b { font-size: 17px; }
  .header__inner { grid-template-columns: auto 1fr; }
  .burger { display: block; }
  .nav {
    position: fixed; top: calc(var(--header-h) + 8px); left: 16px; right: 16px;
    flex-direction: column; gap: 2px; padding: 8px; border-radius: 18px;
    background: var(--surface); box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .2s, transform .2s var(--ease), visibility .2s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav a { padding: 12px 16px; border-radius: 12px; font-size: 15px; }
  .nav a.is-active { background: var(--surface-2); box-shadow: none; }
  .grid, .features, .about-grid, .gallery { grid-template-columns: 1fr; }
  .row { grid-template-columns: 88px 1fr; gap: 14px; }
  .row__thumb { width: 88px; }
  .row__arrow { display: none; }
  .detail__main { padding: 22px; }
  .commits li { grid-template-columns: 1fr; gap: 4px; }
  .commits .noscope { display: none; }
  .search { min-width: 0; width: 100%; }
  .download { grid-template-columns: 1fr; }
  .panel { padding: 24px; }
  .footer { font-size: 11.5px; }
  .footer__inner { flex-direction: column; justify-content: center; gap: 0; line-height: 1.45; }
  :root { --footer-h: 52px; }
}

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