/* ==========================================================================
   base.css — reset + tipografia base + focus states
   ========================================================================== */

@font-face {
  font-family: "Rajdhani";
  src: url("../fonts/rajdhani-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  font-family: var(--font-body);
  line-height: var(--lh-body);
  font-size: 16px;
  background: var(--void);
  color: var(--text-1);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--lh-body);
  color: var(--text-1);
  background-color: var(--void);
  background-image:
    linear-gradient(
      180deg,
      rgba(245, 245, 245, 0) 0%,
      rgba(245, 245, 245, 0) 55%,
      rgba(245, 245, 245, 1) 92%
    ),
    image-set(
      url("../images/background.avif") type("image/avif"),
      url("../images/background.png") type("image/png")
    );
  background-size: 100% 100%, 100% 70vh;
  background-position: top center, top center;
  background-attachment: fixed, fixed;
  background-repeat: no-repeat, no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Mobile: scroll attachment evita repaint pesado em iOS Safari/Android; nuvens menores no topo */
@media (max-width: 768px) {
  body {
    background-attachment: scroll, scroll;
    background-size: 100% 100%, 100% 50vh;
  }
}

/* Headings — Rajdhani, caps, tracking levemente negativo */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--text-1);
  margin: 0 0 var(--space-4);
}
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); font-weight: 500; }
h5 { font-size: var(--text-lg); font-weight: 500; }
h6 { font-size: var(--text-md); font-weight: 500; }

p {
  margin: 0 0 var(--space-4);
  color: var(--text-2);
  max-width: 70ch;
  text-wrap: pretty;
}

small { font-size: var(--text-xs); color: var(--text-3); }
strong, b { font-weight: 500; color: var(--text-1); }
em, i { font-style: italic; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* Lists */
ul, ol { margin: 0 0 var(--space-4); padding-left: var(--space-5); color: var(--text-2); }
ul li, ol li { margin-bottom: var(--space-2); }

/* HR */
hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: var(--space-8) 0;
}

/* Code + pre */
code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}
code {
  padding: 0.15em 0.4em;
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-1);
}
pre {
  padding: var(--space-4);
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  line-height: var(--lh-body);
}
pre code { padding: 0; background: transparent; border: 0; }

/* Images + media */
img, svg, video, canvas { max-width: 100%; display: block; }
img { height: auto; }

/* Forms — reset */
input, button, textarea, select {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; background: none; border: 0; padding: 0; }

/* Focus visible — accent + ring */
:focus { outline: 0; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* Selection */
::selection { background: var(--accent); color: var(--accent-contrast); }

/* Reduced motion */
@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;
  }
}

/* Utility: Mono label (override em components.css mas disponível globalmente) */
.nt-label-mono {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
