/* ==========================================================================
   TOKENS
   ========================================================================== */
:root {
  --bg: #0A0D0C;
  --bg-elevated: #121613;
  --line: #232E29;
  --line-soft: #1A211D;
  --text: #EDEAE2;
  --text-muted: #8B9490;
  --text-dim: #5B615D;
  --accent: #E8963C;
  --accent-soft: rgba(232, 150, 60, 0.14);
  --accent-2: #5FB8A8;
  --accent-2-soft: rgba(95, 184, 168, 0.14);

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Manrope", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --max-width: 1180px;
  --gutter: clamp(1.5rem, 5vw, 4rem);

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

/* ==========================================================================
   RESET
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/*
 * !important aqui é proposital: o Elementor injeta CSS global do "Kit"
 * (cores/tipografia padrão dele) que compete com estas mesmas propriedades
 * no <body>, com a mesma especificidade — e às vezes carrega depois do
 * nosso CSS, vencendo por ordem de carregamento. Como esta é uma página
 * isolada (canvas) que não usa nada do Kit do Elementor, forçamos essas
 * poucas propriedades de base a sempre vencerem essa disputa.
 */
body {
  margin: 0 !important;
  background: var(--bg) !important;
  color: var(--text) !important;
  font-family: var(--font-body) !important;
  font-size: 16px !important;
  line-height: 1.6 !important;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

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

/* Focus visibility */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ==========================================================================
   CUSTOM CURSOR (pointer devices only)
   ========================================================================== */
.cursor-dot, .cursor-ring { display: none; }

@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  a, button { cursor: none; }

  .cursor-dot, .cursor-ring {
    display: block;
    position: fixed;
    top: 0; left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 999;
    transform: translate(-50%, -50%);
    will-change: transform;
  }
  .cursor-dot {
    width: 6px; height: 6px;
    background: var(--accent);
  }
  .cursor-ring {
    width: 34px; height: 34px;
    border: 1px solid var(--text-muted);
    transition: width 0.25s var(--ease), height 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
  }
  .cursor-ring.is-hovering {
    width: 54px; height: 54px;
    border-color: var(--accent);
    background: var(--accent-soft);
  }
}

/* ==========================================================================
   LAYOUT HELPERS
   ========================================================================== */
.section {
  padding: clamp(4rem, 10vw, 7rem) var(--gutter);
  border-top: 1px solid var(--line-soft);
}
.section-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
}
.section-head h2 {
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  position: sticky;
  top: 6.5rem;
}
.section-head p {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 32ch;
}
.section-body { min-width: 0; }
.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--text);
  max-width: 62ch;
  margin-bottom: 1.25rem;
}
.section-body p:not(.lede) {
  color: var(--text-muted);
  max-width: 62ch;
  margin-bottom: 1.25rem;
}

@media (max-width: 760px) {
  .section-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .section-head h2 { position: static; }
}

/* ==========================================================================
   HEADER / NAV
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  background: rgba(10, 13, 12, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.1rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}
.logo-dot { color: var(--accent); }

.main-nav { display: flex; gap: 2rem; }
.main-nav a {
  font-size: 0.9rem;
  color: var(--text-muted);
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.2s var(--ease);
}
.main-nav a:hover,
.main-nav a.is-active { color: var(--text); }
.main-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: var(--accent);
}

.header-controls { display: flex; align-items: center; gap: 1.25rem; }
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}
.lang-sep { color: var(--text-dim); }
.lang-btn {
  color: var(--text-dim);
  padding: 0.2rem 0.15rem;
  transition: color 0.2s var(--ease);
}
.lang-btn.is-active { color: var(--accent); }
.lang-btn:hover { color: var(--text); }

.nav-toggle {
  display: none !important;
  flex-direction: column;
  gap: 5px;
  padding: 0.4rem;
}
.nav-toggle span {
  width: 20px; height: 1.5px;
  background: var(--text);
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: flex !important; }
  .main-nav {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: var(--bg-elevated);
    border-left: 1px solid var(--line);
    flex-direction: column;
    justify-content: center;
    gap: 1.75rem;
    padding: 2rem;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
  }
  .main-nav.is-open { transform: translateX(0); }
  .main-nav a { font-size: 1.1rem; }
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 8rem var(--gutter) 4rem;
  overflow: hidden;
}
.hero-network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 720px;
}
.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-bottom: 1.75rem;
  padding: 0.4rem 0.8rem 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: rgba(18, 22, 19, 0.6);
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 3px var(--accent-2-soft);
  flex-shrink: 0;
}
.hero-name {
  font-size: clamp(2.75rem, 8vw, 5.5rem);
  line-height: 0.98;
  margin-bottom: 1.25rem;
}
.hero-line {
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  color: var(--text-muted);
  max-width: 46ch;
  margin-bottom: 2.5rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.85rem 1.6rem;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn-primary {
  background: var(--accent);
  color: #14100A;
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); transform: translateY(-2px); }

.scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: var(--gutter);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.scroll-cue i {
  width: 1px; height: 26px;
  background: linear-gradient(var(--text-dim), transparent);
  display: block;
}

@media (max-width: 560px) {
  .scroll-cue { display: none; }
}

/* ==========================================================================
   ABOUT
   ========================================================================== */
