/* ==========================================================================
   PROJETO METAL E BRASA — BASE
   1. Fontes
   2. Tokens (cores, tipografia, raios, sombras, layout)
   3. Reset
   4. Tipografia
   5. Layout (container, seções, cabeçalhos de seção)
   6. Utilitários
   7. Animação de entrada (reveal) + prefers-reduced-motion
   ========================================================================== */

/* 1. Fontes ---------------------------------------------------------------- */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/montserrat-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/montserrat-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/montserrat-latin-800-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/inter-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/inter-latin-600-normal.woff2") format("woff2");
}

/* 2. Tokens ---------------------------------------------------------------- */
:root {
  /* Fundos escuros */
  --bg-darker: #0C0E10;
  --bg-dark: #101214;
  --bg-secondary: #181B1E;
  --graphite: #24282C;

  /* Fundos claros */
  --paper: #F4F1EA;
  --stone: #EAE6DE;
  --white: #FFFFFF;

  /* Texto */
  --text-light: #F4F1EA;
  --text-soft: #D2D4D5;
  --text-muted: rgba(210, 212, 213, 0.7);
  --ink: #101214;
  --ink-soft: #4B4F53;

  /* Destaque (cobre) */
  --accent: #D87532;
  --accent-light: #F29A52;
  --accent-hover: #E2843F;
  --accent-ink: #A3501B;        /* cobre escurecido para texto sobre fundo claro (contraste AA) */
  --accent-tint: rgba(216, 117, 50, 0.12);
  --accent-line: rgba(216, 117, 50, 0.35);

  /* Linhas */
  --line-dark: rgba(255, 255, 255, 0.08);
  --line-dark-strong: rgba(255, 255, 255, 0.14);
  --line-light: rgba(16, 18, 20, 0.09);
  --line-light-strong: rgba(16, 18, 20, 0.16);

  /* Tipografia */
  --font-heading: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Raios */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-card: 18px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2), 0 6px 16px -8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 18px 40px -20px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 40px 80px -32px rgba(0, 0, 0, 0.75);
  --shadow-light: 0 1px 2px rgba(16, 18, 20, 0.04), 0 16px 36px -20px rgba(16, 18, 20, 0.22);
  --shadow-light-lg: 0 2px 4px rgba(16, 18, 20, 0.04), 0 32px 64px -28px rgba(16, 18, 20, 0.35);
  --shadow-accent: 0 14px 32px -14px rgba(216, 117, 50, 0.7);

  /* Layout */
  --container: 1200px;
  --gutter: 20px;
  --section-y: clamp(72px, 9vw, 124px);
  --head-gap: clamp(40px, 5vw, 64px);

  /* Movimento */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.3s;
}

@media (min-width: 768px) {
  :root { --gutter: 32px; }
}

/* 3. Reset ----------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

html,
body {
  overflow-x: hidden; /* fallback */
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-dark);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html.is-locked,
html.is-locked body { overflow: hidden; }

img,
svg,
picture { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; }

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

s { text-decoration-thickness: 1.5px; }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 3px;
}

/* 4. Tipografia ------------------------------------------------------------ */
.h-display {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(30px, 3.4vw + 17px, 58px);
  line-height: 1.07;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.h-section {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(27px, 2.2vw + 18px, 46px);
  line-height: 1.12;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.h-card {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.lead {
  font-size: clamp(16px, 0.35vw + 15px, 19px);
  line-height: 1.65;
  color: var(--text-soft);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-light);
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
}

.hl { color: var(--accent-light); }

/* 5. Layout ---------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: var(--section-y);
  isolation: isolate;
}

.section--dark { background: var(--bg-dark); color: var(--text-light); }
.section--paper { background: var(--paper); color: var(--ink); }
.section--stone { background: var(--stone); color: var(--ink); }

/* Ajustes de cor para seções claras */
.section--paper .eyebrow,
.section--stone .eyebrow,
.section--paper .hl,
.section--stone .hl { color: var(--accent-ink); }
.section--paper .lead,
.section--stone .lead { color: var(--ink-soft); }

.section-head {
  max-width: 760px;
  margin: 0 auto var(--head-gap);
  text-align: center;
}
.section-head .eyebrow { margin-bottom: 18px; }
.section-head .lead { margin-top: 18px; }
.section-head--left { margin-inline: 0; text-align: left; }

/* Grade técnica (linhas finas de desenho técnico) */
.blueprint::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line, rgba(255, 255, 255, 0.035)) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line, rgba(255, 255, 255, 0.035)) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  -webkit-mask-image: var(--grid-mask, radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 80%));
  mask-image: var(--grid-mask, radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 80%));
}

/* 6. Utilitários ----------------------------------------------------------- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus { transform: none; }

.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.only-mobile { display: inline; }
.only-desktop { display: none; }
@media (min-width: 900px) {
  .only-mobile { display: none; }
  .only-desktop { display: inline; }
}

/* 7. Reveal ---------------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s var(--ease) var(--reveal-delay, 0ms),
    transform 0.7s var(--ease) var(--reveal-delay, 0ms);
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
