/* casca.css: a base do "Estúdio noturno": cores, letras, ícones, botões, a barra lateral (no telefone, a barra
   de baixo) e o rodapé. Depende de: ../comum/modal.css antes dele; pecas.css e paginas.css vêm depois. */

/* ================================================================ cores, letras e tempos */

:root {
  color-scheme: dark;

  /* a noite do estúdio */
  --fundo: #0b0d13;
  --fundo-lado: #0e1119;
  --cartao: #151924;
  --cartao-alto: #1d2230;
  --texto: #eef0f6;
  --texto-fraco: #a7afc1;
  --linha: rgba(255, 255, 255, 0.09);
  --raio: 18px;
  --raio-pequeno: 10px;
  --creme: #f3eee4;
  --no-ar: #ff5a4e;
  --foco: #ffd84d;
  --tinta-escura: #0b0d13;

  /* cada tema com a sua cor viva */
  --tema-web: #4da3ff;
  --tema-fundamentos: #ffc53d;
  --tema-automacao: #ff6b9a;
  --tema-ia: #a98bff;
  --tema-hardware: #ff8a3d;
  --tema-android: #3ddc84;

  /* a cor de quem está em volta: o tema do episódio, ou creme quando não há tema */
  --cor: var(--creme);
  --cor2: #5b6275;
  --progresso: 0;

  --letra-titulo: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --letra-texto: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;

  --rapido: 160ms;
  --medio: 420ms;
  --altura-da-barra-de-baixo: 66px;
}

/* Quem tem data-tema passa a cor do tema pros filhos; o segundo tema vira a segunda cor da arte. */
[data-tema="web"], [data-filtro-tema="web"] { --cor: var(--tema-web); }
[data-tema="fundamentos"], [data-filtro-tema="fundamentos"] { --cor: var(--tema-fundamentos); }
[data-tema="automacao"], [data-filtro-tema="automacao"] { --cor: var(--tema-automacao); }
[data-tema="ia"], [data-filtro-tema="ia"] { --cor: var(--tema-ia); }
[data-tema="hardware"], [data-filtro-tema="hardware"] { --cor: var(--tema-hardware); }
[data-tema="android"], [data-filtro-tema="android"] { --cor: var(--tema-android); }
[data-tema]:not([data-tema2]) { --cor2: color-mix(in oklab, var(--cor) 45%, #241a5e); }
[data-tema2="web"] { --cor2: var(--tema-web); }
[data-tema2="fundamentos"] { --cor2: var(--tema-fundamentos); }
[data-tema2="automacao"] { --cor2: var(--tema-automacao); }
[data-tema2="ia"] { --cor2: var(--tema-ia); }
[data-tema2="hardware"] { --cor2: var(--tema-hardware); }
[data-tema2="android"] { --cor2: var(--tema-android); }

/* ================================================================ base */

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

[hidden] { display: none !important; }

html { position: relative; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: calc(var(--altura-da-barra-de-baixo) + env(safe-area-inset-bottom));
  background: var(--fundo);
  color: var(--texto);
  font: 400 16px/1.55 var(--letra-texto);
}

/* O ar do estúdio: duas luzes baixas e um grão de fita, atrás de tudo, do alto ao fim da página. */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .045 0'/></filter><rect width='100%25' height='100%25' filter='url(%23g)'/></svg>"),
    radial-gradient(900px 520px at 88% -12%, rgba(77, 163, 255, 0.1), transparent 70%),
    radial-gradient(700px 520px at -12% 112%, rgba(255, 90, 78, 0.07), transparent 70%);
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--letra-titulo);
  font-weight: 750;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

p, dl, dd, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }

