:root {
  --bg: #111111;
  --text: #b2b2b2;
  --text-dim: rgba(255, 255, 255, 0.5);
  --pad: 32px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --bounce: cubic-bezier(0.68, -0.6, 0.27, 1.6);
}

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

::selection {
  background: #fff;
  color: var(--bg);
}
::-moz-selection {
  background: #fff;
  color: var(--bg);
}

html, body { height: 100%; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Quantico", ui-monospace, "Segoe UI", sans-serif;
  font-size: 20px;
  line-height: normal;
  letter-spacing: 0.01em;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Ambient background ---------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}

/* soft light rising from the bottom-center, matching the Figma radial */
.glow--base {
  left: 50%;
  bottom: -40%;
  width: 130vw;
  height: 110vh;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
  animation: breathe 9s ease-in-out infinite;
}

/* glow that gently follows the cursor */
.glow--cursor {
  left: 0;
  top: 0;
  width: 640px;
  height: 640px;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0));
  transform: translate3d(-50%, -50%, 0);
  opacity: 0;
  transition: opacity 0.6s var(--ease);
  will-change: transform;
}

.grain {
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  opacity: 0.025;
  mix-blend-mode: screen;
}

@keyframes breathe {
  0%, 100% { opacity: 0.75; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1;    transform: translateX(-50%) scale(1.08); }
}

/* ---------- Layout ---------- */
.screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: var(--pad);
}

/* ---------- 3D particle model ---------- */
.model {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: transparent;
  cursor: grab;
  opacity: 0;
  animation: model-in 1.4s var(--ease) 0.2s forwards;
  touch-action: none;
}
.model:active { cursor: grabbing; }
.model canvas { display: block; }

@keyframes model-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.identity {
  position: absolute;
  top: var(--pad);
  left: var(--pad);
  z-index: 2;
}

.identity__name,
.identity__role {
  color: var(--text);
  white-space: nowrap;
  word-break: break-word;
}

.identity__role { opacity: 0.5; }

/* discrete language switcher, top-right */
.langswitch {
  position: absolute;
  top: var(--pad);
  right: var(--pad);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: opacity 0.4s var(--ease);
}
.langswitch__btn {
  padding: 0;
  border: none;
  background: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: color 0.3s var(--ease);
}
.langswitch__btn:hover { color: var(--text); }
.langswitch__btn.is-active { color: #fff; }
.langswitch__sep { color: var(--text-dim); font-size: 12px; opacity: 0.5; }
/* step aside when the projects view is open, like the other home UI */
body.projects-open .langswitch,
body.pview-open .langswitch { opacity: 0; pointer-events: none; }

.socials {
  position: absolute;
  top: 50%;
  left: var(--pad);
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 44px;
  z-index: 2;
}

.contact {
  position: absolute;
  right: var(--pad);
  bottom: var(--pad);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.contact__email {
  color: var(--text);
  text-decoration: none;
  position: relative;
  transition: color 0.3s var(--ease);
}
.contact__email::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.contact__email:hover { color: #fff; }
.contact__email:hover::after { transform: scaleX(1); transform-origin: left; }

.contact__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.92); /* brighter than the credit below */
  text-decoration: none;
  font-size: 15px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transition: color 0.3s var(--ease);
}
.contact__btn svg { flex-shrink: 0; transition: transform 0.3s var(--ease); }
.contact__btn:hover { color: #fff; }
.contact__btn:hover svg { transform: translateX(3px); }

.contact__credit { color: var(--text-dim); font-size: 12px; letter-spacing: 0.08em; }

/* SVG that only hosts the displacement filter — keep it out of the layout. */
.glass-filter { position: absolute; width: 0; height: 0; pointer-events: none; }

/* ---------- Glass CTA (iOS liquid glass) ---------- */
.cta {
  position: fixed;
  /* centered horizontally, pushed well below center vertically */
  inset: 320px 0 0 0;
  margin: auto;
  z-index: 3;

  width: 210px;
  height: 60px;
  border-radius: 40px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  color: #fff;
  text-decoration: none;
  font-size: 15px;
  letter-spacing: 0.12em;
  white-space: nowrap;
  cursor: pointer;

  /* Figma fill: 10% white, rendered as refractive glass */
  background: rgba(255, 255, 255, 0.1);
  /* Fallback: plain frosted glass everywhere. */
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  backdrop-filter: blur(8px) saturate(180%);
  /* Enhanced: real edge distortion (Chromium). Ignored where url() in
     backdrop-filter is unsupported, leaving the fallback above intact. */
  -webkit-backdrop-filter: url(#liquid-glass) blur(3px) saturate(160%);
  backdrop-filter: url(#liquid-glass) blur(3px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    inset 0 -1px 2px rgba(255, 255, 255, 0.06),
    0 8px 32px rgba(0, 0, 0, 0.35);
  transition:
    transform 0.4s var(--ease),
    background 0.4s var(--ease),
    border-color 0.4s var(--ease),
    box-shadow 0.4s var(--ease);
}

/* top glossy highlight, like the light hitting the glass edge */
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.22),
    rgba(255, 255, 255, 0) 45%
  );
  pointer-events: none;
}

.cta__label { position: relative; z-index: 1; }

.cta:hover {
  transform: scale(1.04);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.45),
    inset 0 -1px 2px rgba(255, 255, 255, 0.08),
    0 12px 40px rgba(0, 0, 0, 0.45);
}

