*,
*::before,
*::after {
  box-sizing: border-box;
}

@font-face {
  font-family: "Be Vietnam Pro";
  src: url("./RecursosWeb/Vietnam font/BeVietnamPro-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Be Vietnam Pro";
  src: url("./RecursosWeb/Vietnam font/BeVietnamPro-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Be Vietnam Pro";
  src: url("./RecursosWeb/Vietnam font/BeVietnamPro-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #d8d8d8;
  --thickness: 2.2px;
  --edge-opacity: 0.56;
  --frame-side-gap: clamp(16px, 2vw, 28px);
  --banner-top: var(--frame-side-gap);
  --banner-height: clamp(58px, 5.2vw, 92px);
  --banner-track-gap: clamp(7px, 0.8vw, 11px);
  --nav-gap: clamp(9px, 0.8vw, 14px);
  --nav-top: calc(var(--banner-top) + var(--banner-height) + var(--nav-gap));
  /* Set to 0 to disable the rough texture quickly */
  --roughness-opacity: 0.28;
  --rotate-x: -14deg;
  --rotate-y: 14deg;
  --about-stage-top: calc(var(--nav-top) + clamp(26px, 2.2vw, 34px));
  --about-stage-bottom: 0px;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  font-family: "Be Vietnam Pro", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.scene {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 0;
  isolation: isolate;
  overflow: hidden;
}

.bg-layout {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-banner {
  position: absolute;
  top: var(--banner-top);
  left: 0;
  right: 0;
  height: var(--banner-height);
  border-top: 2px solid rgba(212, 86, 52, 0.9);
  border-bottom: 2px solid rgba(212, 86, 52, 0.9);
  overflow: hidden;
}

.bg-banner::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: var(--banner-track-gap);
  bottom: var(--banner-track-gap);
  background-image: url("./RecursosWeb/Banner.png");
  background-repeat: repeat-x;
  background-size: auto 100%;
  background-position: 0 center;
  animation: banner-scroll 68s linear infinite;
  will-change: background-position;
}

.bg-nav,
.bg-footer,
.bg-center,
.bg-text {
  position: absolute;
}

.bg-layout img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.bg-nav {
  top: var(--nav-top);
  left: var(--frame-side-gap);
  right: var(--frame-side-gap);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  color: rgba(255, 35, 35, 0.95);
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  font-size: clamp(16px, 1.25vw, 22px);
  font-weight: 500;
  line-height: 1;
  pointer-events: auto;
}

.bg-nav-link {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  pointer-events: auto;
}

.bg-nav-link--home {
  justify-self: start;
}

.bg-nav-link--projects {
  justify-self: center;
}

.bg-nav-link--about {
  justify-self: end;
}

.bg-text {
  background: rgba(247, 247, 247, 0.62);
  padding: clamp(8px, 0.9vw, 14px) clamp(12px, 1.2vw, 18px);
  color: rgba(255, 35, 35, 0.95);
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  font-size: clamp(9px, 1.05vw, 16px);
  line-height: 1.1;
  pointer-events: auto;
  width: max-content;
  max-width: calc(100vw - 16px);
}

.bg-text__line {
  margin: 0;
  font-weight: 400;
  white-space: nowrap;
  -webkit-hyphens: none;
  hyphens: none;
}

.bg-text__line--bold {
  font-weight: 600;
}

.bg-text--left {
  left: 2%;
  top: 40%;
}

.bg-text--right {
  right: 2%;
  bottom: 15%;
}

.bg-center {
  left: 50%;
  top: 54%;
  width: clamp(72px, 6.6vw, 95px);
  transform: translate(-50%, -50%);
}

.bg-footer {
  left: var(--frame-side-gap);
  right: var(--frame-side-gap);
  bottom: var(--frame-side-gap);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  color: rgba(255, 35, 35, 0.95);
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  font-size: clamp(11px, 1vw, 15px);
  font-weight: 500;
  line-height: 1.14;
  pointer-events: none;
}

.bg-footer__item {
  display: flex;
  flex-direction: column;
  margin: 0;
  white-space: nowrap;
}

.bg-footer__item--left {
  justify-self: start;
  text-align: left;
}

.bg-footer__item--center {
  justify-self: center;
  text-align: left;
}

.bg-footer__item--right {
  justify-self: end;
  text-align: right;
}

.bg-footer__link,
.bg-footer__link:link,
.bg-footer__link:visited,
.bg-footer__link:hover,
.bg-footer__link:active {
  color: inherit;
  text-decoration: none;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

@keyframes banner-scroll {
  from {
    background-position: 0 center;
  }

  to {
    background-position: -4200px center;
  }
}

.card-stage {
  z-index: 2;
  width: 100%;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  perspective: 2400px;
  perspective-origin: center;
  position: relative;
  pointer-events: none;
}

.about-page .bg-center,
.about-page .card-shadow,
.about-page .adios-card {
  display: none;
}

.projects-page .bg-center,
.projects-page .bg-text,
.projects-page .card-shadow,
.projects-page .adios-card {
  display: none;
}

.about-page .card-stage {
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-top: var(--about-stage-top);
  padding-bottom: var(--about-stage-bottom);
  perspective: none;
}

.about-page .bg-layout {
  z-index: 2;
}

.about-page .bg-text {
  background: rgba(247, 247, 247, 0.84);
}

.about-page .bg-text--left {
  left: clamp(140px, 10.2vw, 180px);
  top: 39%;
}

.about-page .bg-text--right-top {
  right: clamp(120px, 9.8vw, 180px);
  bottom: 31%;
}

.about-page .bg-text--right-bottom {
  right: clamp(100px, 8.2vw, 160px);
  bottom: 11.8%;
}

.projects-page .bg-layout {
  z-index: 3;
}

.projects-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100dvh;
  overflow-y: auto;
  padding: calc(var(--nav-top) + clamp(10px, 1.4vw, 20px)) var(--frame-side-gap) clamp(82px, 9vh, 112px);
  pointer-events: auto;
}

.projects-shell {
  width: calc(100vw - (var(--frame-side-gap) * 2));
  margin: 0 auto;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 44px) clamp(18px, 2vw, 32px);
}

.project-card {
  min-width: 0;
  color: rgba(255, 35, 35, 0.95);
}

.project-card__media {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 16 / 9;
  border: 1.5px solid rgba(255, 35, 35, 0.95);
  background: rgba(247, 247, 247, 0.46);
  color: rgba(255, 35, 35, 0.76);
  padding: clamp(8px, 0.9vw, 12px);
  overflow: hidden;
}

.project-card__number {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(40px, 5.2vw, 78px);
  font-weight: 500;
  line-height: 1;
}

.project-card h2,
.project-card p {
  margin: 0;
  position: relative;
  z-index: 1;
  line-height: 1.12;
}

.project-card h2 {
  font-size: clamp(12px, 1vw, 15px);
  font-weight: 500;
}

.project-card p {
  margin-top: 0.1rem;
  font-size: clamp(10px, 0.85vw, 13px);
}

.about-phone {
  position: relative;
  --camera-left: 20.43%;
  --camera-top: 15.27%;
  --camera-width: 52.5%;
  --camera-height: 50.53%;
  --camera-bleed: 3px;
  height: min(
    clamp(740px, 92vh, 980px),
    calc(100dvh - var(--about-stage-top) - var(--about-stage-bottom))
  );
  max-height: calc(100dvh - var(--about-stage-top) - var(--about-stage-bottom));
  aspect-ratio: 2819 / 3903;
  overflow: hidden;
  border-radius: 1rem;
  pointer-events: auto;
  z-index: 1;
  margin-bottom: 0;
}

.about-phone__scale-layer {
  position: absolute;
  inset: 0;
}

.about-phone[data-camera-filter="red"]::before {
  content: "";
  position: absolute;
  left: calc(var(--camera-left) - var(--camera-bleed));
  top: calc(var(--camera-top) - var(--camera-bleed));
  width: calc(var(--camera-width) + var(--camera-bleed) + var(--camera-bleed));
  height: calc(var(--camera-height) + var(--camera-bleed) + var(--camera-bleed));
  z-index: 2;
  background: rgba(230, 0, 0, 0.62);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.about-phone__camera-video {
  position: absolute;
  left: calc(var(--camera-left) - var(--camera-bleed));
  top: calc(var(--camera-top) - var(--camera-bleed));
  z-index: 1;
  width: calc(var(--camera-width) + var(--camera-bleed) + var(--camera-bleed));
  height: calc(var(--camera-height) + var(--camera-bleed) + var(--camera-bleed));
  object-fit: cover;
  transform: scaleX(-1);
  background: #000;
}

.about-phone[data-camera-filter="red"] .about-phone__camera-video {
  filter: grayscale(1) contrast(1.3) brightness(0.78) sepia(1) saturate(10) hue-rotate(-42deg);
}

.about-phone__mockup {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.about-phone__camera-btn {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: -2.6rem;
  transform: translateX(-50%);
  border: 1px solid rgba(212, 86, 52, 0.72);
  background: rgba(245, 245, 245, 0.94);
  color: rgba(196, 66, 36, 1);
  font: inherit;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}

.about-phone__snap-btn {
  display: block;
  position: absolute;
  z-index: 6;
  left: 47.03%;
  top: 70.78%;
  width: max(42px, 10.6%);
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  cursor: pointer;
}

.about-phone__snap-btn:hover:not(:disabled) {
  transform: translate(-50%, -50%);
}

.about-phone__snap-btn:active:not(:disabled) {
  transform: translate(-50%, -50%);
}

.about-phone__snap-btn:disabled {
  opacity: 0;
  cursor: not-allowed;
}

.about-phone__camera-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.about-phone.is-capturing .about-phone__camera-video {
  opacity: 0;
  visibility: hidden;
}

.about-phone.is-capturing::before {
  opacity: 0;
  visibility: hidden;
}

/* Message shown inside the screen when camera access is denied/unavailable */
.about-phone__camera-msg {
  position: absolute;
  z-index: 4;
  left: var(--camera-left);
  top: var(--camera-top);
  width: var(--camera-width);
  height: var(--camera-height);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 7%;
  background: #000;
  color: rgba(255, 35, 35, 0.95);
  text-align: center;
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  font-weight: 500;
  font-size: clamp(11px, 1.5vw, 18px);
  line-height: 1.3;
}

.about-phone__camera-msg[hidden] {
  display: none;
}

.adios-card {
  pointer-events: auto;
}

.about-page .bg-text,
.about-page .bg-footer {
  z-index: 3;
}

.card-shadow {
  position: absolute;
  width: min(84vw, 740px);
  height: min(28vw, 220px);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(79, 85, 95, 0.22) 0%, rgba(79, 85, 95, 0) 74%);
  transform: translateY(60%);
  filter: blur(26px);
  pointer-events: none;
}

.adios-card {
  --card-radius: 8px;
  width: min(88vw, 760px);
  aspect-ratio: 9499 / 5937;
  border-radius: var(--card-radius);
  position: relative;
  cursor: grab;
  transform-style: preserve-3d;
  transform: rotateX(var(--rotate-x)) rotateY(var(--rotate-y));
  transition: transform 120ms ease;
  user-select: none;
  touch-action: none;
}

.adios-card:active {
  cursor: grabbing;
}

.adios-card__face,
.adios-card__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.adios-card__face {
  overflow: hidden;
  clip-path: inset(0 round var(--card-radius));
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: rgba(233, 238, 245, 0.46);
}

.adios-card__face::before,
.adios-card__face::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.adios-card__face::before {
  background: linear-gradient(138deg, rgba(255, 255, 255, 0.34), rgba(228, 234, 243, 0.16));
  backdrop-filter: blur(1.6px) saturate(92%);
  -webkit-backdrop-filter: blur(1.6px) saturate(92%);
}

.adios-card__face::after {
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.09), transparent 48%),
    repeating-linear-gradient(
      115deg,
      rgba(255, 255, 255, 0.08) 0 1px,
      rgba(202, 210, 221, 0.04) 1px 3px
    );
  opacity: var(--roughness-opacity);
  mix-blend-mode: soft-light;
}

.adios-card__face--front {
  transform: translateZ(calc(var(--thickness) / 2));
}

.adios-card__face--back {
  transform: rotateY(180deg) translateZ(calc(var(--thickness) / 2));
}

.adios-card__art {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
  border-radius: inherit;
  clip-path: inset(0 round var(--card-radius));
  pointer-events: none;
  user-select: none;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  position: relative;
  z-index: 1;
}

.adios-card__contact {
  position: absolute;
  top: 76%;
  right: 13%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.8%;
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  font-weight: 500;
  font-size: clamp(13px, 4.4vw, 31.5px);
  line-height: 1.1;
  color: rgba(255, 35, 35, 1);
  text-align: left;
  pointer-events: auto;
}

.adios-card__contact-line,
.adios-card__contact-line:link,
.adios-card__contact-line:visited,
.adios-card__contact-line:hover,
.adios-card__contact-line:active {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}

.adios-card__edge {
  opacity: var(--edge-opacity);
}

.adios-card__edge--top,
.adios-card__edge--bottom {
  left: 0;
  width: 100%;
  height: var(--thickness);
}

.adios-card__edge--top {
  top: 0;
  transform: translateY(calc(var(--thickness) * -0.5)) rotateX(90deg);
  transform-origin: center top;
  border-radius: 0.2rem 0.2rem 0 0;
}

.adios-card__edge--bottom {
  bottom: 0;
  transform: translateY(calc(var(--thickness) * 0.5)) rotateX(-90deg);
  transform-origin: center bottom;
  border-radius: 0 0 0.2rem 0.2rem;
}

.adios-card__edge--left,
.adios-card__edge--right {
  top: 0;
  width: var(--thickness);
  height: 100%;
}

.adios-card__edge--left {
  left: 0;
  transform: translateX(calc(var(--thickness) * -0.5)) rotateY(-90deg);
  transform-origin: left center;
  border-radius: 0.2rem 0 0 0.2rem;
}

.adios-card__edge--right {
  right: 0;
  transform: translateX(calc(var(--thickness) * 0.5)) rotateY(90deg);
  transform-origin: right center;
  border-radius: 0 0.2rem 0.2rem 0;
}

@media (max-width: 1024px) {
  :root {
    --frame-side-gap: clamp(12px, 2.8vw, 22px);
    --banner-top: 1.4rem;
    --banner-height: clamp(52px, 6.4vw, 76px);
    --banner-track-gap: clamp(6px, 1vw, 10px);
    --nav-gap: clamp(9px, 1vw, 13px);
  }

  .bg-text--left {
    top: 36%;
    width: clamp(220px, 33vw, 360px);
  }

  .bg-text--right {
    bottom: 12%;
    width: clamp(240px, 36vw, 410px);
  }

  .bg-center {
    top: 52%;
    width: clamp(64px, 8vw, 90px);
  }

  .adios-card {
    width: min(90vw, 680px);
  }

  .adios-card__contact {
    right: 0;
    font-size: clamp(12px, 3.4vw, 24px);
  }

  .card-shadow {
    width: min(86vw, 620px);
    height: min(24vw, 190px);
  }

  .about-phone {
    height: min(
      clamp(680px, 90vh, 880px),
      calc(100dvh - var(--about-stage-top) - var(--about-stage-bottom))
    );
  }
}

@media (max-width: 768px) {
  :root {
    --frame-side-gap: 8px;
    --banner-top: max(8px, env(safe-area-inset-top));
    --banner-height: clamp(44px, 9.8vw, 62px);
    --banner-track-gap: clamp(6px, 1vw, 10px);
    --nav-gap: 9px;
  }

  .scene {
    min-height: 100dvh;
    padding: 0;
  }

  .bg-banner {
    top: var(--banner-top);
    height: var(--banner-height);
  }

  .bg-nav {
    font-size: clamp(13px, 3.4vw, 16px);
  }

  .bg-footer {
    grid-template-columns: 1fr 1fr;
    column-gap: 12px;
    row-gap: 10px;
    font-size: clamp(10px, 2.6vw, 12px);
    line-height: 1.2;
    text-align: left;
  }

  .bg-footer__item {
    white-space: normal;
  }

  .bg-footer__item--left {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    align-items: flex-start;
    text-align: left;
  }

  .bg-footer__item--right {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-items: flex-end;
    text-align: right;
  }

  .bg-footer__item--center {
    display: none;
  }

  .bg-center {
    top: 47%;
    width: clamp(56px, 11vw, 74px);
  }

  .bg-text--left,
  .bg-text--right {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .bg-text {
    width: min(92vw, 380px);
    max-width: min(92vw, 380px);
    padding: 10px 14px;
    font-size: clamp(13px, 3.4vw, 16px);
    line-height: 1.18;
  }

  .bg-text__line {
    white-space: normal;
    text-wrap: balance;
  }

  .bg-text--left {
    top: 7%;
  }

  .bg-text--right {
    bottom: calc(70px + env(safe-area-inset-bottom));
  }

  /* Home page: narrower blocks pinned to top-left / bottom-right */
  .home-page .bg-text {
    width: max-content;
    max-width: 70%;
  }

  .home-page .bg-text__line {
    text-wrap: normal;
  }

  .home-page .bg-text--left,
  .home-page .bg-text--right {
    transform: none;
  }

  .home-page .bg-text--left {
    left: 4%;
    right: auto;
    top: calc(var(--nav-top) + 34px);
  }

  .home-page .bg-text--right {
    left: auto;
    right: 4%;
    bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .bg-footer {
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
  }

  .card-stage {
    align-items: center;
  }

  .adios-card {
    width: min(88vw, 430px);
  }

  .adios-card__contact {
    font-size: clamp(11px, 4vw, 20px);
  }

  .card-shadow {
    width: min(96vw, 460px);
    height: min(33vw, 160px);
    transform: translateY(70%);
  }

  .about-page .card-stage {
    align-items: flex-end;
    padding-top: var(--about-stage-top);
    padding-bottom: var(--about-stage-bottom);
  }

  .about-page {
    --about-stage-bottom: calc(0px + env(safe-area-inset-bottom));
  }

  .about-page .bg-text {
    display: none;
  }

  .projects-stage {
    padding-top: calc(var(--nav-top) + 18px);
  }

  .projects-shell {
    width: min(calc(100vw - (var(--frame-side-gap) * 2)), 680px);
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .about-phone {
    width: auto;
    height: min(138vw, calc(100dvh - var(--about-stage-top) - var(--about-stage-bottom)));
    max-width: none;
    max-height: calc(100dvh - var(--about-stage-top) - var(--about-stage-bottom));
    margin-bottom: 0;
    border-radius: 0.85rem;
  }

  .about-phone__snap-btn {
    top: 70.78%;
    width: max(42px, 10.6%);
  }
}

@media (max-width: 560px) {
  :root {
    --banner-height: 44px;
    --nav-gap: 8px;
  }

  .bg-banner {
    height: var(--banner-height);
  }

  .bg-banner::before {
    animation-duration: 54s;
  }

  .bg-nav {
    font-size: clamp(12px, 3.3vw, 14px);
  }

  .bg-text--left {
    top: 23%;
  }

  .bg-text--right {
    bottom: calc(160px + env(safe-area-inset-bottom));
  }

  .bg-center {
    top: 49%;
  }

  .adios-card {
    width: min(86vw, 350px);
  }

  .projects-grid {
    grid-template-columns: minmax(0, 1fr);
  }

}

@media (prefers-reduced-motion: reduce) {
  .bg-banner::before {
    animation: none;
  }
}
