/* ============ Tokens ============ */
:root {
  --bg: #0B0C0E;
  --panel: #141518;
  --panel-2: #17181B;
  --line: #2A2C31;
  --line-soft: rgba(255, 255, 255, 0.06);
  --text: #ECECEA;
  --text-muted: #9A9DA3;
  --red: #E4262B;
  --red-dim: #7A1518;
  --steel: #B8BCC2;
  --steel-dim: #6B6F76;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --container: 1120px;
  --gutter: 32px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--text);
  margin: 0 0 .5em;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
  color: var(--text-muted);
  max-width: 62ch;
}

a {
  color: inherit;
  text-decoration: none;
}

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

code {
  font-family: var(--font-mono);
  font-size: .9em;
  color: var(--steel);
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* faint blueprint grid across the whole page */
.grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

main,
header,
footer {
  position: relative;
  z-index: 1;
}

/* ============ Layout helpers ============ */
.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: 96px var(--gutter);
  border-top: 1px solid var(--line-soft);
}

.section-head {
  margin-bottom: 40px;
  max-width: 640px;
}

.section-note {
  font-size: .95rem;
}

/* ============ Topbar ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 18px var(--gutter);
  background: rgba(11, 12, 14, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}

.brand-mark {
  height: 32px;
  width: auto;
}

.nav {
  display: flex;
  gap: 28px;
  margin-right: auto;
}

.nav a {
  color: var(--text-muted);
  font-size: .95rem;
}

.nav a:hover {
  color: var(--text);
}

.nav-cta {
  font-size: .9rem;
}

.nav-toggle {
  display: none;
}

@media (max-width: 760px) {
  .nav {
    display: none;
  }

  .nav--open {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line-soft);
    padding: 8px var(--gutter) 16px;
  }

  .nav--open a {
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .nav-cta {
    display: none;
  }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
  }

  .nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text);
    display: block;
  }
}

/* ============ Hero ============ */
.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: 72px var(--gutter) 96px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.kicker {
  font-family: var(--font-mono);
  color: var(--red);
  font-size: .85rem;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  max-width: 14ch;
}

.hero-lede {
  font-size: 1.05rem;
  max-width: 48ch;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin: 28px 0 44px;
  flex-wrap: wrap;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 28px;
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  max-width: 560px;
}

.hero-stats dt {
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.hero-stats dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--steel);
}

.hero-diagram {
  justify-self: center;
  width: 100%;
  max-width: 360px;
}

.pulse-dot {
  animation: pulse 2.4s ease-in-out infinite;
  transform-origin: 80px 90px;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .25;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-diagram {
    max-width: 280px;
  }
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 24px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: .95rem;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--red);
  color: #fff;
}

.btn-primary:hover {
  background: #c81f24;
}

.btn-outline {
  border-color: var(--line);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--steel);
}

.btn-ghost {
  color: var(--text-muted);
  border-color: var(--line);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--steel);
}

/* ============ Servicos ============ */
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}

.service-card {
  background: var(--bg);
  padding: 28px 26px;
}

.service-card h3 {
  font-size: 1.05rem;
  margin-bottom: .5em;
}

.service-card p {
  font-size: .92rem;
  margin: 0;
}

@media (max-width: 900px) {
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .service-grid {
    grid-template-columns: 1fr;
  }
}

/* ============ Sobre ============ */
.sobre-body {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 48px;
}

.skills-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.skills-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.skills-list span {
  font-family: var(--font-mono);
  color: var(--text);
  font-size: .95rem;
}

.skills-list small {
  color: var(--text-muted);
  font-size: .85rem;
}

@media (max-width: 800px) {
  .sobre-body {
    grid-template-columns: 1fr;
  }
}

.sobre-autor{
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line-soft);
  max-width: 72ch;
}
.sobre-autor h3{ font-size: 1.1rem; }
.sobre-autor p{ font-size: .95rem; }
.sobre-autor-meta{
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--steel);
  margin: 0;
}

