:root{
  --bg:#f5f5f1;
  --ink:#10100f;
  --muted:#393934;
  --line:rgba(16,16,15,.16);
  --line-soft:rgba(16,16,15,.08);
  --card-size:clamp(138px, min(12.6vw, 27vh), 214px);
  --gap:clamp(18px, 2vw, 34px);
  --font-main:"Avenir Next", "Segoe UI Light", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

*{box-sizing:border-box}
html,body{width:100%;height:100%;margin:0}

body{
  min-width:320px;
  overflow:hidden;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--font-main);
  font-weight:300;
  -webkit-font-smoothing:antialiased;
  text-rendering:geometricPrecision;
}

.loader{
  position:fixed;
  inset:0;
  z-index:20;
  display:grid;
  place-items:center;
  background:var(--bg);
  animation:loaderFade .7s ease 1.35s forwards;
}

.loader img{
  width:min(54vw, 420px);
  max-height:62vh;
  object-fit:contain;
  opacity:0;
  animation:logoIn .55s ease forwards, logoOut .55s ease .85s forwards;
}

@keyframes logoIn{to{opacity:1}}
@keyframes logoOut{to{opacity:0; transform:scale(.985)}}
@keyframes loaderFade{to{opacity:0; visibility:hidden; pointer-events:none}}

.site-shell{
  height:100svh;
  min-height:0;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:clamp(12px, 2vh, 26px);
  padding:clamp(12px, 2.2vh, 25px) clamp(14px, 3.4vw, 66px);
}

.brand{
  flex:0 0 auto;
  text-align:center;
  padding-top:clamp(0px, .8vh, 8px);
}

.brand-logo{
  display:block;
  width:min(22vw, clamp(108px, 15vh, 182px));
  height:auto;
  max-height:23vh;
  object-fit:contain;
  margin:0 auto clamp(8px, 1.2vh, 14px);
}

.brand p{
  margin:0;
  font-size:clamp(12px, 1.12vw, 20px);
  letter-spacing:clamp(.28em, .44vw, .58em);
  font-weight:200;
  color:#191917;
}

.portfolio{
  flex:1 1 auto;
  min-height:0;
  width:100%;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:clamp(8px, 1.35vw, 24px);
}

.projects{
  min-width:0;
  display:flex;
  align-items:flex-start;
  gap:var(--gap);
  overflow-x:auto;
  overflow-y:hidden;
  scroll-behavior:smooth;
  scroll-snap-type:x mandatory;
  scrollbar-width:none;
  padding:8px 2px 12px;
  -webkit-overflow-scrolling:touch;
}

.projects::-webkit-scrollbar{display:none}
.projects.fit{justify-content:center}

.project-card{
  flex:0 0 var(--card-size);
  scroll-snap-align:center;
  display:block;
  text-decoration:none;
  color:var(--ink);
  outline:none;
}

.project-card img{
  display:block;
  width:100%;
  aspect-ratio:1/1;
  object-fit:cover;
  background:#1c1c1b;
  border:1px solid var(--line-soft);
  border-radius:10px;
  transition:transform .22s ease, opacity .22s ease, border-color .22s ease;
}

.project-card span{
  display:block;
  width:100%;
  margin-top:clamp(8px, 1.2vh, 13px);
  text-align:center;
  font-size:clamp(12px, .92vw, 16px);
  line-height:1.24;
  font-weight:300;
  letter-spacing:.015em;
  color:#151513;
  white-space:normal;
}

.project-card:hover img,
.project-card:focus-visible img{
  transform:translateY(-4px);
  opacity:.94;
  border-color:rgba(16,16,15,.22);
}