:focus-visible {
  outline: 3px solid var(--foco);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection { background: var(--foco); color: var(--tinta-escura); }

.visualmente-oculto {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.pular {
  position: absolute;
  top: -80px;
  left: 12px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--creme);
  color: var(--tinta-escura);
  font-weight: 700;
  text-decoration: none;
  transition: top var(--rapido) ease-out;
}
.pular:focus { top: 12px; }

/* ================================================================ ícones (desenhados aqui, pintados com a cor do texto) */

.icone {
  display: inline-block;
  flex: none;
  width: 1.25em;
  height: 1.25em;
  background: currentColor;
  -webkit-mask: var(--desenho) center / contain no-repeat;
  mask: var(--desenho) center / contain no-repeat;
}

/* Botão cujo texto o JavaScript troca ("Copiado") leva o ícone num ::before, que sobrevive à troca. */
.com-icone::before {
  content: "";
  flex: none;
  width: 1.15em;
  height: 1.15em;
  background: currentColor;
  -webkit-mask: var(--desenho) center / contain no-repeat;
  mask: var(--desenho) center / contain no-repeat;
}

.icone--tocar { --desenho: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M8 4.9v14.2a1.2 1.2 0 0 0 1.8 1l11-7.1a1.2 1.2 0 0 0 0-2l-11-7.1A1.2 1.2 0 0 0 8 4.9z'/></svg>"); }
[data-player="tocar"] .icone--tocar { translate: 1.5px 0; }
html[data-tocador="tocando"] [data-player="tocar"] .icone--tocar {
  --desenho: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><rect x='5.5' y='4' width='4.6' height='16' rx='1.3'/><rect x='13.9' y='4' width='4.6' height='16' rx='1.3'/></svg>");
  translate: 0 0;
}
.icone--voltar { --desenho: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4.5 12a7.5 7.5 0 1 0 2.2-5.3'/><path d='M4 3.5v4h4'/></svg>"); }
.icone--avancar { --desenho: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M19.5 12a7.5 7.5 0 1 1-2.2-5.3'/><path d='M20 3.5v4h-4'/></svg>"); }
.icone--compartilhar { --desenho: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='18' cy='5.5' r='2.6'/><circle cx='6' cy='12' r='2.6'/><circle cx='18' cy='18.5' r='2.6'/><path d='m8.3 13.3 7.4 4M15.7 6.8l-7.4 4'/></svg>"); }
.icone--baixar { --desenho: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'><path d='M12 4v11m-5-5 5 5 5-5M5 20h14'/></svg>"); }
.icone--inicio { --desenho: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 3.2 3 10.4V20a1 1 0 0 0 1 1h5.5v-6h5v6H20a1 1 0 0 0 1-1v-9.6z'/></svg>"); }
.icone--episodios { --desenho: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><rect x='2.5' y='9' width='2.6' height='6' rx='1.3'/><rect x='7' y='5' width='2.6' height='14' rx='1.3'/><rect x='11.5' y='2.5' width='2.6' height='19' rx='1.3'/><rect x='16' y='7' width='2.6' height='10' rx='1.3'/><rect x='20.4' y='10' width='2.4' height='4' rx='1.2'/></svg>"); }
.icone--sobre { --desenho: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill-rule='evenodd' d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm-1.25 8.4h2.5V17h-2.5zM12 6.2a1.55 1.55 0 1 1 0 3.1 1.55 1.55 0 0 1 0-3.1z'/></svg>"); }
.icone--busca { --desenho: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'><circle cx='10.5' cy='10.5' r='6.5'/><path d='m15.5 15.5 5 5'/></svg>"); }
.icone--texto { --desenho: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'><path d='M5 6h14M5 10h14M5 14h14M5 18h8'/></svg>"); }
.icone--copiar { --desenho: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='8' y='8' width='12' height='12' rx='2.5'/><path d='M16 8V5.5A1.5 1.5 0 0 0 14.5 4h-9A1.5 1.5 0 0 0 4 5.5v9A1.5 1.5 0 0 0 5.5 16H8'/></svg>"); }
.icone--feed { --desenho: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='6' cy='18' r='2.3'/><path d='M4 10.5a9.5 9.5 0 0 1 9.5 9.5h-2.6A6.9 6.9 0 0 0 4 13.1z'/><path d='M4 4a16 16 0 0 1 16 16h-2.6A13.4 13.4 0 0 0 4 6.6z'/></svg>"); }
.icone--mais { --desenho: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'><path d='M12 5v14M5 12h14'/></svg>"); }
.icone--carta { --desenho: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='14' rx='2.5'/><path d='m4 7 8 6 8-6'/></svg>"); }
.icone--externo { --desenho: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M14 4h6v6M20 4l-9 9M18 14v4.5a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 4 18.5v-11A1.5 1.5 0 0 1 5.5 6H10'/></svg>"); }
.icone--seta { --desenho: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h14m-5-5 5 5-5 5'/></svg>"); }

/* ================================================================ botões e links */

.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--linha);
  border-radius: 999px;
  background: var(--cartao-alto);
  color: var(--texto);
  font: 700 15px/1.2 var(--letra-texto);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--rapido), border-color var(--rapido), transform var(--rapido);
}
.botao:hover { background: #283043; border-color: rgba(255, 255, 255, 0.2); }
.botao:active { transform: scale(0.97); }
.botao--claro { border-color: transparent; background: var(--creme); color: var(--tinta-escura); }
.botao--claro:hover { background: #fffaf0; }
.botao--pequeno { min-height: 38px; padding: 7px 14px; font-size: 14px; }

.link-limpo { text-decoration: none; }
.link-limpo:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

.link-seta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--texto);
  font-weight: 700;
  text-decoration: none;
}
.link-seta::after {
  content: "";
  width: 1.1em;
  height: 1.1em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h14m-5-5 5 5-5 5'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h14m-5-5 5 5-5 5'/></svg>") center / contain no-repeat;
  transition: translate var(--rapido);
}
.link-seta:hover::after { translate: 3px 0; }
.link-seta:hover { color: var(--cor); }

.sobretitulo {
  color: var(--texto-fraco);
  font: 700 12.5px/1.35 var(--letra-texto);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ================================================================ a casca: no telefone, marca em cima e navegação embaixo */

.casca {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 8px;
}

.marca {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  text-decoration: none;
}

/* O sinal: o ponto vermelho do "no ar" e duas ondas saindo dele. */
.marca__sinal {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background:
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 38 38'><circle cx='12' cy='26' r='3.6' fill='%23ff5a4e'/><path d='M12 17a9 9 0 0 1 9 9' fill='none' stroke='%23f3eee4' stroke-width='2.8' stroke-linecap='round'/><path d='M12 9.5A16.5 16.5 0 0 1 28.5 26' fill='none' stroke='%23f3eee4' stroke-width='2.8' stroke-linecap='round' opacity='.55'/></svg>") center / 100% no-repeat,
    linear-gradient(145deg, #262c3e, #11141d);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.marca__texto { display: grid; min-width: 0; }
.marca__nome { font: 800 18px/1.1 var(--letra-titulo); letter-spacing: -0.02em; }
.marca__ritmo {
  overflow: hidden;
  color: var(--texto-fraco);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Telefone: a navegação é a barra de baixo, com os três destinos à vista. */
.navegacao {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--linha);
  background: rgba(12, 14, 20, 0.94);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.navegacao__link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px 4px;
  border-radius: 14px;
  color: var(--texto-fraco);
  font: 700 12.5px/1.2 var(--letra-texto);
  text-decoration: none;
}
.navegacao__link .icone { position: relative; z-index: 1; width: 23px; height: 23px; }
.navegacao__link::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 50%;
  width: 58px;
  height: 30px;
  border-radius: 999px;
  translate: -50% 0;
  background: transparent;
  transition: background-color var(--rapido);
}
.navegacao__link[aria-current="page"] { color: var(--texto); }
.navegacao__link[aria-current="page"]::before { background: rgba(255, 255, 255, 0.12); }
.navegacao__link[aria-current="page"] .icone { color: var(--creme); }

.casca__temas,
.casca__feed { display: none; }

/* No início do telefone a capa do programa já mostra o nome e o ritmo logo abaixo: a marca do alto sairia repetida. */
body[data-pagina="inicio"] .marca { display: none; }
body[data-pagina="inicio"] .casca { padding: 0; }

.casca__rotulo {
  margin: 0 0 8px;
  padding: 0 12px;
  color: var(--texto-fraco);
  font: 700 12px/1.3 var(--letra-texto);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.temas-lado { display: grid; gap: 2px; }
.temas-lado__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--texto);
  font-size: 15px;
  text-decoration: none;
  transition: background-color var(--rapido);
}
.temas-lado__link:hover { background: var(--cartao); }
.temas-lado__cor {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--cor);
  box-shadow: 0 0 12px color-mix(in oklab, var(--cor) 55%, transparent);
}
.temas-lado__nome { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ================================================================ rodapé */

.rodape {
  display: grid;
  gap: 14px;
  margin: 40px 16px 0;
  padding: 22px 0 26px;
  border-top: 1px solid var(--linha);
  color: var(--texto-fraco);
  font-size: 14px;
}
.rodape__marca { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.rodape__marca strong { color: var(--texto); font: 800 16px/1.2 var(--letra-titulo); }
.rodape__ouvir { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.rodape__titulo {
  font: 700 12px/1.3 var(--letra-texto);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.rodape__plataformas { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.rodape__plataformas a { color: var(--texto); text-decoration: none; }
.rodape__plataformas a:hover { text-decoration: underline; text-underline-offset: 3px; }
.rodape__aviso { font-size: 13.5px; }
.rodape__marca > span { display: none; }

/* ================================================================ menos movimento: tudo quase instantâneo */

@media (prefers-reduced-motion: reduce) {
  :root { --rapido: 0.01ms; --medio: 0.01ms; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ================================================================ computador: a casca vira a barra lateral de um app */

@media (min-width: 900px) {
  /* A coluna da barra lateral é pintada no fundo da página: vai até o fim, por mais longa que a página seja. */
  body {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    padding-bottom: 0;
    background: linear-gradient(to right, var(--fundo-lado) 251px, var(--linha) 251px 252px, var(--fundo) 252px);
  }

  .casca {
    position: sticky;
    top: 0;
    grid-row: 1 / 3;
    grid-column: 1;
    align-self: start;
    flex-direction: column;
    align-items: stretch;
    gap: 26px;
    height: 100vh;
    padding: 24px 14px 20px;
    overflow-y: auto;
  }

  .marca,
  body[data-pagina="inicio"] .marca { display: inline-flex; padding: 0 6px; }
  body[data-pagina="inicio"] .casca { padding: 24px 14px 20px; }

  .navegacao {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0;
    border: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .navegacao__link {
    flex-direction: row;
    gap: 14px;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 15.5px;
    transition: background-color var(--rapido), color var(--rapido);
  }
  .navegacao__link::before { display: none; }
  .navegacao__link .icone { width: 22px; height: 22px; }
  .navegacao__link:hover { background: var(--cartao); color: var(--texto); }
  .navegacao__link[aria-current="page"] {
    background: var(--cartao-alto);
    box-shadow: inset 3px 0 0 var(--no-ar);
  }

  .casca__temas { display: block; }
  .casca__feed { display: grid; gap: 4px; justify-items: start; margin-top: auto; padding: 0 2px; }
  .casca__feed .casca__rotulo { padding: 0 10px; }

  /* align-content: com pouca coisa na página (a busca achou um só), as linhas não esticam pra encher a tela. */
  main { grid-column: 2; min-width: 0; align-content: start; }

  .rodape {
    grid-column: 2;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px 32px;
    margin: 32px 40px 0;
  }
  .rodape__aviso { grid-column: 1 / -1; }
  .rodape__marca { display: grid; }
  .rodape__marca > span { display: inline; }
}
