/* Tokens compartilhados vêm de tokens.css (carregado antes deste arquivo).
   Aqui ficam só os tokens locais do hub e o estilo dos seus componentes. */

:root {
  /* Locais do hub: variam por tema mas não fazem parte do sistema compartilhado. */
  --card-bg: linear-gradient(180deg, var(--surface-2), var(--surface));
  --card-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --card-shadow-hover:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(249, 115, 22, 0.12),
    0 14px 40px -20px var(--accent-glow),
    0 10px 30px -22px rgba(0, 0, 0, 0.75);
  --h1-gradient: linear-gradient(180deg, #ffffff 0%, #cfcfd4 100%);
  --icon-bg: linear-gradient(145deg, rgba(249, 115, 22, 0.22), rgba(249, 115, 22, 0.07));
  --dot-grid: rgba(255, 255, 255, 0.025);
}

:root[data-theme="light"] {
  --card-bg: #ffffff;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --card-shadow-hover:
    0 0 0 1px rgba(249, 115, 22, 0.16),
    0 25px 50px -12px rgba(0, 0, 0, 0.10),
    0 14px 40px -24px rgba(249, 115, 22, 0.45);
  --h1-gradient: linear-gradient(180deg, #18181b 0%, #3f3f46 100%);
  --icon-bg: rgba(249, 115, 22, 0.13);
  --dot-grid: rgba(0, 0, 0, 0.035);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  font-family: var(--font-body);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Layered background: warm glow top + bottom, plus a faint dot grid */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 50% -8%, var(--accent-glow), transparent 60%),
    radial-gradient(ellipse 55% 40% at 88% 105%, rgba(249, 115, 22, 0.07), transparent 55%);
}

.bg-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--dot-grid) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 28%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 28%, #000 30%, transparent 75%);
}

.page {
  position: relative;
  z-index: 1;
  max-width: 33rem;
  margin: 0 auto;
  min-height: 100vh;
  padding: clamp(3rem, 10vh, 5rem) 1.25rem 2.5rem;
  display: flex;
  flex-direction: column;
}

/* —— Cabeçalho —— */

/* Barra própria acima do título: o botão não disputa largura com o h1, que
   usa background-clip:text e some silenciosamente se transbordar a caixa. */
.page-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.intro {
  margin-bottom: 2.5rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.9rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, currentColor, transparent);
}

.intro h1 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-4);
  line-height: 1.05;
  letter-spacing: -0.02em;
  background: var(--h1-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Abaixo de ~360px, "Ferramentas" em Syne 800 não cabe nem no mínimo do
   --step-4 — e como o h1 usa background-clip:text, o excedente some em vez
   de estourar visivelmente. Tamanho medido para caber em 320px. */
@media (max-width: 360px) {
  .intro h1 {
    font-size: 1.7rem;
  }
}

.lede {
  margin: 0;
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 34ch;
}

/* —— Botão de tema —— */

.theme-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--accent-text);
  border-color: var(--border-hover);
}

.theme-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
}

/* Só um dos dois ícones aparece — o que representa o tema para o qual o clique leva. */
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }

/* —— Lista de apps —— */

.menu {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.entry {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.entry:hover,
.entry:focus-visible {
  border-color: var(--border-hover);
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.entry:active {
  transform: translateY(0) scale(0.99);
}

.entry:focus-visible,
.theme-toggle:focus-visible,
.site-footer a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.entry-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 0.85rem;
  background: var(--icon-bg);
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.25);
  color: var(--accent-text);
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.entry:hover .entry-icon,
.entry:focus-visible .entry-icon {
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.5), 0 0 22px -6px var(--accent-glow);
  transform: scale(1.05);
}

.entry-icon svg {
  width: 1.4rem;
  height: 1.4rem;
}

.entry-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

/* h2 desde a virada de SEO: o nome do app agora e um titulo de verdade na
   hierarquia do documento, nao um span. Reset de margin/line-height porque o
   default do h2 do browser abriria o card e mudaria o ritmo da lista. */
.entry-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-1);
  line-height: 1.25;
  color: var(--text);
}

.entry-desc {
  font-size: var(--step--1);
  line-height: 1.4;
  color: var(--text-dim);
}

.entry-arrow {
  flex-shrink: 0;
  display: flex;
  color: var(--text-faint);
  transition: color 0.2s ease, transform 0.2s ease;
}

.entry-arrow svg {
  width: 1.15rem;
  height: 1.15rem;
}

.entry:hover .entry-arrow,
.entry:focus-visible .entry-arrow {
  color: var(--accent-text);
  transform: translate(3px, -3px);
}

/* —— Grupos de ofertas —— */

.community {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
}

/* Texto sobre laranja é --on-accent, nunca branco (branco dá 2,8:1). */
.btn-ofertas {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 3rem;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-1);
  text-decoration: none;
  box-shadow: 0 10px 30px -14px var(--accent-glow);
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-ofertas:hover,
.btn-ofertas:focus-visible {
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 14px 40px -14px var(--accent-glow);
}

.btn-ofertas:active {
  transform: translateY(0) scale(0.99);
}

.btn-ofertas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-ofertas svg {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
}

.community-note {
  margin: 0;
  font-size: var(--step--1);
  color: var(--text-dim);
}

/* —— Rodapé —— */

.site-footer {
  margin-top: auto;
  padding-top: 3rem;
  text-align: center;
}

.site-footer::before {
  content: "";
  display: block;
  width: 100%;
  max-width: 8rem;
  height: 1px;
  margin: 0 auto 1.4rem;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* --text-dim, não --text-faint: a 0.8rem, 4,1:1 no escuro reprova AA. */
.site-footer a {
  font-size: var(--step--1);
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--accent-text);
}

/* Entrance — staggered rise. `backwards` fill so hover transforms still win after it ends. */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.intro,
.entry,
.community,
.site-footer {
  animation: rise 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
}

.intro { animation-delay: 0.02s; }
.entry:nth-child(1) { animation-delay: 0.12s; }
.entry:nth-child(2) { animation-delay: 0.2s; }
.entry:nth-child(3) { animation-delay: 0.28s; }
.community { animation-delay: 0.36s; }
.site-footer { animation-delay: 0.44s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .entry:hover,
  .entry:focus-visible,
  .btn-ofertas:hover,
  .btn-ofertas:focus-visible {
    transform: none;
  }
}
