/* ModuloDev — base: tokens, reset, tipografia, header, trilhos, footer */

:root {
  --bg: #0a0a0b;
  --paper: #ece2d2;
  --text: #f1ece4;
  --muted: #948e85;
  --red: #ff3d1f;
  --coral: #ff6347;
  --lime: #bee26e;
  --green: #62b02a;
  --on-lime: #0b0b0b;
  --on-paper: #1f1f1f;

  --f-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --f-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;

  --maxw: 1680px;
  --gutter: clamp(20px, 4.2vw, 80px);
  --rail: 0px;
  --header-h: 76px;
  --radius: 4px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* cores derivadas das cores base; .tema permite recalcular numa prévia com outras cores */
:root, .tema {
  --bg-2: color-mix(in srgb, var(--bg), var(--text) 2%);
  --surface: color-mix(in srgb, var(--bg), var(--text) 5%);
  --surface-2: color-mix(in srgb, var(--bg), var(--text) 8%);
  --line: color-mix(in srgb, var(--bg), var(--text) 11%);
  --line-2: color-mix(in srgb, var(--bg), var(--text) 18%);
  --faint: color-mix(in srgb, var(--muted), var(--bg) 40%);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* grão sutil + grade técnica ao fundo */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--text) 2.2%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--text) 2.2%, transparent) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, #000 30%, transparent 100%);
}

img, svg { max-width: 100%; display: block; }
figure { margin: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--lime); color: var(--bg); }

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
p { margin: 0 0 1em; color: var(--muted); text-wrap: pretty; }

.shell {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: calc(var(--gutter) + var(--rail));
}

.mono {
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 22px;
}
.tag::before {
  content: '';
  width: 22px;
  height: 2px;
  background: currentColor;
}

.idx { font-family: var(--f-mono); font-size: .72rem; color: var(--faint); letter-spacing: .06em; }

