/* ===== Reset e base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth; /* fallback caso JS não carregue */
}

body {
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  background-color: #f9f9f9;
  color: #333;
}

/* ===== Header e navegação ===== */
header {
  background: #111;
  color: #fff;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo img {
  height: 100px;
  width: auto;
}

.logo span {
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffffff;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
  transition: all 0.3s ease;
}

nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}

nav a:hover,
nav a:focus {
  text-decoration: underline;
}

.menu-toggle {
  display: none;
  font-size: 2rem;
  cursor: pointer;
  color: #fff;
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(to right, #0f2027, #203a43, #2c5364);
  color: #fff;
  padding: 5rem 2rem;
  text-align: center;
}

.hero h1 {
  height: 3em;            /* evita salto do layout no typewriter */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#typed {
  display: inline-block;
  min-width: 360px;
  text-align: center;
}

.hero p {
  margin-top: 0.75rem;
  opacity: 0.9;
}

/* ===== Seções ===== */
section {
  padding: 4rem 2rem;
  max-width: 1000px;
  margin: auto;
  scroll-margin-top: 80px; /* compensa header sticky */
}

h2 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* ===== Cards de serviços ===== */
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
  justify-content: center;
  list-style: none;
}

.card {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  flex: 1;
  min-width: 250px;
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
}

/* ===== Portfólio (links diretos) ===== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.item {
  display: block;                 /* garante área clicável inteira */
  background: #eee;
  padding: 2rem;
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;          /* remove sublinhado do <a> */
  color: #111;
  font-weight: 500;
  outline: none;                  /* vamos estilizar o foco manualmente */
}

.item:hover {
  transform: translateY(-2px);
  background: #e3e3e3;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.item:focus {
  box-shadow: 0 0 0 3px #2c5364;  /* foco visível e acessível */
  background: #e8eef2;
}

/* ===== Contato ===== */
.contato-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.contato-links a {
  background: #111;
  color: #fff;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.contato-links a:hover,
.contato-links a:focus {
  background: #222;
  transform: translateY(-2px);
}

/* ===== Footer ===== */
footer {
  background: #111;
  color: #fff;
  text-align: center;
  padding: 1rem;
}

/* ===== Fade-in de performance ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsivo ===== */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    display: none;
    background: #111;
    position: absolute;
    top: 60px;
    right: 0;
    width: 220px;
    padding: 1rem;
    border-radius: 6px;
  }

  nav ul.active {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  .logo img { height: 70px; }
  .logo span { font-size: 1rem; }

  .hero { padding: 4rem 1.5rem; }
  #typed { min-width: 260px; }
}

@media (max-width: 480px) {
  .logo img { height: 55px; }
  .logo span { font-size: 0.9rem; }
  .hero { padding: 3rem 1rem; }
  section { padding: 3rem 1rem; }
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.item {
  text-decoration: none;
  background-color: #1a1a1a;
  padding: 30px;
  border-radius: 10px;
  transition: transform 0.3s ease;
}

.item:hover {
  transform: scale(1.05);
}

.projeto-nome {
  display: block;
  font-family: 'Impact', 'Arial Black', sans-serif;
  font-size: 1.5rem;
  color: #ffffff;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#portfolio .chamada {
  font-size: 0.9em;
  font-weight: normal;
  color: #666;
  margin-left: 8px;
}

#portfolio h2 {
  display: flex;
  align-items: center;
  gap: 6px;
}
