/*
  SQNZN — Base
  Reset, tipografia base, foco, seleção, reduced motion.
*/

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

* {
  margin: 0;
  padding: 0;
}

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-200);
  line-height: var(--lh-base);
  color: var(--ink-950);
  background: var(--paper-50);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100svh;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  font-weight: 600;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
}

/* Seleção */
::selection {
  background: var(--ink-950);
  color: var(--paper-50);
}

/* Foco — visível sempre, nunca removido */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Utilitário de acessibilidade */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100%;
  left: var(--sp-4);
  z-index: 1000;
  background: var(--ink-950);
  color: var(--paper-50);
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--fs-100);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: top var(--dur-fast) var(--ease-editorial);
}

.skip-link:focus {
  top: var(--sp-4);
}

/* Textura sutil — remove a sensação "excessivamente digital" (ver motion-system.md, efeito 9) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 180px;
}

/* Reduced motion — desliga animação programática e suaviza transições */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