/* ------------------------------------------------ botões */
.btn {
  --bg-btn: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 15px 26px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--bg-btn);
  color: var(--text);
  font-family: var(--f-display);
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.btn .seta { transition: transform .3s var(--ease); }
.btn:hover .seta { transform: translateX(4px); }
.btn-primario { --bg-btn: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.btn-primario:hover { --bg-btn: color-mix(in srgb, var(--lime), #fff 22%); border-color: color-mix(in srgb, var(--lime), #fff 22%); }
.btn-linha:hover { border-color: var(--text); }

.link-seta {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-family: var(--f-display);
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 4px;
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
.link-seta:hover { border-color: var(--lime); color: var(--lime); }

/* ------------------------------------------------ header */
.topo {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  border-bottom: 1px solid var(--line);
}
/* o desfoque fica num pseudo-elemento: backdrop-filter no próprio header prenderia o menu mobile (position: fixed) dentro dele */
.topo::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.topo .shell { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.marca { display: flex; align-items: center; gap: 12px; font-family: var(--f-display); font-size: 1.1rem; letter-spacing: -0.02em; }
.marca img { height: 30px; width: auto; max-width: 180px; object-fit: contain; }
.marca b { font-weight: 700; }
.marca span { font-weight: 400; }

.nav { display: flex; align-items: center; gap: clamp(18px, 2.2vw, 40px); }
.nav a { display: inline-flex; align-items: baseline; gap: 6px; font-size: .92rem; color: var(--muted); transition: color .25s; }
.nav a small { font-family: var(--f-mono); font-size: .62rem; color: var(--faint); }
.nav a:hover, .nav a.ativo { color: var(--text); }
.nav a.ativo small { color: var(--lime); }
.nav .btn { padding: 11px 20px; font-size: .88rem; color: var(--on-lime); }
.nav .btn:hover { color: var(--on-lime); }

.menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.menu-btn span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 1.5px;
  background: var(--text);
  transition: transform .3s var(--ease), top .3s var(--ease);
}
.menu-btn span:nth-child(1) { top: 17px; }
.menu-btn span:nth-child(2) { top: 25px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

/* ------------------------------------------------ aparências do visitante (menu) */
.temas { position: relative; }
.temas-btn {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: .92rem;
  color: var(--muted);
  cursor: pointer;
  transition: color .25s;
}
.temas-btn small { font-family: var(--f-mono); font-size: .62rem; color: var(--faint); }
.temas-btn:hover, .temas-btn[aria-expanded="true"] { color: var(--text); }
.temas-lista {
  position: absolute;
  top: calc(100% + 18px);
  right: 0;
  z-index: 70;
  min-width: 230px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .7);
}
.temas-lista[hidden] { display: none; }
.tema-op {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: .9rem;
  text-align: left;
  cursor: pointer;
}
.tema-op:hover { background: var(--surface-2); }
.tema-op[aria-pressed="true"] { background: var(--surface-2); }
/* marcador da aparência escolhida: o cubo da logo em pixel art, na cor do texto */
.tema-op::before {
  content: '';
  width: 14px;
  height: 16px;
  flex: none;
  background: currentColor;
  -webkit-mask: url("../img/cubo-pixel.45c9c3c168dd.svg") center / contain no-repeat;
  mask: url("../img/cubo-pixel.45c9c3c168dd.svg") center / contain no-repeat;
  visibility: hidden;
}
.tema-op[aria-pressed="true"]::before { visibility: visible; }
.tema-amostra {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: conic-gradient(var(--a) 0 50%, var(--b) 0 75%, var(--c) 0);
}

/* ------------------------------------------------ trilhos laterais (estilo pôster) */
.trilho {
  position: fixed;
  top: var(--header-h);
  bottom: 0;
  width: var(--rail);
  z-index: 40;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 36px 0;
  pointer-events: none;
}
.trilho-esq { left: 0; border-right: 1px solid var(--line); }
.trilho-dir { right: 0; border-left: 1px solid var(--line); }
.trilho .vertical {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--f-mono);
  font-size: .66rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}
.trilho .vertical b { color: var(--lime); font-weight: 500; }
.trilho-dir .vertical { transform: none; }
.trilho .riscos { display: flex; flex-direction: column; gap: 6px; }
.trilho .riscos i { display: block; width: 12px; height: 1.5px; background: var(--line-2); transform: rotate(-35deg); }
.trilho .progresso {
  width: 1px;
  flex: 0 0 140px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.trilho .progresso::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: calc(var(--scroll, 0) * 100%);
  background: var(--lime);
}

/* ------------------------------------------------ mensagens */
.avisos { padding-top: 20px; }
.aviso {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border: 1px solid color-mix(in srgb, var(--lime) 30%, transparent);
  background: color-mix(in srgb, var(--lime) 7%, transparent);
  color: var(--lime);
  border-radius: var(--radius);
  font-size: .95rem;
}
.aviso-error { border-color: color-mix(in srgb, var(--red) 35%, transparent); background: color-mix(in srgb, var(--red) 8%, transparent); color: var(--coral); }
/* ícone de stack (Simple Icons) pintado na cor do texto: o SVG entra como máscara */
.stack-icone {
  display: inline-block;
  flex: none;
  width: 1.25em;
  height: 1.25em;
  background: currentColor;
  -webkit-mask: var(--icone) center / contain no-repeat;
  mask: var(--icone) center / contain no-repeat;
}
.aviso-warning { border-color: color-mix(in srgb, var(--coral) 35%, transparent); background: color-mix(in srgb, var(--coral) 7%, transparent); color: var(--text); }

/* ------------------------------------------------ footer */
.rodape { margin-top: clamp(80px, 10vw, 160px); border-top: 1px solid var(--line); background: var(--bg-2); overflow: hidden; }
.rodape-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-block: 72px 56px;
}
.rodape h4 { font-family: var(--f-mono); font-size: .7rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 18px; }
.rodape-col { display: flex; flex-direction: column; gap: 10px; }
.rodape-col a { color: var(--muted); font-size: .95rem; transition: color .25s; width: fit-content; }
.rodape-col a:hover { color: var(--lime); }
.rodape-sobre p { max-width: 360px; font-size: .95rem; }
.rodape-palavra {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(4rem, 17vw, 22rem);
  line-height: .8;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-2);
  white-space: nowrap;
  user-select: none;
  margin-bottom: -0.12em;
}
.rodape-palavra span { -webkit-text-stroke: 0; color: var(--surface-2); }
.rodape-base {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-block: 22px;
  border-top: 1px solid var(--line);
  color: var(--faint);
}

/* ------------------------------------------------ revelação ao rolar */
.js .revela { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.js .revela.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .revela { opacity: 1; transform: none; transition: none; }
}
