:root {
  --color-bg: #0f172a;
  --color-surface: #16213a;
  --color-surface-alt: #1c2b4a;
  --color-border: #2a3b5c;
  --color-primary: #f5a623;
  --color-primary-dark: #d98c12;
  --color-text: #e8ecf4;
  --color-text-muted: #a9b4c9;
  --font-heading: "Segoe UI", Roboto, Arial, sans-serif;
  --font-body: "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 10px;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  --container-width: 1100px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
}

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

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary);
  color: #1a1a1a;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 10px; top: 10px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.96);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  gap: 16px;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
  text-decoration: none;
}

.main-nav {
  display: flex;
  gap: 24px;
}

.main-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.main-nav a:hover,
.main-nav a:focus {
  color: var(--color-primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--color-text);
}

/* Hero */
.hero {
  padding: 64px 0 48px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  margin: 0 0 16px;
}

.hero p {
  max-width: 640px;
  margin: 0 auto;
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

/* Sections */
section { padding: 56px 0; }
section h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  margin-bottom: 28px;
  text-align: center;
}

/* Project cards */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.project-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--color-surface-alt);
}

.project-card-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-card-body h3 {
  font-size: 1.1rem;
  margin: 0 0 8px;
}

.project-card-body p {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  flex: 1;
  margin: 0 0 16px;
}

.btn {
  display: inline-block;
  align-self: flex-start;
  background: var(--color-primary);
  color: #1a1a1a;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.92rem;
}

.btn:hover, .btn:focus { background: var(--color-primary-dark); }

/* About */
.about-block {
  max-width: 720px;
  margin: 0 auto;
  color: var(--color-text-muted);
  text-align: center;
}

.brevemito-callout {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 28px;
  text-align: center;
}

.brevemito-callout p {
  color: var(--color-text-muted);
  margin: 0 0 12px;
}

/* WhatsApp section */
.whatsapp-section {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}

.whatsapp-section h2 { margin-bottom: 10px; }

.whatsapp-section .whatsapp-lead {
  color: var(--color-text-muted);
  max-width: 520px;
  margin: 0 auto 24px;
}

.whatsapp-section a {
  display: block;
  max-width: 480px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* Footer */
.site-footer {
  padding: 36px 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.site-footer a { color: var(--color-primary); text-decoration: none; }

/* Responsive */
@media (max-width: 720px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 16px 20px;
    gap: 14px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: flex; }
  .hero h1 { font-size: 1.7rem; }
}

/* Project page */
.project-page { padding: 40px 0 64px; }

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.project-page h1 { font-family: var(--font-heading); margin-bottom: 6px; }
.project-page .lead { color: var(--color-text-muted); margin-top: 0; }

.project-page section {
  padding: 28px 0;
  border-bottom: 1px solid var(--color-border);
}
.project-page section:last-of-type { border-bottom: none; }

.project-page h2 {
  font-size: 1.25rem;
  text-align: left;
  margin-bottom: 14px;
}

.spec-list, .steps-list {
  padding-left: 20px;
}
.spec-list li, .steps-list li { margin-bottom: 6px; }

.diagram-figure {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}

.diagram-figure figcaption {
  margin-top: 10px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.project-page .brevemito-callout { text-align: left; }
.project-page .brevemito-callout p { margin-bottom: 12px; }

/* Gallery carousel (usado na página Inversão de Marcha) */
.carousel-container {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.carousel-slide { display: none; }
.carousel-slide.active { display: block; }

.carousel-caption {
  padding: 12px;
  background: var(--color-surface);
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.carousel-prev, .carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 18px;
  border-radius: 4px;
}
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }
