/*
 * DDone portfolio — adapted from Codrops "On-Scroll 3D Carousel".
 * Original: https://github.com/codrops/3DCarousel
 * Copyright (c) Codrops — MIT License.
 */
@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&display=swap');
*,
*::before,
*::after { box-sizing: border-box; }

:root {
  /* Same palette as styles/originix-ddone.css */
  --p3-bg: #f5f5f5;
  --p3-surface: #ffffff;
  --p3-surface-soft: #f4f4f4;
  --p3-text: #171717;
  --p3-text-2: #404040;
  --p3-muted: #737373;
  --p3-muted-2: #a3a3a3;
  --p3-line: #e5e5e5;
  --p3-coral: #ff7c61;
  --p3-pink: #ff68a5;
  --p3-primary-soft: rgba(255,136,150,.20);
  --p3-pad: clamp(16px, 2.2vw, 34px);
}

html {
  margin: 0;
  background: var(--p3-bg);
  color-scheme: light;
  overflow-x: hidden;
}

body.portfolio3d-page {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 8%, rgba(255,124,97,.13), transparent 29rem),
    radial-gradient(circle at 82% 88%, rgba(255,104,165,.10), transparent 31rem),
    var(--p3-bg);
  color: var(--p3-text);
  font-family: "Figtree", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(255,124,97,.22);
}

.portfolio3d-page a {
  color: inherit;
  text-decoration: none;
}

.portfolio3d-page a:focus-visible {
  outline: 2px solid var(--p3-coral);
  outline-offset: 5px;
}

.js .portfolio3d-page.loading::before,
.js .portfolio3d-page.loading::after {
  position: fixed;
  z-index: 5000;
  content: "";
}

.js .portfolio3d-page.loading::before {
  inset: 0;
  background: var(--p3-bg);
}

.js .portfolio3d-page.loading::after {
  top: 50%;
  left: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--p3-coral), var(--p3-pink));
  opacity: .42;
  box-shadow:
    0 12px 32px rgba(255,124,97,.12),
    0 6px 20px rgba(255,104,165,.10);
  animation: p3loader .72s linear infinite alternate forwards;
}

@keyframes p3loader {
  to {
    opacity: 1;
    transform: scale3d(.5,.5,1);
  }
}

.portfolio3d-frame {
  position: fixed;
  z-index: 1000;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 18px var(--p3-pad);
  color: var(--p3-text);
  pointer-events: none;
}

.portfolio3d-frame::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  height: 74px;
  background: linear-gradient(to bottom, rgba(245,245,245,.94), rgba(245,245,245,.72) 62%, rgba(245,245,245,0));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  content: "";
  pointer-events: none;
}

.portfolio3d-frame > * { pointer-events: auto; }

.portfolio3d-frame__home,
.portfolio3d-frame__count,
.portfolio3d-frame__contact {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .02em;
}

.portfolio3d-frame__brand {
  justify-self: center;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -.055em;
}