.cta:active {
  transform: scale(0.98);
}

/* the CTA steps aside once the projects view opens */
body.projects-open .cta { opacity: 0; pointer-events: none; }

/* ---------- Category list (left, with the carousel) ---------- */
.categories {
  position: fixed;
  left: var(--pad);
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
}
body.gallery-in .categories { opacity: 1; pointer-events: auto; }

.category {
  position: relative;
  padding: 2px 0 2px 18px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: left;
  cursor: pointer;
  transition: color 0.3s var(--ease);
}
.category::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 10px;
  height: 1px;
  background: currentColor;
  transform: translateY(-50%) scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.category:hover { color: var(--text); }
.category.is-active { color: #fff; }
.category.is-active::before,
.category:hover::before { transform: translateY(-50%) scaleX(1); }

/* the socials step aside so the categories can use the left edge */
.socials { transition: opacity 0.4s var(--ease); }
body.projects-open .socials { opacity: 0; pointer-events: none; }

/* ---------- Hovered-project info panel ---------- */
.project-info {
  position: fixed;
  right: var(--pad);
  top: var(--pad);
  z-index: 6;
  width: min(260px, 34vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: right;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.project-info.is-visible { opacity: 1; transform: none; }

.project-info__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: block;
}
.project-info__title {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
}
.project-info__desc {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.4;
}

/* ---------- Mobile projects gallery (2-column scroll, blurred edges) ---------- */
.mdeck {
  position: fixed;
  inset: 0;
  z-index: 7;
  display: none;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  background: var(--bg);
}
.mdeck.is-open { display: block; }
.mdeck.is-shown { opacity: 1; }

/* decorative dots that scatter out from the center behind the deck */
.mdeck__dots {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.mdeck__scroll {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 13vh 16px;
  scrollbar-width: none;
}
.mdeck__scroll::-webkit-scrollbar { display: none; }

.mdeck__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.mdeck__cell {
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  background: #1c1c1c;
  /* JS tilts each cell in 3D as it nears the top/bottom edge */
  transform-origin: center;
  backface-visibility: hidden;
  will-change: transform;
}
.mdeck__cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* fade the images near the top and bottom edges (gradient only, no
   backdrop-filter: blur + mask together warps into an arc on mobile GPUs) */
.mdeck__fade {
  position: absolute;
  left: 0;
  right: 0;
  height: 32%;
  z-index: 2;
  pointer-events: none;
}
.mdeck__fade--top {
  top: 0;
  background: linear-gradient(to bottom, var(--bg) 18%, rgba(17, 17, 17, 0));
}
.mdeck__fade--bottom {
  bottom: 0;
  background: linear-gradient(to top, var(--bg) 18%, rgba(17, 17, 17, 0));
}

.mdeck__hint {
  position: absolute;
  top: max(var(--pad), env(safe-area-inset-top));
  left: var(--pad);
  z-index: 4;
  pointer-events: none;
}

/* category hamburger (top-right) */
.mdeck__menu-btn {
  position: absolute;
  top: max(var(--pad), env(safe-area-inset-top));
  right: var(--pad);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  cursor: pointer;
  /* same refractive glass as the home CTA */
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: url(#liquid-glass) blur(3px) saturate(160%);
  backdrop-filter: url(#liquid-glass) blur(3px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    inset 0 -1px 2px rgba(255, 255, 255, 0.06),
    0 8px 32px rgba(0, 0, 0, 0.35);
}
/* top glossy highlight, like the light hitting the glass edge */
.mdeck__menu-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 45%);
  pointer-events: none;
}
.mdeck__menu-btn span {
  position: relative;
  z-index: 1;
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.mdeck__menu-btn.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mdeck__menu-btn.is-open span:nth-child(2) { opacity: 0; }
.mdeck__menu-btn.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mdeck__menu {
  position: absolute;
  top: calc(max(var(--pad), env(safe-area-inset-top)) + 52px);
  right: var(--pad);
  z-index: 6;
  display: flex;
  flex-direction: column;
  min-width: 168px;
  padding: 8px;
  border-radius: 16px;
  /* same refractive glass as the home CTA */
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: url(#liquid-glass) blur(4px) saturate(160%);
  backdrop-filter: url(#liquid-glass) blur(4px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.32),
    inset 0 -1px 2px rgba(255, 255, 255, 0.06),
    0 12px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  opacity: 0;
  transform-origin: top right;
  pointer-events: none;
  will-change: opacity;
  transition: opacity 0.2s var(--ease);
}
.mdeck__menu.is-open { opacity: 1; pointer-events: auto; }

/* the bounce lives on this filter-free wrapper, so it stays buttery smooth */
.mdeck__menu-inner {
  display: flex;
  flex-direction: column;
  transform-origin: top right;
  transform: translateY(-10px) scale(0.8);
  will-change: transform;
  transition: transform 0.42s var(--bounce);
}
.mdeck__menu.is-open .mdeck__menu-inner { transform: none; }
/* top glossy highlight on the glass panel */
.mdeck__menu::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 40%);
  pointer-events: none;
}
.mdeck__menu-item {
  position: relative;
  z-index: 1;
  padding: 11px 14px;
  border: none;
  border-radius: 9px;
  background: none;
  color: rgba(255, 255, 255, 0.65);
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.mdeck__menu-item.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
/* current (centered) project title + description, above the Voltar button */
.mdeck__info {
  position: absolute;
  left: 50%;
  bottom: calc(max(20px, env(safe-area-inset-bottom)) + 58px);
  transform: translateX(-50%);
  z-index: 4;
  width: min(88%, 440px);
  text-align: center;
  pointer-events: none;
}
.mdeck__info-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
}
.mdeck__info-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
}

.mdeck__close {
  position: absolute;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  padding: 10px 24px;
  border-radius: 999px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.12em;
  cursor: pointer;
  /* same refractive glass as the home CTA */
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: url(#liquid-glass) blur(3px) saturate(160%);
  backdrop-filter: url(#liquid-glass) blur(3px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    inset 0 -1px 2px rgba(255, 255, 255, 0.06),
    0 8px 32px rgba(0, 0, 0, 0.35);
}
/* top glossy highlight, like the light hitting the glass edge */
.mdeck__close::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 45%);
  pointer-events: none;
}
.mdeck__close > * { position: relative; z-index: 1; }

/* ---------- Project detail overlay ---------- */
.pview {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--bg);
  visibility: hidden;
  opacity: 0;
  transform: translateY(24px);
  pointer-events: none;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease),
    visibility 0s linear 0.5s;
}
.pview.is-open {
  visibility: visible;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
/* blurred main image behind everything */
.pview__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  filter: blur(60px) saturate(1.3);
  transform: scale(1.2); /* hide the blur bleeding past the edges */
}
.pview__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  /* darken so the text stays readable over any image */
  background:
    linear-gradient(180deg, rgba(17, 17, 17, 0.72), rgba(17, 17, 17, 0.82)),
    rgba(17, 17, 17, 0.35);
}