/* ============ Projetos ============ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.project-card {
  border: 1px solid var(--line);
  background: var(--panel);
  position: relative;
}

.project-card::before,
.project-card::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--red);
  border-style: solid;
  border-width: 0;
}

.project-card::before {
  top: -1px;
  left: -1px;
  border-top-width: 2px;
  border-left-width: 2px;
}

.project-card::after {
  bottom: -1px;
  right: -1px;
  border-bottom-width: 2px;
  border-right-width: 2px;
}

.project-media {
  aspect-ratio: 16/10;
  background: var(--panel-2);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.project-media img,
.project-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 20px;
  background: var(--panel-2);
}

.project-media--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: .9rem;
}

.project-body {
  padding: 22px 24px 26px;
}

.project-body h3 {
  font-size: 1.15rem;
  margin-bottom: .4em;
}

.project-body p {
  font-size: .95rem;
  margin-bottom: 16px;
}

.tag-list {
  list-style: none;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

.tag-list li {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--steel);
  border: 1px solid var(--line);
  padding: 4px 9px;
}

.project-card--placeholder {
  border-style: dashed;
  opacity: .7;
}

@media (max-width: 760px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
}

/* Variante para screenshots de celular (retrato) */
.project-media--phone {
  aspect-ratio: 16/10;
  /* mantém a mesma altura de card que os outros */
  background: var(--panel-2);
  display: flex;
  align-items: flex-start;
  /* alinha o topo do print, onde está o conteúdo real */
  justify-content: center;
}

.project-media--phone img,
.project-media--phone .gallery-track img {
  width: auto;
  height: 100%;
  object-fit: contain;
}

/* ============ Contato ============ */
.contact-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 700px;
}

.contact-card {
  border: 1px solid var(--line);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .15s ease, transform .15s ease;
}

.contact-card:hover {
  border-color: var(--red);
  transform: translateY(-2px);
}

.contact-label {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--red);
}

.contact-value {
  font-size: 1.05rem;
}

@media (max-width: 620px) {
  .contact-actions {
    grid-template-columns: 1fr;
  }
}

/* ============ Formulário de orçamento ============ */
.quote-form {
  display: grid;
  gap: 20px;
  max-width: 640px;
  margin-bottom: 56px;
}

.hidden-field {
  display: none;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field label {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--text);
}

.form-field input,
.form-field textarea,
.form-field select {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: .95rem;
  border-radius: 2px;
  width: 100%;
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--text-muted);
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--red);
}

.form-field select {
  appearance: none;
  cursor: pointer;
}

.form-field input[type="file"] {
  padding: 10px 14px;
  cursor: pointer;
}

.form-field small {
  color: var(--text-muted);
  font-size: .8rem;
}

.quote-form .btn {
  justify-self: start;
}

/* ============ Footer ============ */
.footer {
  max-width: var(--container);
  margin: 0 auto;
  padding: 40px var(--gutter) 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

.footer-cnpj{
  margin: 0;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--text-muted);
}

.footer-mark {
  height: 22px;
  opacity: .8;
}

.footer p {
  margin: 0;
  font-size: .85rem;
}

/* ============ Lang toggle ============ */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .7rem;
}

.lang-toggle button {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: .03em;
  transition: background .15s ease, color .15s ease;
}

.lang-toggle button.is-active {
  background: var(--red);
  color: #fff;
}

.lang-toggle button:not(.is-active):hover {
  color: var(--text);
}

/* ============ Project image gallery ============ */
.project-media[data-gallery] {
  position: relative;
}

.project-media[data-gallery] .gallery-track img {
  display: none;
}

.project-media[data-gallery] .gallery-track img.is-active {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 20px;
}

.project-media[data-gallery] .gallery-track {
  width: 100%;
  height: 100%;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-soft);
  background: rgba(11, 12, 14, .55);
  color: var(--text);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1;
  transition: background .15s ease, border-color .15s ease;
}

.gallery-nav:hover {
  background: var(--red);
  border-color: var(--red);
}

.gallery-prev {
  left: 10px;
}

.gallery-next {
  right: 10px;
}

.gallery-dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.gallery-dots button {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid rgba(236, 236, 234, .6);
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.gallery-dots button.is-active {
  background: var(--red);
  border-color: var(--red);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(11, 12, 14, .92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--line);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
}

.lightbox-close:hover {
  background: var(--red);
  border-color: var(--red);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  background: rgba(11, 12, 14, .6);
  color: var(--text);
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.lightbox-nav:hover {
  background: var(--red);
  border-color: var(--red);
}

.lightbox-prev {
  left: 24px;
}

.lightbox-next {
  right: 24px;
}

/* deixa claro que a imagem do card é clicável */
.project-media img {
  cursor: zoom-in;
}

@media (max-width: 620px) {
  .lightbox {
    padding: 16px;
  }

  .lightbox-nav {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
}