.portfolio3d-frame__brand span {
  background: linear-gradient(270deg, var(--p3-coral), var(--p3-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.portfolio3d-frame__count { justify-self: end; opacity: .72; }
.portfolio3d-frame__contact { justify-self: end; }

.portfolio3d-scene__eyebrow {
  color: var(--p3-coral);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.portfolio3d-scenes {
  position: relative;
  min-height: 100svh;
}

/* First project is the landing view. */
.portfolio3d-scene:first-child {
  min-height: 100svh;
}

.portfolio3d-loading {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  color: var(--p3-muted);
}

.portfolio3d-scene {
  --scene-index: 0;
  position: relative;
  display: grid;
  min-height: 112svh;
  place-items: center;
  perspective: 950px;
  isolation: isolate;
  overflow: clip;
}

.portfolio3d-scene::before {
  position: absolute;
  inset: 12% 8%;
  z-index: -2;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,124,97,.12), transparent 68%);
  filter: blur(20px);
  content: "";
  opacity: calc(.55 + (var(--scene-index) * 0));
}

.portfolio3d-scene__meta {
  position: absolute;
  z-index: 50;
  top: 20%;
  left: var(--p3-pad);
  display: grid;
  gap: 7px;
  max-width: 20rem;
}

.portfolio3d-scene__index {
  color: var(--p3-muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .12em;
}

.portfolio3d-scene__eyebrow { font-size: 10px; }

.portfolio3d-scene__title {
  position: relative;
  /* Exact middle layer: rear carousel < title < front carousel. */
  z-index: 20;
  max-width: min(84vw, 1160px);
  margin: 0;
  text-align: center;
  pointer-events: none;
}

.portfolio3d-scene__title a {
  pointer-events: auto;
}

.portfolio3d-scene__title span {
  display: inline-block;
  font-size: clamp(58px, 9.2vw, 148px);
  line-height: .82;
  font-weight: 610;
  letter-spacing: -.078em;
  text-wrap: balance;
  color: var(--p3-text);
  text-shadow: 0 2px 24px rgba(255,255,255,.84);
}

/* Slightly reduce long project names so they remain readable through the orbit. */
.portfolio3d-scene__title--long span {
  font-size: clamp(52px, 7.35vw, 118px);
  letter-spacing: -.072em;
}

.portfolio3d-scene__open {
  position: absolute;
  z-index: 50;
  right: var(--p3-pad);
  bottom: 17%;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(23,23,23,.48);
  font-size: 12px;
  font-weight: 650;
}

.portfolio3d-carousel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(260px, 29vw, 410px);
  height: clamp(330px, 37vw, 520px);
  margin-top: calc(clamp(330px, 37vw, 520px) / -2);
  margin-left: calc(clamp(260px, 29vw, 410px) / -2);
  transform: none;
  transform-style: preserve-3d;
  pointer-events: none;
}

/* True interleaving around the title. A single CSS 3D stacking context cannot
   reliably interleave transformed descendants with a sibling text layer in
   every browser, so the orbit is rendered as two synchronized paint layers. */
.portfolio3d-carousel--back {
  z-index: 10;
}

.portfolio3d-carousel--front {
  z-index: 30;
}

.portfolio3d-cell {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  backface-visibility: visible;
  -webkit-backface-visibility: visible;
  will-change: transform;
}

.portfolio3d-card {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  transform-style: preserve-3d;
  overflow: hidden;
  background: #e7e7e7;
  box-shadow:
    0 34px 80px rgba(23,23,23,.12),
    0 10px 30px rgba(23,23,23,.08);
}

.portfolio3d-card__face {
  position: absolute;
  inset: 0;
  background-image: var(--img);
  background-size: cover;
  background-position: var(--pos, 50% 50%);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.portfolio3d-card__face::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255,255,255,.20), transparent 40%, rgba(23,23,23,.08));
  content: "";
}

.portfolio3d-card__face--back { transform: rotateY(180deg); }

.portfolio3d-scene__hit {
  position: absolute;
  /* Interaction layer stays above both title and cards while remaining
     visually transparent. */
  z-index: 60;
  width: min(64vw, 620px);
  height: min(76vh, 650px);
  border: 0;
  background: transparent;
  cursor: pointer;
}

.portfolio3d-footer {
  display: flex;
  min-height: 34svh;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 80px var(--p3-pad) 30px;
  border-top: 1px solid var(--p3-line);
  color: var(--p3-muted);
  font-size: 11px;
}

.portfolio3d-footer a {
  color: var(--p3-text);
  font-weight: 600;
}

.portfolio3d-scene__open:hover,
.portfolio3d-footer a:hover,
.portfolio3d-frame__home:hover,
.portfolio3d-frame__contact:hover {
  color: var(--p3-coral);
}

.portfolio3d-transition {
  position: fixed;
  z-index: 4000;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

.portfolio3d-page.is-transitioning {
  overflow: hidden;
}

@media (max-width: 760px) {
  .portfolio3d-frame {
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    padding: 15px 14px;
  }

  .portfolio3d-frame__count { display: none; }
  .portfolio3d-frame__home,
  .portfolio3d-frame__contact { font-size: 10px; }
  .portfolio3d-frame__brand { font-size: 16px; }

  .portfolio3d-scene {
    min-height: 100svh;
    perspective: 760px;
  }

  .portfolio3d-scene__meta {
    top: 12%;
    right: 16px;
    left: 16px;
    text-align: center;
  }

  .portfolio3d-scene__title {
    max-width: 94vw;
  }

  .portfolio3d-scene__title span {
    font-size: clamp(48px, 15vw, 78px);
    line-height: .86;
  }

  .portfolio3d-scene__title--long span {
    font-size: clamp(42px, 12.6vw, 66px);
  }

  .portfolio3d-carousel {
    width: min(58vw, 280px);
    height: min(75vw, 360px);
  }

  .portfolio3d-scene__open {
    right: 50%;
    bottom: 10%;
    transform: translateX(50%);
  }

  .portfolio3d-scene__hit {
    width: 82vw;
    height: 66vh;
  }

  .portfolio3d-footer {
    min-height: 28svh;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio3d-card,
  .portfolio3d-transition {
    transition: none !important;
  }
}


.portfolio3d-cell[data-orbit-copy] {
  transition: none !important;
}