.fact-list {
  margin-top: 2.5rem;
  border-top: 1px solid var(--line-soft);
}
.fact {
  display: grid;
  grid-template-columns: minmax(0, 140px) 1fr;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.fact dt {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.fact dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}
@media (max-width: 560px) {
  .fact { grid-template-columns: 1fr; gap: 0.35rem; }
}

/* ==========================================================================
   STACK
   ========================================================================== */
.stack-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem 3rem;
}
.stack-group h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.chip-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip-list li {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.chip-list li:hover {
  border-color: var(--accent-2);
  color: var(--text);
}
@media (max-width: 620px) {
  .stack-groups { grid-template-columns: 1fr; }
}

/* ==========================================================================
   PROCESS — scroll-scrubbed section
   ========================================================================== */
.process {
  position: relative;
  height: 400vh; /* scroll distance that drives the scrub */
  border-top: 1px solid var(--line-soft);
}
.process-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  overflow: hidden;
  background: var(--bg-elevated);
}
.process-canvas, .process-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.process-video { display: none; } /* shown via JS only if a real video loads */
.process-video.is-active { display: block; }
.process-video.is-active + .process-canvas,
.process-canvas.is-hidden { display: none; }

.process-copy {
  position: relative;
  z-index: 2;
  padding: 0 clamp(1.5rem, 4vw, 4rem);
}
.process-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  margin-bottom: 2.5rem;
}
.process-stage {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1.25rem;
  row-gap: 0.4rem;
  opacity: 0.28;
  transform: translateX(0);
  transition: opacity 0.4s var(--ease);
  padding-bottom: 1.6rem;
}
.process-stage.is-active { opacity: 1; }
.stage-index {
  grid-row: 1 / 3;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  padding-top: 0.2rem;
}
.process-stage h3 { font-size: 1.15rem; }
.process-stage p {
  grid-column: 2;
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 40ch;
}

@media (max-width: 760px) {
  .process { height: 320vh; }
  .process-sticky { grid-template-columns: 1fr; grid-template-rows: 45vh 55vh; }
  .process-copy { padding: 1.5rem clamp(1.25rem, 6vw, 2rem); overflow-y: auto; }
  .process-stage { padding-bottom: 1.1rem; }
}

/* ==========================================================================
   PROJECTS
   ========================================================================== */
.project-list { display: flex; flex-direction: column; }
.project {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 1.5rem;
  padding: 2.25rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.project:first-child { padding-top: 0; }

.project-icon {
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  position: relative;
  flex-shrink: 0;
}
.project-icon::before, .project-icon::after {
  content: "";
  position: absolute;
  border-color: var(--accent-2);
}
/* commerce: overlapping squares */
.project-icon[data-icon="commerce"]::before {
  top: 11px; left: 10px; width: 14px; height: 14px;
  border: 1.4px solid var(--accent-2);
}
.project-icon[data-icon="commerce"]::after {
  bottom: 10px; right: 9px; width: 14px; height: 14px;
  border: 1.4px solid var(--accent);
}
/* iot: node + rings */
.project-icon[data-icon="iot"]::before {
  top: 50%; left: 50%; width: 8px; height: 8px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--accent);
  border: none;
}
.project-icon[data-icon="iot"]::after {
  top: 50%; left: 50%; width: 26px; height: 26px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.4px solid var(--accent-2);
}
/* api: connecting line + dots */
.project-icon[data-icon="api"]::before {
  top: 50%; left: 9px; right: 9px; height: 1.4px;
  background: var(--accent-2);
  border: none;
  transform: translateY(-50%);
}
.project-icon[data-icon="api"]::after {
  top: 50%; right: 8px; width: 8px; height: 8px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--accent);
  border: none;
}
.project-icon[data-icon="soon"] {
  border-style: dashed;
}

.project-content h3 { font-size: 1.2rem; margin-bottom: 0.6rem; }
.project-content > p {
  color: var(--text-muted);
  max-width: 62ch;
  margin-bottom: 0.85rem;
  font-size: 0.96rem;
}
.project-demonstrates {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}
.project-demonstrates strong { color: var(--text-muted); font-weight: 500; }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.tag-list li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-2);
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.project-note {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
}
.project-placeholder .project-content h3 { color: var(--text-muted); }
.project-placeholder .project-content > p {
  font-style: italic;
}

@media (max-width: 560px) {
  .project { grid-template-columns: 40px 1fr; gap: 1rem; }
  .project-icon { width: 36px; height: 36px; }
}

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}
.contact-link {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line-soft);
  transition: gap 0.25s var(--ease);
}
.contact-link:hover { gap: 1.4rem; }
.contact-link:hover .contact-value { color: var(--accent); }
.contact-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  width: 90px;
  flex-shrink: 0;
}
.contact-value {
  font-size: 1.15rem;
  transition: color 0.2s var(--ease);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  display: flex;
  justify-content: space-between;
  padding: 2rem var(--gutter);
  font-size: 0.8rem;
  color: var(--text-dim);
  border-top: 1px solid var(--line-soft);
}
@media (max-width: 480px) {
  .site-footer { flex-direction: column; gap: 0.4rem; }
}
