* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #222;
  line-height: 1.6;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  background: #1c1c1c;
  color: #fff;
  padding: 16px 0;
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  row-gap: 12px;
}

.logo {
  color: #fff;
  font-weight: bold;
  font-size: 1.2rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.logo img {
  height: 40px;
  width: auto;
  display: block;
}

.site-header nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 20px;
}

.site-header nav a {
  color: #fff;
  text-decoration: none;
}

.hero {
  background: #1c1c1c;
  color: #fff;
  padding: 80px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero .container {
  position: relative;
  z-index: 1;
}

/* Decorative project sketches that drift in and settle in the empty
   dark margins above/below the hero text (never over the copy). Slots
   --1 through --6 give each new sketch its own resting corner as more
   project drawings are added. */
.floating-sketches {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.floating-sketch {
  position: absolute;
  height: 56px;
  width: auto;
  opacity: 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.floating-sketch--1 {
  top: 10px;
  right: 14px;
  animation:
    sketch-drift-1 17s cubic-bezier(0.34, 0.06, 0.22, 1) 0.6s forwards,
    sketch-bob 6s ease-in-out 17.6s infinite;
}

.floating-sketch--2 {
  top: 10px;
  left: 14px;
  animation:
    sketch-drift-2 18s cubic-bezier(0.34, 0.06, 0.22, 1) 2.4s forwards,
    sketch-bob 6.5s ease-in-out 20.4s infinite;
}

.floating-sketch--3 {
  bottom: 10px;
  right: 14px;
  animation:
    sketch-drift-1 17s cubic-bezier(0.34, 0.06, 0.22, 1) 4.2s forwards,
    sketch-bob 7s ease-in-out 21.2s infinite;
}

.floating-sketch--4 {
  bottom: 10px;
  left: 14px;
  animation:
    sketch-drift-2 18s cubic-bezier(0.34, 0.06, 0.22, 1) 6s forwards,
    sketch-bob 6.2s ease-in-out 24s infinite;
}

.floating-sketch--5 {
  top: 10px;
  left: calc(50% - 28px);
  animation:
    sketch-drift-1 17s cubic-bezier(0.34, 0.06, 0.22, 1) 7.8s forwards,
    sketch-bob 6.8s ease-in-out 24.8s infinite;
}

.floating-sketch--6 {
  bottom: 10px;
  left: calc(50% - 28px);
  animation:
    sketch-drift-2 18s cubic-bezier(0.34, 0.06, 0.22, 1) 9.6s forwards,
    sketch-bob 6.4s ease-in-out 27.6s infinite;
}

@keyframes sketch-drift-1 {
  0% { transform: translate(60px, -50px) rotate(-20deg) scale(0.6); opacity: 0; }
  12% { opacity: 0.85; }
  32% { transform: translate(-26px, 18px) rotate(10deg) scale(0.85); }
  58% { transform: translate(16px, -16px) rotate(-8deg) scale(0.92); }
  80% { transform: translate(-10px, 8px) rotate(4deg) scale(0.97); }
  100% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 0.55; }
}

@keyframes sketch-drift-2 {
  0% { transform: translate(-60px, -50px) rotate(20deg) scale(0.6); opacity: 0; }
  12% { opacity: 0.85; }
  32% { transform: translate(26px, 18px) rotate(-10deg) scale(0.85); }
  58% { transform: translate(-16px, -16px) rotate(8deg) scale(0.92); }
  80% { transform: translate(10px, 8px) rotate(-4deg) scale(0.97); }
  100% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 0.55; }
}

@keyframes sketch-bob {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  50% { transform: translate(0, -6px) rotate(1deg) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .floating-sketch {
    animation: none;
    opacity: 0.55;
    transform: none;
  }
}

.hero-logo {
  max-width: 260px;
  width: 60%;
  height: auto;
  margin: 0 auto 32px;
}

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 16px;
}

.hero p {
  margin-bottom: 24px;
  font-size: 1.1rem;
}

@media (max-width: 480px) {
  .site-header .container {
    flex-direction: column;
  }

  .hero h1 {
    font-size: 1.7rem;
  }
}

.btn {
  display: inline-block;
  background: #c9a227;
  color: #1c1c1c;
  padding: 12px 28px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
}

.intro {
  padding: 60px 0;
}

.intro h2 {
  margin-top: 32px;
  margin-bottom: 16px;
}

.intro h2:first-child {
  margin-top: 0;
}

.intro p {
  margin-bottom: 16px;
}

.site-footer {
  background: #1c1c1c;
  color: #aaa;
  text-align: center;
  padding: 20px 0;
}

.footer-contact {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin-bottom: 12px;
}

.footer-contact a {
  color: #aaa;
  text-decoration: none;
}

.footer-contact a:hover {
  color: #fff;
  text-decoration: underline;
}

.contact-list {
  list-style: none;
  margin-top: 20px;
}

.contact-list li {
  margin-bottom: 14px;
  font-size: 1.1rem;
}

.contact-list a {
  color: #b91c1c;
  font-weight: bold;
  text-decoration: none;
}

.contact-list a:hover {
  text-decoration: underline;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.service-card {
  background: #f7f7f7;
  border-radius: 8px;
  padding: 24px;
  border-top: 4px solid #b91c1c;
}

.service-card h3 {
  margin-bottom: 8px;
  color: #1a1c4d;
}

.services-cta {
  margin-top: 40px;
  font-size: 1.1rem;
  text-align: center;
}

.services-cta a {
  color: #b91c1c;
  font-weight: bold;
  text-decoration: none;
}

.services-cta a:hover {
  text-decoration: underline;
}

.gallery-note {
  margin-bottom: 24px;
  color: #555;
}

.gallery-note a {
  color: #b91c1c;
  font-weight: bold;
  text-decoration: none;
}

.gallery-note a:hover {
  text-decoration: underline;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: #1a1c4d;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px;
  color: #fff;
  font-weight: bold;
  font-size: 0.9rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
}

.ideas-figure {
  margin: 24px 0;
}

.ideas-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.ideas-figure figcaption {
  text-align: center;
  color: #555;
  font-size: 0.9rem;
  margin-top: 10px;
}

/* Gallery cards that link to a "How we built it" cartoon */
.gallery-link {
  position: relative;
  display: block;
  color: inherit;
  text-decoration: none;
}

.gallery-link::after {
  content: "How we built it \2192";
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #c9a227;
  color: #1c1c1c;
  font-size: 0.75rem;
  font-weight: bold;
}

.gallery-link:hover .gallery-item,
.gallery-link:focus-visible .gallery-item {
  box-shadow: 0 0 0 3px #c9a227;
}

/* "How we built it" comic page */
.comic {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px;
  background: #f3ead2;
  border: 4px solid #14110f;
  box-shadow: 6px 6px 0 #14110f;
}

.panel {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: #fff;
  border: 4px solid #14110f;
  container-type: inline-size;
}

.panel .scene {
  display: block;
  width: 100%;
  height: auto;
}

.panel.tilt .scene {
  transform: rotate(-2.5deg) scale(1.1);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(rgba(20, 17, 15, 0.5) 1px, transparent 1.6px) 0 0 / 6px 6px;
  -webkit-mask-image: linear-gradient(160deg, transparent 55%, #000);
  mask-image: linear-gradient(160deg, transparent 55%, #000);
  opacity: 0.35;
}

.panel.cool::before,
.panel.warm::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.panel.cool::before { background: linear-gradient(180deg, rgba(120, 160, 220, 0.28), transparent 70%); }
.panel.warm::before { background: linear-gradient(180deg, rgba(247, 161, 74, 0.34), transparent 75%); }

.narration {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  max-width: 58%;
  margin: 0;
  padding: 0.35em 0.65em;
  background: #f6d64a;
  border: 0 solid #14110f;
  border-right-width: 3px;
  border-bottom-width: 3px;
  color: #14110f;
  font: 600 clamp(10px, 3.3cqi, 16px) / 1.25 "Trebuchet MS", "Segoe UI", sans-serif;
}

.narration b {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.narration--bottom {
  top: auto;
  bottom: 0;
  border-bottom-width: 0;
  border-top-width: 3px;
}

.bubble {
  position: absolute;
  z-index: 3;
  margin: 0;
  padding: 0.35em 0.7em;
  background: #fff;
  border: 3px solid #14110f;
  border-radius: 16px;
  color: #14110f;
  font: 700 clamp(10px, 3.3cqi, 15px) / 1.2 "Trebuchet MS", "Segoe UI", sans-serif;
  text-align: center;
}

.bubble::before,
.bubble::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
}

.bubble.tail-bl::before,
.bubble.tail-br::before { bottom: -17px; border-width: 17px 0 0 15px; border-color: #14110f transparent; }
.bubble.tail-bl::after,
.bubble.tail-br::after { bottom: -11px; border-width: 12px 0 0 10px; border-color: #fff transparent; }
.bubble.tail-bl::before { left: 14px; }
.bubble.tail-bl::after { left: 16px; }
.bubble.tail-br::before { right: 14px; transform: scaleX(-1); }
.bubble.tail-br::after { right: 16px; transform: scaleX(-1); }

.sfx {
  position: absolute;
  z-index: 3;
  color: #ffdf3d;
  font: 900 clamp(16px, 7.5cqi, 40px) / 1 Impact, "Arial Black", sans-serif;
  letter-spacing: 0.03em;
  -webkit-text-stroke: 5px #14110f;
  paint-order: stroke fill;
  text-shadow: 3px 3px 0 #14110f;
  transform: rotate(var(--r, -6deg));
  pointer-events: none;
}

.panel-photo {
  aspect-ratio: 4 / 5;
}

.panel-photo img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.crew-overlay {
  position: absolute;
  z-index: 2;
  left: 0;
  bottom: 0;
  width: 100%;
  height: auto;
}

.build-cta {
  margin-top: 28px;
  text-align: center;
}

@media (min-width: 760px) {
  .comic {
    grid-template-columns: repeat(12, 1fr);
    gap: 14px;
    padding: 14px;
  }

  .p1 { grid-column: 1 / -1; }
  .p2 { grid-column: 1 / 8; }
  .p3 { grid-column: 8 / 13; }
  .p4 { grid-column: 1 / 8; grid-row: 3; }
  .p5 { grid-column: 1 / 8; grid-row: 4; }
  .p6 { grid-column: 8 / 13; grid-row: 3 / 5; }

  .panel .scene--fill {
    position: absolute;
    inset: 0;
    height: 100%;
  }

  .panel-photo {
    aspect-ratio: auto;
  }

  .panel-photo img {
    object-position: 45% 30%;
  }
}

/* Cartoon crew: each person sets their own colors on the <g> that uses a pose */
.p-rafa   { --skin: #c98f62; --hair: #2b1b12; --shirt: #e2702a; --shirt-dark: #b85a20; --hat: #f2c22e; }
.p-bia    { --skin: #7a4a32; --hair: #1d120d; --shirt: #7d4fa8; --shirt-dark: #61398a; --hat: #ffffff; --bun: visible; }
.p-thiago { --skin: #f0c9a4; --hair: #8a5a2b; --shirt: #2f80c8; --shirt-dark: #2364a0; --hat: #e8672b; --beard: visible; }
.p-marcos { --skin: #4a2c1f; --hair: #111111; --shirt: #e8c53a; --shirt-dark: #c4a324; --hat: #3f9b4f; }
.p-lu     { --skin: #b47a52; --hair: #3b2314; --shirt: #d9485f; --shirt-dark: #b03348; --hat: #ffffff; --curl: visible; }

.skin { fill: var(--skin); }
.shirt { fill: var(--shirt); }
.hat { fill: var(--hat); }
.glove { fill: #d9b24a; stroke: #8a6d1f; stroke-width: 1; }
.s-skin { stroke: var(--skin); }
.s-shirt { stroke: var(--shirt); }
.s-shirt-dark { stroke: var(--shirt-dark); }
.pants, .pants-back { fill: none; stroke-width: 13; stroke-linecap: round; stroke-linejoin: round; }
.pants { stroke: #3a4a6a; }
.pants-back { stroke: #2f3d5a; }
.boot { fill: #4b3426; }

@media (max-width: 759px) {
  .p1 .bubble:nth-of-type(3) { display: none; }
}
