/* MHLR — implementação própria; estética minimalista preto-no-branco */

:root {
  --paper: #ffffff;
  --ink: #111111;
  --ink-strong: #000000;   /* titulos: mais peso que o corpo */
  --muted: #555555;
  --line: #e2e2e2;
  --serif: "Iowan Old Style", Baskerville, "Times New Roman", Times, serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --gutter: 1.5rem;   /* largura da coluna da linha-guia */
  --col-gap: 1.5rem;  /* respiro entre a linha-guia e o texto */
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: var(--ink);
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.8125rem;
  padding: 0.75rem 1rem;
  z-index: 10;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--ink);
}

.header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.brand {
  font-family: var(--mono);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-decoration: none;
}

/* Marca dentro de texto corrido: mesmo desenho de .brand, tamanho relativo ao texto */
.wordmark {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 0.92em;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  font-family: var(--mono);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
}

/* ---------- Hero ---------- */

.hero {
  border-bottom: 1px solid var(--line);
}

.hero .container {
  padding-top: 4rem;
  padding-bottom: 3.5rem;
}

.kicker {
  font-family: var(--mono);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink-strong);
  font-size: clamp(2.4rem, 7.5vw, 3.75rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin-bottom: 1.75rem;
}

.lede {
  font-size: 1.1875rem;
  color: var(--muted);
  max-width: 36rem;
}

/* ---------- Seções ---------- */

.section {
  border-bottom: 1px solid var(--line);
}

.section .container {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.section-label {
  font-family: var(--mono);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 1.25rem;
  position: relative;
}

.section h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink-strong);
  text-wrap: balance;
  margin-bottom: 1.5rem;
}

.section p + p {
  margin-top: 1rem;
}

.section p {
  max-width: 36rem;
}

/* ---------- Linha-guia vertical ---------- */

.hero .container,
.section .container {
  position: relative;
}


.spine {
  display: none;
}

.spine::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

/* nó sobre a linha, alinhado ao rótulo da seção */
.spine::after {
  content: "";
  position: absolute;
  left: -3px;
  top: 4.67rem;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--ink);
}

.spine--start::before {
  background: linear-gradient(to bottom, transparent, var(--line) 45%);
}

.spine--start::after {
  display: none;
}

#contato .spine::before {
  background: linear-gradient(to bottom, var(--line) 62%, transparent);
}

/* ---------- Figuras 3D ---------- */

.figure {
  color: var(--ink);
}

.figure canvas {
  display: block;
  aspect-ratio: 1 / 1;
}

/* o conteudo sempre por cima da camada de fundo */
.hero-text,
.section-main,
.projects {
  position: relative;
  z-index: 1;
}

/* No mobile os solidos viram camada de fundo atras do texto. */
@media (max-width: 780px) {
  .figure {
    position: absolute;
    inset: 0;
    overflow: hidden;    /* recorta o sangramento sem afetar o texto */
    pointer-events: none;
    z-index: 0;
    opacity: 0.17;
  }

  .figure canvas {
    position: absolute;
  }

  /* cada solido em um ponto diferente da sua secao */
  .figure-hero canvas { width: 70%; right: -12%; top: 26%; }
  #produtos .figure canvas { width: 56%; right: -10%; top: 4%; }
  #contato .figure canvas { width: 66%; right: -16%; bottom: 4%; }
}

/* ---------- Retrato ---------- */

.portrait {
  position: relative;
  z-index: 1;
  margin-top: 2.5rem;
  max-width: 15rem;
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 20%;   /* privilegia o rosto no recorte 4:5 */
}

.portrait figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portrait-name {
  color: var(--ink);
}

.portrait-role {
  color: var(--muted);
}

/* No mobile a foto sangra ate as bordas da tela; a legenda fica fora
   dela, alinhada ao texto. */
@media (max-width: 780px) {
  .portrait {
    max-width: none;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
  }

  /* empilhada: lado a lado os dois textos nao cabem em 390px */
  .portrait figcaption {
    margin-left: 1.5rem;
    margin-right: 1.5rem;
  }
}

/* ---------- Cards de produtos ---------- */

.projects {
  list-style: none;
  margin-top: 2.5rem;
  border-top: 1px solid var(--ink);
}

.project {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 1.5rem 0.25rem;
  border-bottom: 1px solid var(--ink);
  text-decoration: none;
  transition: background 0.15s ease;
}

.project:hover {
  background: #f5f5f5;
}

.project-num {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
  flex-shrink: 0;
}

.project-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.project-name {
  font-family: var(--serif);
  font-size: 1.375rem;
}

.project:hover .project-name {
  text-decoration: underline;
}

.project-desc {
  font-size: 0.9375rem;
  color: var(--muted);
}

