/* ===========================================================================
   Base, reset e a atmosfera da sala escura
   =========================================================================== */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--line-strong) transparent;
}

body {
  min-block-size: 100dvh;
  font-family: var(--font-text);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.55;
  color: var(--text);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  /* impede o "pull to refresh" acidental em standalone no meio de uma compra */
  overscroll-behavior-y: contain;
}

img,
picture,
svg,
video {
  display: block;
  max-inline-size: 100%;
}

/* Um <svg> sem regra de tamanho assume o padrão de 300×150 do CSS e destrói a
   linha em que caiu. Como os ícones são inseridos soltos em muitos lugares,
   o tamanho base fica aqui — cada componente que precisa de outro sobrescreve. */
svg {
  inline-size: 1.25rem;
  block-size: 1.25rem;
  flex: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: 0.005em;
  text-wrap: balance;
  text-transform: uppercase;
}

h1 {
  font-size: var(--step-4);
}
h2 {
  font-size: var(--step-3);
}
h3 {
  font-size: var(--step-2);
}
h4 {
  font-size: var(--step-1);
}

p {
  text-wrap: pretty;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: var(--r-1);
}

::selection {
  background: var(--amber);
  color: var(--ink);
}

.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Link para pular direto ao conteúdo — aparece só no teclado */
.skip {
  position: fixed;
  inset-block-start: calc(var(--safe-t) + 0.5rem);
  inset-inline-start: 0.5rem;
  z-index: var(--z-top);
  padding: 0.6rem 1rem;
  background: var(--amber);
  color: var(--ink);
  font-weight: 700;
  border-radius: var(--r-2);
  transform: translateY(-200%);
  transition: transform var(--t-fast) var(--ease-out);
}
.skip:focus-visible {
  transform: none;
}

/* ── Atmosfera: grão de filme + vinheta de projetor ──────────────────────
   Duas camadas fixas, sem custo de layout, com pointer-events desligados.
   O grão é um feTurbulence embutido: nenhuma requisição extra. */
.grain,
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.grain {
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  animation: grain-drift 900ms steps(4) infinite;
}

@keyframes grain-drift {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-2%, 1%);
  }
  50% {
    transform: translate(1%, -2%);
  }
  75% {
    transform: translate(-1%, -1%);
  }
  100% {
    transform: translate(0, 0);
  }
}

.vignette {
  background:
    radial-gradient(120% 80% at 50% -10%, rgb(var(--amber-glow) / 0.07), transparent 55%),
    radial-gradient(100% 100% at 50% 50%, transparent 40%, rgb(0 0 0 / 0.55) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .grain {
    animation: none;
  }
}

/* Em telas grandes o app fica centrado; o entorno vira uma sala escura
   com o cartaz do filme atual esmaecido ao fundo. */
.stage {
  position: relative;
  z-index: 2;
  min-block-size: 100dvh;
  display: grid;
  /* minmax(0, 1fr) e não `auto`: uma trilha `auto` cresce até o max-content do
     .shell (os 30rem do max-inline-size) e estoura a viewport em telas mais
     estreitas que isso — o texto ficava cortado no iPhone. */
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}

.stage::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(80% 60% at 50% 0%, color-mix(in oklab, var(--film) 45%, transparent), transparent 70%);
  transition: background var(--t-slow) var(--ease-out);
  pointer-events: none;
}

.shell {
  inline-size: 100%;
  max-inline-size: var(--shell);
  min-block-size: 100dvh;
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--ink-2), var(--ink) 30%);
  box-shadow: 0 0 0 1px var(--line), 0 40px 120px -40px #000;
}

@media (min-width: 40rem) {
  .shell {
    min-block-size: min(100dvh, 60rem);
    margin-block: clamp(0rem, 4vh, 3rem);
    border-radius: var(--r-4);
    overflow: clip;
  }
}

.view {
  flex: 1;
  padding-block-end: calc(var(--nav-h) + var(--safe-b) + var(--s-4));
}

/* Utilitários enxutos — só o que se repete de verdade */
.pad {
  padding-inline: var(--gutter);
}
.stack > * + * {
  margin-block-start: var(--flow, var(--s-4));
}
.row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}
.grow {
  flex: 1;
  min-inline-size: 0;
}
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.amber {
  color: var(--amber);
}
.dim {
  color: var(--text-2);
}
.faint {
  color: var(--text-3);
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.center {
  text-align: center;
}
.hidden {
  display: none !important;
}

/* ── Transição entre telas ────────────────────────────────────────────────
   Um fade curto, só na troca de rota. Deslizes laterais custam caro em
   telas longas e atrapalham quem volta rápido no funil de compra. */
@view-transition {
  navigation: auto;
}
::view-transition-old(root) {
  animation: sumir 90ms var(--ease-in-out) both;
}
::view-transition-new(root) {
  animation: surgir 180ms var(--ease-out) both;
}
@keyframes sumir {
  to {
    opacity: 0;
  }
}
@keyframes surgir {
  from {
    opacity: 0;
  }
}
