/* SmallTV Pomodoro — site do projeto. Mesmo clima do painel do relógio:
   fundo escuro, cartões arredondados e o vermelho do tomate. */
:root {
  --bg: #0b0d10;
  --bg-2: #111419;
  --card: #161a20;
  --card-2: #1d222a;
  --line: #262c35;
  --text: #e9ecf1;
  --muted: #9aa3b0;
  --accent: #ff5a47;
  --accent-2: #ff8a5c;
  --green: #60c454;
  --radius: 10px;
  --pixel: "Silkscreen", ui-monospace, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
.px { image-rendering: pixelated; }
[id] { scroll-margin-top: 72px; }
a { color: var(--accent-2); }
a:hover { color: #ffb08f; }
code, kbd {
  font: 0.9em ui-monospace, "Cascadia Mono", Consolas, monospace;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.4em;
  overflow-wrap: anywhere;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h2 { font-size: clamp(1.5rem, 5vw, 2.1rem); letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- Cabeçalho ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11, 13, 16, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-weight: 700; white-space: nowrap;
}
.brand img { width: 30px; height: 30px; }
.brand span { font-family: var(--pixel); font-weight: 400; font-size: 15px; }
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: 15px;
  padding: 8px 10px; border-radius: 6px;
}
.nav a:hover { color: var(--text); background: var(--card); }
.nav a[aria-current="page"] { color: var(--text); background: var(--card-2); }
@media (max-width: 520px) {
  .brand span { display: none; }
  .nav a { padding: 8px 7px; font-size: 14px; }
  .nav .opt { display: none; }
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  border-radius: 6px; border: 1px solid var(--line);
  background: var(--card-2); color: var(--text);
  font: 600 15px var(--sans); text-decoration: none; cursor: pointer;
  transition: transform 0.12s, background 0.12s;
}
.btn:hover { color: var(--text); background: #262c36; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a0705; }
.btn.primary:hover { background: #ff705f; color: #1a0705; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 24px; }
.hero .wrap { display: grid; gap: 32px; align-items: center; }
.eyebrow {
  font-family: var(--pixel); font-size: 13px; color: var(--accent);
  letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 10px;
}
.hero h1 { font-size: clamp(2rem, 8vw, 3.4rem); letter-spacing: -0.02em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { font-size: 1.1rem; color: var(--muted); max-width: 34em; }
.hero .meta { font-size: 14px; color: var(--muted); margin-top: 14px; }
@media (min-width: 820px) {
  .hero { padding: 72px 0 40px; }
  .hero .wrap { grid-template-columns: 1.15fr 1fr; }
}

/* O relógio: um cubinho com a tela 240×240 trocando de mostrador. */
.device {
  --s: min(78vw, 340px);
  width: var(--s); margin: 0 auto; position: relative;
  padding: calc(var(--s) * 0.075) calc(var(--s) * 0.075) calc(var(--s) * 0.16);
  border-radius: calc(var(--s) * 0.08);
  background: linear-gradient(160deg, #f4f1ea, #d9d4c9);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.7), inset 0 -6px 12px rgba(0,0,0,0.12);
}
.device::after {
  content: ""; position: absolute; left: 50%; bottom: calc(var(--s) * 0.06);
  width: 18%; height: 4px; transform: translateX(-50%);
  border-radius: 4px; background: rgba(0,0,0,0.12);
}
.device .screen {
  position: relative; aspect-ratio: 1; overflow: hidden;
  border-radius: 6px; background: #000;
  box-shadow: 0 0 0 calc(var(--s) * 0.035) #0d0d0d;
}
.device .screen img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity 0.5s;
}
.device .screen img.on { opacity: 1; }
.device-caption { text-align: center; font-size: 13px; color: var(--muted); margin-top: 14px; font-family: var(--pixel); }

/* ---------- Seções ---------- */
section { padding: 48px 0; }
section + section { border-top: 1px solid var(--line); }
.section-lead { color: var(--muted); max-width: 42em; margin-bottom: 28px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
}
.grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .grid.two { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .grid.three { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 640px) and (max-width: 899px) { .grid.three { grid-template-columns: 1fr 1fr; } }

.feature h3 { display: flex; align-items: center; gap: 10px; }
.feature .ico {
  width: 34px; height: 34px; flex: none; border-radius: 6px;
  display: grid; place-items: center; font-size: 18px;
  background: rgba(255, 90, 71, 0.12);
}
.feature .ico img { width: 24px; height: 24px; }
.feature p { color: var(--muted); margin: 0; font-size: 15px; }
.btn img { width: 16px; height: 16px; }

/* Vitrine de pacotes na página inicial */
.shelf { display: grid; gap: 10px; grid-template-columns: repeat(4, 1fr); margin: 18px 0; }
.shelf a { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #000; transition: transform 0.15s; }
.shelf a:hover { transform: translateY(-3px); }
.shelf img { width: 100%; aspect-ratio: 1; }
@media (min-width: 760px) { .shelf { grid-template-columns: repeat(8, 1fr); } }
.shelf .ph { aspect-ratio: 1; border-radius: 8px; background: var(--card); border: 1px dashed var(--line); }

/* Troca de idioma */
.lang {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); text-decoration: none; font: 600 13px var(--sans);
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; margin-left: 4px; white-space: nowrap;
}
.lang img { width: 16px; height: 16px; }
.lang:hover { color: var(--text); background: var(--card); }

.shot {
  margin: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.shot img { width: 100%; background: #2a2a2a; }
.shot figcaption { padding: 12px 16px; font-size: 14px; color: var(--muted); }
.shots { display: grid; gap: 14px; margin-top: 14px; }

/* Antes e depois */
.compare { display: grid; gap: 10px; }
.compare .row {
  display: grid; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px;
}
.compare .topic { font-weight: 700; }
.compare .was, .compare .now { font-size: 15px; display: flex; gap: 8px; }
.compare .was { color: var(--muted); }
.compare .was::before { content: "Antes"; }
.compare .now::before { content: "Agora"; color: var(--accent); }
.compare .was::before, .compare .now::before {
  font-family: var(--pixel); font-size: 11px; flex: none; width: 50px; padding-top: 3px;
}
@media (min-width: 760px) {
  .compare .head, .compare .row { grid-template-columns: 170px 1fr 1fr; gap: 16px; align-items: start; }
  .compare .head { display: grid; padding: 0 16px; font-family: var(--pixel); font-size: 12px; color: var(--muted); }
  .compare .head span:last-child { color: var(--accent); }
  .compare .was::before, .compare .now::before { display: none; }
}
.compare .head { display: none; }
@media (min-width: 760px) { .compare .head { display: grid; } }

/* Passos de instalação */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; display: grid; gap: 12px; }
.steps > li {
  counter-increment: s; position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 18px 64px;
}
.steps > li::before {
  content: counter(s); position: absolute; left: 18px; top: 16px;
  width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center;
  background: var(--accent); color: #1a0705; font: 400 16px var(--pixel);
}
.steps > li h3 { margin-bottom: 4px; }
.steps > li p { margin: 0; color: var(--muted); font-size: 15px; }
.steps > li p + p { margin-top: 8px; }

.note {
  border-radius: 8px; padding: 14px 16px; font-size: 15px;
  background: rgba(255, 90, 71, 0.08); border: 1px solid rgba(255, 90, 71, 0.35);
}
.note.warn { background: rgba(255, 196, 61, 0.08); border-color: rgba(255, 196, 61, 0.4); }
.note strong { color: var(--text); }
details.note { margin-top: 12px; }
details.note summary { cursor: pointer; font-weight: 600; }
details.note[open] summary { margin-bottom: 8px; }
details.note ol { margin: 0; padding-left: 20px; color: var(--muted); }
details.note li + li { margin-top: 4px; }

/* Downloads */
.download {
  display: grid; gap: 16px; align-items: center;
  background: linear-gradient(135deg, #1d1416, var(--card));
  border: 1px solid #3a2523; border-radius: var(--radius); padding: 22px;
}
.download .ver { font-family: var(--pixel); color: var(--accent); font-size: 14px; }
.download h3 { font-size: 1.3rem; margin: 4px 0; }
.download p { margin: 0; color: var(--muted); font-size: 15px; }
@media (min-width: 720px) { .download { grid-template-columns: 1fr auto; } }

.list { margin: 0; padding-left: 20px; }
.list li { margin-bottom: 6px; color: var(--muted); }
.list li strong { color: var(--text); }

/* ---------- Galeria ---------- */
.page-head { padding: 40px 0 8px; }
.page-head h1 { font-size: clamp(1.9rem, 7vw, 2.8rem); }
.page-head p { color: var(--muted); max-width: 40em; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0 6px; }
.tabs button {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 6px; padding: 8px 14px; font: 600 14px var(--sans); cursor: pointer;
}
.tabs button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.tabs .count { font-family: var(--pixel); font-size: 12px; font-weight: 400; opacity: 0.7; margin-left: 5px; }

.faces { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.face {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.face:target { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 90, 71, 0.25); }
.sub-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sub-head .count { font-family: var(--pixel); color: var(--accent); font-size: 14px; }
.face .prev {
  display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in;
  background: #000; aspect-ratio: 1; position: relative;
}
.face .prev img { width: 100%; height: 100%; }
.face .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.face .title { display: flex; align-items: baseline; gap: 8px; }
.face h3 { margin: 0; font-size: 1.05rem; }
.face .num { font-family: var(--pixel); font-size: 11px; color: var(--muted); }
.face .desc { color: var(--muted); font-size: 14px; margin: 0; }
.face .by { font-size: 13px; color: var(--muted); margin-top: auto; padding-top: 6px; }
.face .by b { color: var(--text); font-weight: 600; }
.face .actions { display: flex; gap: 8px; margin-top: 8px; }
.tag {
  display: inline-block; font-family: var(--pixel); font-size: 10px;
  padding: 2px 7px; border-radius: 6px; margin-left: auto;
  background: var(--card-2); color: var(--muted); border: 1px solid var(--line);
}
.tag.pkg { color: var(--accent); border-color: rgba(255, 90, 71, 0.4); }

.soon {
  display: grid; gap: 18px; align-items: center;
  background: var(--card); border: 1px dashed #3a414c; border-radius: var(--radius); padding: 22px;
}
.soon img { width: 64px; height: 64px; }
.soon h3 { margin-bottom: 4px; }
.soon p { margin: 0; color: var(--muted); font-size: 15px; }
.soon p + p { margin-top: 8px; }
@media (min-width: 640px) { .soon { grid-template-columns: auto 1fr; } }

.how { counter-reset: h; display: grid; gap: 12px; margin-top: 18px; }
@media (min-width: 760px) { .how { grid-template-columns: repeat(3, 1fr); } }
.how .card h3::before {
  counter-increment: h; content: counter(h) ". "; color: var(--accent);
}
.how .card p { margin: 0; font-size: 15px; color: var(--muted); }

/* Visualização ampliada */
dialog.zoom {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--text); padding: 16px;
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
}
dialog.zoom::backdrop { background: rgba(0, 0, 0, 0.75); }
dialog.zoom img { width: 100%; aspect-ratio: 1; background: #000; border-radius: 8px; }
dialog.zoom .bar { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
dialog.zoom h3 { margin: 0; }
dialog.zoom p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
dialog.zoom .bar .btn { margin-left: auto; }

/* ---------- Rodapé ---------- */
footer {
  border-top: 1px solid var(--line); padding: 28px 0 40px;
  color: var(--muted); font-size: 14px;
}
footer .foot-bottom { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.foot-grid { display: grid; gap: 24px; margin-bottom: 20px; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
.foot-grid h3 { font-size: 15px; color: var(--text); margin-bottom: 8px; }
.foot-grid ul { margin: 0; padding-left: 18px; }
.foot-grid li { margin-bottom: 5px; }
footer .fine { font-size: 13px; border-top: 1px solid var(--line); padding-top: 16px; }
footer img { width: 22px; height: 22px; }
footer .links { display: flex; gap: 16px; flex-wrap: wrap; margin-left: auto; }
footer a { color: var(--muted); }
footer a:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .device .screen img { transition: none; }
}

[hidden] { display: none !important; }

/* "Veja de perto": uma imagem por vez, escolhida nas abas */
.viewer .tabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 0 12px; padding-bottom: 2px; scrollbar-width: none; }
.viewer .tabs::-webkit-scrollbar { display: none; }
.viewer .tabs button { flex: none; }

/* Galeria: segunda fileira de filtros (estilos), versão mínima do firmware */
.tabs.styles { margin-top: 0; }
.tabs.styles button { padding: 6px 12px; font-size: 13px; font-weight: 600; }
.tabs.styles button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #1a0705; }
section[data-kind].first { border-top: 0; padding-top: 16px; }
.face .req { margin: 0; font-size: 12px; color: var(--muted); }

/* Página do jogo */
.game-card { margin: 0 auto; max-width: 300px; text-align: center; }
.game-card img { width: 100%; border-radius: 8px; box-shadow: 0 24px 50px -18px rgba(0, 0, 0, 0.8); }
.game-card figcaption { font-family: var(--pixel); font-size: 12px; color: var(--muted); margin-top: 12px; }
.game-card.small { max-width: 260px; }
.stages { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .stages { grid-template-columns: repeat(3, 1fr); } }
.stages figure { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stages figure > img { width: 100%; aspect-ratio: 1; background: #000; }
.stages figcaption { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 10px 12px; }
.stages figcaption img { grid-row: span 2; width: 32px; height: 32px; }
.stages figcaption b { font-size: 15px; line-height: 1.2; }
.stages figcaption span { font-family: var(--pixel); font-size: 11px; color: var(--accent); }
.garden { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; }
.garden i { display: block; aspect-ratio: 1; border-radius: 2px; background: #262c35; }
.garden i.some { background: #5a2a26; }
.garden i.on { background: var(--accent); }
.garden-sum { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.garden-sum b { color: var(--text); font-family: var(--pixel); font-weight: 400; }
.achs { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.achs div { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.achs img { grid-row: span 2; width: 40px; height: 40px; }
.achs b { font-size: 15px; line-height: 1.25; }
.achs span { font-size: 13px; color: var(--muted); }
.split { display: grid; gap: 24px; align-items: center; }
@media (min-width: 760px) { .split { grid-template-columns: 280px 1fr; } }
/* "Veja de perto": telas únicas do relógio (240x240) num tamanho confortável */
.shot.one img { max-width: 360px; margin: 0 auto; background: #000; }
.shot.one { background: #000; }
.shot.one figcaption { background: var(--card); }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.acts span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 6px; background: var(--card-2); border: 1px solid var(--line); color: var(--text); font-size: 13px; }
.acts img { width: 20px; height: 20px; }

/* Pomodoro animado: a faixa de quadros (240x240 cada) passa um a um */
.shot.pomo .anim { width: 100%; max-width: 360px; aspect-ratio: 1; margin: 0 auto; background-color: #000; background-repeat: no-repeat; background-position: 0 0; image-rendering: pixelated; }
.shot.pomo figcaption p { margin: 10px 0 0; }
.shot.pomo .sub { font-family: var(--pixel); font-size: 11px; color: var(--accent); }
.shot.pomo .act-lead { border-top: 1px solid var(--line); padding-top: 10px; }
.viewer .tabs.states { margin: 0; flex-wrap: wrap; overflow: visible; }
.tabs.states button { padding: 6px 12px; font-size: 13px; }

/* Ícone do GitHub em pixel art (traço de 1 px, como o tomate do LCD); pinta com a cor do link */
.gh {
  display: inline-block; width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px;
  background: currentColor; image-rendering: pixelated;
  -webkit-mask: url(img/icons/github.svg) center / 16px 16px no-repeat;
  mask: url(img/icons/github.svg) center / 16px 16px no-repeat;
}

/* Seção Alexa: frases de voz em cartões */
.h-ico img { display: inline-block; width: 28px; height: 28px; vertical-align: -4px; margin-right: 10px; }
.voice { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.voice div { background: var(--card); border: 1px solid var(--line); border-left: 3px solid #3fc8ff; border-radius: 8px; padding: 12px 14px; }
.voice b { display: block; font-size: 15px; margin-bottom: 2px; }
.voice span { font-size: 14px; color: var(--muted); }

/* Página de versões (gerada por scripts/releases-page.cjs) */
.page-head h1 .count { font-family: var(--pixel); font-size: 14px; font-weight: 400; color: var(--accent); vertical-align: middle; margin-left: 6px; }
.page-head .note { margin: 18px 0 0; max-width: 46em; }
.releases .section-lead { font-size: 15px; }
.rel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 14px;
}
.rel.avoid { border-color: rgba(255, 196, 61, 0.4); }
.rel-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 10px; }
.rel-head h2 { font-family: var(--pixel); font-weight: 400; font-size: 1.35rem; margin: 0; letter-spacing: 0; }
.rel-head .tag { margin-left: 0; }
.rel-head time { margin-left: auto; color: var(--muted); font-size: 14px; }
.rel .note { margin-bottom: 12px; }
.rel .list { margin-bottom: 14px; }
.rel .list li { margin-bottom: 4px; }
.rel .btns { gap: 8px; }
.rel .btn .sz { font-weight: 400; opacity: 0.7; margin-left: 6px; font-size: 12px; }
.tag.bad { color: #ffc43d; border-color: rgba(255, 196, 61, 0.5); }
.face .title .tag + .tag { margin-left: 0; }
.tag.anim { color: var(--green); border-color: rgba(96, 196, 84, 0.45); }