.project-card:hover span,
.project-card:focus-visible span{color:#000}

.arrow{
  width:clamp(34px, 3.1vw, 46px);
  height:clamp(34px, 3.1vw, 46px);
  border:1px solid var(--line);
  border-radius:999px;
  background:transparent;
  color:var(--ink);
  cursor:pointer;
  font-family:var(--font-main);
  font-weight:200;
  font-size:clamp(24px, 3vw, 36px);
  line-height:1;
  display:grid;
  place-items:center;
  padding:0 0 4px;
  transition:opacity .2s ease, border-color .2s ease;
}

.arrow:hover{border-color:rgba(16,16,15,.36)}
.arrow:disabled{opacity:.22; cursor:default}

.social{
  flex:0 0 auto;
  width:min(100%, 620px);
  margin:0 auto;
  padding-bottom:clamp(4px, 1.25vh, 14px);
}

.social-line{
  width:100%;
  height:1px;
  background:var(--line);
}

.social-icons{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:clamp(22px, 3.2vw, 44px);
  margin-top:clamp(13px, 2.1vh, 20px);
}

.social-icons:empty{display:none}

.social-icons a{
  width:clamp(21px, 2vw, 28px);
  height:clamp(21px, 2vw, 28px);
  display:grid;
  place-items:center;
  color:#111;
  text-decoration:none;
  opacity:.95;
  transition:opacity .2s ease, transform .2s ease;
}

.social-icons a:hover,
.social-icons a:focus-visible{
  opacity:.62;
  transform:translateY(-2px);
}

.social-icons svg{width:100%;height:100%;display:block}

.site-message{
  margin:auto;
  max-width:720px;
  padding:24px;
  border:1px solid var(--line);
  border-radius:10px;
  text-align:center;
  line-height:1.7;
}

/* Página interna do projeto */
body.project-body{
  overflow-y:auto;
}
body.project-body .loader{display:none}
.project-page{
  width:min(920px, calc(100% - 36px));
  margin:0 auto;
  padding:28px 0 80px;
}
.project-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding-bottom:34px;
}
.project-top img{
  width:auto;
  height:68px;
  object-fit:contain;
}
.back-link{
  color:var(--ink);
  text-decoration:none;
  font-weight:300;
}
.project-content h1{
  font-size:clamp(2rem, 4.5vw, 4.3rem);
  font-weight:200;
  letter-spacing:-.02em;
  margin:0 0 30px;
}
.project-hero{
  width:100%;
  max-height:620px;
  object-fit:cover;
  border-radius:12px;
  border:1px solid var(--line);
  margin-bottom:36px;
}
.rich-text{
  font-size:1.08rem;
  line-height:1.8;
  font-weight:300;
}
.rich-text img{max-width:100%;height:auto;border-radius:10px}
.rich-text h2,.rich-text h3{font-weight:300;letter-spacing:.02em;margin-top:2em}
.rich-text a{color:var(--ink);text-decoration:underline;text-underline-offset:3px}
.project-gallery{
  margin-top:40px;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:18px;
}
.project-gallery img{
  width:100%;
  aspect-ratio:1/1;
  object-fit:cover;
  border-radius:10px;
  border:1px solid var(--line);
}
.project-button{
  display:inline-block;
  margin-top:34px;
  color:var(--ink);
  text-decoration:none;
  border:1px solid var(--ink);
  border-radius:999px;
  padding:12px 22px;
  font-weight:300;
}

@media (max-width:900px){
  :root{
    --card-size:clamp(146px, 39vw, 220px);
    --gap:18px;
  }

  .site-shell{
    padding:14px 12px;
    gap:10px;
  }

  .brand-logo{
    width:clamp(96px, 21vh, 146px);
    max-height:21vh;
  }

  .brand p{
    font-size:clamp(11px, 2.5vw, 16px);
    letter-spacing:.28em;
  }

  .portfolio{gap:8px}
  .arrow{width:34px;height:34px;font-size:26px}
  .social{width:min(86vw, 520px)}
}

@media (max-width:560px){
  :root{
    --card-size:clamp(150px, 62vw, 220px);
    --gap:16px;
  }

  .site-shell{
    height:100dvh;
    padding:12px 10px 10px;
  }

  .brand-logo{
    width:clamp(88px, 19vh, 124px);
    max-height:19vh;
    margin-bottom:8px;
  }

  .brand p{
    font-size:11px;
    letter-spacing:.2em;
  }

  .portfolio{
    grid-template-columns:28px minmax(0,1fr) 28px;
    gap:4px;
  }

  .arrow{
    width:28px;
    height:28px;
    font-size:23px;
  }

  .project-card span{
    font-size:13px;
  }

  .social-icons a{width:22px;height:22px}
}

@media (max-height:620px) and (min-width:700px){
  :root{
    --card-size:clamp(118px, min(11.3vw, 25vh), 176px);
    --gap:clamp(16px, 1.8vw, 28px);
  }

  .site-shell{
    gap:8px;
    padding-top:8px;
    padding-bottom:8px;
  }

  .brand-logo{
    width:clamp(82px, 13.5vh, 126px);
    max-height:19vh;
    margin-bottom:6px;
  }

  .brand p{
    font-size:clamp(11px, .95vw, 15px);
    letter-spacing:.34em;
  }

  .project-card span{margin-top:8px;font-size:13px}
  .social-line{margin-bottom:0}
  .social-icons{margin-top:12px}
  .social-icons a{width:22px;height:22px}
}
