:root {
  --bg: #fafafa;
  --card: #ffffff;
  --text: #1c1c1c;
  --muted: #555555;
  --accent: #f97316;
  --border: #e0e0e0;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  --radius: 16px;
  --container: 1120px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1200px 800px at 10% -10%, rgba(249,115,22,0.08), transparent 40%),
              radial-gradient(900px 700px at 110% 10%, rgba(251,146,60,0.08), transparent 45%),
              var(--bg);
  line-height: 1.6;
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

/* Cabeçalho */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(140%) blur(8px);
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  letter-spacing: .3px;
}

.brand .logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #fb923c);
  box-shadow: var(--shadow);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem; /* espaçamento entre Sobre e o switch */
}

.title {
  margin: 0.75rem 0 1.25rem;
  font-size: clamp(1.6rem, 2.2vw + 1rem, 2.75rem);
  font-weight: 800;
}

.subtitle {
  margin: 0 0 1.25rem;
  color: var(--muted);
  max-width: 60ch;
}

/* Grade de cards */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
}

.card {
  grid-column: span 12;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,.15);
  border-color: rgba(249,115,22,.5);
}

.card-inner { padding: 1.25rem; }

.card h2 {
  margin: 0 0 .5rem;
  font-size: 1.15rem;
}

.card h3 {
  margin: .5rem 0;
  font-size: 1rem;
}

.card p { margin: 0; color: var(--muted); }

.badge {
  display: inline-block;
  padding: .25rem .6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: .75rem;
  margin-bottom: .75rem;
  color: var(--accent);
  background: rgba(249,115,22,0.08);
}

@media (min-width: 640px) {
  .card { grid-column: span 6; }
}
@media (min-width: 1024px) {
  .card { grid-column: span 4; }
}

/* Rodapé */
footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  background: var(--card);
}

.footer-wrap {
  padding: 1.25rem 0 1rem;
  display: grid;
  gap: 0.5rem;
}

.ad-slot {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 120px;
  border: 2px dashed rgba(0,0,0,0.15);
  border-radius: var(--radius);
  background: repeating-linear-gradient(
    -45deg,
    rgba(249,115,22,0.08),
    rgba(249,115,22,0.08) 12px,
    rgba(249,115,22,0.02) 12px,
    rgba(249,115,22,0.02) 24px
  );
  text-align: center;
  padding: 1rem;
}

.ad-slot small { color: var(--muted); }

/* Botões de exemplo */
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .9rem; }
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: .55rem .9rem;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(249,115,22,.5); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #fb923c); border: none; color: #fff; }

/* Espaçamento de seções */
section { padding: 2rem 0 1rem; }

/* Tema escuro automático e classe .dark */
html.dark {
  --bg: #0a0603;
  --card: #120b06;
  --text: #fefaf7;
  --muted: #c9a98b;
  --accent: #fb923c;
  --border: #26170d;
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

html.dark header,
html.dark footer,
html.dark .btn {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}

html.dark .btn:hover {
  border-color: rgba(251,146,60,.5);
}

/* Switch estilo toggle com ícones */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border);
  transition: .3s;
  border-radius: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  font-size: 16px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: var(--card);
  transition: .3s;
  border-radius: 50%;
  box-shadow: var(--shadow);
  z-index: 1;
}

/* Ícones dentro do slider */
.slider::before {
  z-index: 2;
}

.slider::after {
  content: "";
  position: absolute;
  z-index: 0;
}

.slider .icon-left,
.slider .icon-right {
  z-index: 0;
  pointer-events: none;
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(30px);
}

/* Inserir os ícones diretamente no slider */
.slider::before {
  content: "🌙";
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

input:checked + .slider::before {
  content: "☀️";
}

/* Estilo do link no header */
.btn-link {
  /* margin-left: 1rem; */
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.btn-link:hover {
  text-decoration: underline;
}

/* Estilos do modal */
.modal {
  display: none; /* escondido por padrão */
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: var(--card);
  color: var(--text);
  padding: 1rem;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow);
  position: relative;
  animation: fadeIn .3s ease;
}

.modal-content h2 {
  margin: 0 1rem 0 0;
  font-size: 1.15rem;
}

.modal .close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  color: var(--accent);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* No modo escuro */
.dark .modal-content {
  background: #2c2c2c;
  color: #f5f5f5;
}