.pview__scroll {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: clamp(24px, 6vw, 72px);
}
.pview__scroll::-webkit-scrollbar { display: none; }

.pview__close {
  position: sticky;
  top: 0;
  z-index: 2;
  align-self: flex-start;
  padding: 10px 22px;
  border-radius: 999px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.12em;
  cursor: pointer;
  /* same refractive glass as the home CTA */
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: url(#liquid-glass) blur(3px) saturate(160%);
  backdrop-filter: url(#liquid-glass) blur(3px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    inset 0 -1px 2px rgba(255, 255, 255, 0.06),
    0 8px 32px rgba(0, 0, 0, 0.35);
}

.pview__head {
  max-width: 880px;
  margin: 40px auto 0;
}
.pview__cat {
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.pview__title {
  font-size: clamp(30px, 6vw, 60px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #fff;
}
.pview__desc {
  margin-top: 22px;
  max-width: 62ch;
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.7;
  color: var(--text);
}
/* rich text authored in the admin panel */
.pview__desc p { margin: 0 0 0.9em; }
.pview__desc a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s var(--ease);
}
.pview__desc a:hover { opacity: 0.7; }
.pview__desc strong, .pview__desc b { color: #fff; font-weight: 700; }
.pview__desc em, .pview__desc i { font-style: italic; }
.pview__desc h2 {
  margin: 1em 0 0.4em;
  font-size: 1.5em;
  font-weight: 700;
  color: #fff;
}
.pview__desc h3 {
  margin: 0.9em 0 0.3em;
  font-size: 1.2em;
  font-weight: 700;
  color: #fff;
}
.pview__desc ul, .pview__desc ol { margin: 0.6em 0 0.9em 1.3em; }
.pview__desc li { margin-bottom: 0.3em; }

.pview__media {
  max-width: 980px;
  margin: clamp(36px, 6vw, 64px) auto 0;
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vw, 28px);
}
.pview__figure {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #1c1c1c;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.pview__figure img,
.pview__figure video {
  display: block;
  width: 100%;
  height: auto;
}

.pview__cta {
  max-width: 880px;
  margin: clamp(56px, 10vw, 120px) auto clamp(24px, 6vw, 60px);
  padding-top: clamp(40px, 6vw, 72px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}
.pview__cta-title {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #fff;
}
.pview__cta-text {
  margin-top: 12px;
  font-size: clamp(15px, 1.6vw, 18px);
  text-transform: uppercase;
  color: var(--text);
}
.pview__cta-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 28px;
  padding: 16px 40px;
  border-radius: 40px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.14em;
  /* same refractive glass as the home CTA */
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: url(#liquid-glass) blur(3px) saturate(160%);
  backdrop-filter: url(#liquid-glass) blur(3px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    inset 0 -1px 2px rgba(255, 255, 255, 0.06),
    0 8px 32px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s var(--ease);
}
.pview__cta-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 45%);
  pointer-events: none;
}
.pview__cta-btn > * { position: relative; z-index: 1; }
.pview__cta-btn:hover { transform: translateY(-2px) scale(1.03); }

/* ---------- "Voltar" button for the 3D carousel ---------- */
.projects-close {
  position: fixed;
  left: 50%;
  bottom: 6vh;
  transform: translateX(-50%);
  z-index: 5;
  padding: 12px 30px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  backdrop-filter: blur(10px) saturate(160%);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.12em;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s var(--ease) 0.15s, background 0.3s var(--ease);
}
body.gallery-in .projects-close { opacity: 1; pointer-events: auto; }
.projects-close:hover { background: rgba(255, 255, 255, 0.16); }

/* ---------- Social items ---------- */
.social {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--text);
  text-decoration: none;
  width: max-content;
}

.social__icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  color: var(--text);
  transition: color 0.3s var(--ease), transform 0.4s var(--ease);
}

.social:hover .social__icon { color: #fff; transform: translateY(-1px); }

.social__reveal {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
}

.social__chevron {
  flex-shrink: 0;
  animation: nudge 1.8s ease-in-out infinite;
}

.social__label {
  white-space: nowrap;
  transition: color 0.3s var(--ease);
}

.social:hover .social__label { color: #fff; }

/* Every social label (WhatsApp included) reveals on hover for a clean,
   consistent interaction. */
.social .social__reveal {
  max-width: 0;
  opacity: 0;
  transform: translateX(-6px);
  transition: max-width 0.5s var(--ease), opacity 0.4s var(--ease), transform 0.5s var(--ease);
}
.social:hover .social__reveal {
  max-width: 240px;
  opacity: 1;
  transform: translateX(0);
}

@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-3px); }
}

/* ---------- Entrance reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(6px);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), filter 0.9s var(--ease);
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  :root { --pad: 20px; }
  /* On touch there is no hover, so drop the label/chevron reveal and show a
     clean horizontal row of icon-only glass pills at the bottom-left. */
  .socials {
    top: auto;
    bottom: calc(var(--pad) + env(safe-area-inset-bottom));
    left: var(--pad);
    transform: none;
    flex-direction: row;
    gap: 12px;
  }
  .social__reveal { display: none; }
  .social { gap: 0; }
  .social__icon {
    width: 44px;
    height: 44px;
    color: #fff;
  }
  .social:active .social__icon { transform: scale(0.92); }

  /* let the role wrap instead of overflowing the small screen */
  .identity__role { white-space: normal; max-width: 60vw; }

  /* footer text a touch smaller so it fits the corner */
  .contact__btn { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; filter: none; }
}