.project-arrow {
  font-family: var(--mono);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.project:hover .project-arrow {
  transform: translateX(4px);
}

/* ---------- Contato ---------- */

.contact-list {
  list-style: none;
  margin-top: 1.75rem;
}

.contact-list li + li {
  margin-top: 0.75rem;
}

.contact-list a {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  max-width: 100%;
  gap: 0.625rem;
  font-family: var(--mono);
  font-size: 0.9375rem;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}

.contact-list a:hover {
  background: var(--ink);
  color: var(--paper);
}

/* o e-mail e uma palavra unica longa: precisa poder quebrar em telas estreitas */
.contact-list a > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.contact-list .icon {
  width: 1.05em;
  height: 1.05em;
  flex: none;
}

.contact-arrow {
  transition: transform 0.15s ease;
}

.contact-list a:hover .contact-arrow {
  transform: translateX(3px);
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 2rem 0 3rem;
}

.footer-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

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

.site-footer a:hover {
  text-decoration: underline;
}

/* ---------- Duas colunas + linha-guia (telas largas) ---------- */

@media (min-width: 781px) {
  .hero .container,
  .section .container {
    position: relative;
    display: grid;
    grid-template-columns: var(--gutter) minmax(0, 1fr) minmax(0, 18rem);
    column-gap: var(--col-gap);
    align-items: start;
  }

  .hero .container {
    padding-top: 5rem;
    padding-bottom: 4.5rem;
    align-items: center;
  }

  .section .container {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  .spine {
    display: block;
    grid-column: 1;
    grid-row: 1;
  }

  .hero-text,
  .section-main {
    grid-column: 2;
    grid-row: 1;
  }

  .figure {
    display: flex;
    grid-column: 3;
    grid-row: 1;
    align-self: start;
  }

  .figure canvas {
    width: 100%;
  }

  /* deslocamentos verticais e horizontais distintos por secao */
  .figure-hero {
    align-self: center;
    justify-content: center;
  }

  .portrait {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
    margin-top: 4.3rem;
    max-width: none;
  }

  #produtos .figure {
    margin-top: 0.5rem;
    justify-content: flex-end;
  }

  #contato .figure {
    margin-top: 3.5rem;
    justify-content: center;
  }

  .figure-hero canvas { max-width: 18rem; }
  #produtos .figure canvas { max-width: 10rem; }
  #contato .figure canvas { max-width: 13.5rem; }

  .projects {
    grid-column: 2 / -1;
    grid-row: 2;
    margin-top: 0;
  }

  #produtos .container {
    row-gap: 2rem;
  }

  /* traço horizontal ligando a linha-guia ao rótulo da seção */
  .section-label::before {
    content: "";
    position: absolute;
    top: 50%;
    left: calc(-1 * (var(--gutter) + var(--col-gap)));
    width: calc(var(--gutter) + var(--col-gap));
    height: 1px;
    background: var(--line);
  }
}

/* ---------- Foguete do "Voltar ao topo" ---------- */
/* Unico ponto de cor do site, presente so durante o voo. */

.rocket-stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 60;
}

.rocket-stage[hidden] {
  display: none;
}

.rocket {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 100%);
  transform: translate(-50%, -50%);
  will-change: transform;
}

.rocket-svg {
  display: block;
  filter: drop-shadow(0 0 10px rgba(255, 159, 28, 0.45));
}

.rocket.is-flying {
  animation: rocket-fly 1300ms cubic-bezier(0.5, 0, 0.75, 0.35) forwards;
}

/* sobe ate ultrapassar o topo da viewport */
@keyframes rocket-fly {
  0% {
    transform: translate(-50%, -50%) translateY(26px) scale(0.68);
    opacity: 0;
  }
  9% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%)
               translateY(calc(-1 * (var(--y) + 260px))) scale(1.06);
    opacity: 1;
  }
}

.rocket.is-flying .rocket-svg {
  animation: rocket-wobble 260ms ease-in-out infinite alternate;
}

@keyframes rocket-wobble {
  from { transform: translateX(-2.5px) rotate(-1.8deg); }
  to   { transform: translateX(2.5px) rotate(1.8deg); }
}

/* a chama pulsa a partir da base do bocal */
.rocket-flame {
  transform-origin: 60px 186px;
  animation: rocket-flame 70ms ease-in-out infinite alternate;
}

@keyframes rocket-flame {
  from { transform: scale(0.88, 0.66); opacity: 0.85; }
  to   { transform: scale(1.06, 1.14); opacity: 1; }
}

/* faiscas deixadas no rastro */
.spark {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: rocket-spark ease-out forwards;
}

@keyframes rocket-spark {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 40px)))
               scale(0.2);
  }
}

/* ---------- Responsivo ---------- */

@media (max-width: 600px) {
  .project {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
  }

  .project-body {
    flex-basis: 100%;
    order: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}
