/* Base compartilhada: fontes, tokens de tema, reset, botões, nav, seções, rodapé e reveal. */

@font-face { font-family: "Geist"; src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2-variations"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono-latin-wght-normal.woff2") format("woff2-variations"); font-weight: 100 900; font-display: swap; }

/* =========================================================================
   DESIGN TOKENS  -  monocromático: o acento é a própria cor do texto, dual-mode via semantic vars
   Cantos: cards 8px, botões 8px, pequenos 6px
   ========================================================================= */
:root {
  --font-display: "Geist", system-ui, sans-serif;
  --font-body: "Geist", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;

  --r-card: 8px;
  --r-sm: 6px;
  --r-pill: 8px;

  --maxw: 1240px;
  --nav-h: 68px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="dark"] {
  --bg: #0a0a0b;
  --bg-elev: #131316;
  --bg-elev-2: #1a1a1f;
  --text: #f4f4f2;
  --text-muted: #a2a2a8;
  --text-faint: #6e6e75;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --accent: #f4f4f2; --accent-ink: #0a0a0b; --accent-text: #f4f4f2; --spot: rgba(255,255,255,0.07); --glow: rgba(255,255,255,0.10); --sheen: rgba(0,0,0,0.12); --deck-shadow: rgba(0,0,0,0.75);
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --logo-color: cfcfd4;       /* simpleicons hex (no #) for tech marquee */
  --grid-line: rgba(255, 255, 255, 0.045);
  --scrim: rgba(10, 10, 11, 0.72);
  /* chrome / metal (neutral material, does not count as the color accent) */
  --chrome: linear-gradient(115deg, #6a6a72 0%, #e9e9ee 24%, #ffffff 40%, #b5b5be 54%, #f2f2f6 70%, #7a7a82 100%);
  --chrome-fallback: #d8d8de;
}

html[data-theme="light"] {
  --bg: #f4f4f5;
  --bg-elev: #ffffff;
  --bg-elev-2: #e9e9ec;
  --text: #101012;
  --text-muted: #52525b;
  --text-faint: #85858e;
  --border: rgba(0, 0, 0, 0.10);
  --border-strong: rgba(0, 0, 0, 0.18);
  --accent: #101012; --accent-ink: #f4f4f5; --accent-text: #101012; --spot: rgba(0,0,0,0.05); --glow: rgba(0,0,0,0.07); --sheen: rgba(255,255,255,0.25); --deck-shadow: rgba(30,30,40,0.30);
  --shadow: 0 24px 60px -24px rgba(20, 20, 25, 0.28);
  --logo-color: 3a3a42;
  --grid-line: rgba(0, 0, 0, 0.05);
  --scrim: rgba(244, 244, 245, 0.72);
  --chrome: linear-gradient(115deg, #4a4a52 0%, #9a9aa4 22%, #d0d0d8 38%, #7c7c86 54%, #b8b8c2 70%, #52525a 100%);
  --chrome-fallback: #6a6a74;
}

/* =========================================================================
   BASE
   ========================================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 18px; } }

section { position: relative; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.02; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.muted { color: var(--text-muted); }
.measure { max-width: 60ch; }

/* Fixed grain / vignette overlay (pointer-events none, non-scrolling) */
.grain {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  opacity: 0.5; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
}


/* =========================================================================
   BUTTONS  (pill, tactile)
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: var(--r-pill);
  font-family: var(--font-display); font-weight: 500; font-size: 15px;
  white-space: nowrap; line-height: 1;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.btn svg { width: 18px; height: 18px; position: relative; z-index: 1; }
.btn-primary { background: var(--accent); color: var(--accent-ink); position: relative; overflow: hidden; }
.btn-primary > .lbl, .btn-primary > svg { position: relative; z-index: 1; }
/* chrome sheen sweep on hover */
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: -140%; width: 60%; height: 100%; z-index: 0;
  background: linear-gradient(105deg, transparent, var(--sheen), transparent);
  transform: skewX(-18deg); transition: left 0.6s var(--ease);
}
.btn-primary:hover::after { left: 160%; }
.btn-primary:hover { transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-ghost { border: 1px solid var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent-text); transform: translateY(-2px); }
.btn-ghost:active { transform: translateY(0) scale(0.98); }
@media (prefers-reduced-motion: reduce) { .btn-primary::after { display: none; } }

/* scroll progress bar (native scroll-driven, no JS listener) */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 70;
  background: var(--accent); transform: scaleX(0); transform-origin: 0 50%;
}
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .progress { animation: progress-grow linear both; animation-timeline: scroll(root); }
    @keyframes progress-grow { to { transform: scaleX(1); } }
  }
}


/* =========================================================================
   NAV  (single line desktop, <=68px)
   ========================================================================= */
header.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: var(--scrim);
  border-bottom: 1px solid var(--border);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 15px; font-weight: 700;
}
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { font-size: 15px; color: var(--text-muted); transition: color 0.2s var(--ease); position: relative; }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 14px; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: var(--r-pill); display: grid; place-items: center;
  border: 1px solid var(--border); color: var(--text-muted);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.theme-toggle svg { width: 18px; height: 18px; }
html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="light"] .icon-moon { display: block; }

.hamburger { display: none; width: 38px; height: 38px; border-radius: var(--r-pill); place-items: center; border: 1px solid var(--border); color: var(--text); }
.hamburger svg { width: 20px; height: 20px; }

.mobile-panel {
  position: fixed; inset: var(--nav-h) 0 auto 0; z-index: 49;
  background: var(--bg); border-bottom: 1px solid var(--border);
  transform: translateY(-120%); transition: transform 0.4s var(--ease);
  padding: 12px 0 20px;
}
.mobile-panel.open { transform: translateY(0); }
.mobile-panel a { display: block; padding: 14px 24px; font-family: var(--font-display); font-size: 20px; color: var(--text); border-bottom: 1px solid var(--border); }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-actions .btn { display: none; }
  .hamburger { display: grid; }
}


/* =========================================================================
   SECTION HEADS
   ========================================================================= */
.sec { padding: 96px 0; }
@media (max-width: 640px) { .sec { padding: 76px 0; } }
.sec-head { max-width: 62ch; margin-bottom: 36px; }
.sec-head h2 { font-size: clamp(2rem, 4vw, 3.1rem); }
.sec-head p { color: var(--text-muted); margin-top: 16px; font-size: 1.05rem; }
.sec-head.row { display: flex; align-items: flex-start; gap: 10px; max-width: none; }
.sec-head .count { font-family: var(--font-mono); font-size: 14px; color: var(--text-faint); margin-top: 4px; }


/* =========================================================================
   FOOTER
   ========================================================================= */
footer { border-top: 1px solid var(--border); padding: 40px 0; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot .l { color: var(--text-faint); font-size: 0.9rem; font-family: var(--font-mono); }
.foot .r { display: flex; align-items: center; gap: 26px; }
.foot .r a { color: var(--text-muted); font-size: 0.9rem; transition: color 0.2s var(--ease); }
.foot .r a:hover { color: var(--text); }

/* =========================================================================
   SCROLL REVEAL  (IntersectionObserver toggles .reveal-in)
   ========================================================================= */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.reveal-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee-track, .status .dot { animation: none !important; }
}
