/* Each module is a free-standing doorway in a shared space. */
.portal-frame {
  --scene-accent: 237, 190, 120;
  min-height: 100svh;
  background:
    radial-gradient(ellipse at 44% 48%, #44382925, transparent 56%),
    radial-gradient(ellipse at 86% 65%, #4933681c, transparent 50%), #0b0b0d;
}
.portal-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.28;
  background-image: radial-gradient(#d7bd8e66 0.6px, transparent 0.6px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse, #000, transparent 75%);
}
.portal-frame::after {
  content: "";
  position: fixed;
  left: 15%;
  top: 20%;
  z-index: -1;
  width: 70vw;
  height: 55vh;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    ellipse,
    rgba(var(--scene-accent), 0.08),
    transparent 68%
  );
  filter: blur(45px);
}
.effects-on.portal-frame::after {
  animation: atmosphere-drift 18s ease-in-out infinite alternate;
}
.portal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 78px;
}
.portal-nav-note {
  color: #968875;
  font-size: 9px;
  letter-spacing: 0.19em;
}
.portal-topbar .portal-contact {
  display: flex;
  align-items: center;
  gap: 25px;
  min-height: 44px;
  color: var(--signal);
  font-size: 12px;
}
.portal-topbar .portal-contact span {
  font-size: 22px;
}
.portal-main {
  position: relative;
  height: max(650px, calc(100svh - 145px));
  max-height: 1120px;
  isolation: isolate;
}
.portal-intro {
  position: absolute;
  z-index: 2;
  left: 44%;
  top: 47%;
  width: 34%;
  translate: -50% -50%;
  text-align: center;
  pointer-events: none;
}
.portal-eyebrow {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  color: #c4a879;
  font-size: 9px;
  margin-bottom: 14px;
}
.portal-intro h1 {
  margin: 0 0 14px;
  font: 500 clamp(25px, 2.5vw, 40px) / 1.55 var(--font-serif);
  letter-spacing: -0.03em;
}
.portal-intro h1 span {
  display: block;
  color: var(--signal);
}
.portal-lede {
  color: #b0a495;
  font-size: 12px;
  margin-bottom: 24px;
}
.portal-explore {
  color: #99876c;
  font-size: 9px;
  letter-spacing: 0.12em;
  margin: 0;
}
.portal-explore span {
  display: inline-block;
  margin-right: 6px;
  color: #dfba79;
}
.portal-space-orbit {
  position: absolute;
  z-index: -1;
  width: 79%;
  height: 62%;
  top: 18%;
  left: 9%;
  border: 1px solid #baa77d18;
  border-radius: 50%;
  transform: rotate(-23deg);
  pointer-events: none;
}
.portal-space-orbit::after {
  content: "";
  position: absolute;
  inset: 15px -36px;
  border: 1px dashed #baa77d0c;
  border-radius: 50%;
}
.portal-space-orbit span {
  position: absolute;
  top: 2%;
  left: 28%;
  color: #b9a17940;
  font: 8px var(--font-mono);
  letter-spacing: 0.27em;
}
.portal-grid {
  position: absolute;
  inset: 0 0 35px;
  perspective: 1800px;
  transform-style: preserve-3d;
}
.portal-slot {
  --depth: 1;
  --angle: 0deg;
  position: absolute;
  left: var(--slot-x);
  top: var(--slot-y);
  width: var(--slot-width);
  aspect-ratio: var(--slot-ratio);
  translate: -50% -50%;
  transform: rotate(var(--angle));
  transform-style: preserve-3d;
  transition:
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.55s,
    filter 0.55s;
}
.portal-slot-about {
  --slot-x: 15%;
  --slot-y: 25%;
  --slot-width: 17%;
  --slot-ratio: 0.78;
  --angle: -11deg;
  --depth: 1.15;
  z-index: 4;
}
.portal-slot-work {
  --slot-x: 48%;
  --slot-y: 17%;
  --slot-width: 24%;
  --slot-ratio: 1.35;
  --angle: 6deg;
  --depth: 0.7;
  z-index: 3;
}
.portal-slot-strengths {
  --slot-x: 83%;
  --slot-y: 24%;
  --slot-width: 16%;
  --slot-ratio: 0.78;
  --angle: 12deg;
  --depth: 0.55;
  z-index: 2;
}
.portal-slot-studio {
  --slot-x: 12%;
  --slot-y: 71%;
  --slot-width: 18%;
  --slot-ratio: 1.27;
  --angle: -7deg;
  --depth: 0.8;
  z-index: 3;
}
.portal-slot-local-ai {
  --slot-x: 73%;
  --slot-y: 66%;
  --slot-width: 18%;
  --slot-ratio: 0.84;
  --angle: -9deg;
  --depth: 1.4;
  z-index: 5;
}
.portal-slot-notes {
  --slot-x: 41%;
  --slot-y: 84%;
  --slot-width: 18%;
  --slot-ratio: 1.35;
  --angle: 7deg;
  --depth: 0.65;
  z-index: 2;
}
.portal-slot-contact {
  --slot-x: 92%;
  --slot-y: 85%;
  --slot-width: 14%;
  --slot-ratio: 1.05;
  --angle: 8deg;
  --depth: 1;
  z-index: 3;
}
.portal-float {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}
.effects-on .portal-float {
  animation: space-drift var(--float-duration, 8s) ease-in-out
    var(--float-delay, 0s) infinite;
}
.portal-float:has(.is-selected),
.portal-float:focus-within {
  animation-play-state: paused;
}
.portal-card {
  --card-accent: 237, 190, 120;
  display: block;
  position: relative;
  isolation: isolate;
  height: 100%;
  border: 1px solid rgba(var(--card-accent), 0.25);
  border-radius: 12px;
  background:
    radial-gradient(
      ellipse at 55% 0%,
      rgba(var(--card-accent), 0.18),
      transparent 80%
    ),
    #161416;
  box-shadow:
    12px 24px 45px #0008,
    0 0 0 5px #ffffff02;
  color: var(--text);
}
.accent-flame {
  --card-accent: 231, 123, 97;
}
.accent-water {
  --card-accent: 111, 206, 218;
}
.accent-violet {
  --card-accent: 197, 164, 233;
}
.portal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: linear-gradient(0deg, #100e12 0%, #100e12dd 18%, transparent 65%);
  pointer-events: none;
}
.portal-art {
  position: absolute;
  inset: -23px -12% 12px;
  pointer-events: none;
}
.portal-art img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 5%;
  filter: drop-shadow(0 17px 15px #0007);
  transition:
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.5s;
}
.portal-art-orbit {
  position: absolute;
  width: 85%;
  aspect-ratio: 1;
  left: 8%;
  top: 12%;
  border: 1px solid rgba(var(--card-accent), 0.15);
  border-radius: 50%;
}
.portal-art-orbit::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(var(--card-accent), 0.1);
  border-radius: 50%;
}
.portal-card-index {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 16px;
  font-size: 7px;
  color: #d4c2a4;
  letter-spacing: 0.08em;
}
.portal-card-copy {
  position: absolute;
  z-index: 2;
  left: 18px;
  right: 25px;
  bottom: 18px;
  transition: translate 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.portal-card-kicker {
  display: block;
  color: rgba(var(--card-accent), 0.8);
  font-size: 7px;
  margin-bottom: 5px;
  letter-spacing: 0.1em;
}
.portal-card h2 {
  margin: 0 0 5px;
  font: 600 clamp(21px, 2vw, 29px) / 1.25 var(--font-serif);
}
.portal-card-description {
  display: block;
  color: #bdb3a7;
  font-size: 10px;
  line-height: 1.6;
  opacity: 0.72;
  transition: opacity 0.4s;
}
.portal-card.is-selected .portal-card-description {
  opacity: 1;
}
.portal-work,
.portal-notes {
  overflow: hidden;
}
.portal-card-enter {
  position: absolute;
  z-index: 3;
  right: 13px;
  bottom: 18px;
  color: rgba(var(--card-accent), 0.9);
  font-size: 20px;
  transition: transform 0.3s;
}
.portal-work .portal-art {
  inset: -7% -8% 0;
  transform: rotate(-3deg);
}
.portal-work .portal-art img {
  object-position: center;
}
.portal-work .portal-art-orbit,
.portal-work-count {
  display: none;
}
.portal-work .portal-card-copy {
  bottom: 16px;
}
.portal-work h2 {
  font-size: clamp(24px, 2.4vw, 34px);
}
.portal-studio .portal-art,
.portal-contact .portal-art {
  inset: -17% -4% 0 32%;
}
.portal-notes .portal-art {
  inset: -25% 0 0 20%;
  opacity: 0.5;
}
.portal-studio .portal-card-kicker,
.portal-notes .portal-card-kicker,
.portal-contact .portal-card-kicker {
  display: none;
}
.portal-ai-chip {
  position: absolute;
  z-index: 2;
  left: 16px;
  top: 34px;
  color: #ceafea;
  font-size: 7px;
}
.portal-ai-chip i {
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 5px;
  background: #c5a4e1;
  border-radius: 50%;
}
.portal-card.is-selected {
  border-color: rgba(var(--card-accent), 0.85);
  box-shadow:
    0 35px 75px #000a,
    0 0 35px rgba(var(--card-accent), 0.16);
}
.portal-card.is-selected .portal-card-enter {
  transform: translate(3px, -3px);
}
.effects-on .portal-card.is-tracking {
  transform: perspective(1100px) rotateX(var(--card-rx, 0deg))
    rotateY(var(--card-ry, 0deg));
}
.effects-on .portal-card.is-tracking .portal-art img {
  transform: translate3d(
      calc(var(--card-px, 0px) * -1.5),
      calc(var(--card-py, 0px) * -1.5),
      25px
    )
    scale(1.09);
  filter: drop-shadow(0 20px 20px #0009) brightness(1.1);
}
.effects-on .portal-card.is-tracking .portal-card-copy {
  translate: calc(var(--card-px, 0px) * 0.6) -4px;
}
.effects-on .portal-art-orbit {
  animation: orbit-trace 24s linear infinite;
}
.portal-selection {
  position: absolute;
  bottom: 3px;
  inset-inline: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}
.portal-selection p,
.portal-selection > span {
  font-size: 8px;
  color: #9e8d72;
  margin: 0;
}
.portal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 67px;
  margin-top: 0;
  color: #8d8070;
}
.portal-footer .mono {
  font-size: 9px;
}
.portal-footer p {
  font: 12px var(--font-serif);
  margin: 0;
}
.portal-footer a {
  font-size: 10px;
  margin-right: 120px;
  color: #b3a28c;
}
.portal-constellation {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.65;
}
.portal-cursor {
  position: fixed;
  z-index: 85;
  top: 0;
  left: 0;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--scene-accent), 0.8);
  background: #0b0b0d9c;
  color: #f4e2be;
  border-radius: 50%;
  font: 10px var(--font-mono);
  pointer-events: none;
  opacity: 0;
  scale: 0.6;
  transition:
    opacity 0.2s,
    scale 0.35s;
  backdrop-filter: blur(4px);
}
.effects-on.scene-pointing .portal-cursor {
  opacity: 1;
  scale: 1;
}
.effects-off .portal-grid {
  transform: none;
}
.effects-off .portal-card .portal-art img {
  transform: none;
}
.effects-off .portal-cursor {
  display: none;
}
@media (min-width: 1000px) {
  .effects-on .portal-grid {
    transform: rotateX(var(--stage-rx, 0deg)) rotateY(var(--stage-ry, 0deg));
  }
  .effects-on .portal-slot {
    transform: translate3d(
        calc(
          var(--stage-x, 0px) * var(--depth) + var(--yield-x, 0px) +
            var(--drag-x, 0px)
        ),
        calc(
          var(--stage-y, 0px) * var(--depth) + var(--yield-y, 0px) +
            var(--drag-y, 0px)
        ),
        0
      )
      rotate(var(--angle));
  }
  .portal-slot:has(.is-selected) {
    z-index: 20;
  }
  .effects-on .portal-slot:has(.is-selected) {
    transform: translate3d(
        calc(var(--stage-x, 0px) * var(--depth) + var(--drag-x, 0px)),
        calc(var(--stage-y, 0px) * var(--depth) + var(--drag-y, 0px)),
        85px
      )
      rotate(0deg) scale(1.12);
  }
  .effects-on
    .portal-grid:has(.is-selected)
    .portal-slot:not(:has(.is-selected)) {
    opacity: 0.68;
    filter: saturate(0.7);
  }
}
@keyframes space-drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(-0.5deg);
  }
  50% {
    transform: translate3d(4px, -14px, 0) rotate(0.8deg);
  }
}
@keyframes atmosphere-drift {
  from {
    transform: translate(-5%, -5%) scale(0.9);
  }
  to {
    transform: translate(20%, 28%) scale(1.2);
  }
}
@keyframes orbit-trace {
  to {
    rotate: 360deg;
  }
}
@media (max-width: 999px) {
  .portal-topbar {
    min-height: 72px;
  }
  .portal-nav-note {
    display: none;
  }
  .portal-main {
    height: 1220px;
    max-height: none;
  }
  .portal-intro {
    left: 50%;
    top: 64px;
    width: 90%;
  }
  .portal-eyebrow {
    font-size: 8px;
    margin-bottom: 8px;
  }
  .portal-intro h1 {
    font-size: 25px;
    line-height: 1.4;
    margin-bottom: 8px;
  }
  .portal-intro h1 span {
    display: block;
  }
  .portal-lede {
    font-size: 11px;
    margin-bottom: 12px;
  }
  .portal-explore {
    font-size: 8px;
  }
  .portal-grid {
    inset: 0 0 35px;
    transform: none;
  }
  .portal-slot-about {
    --slot-x: 24%;
    --slot-y: 255px;
    --slot-width: 43%;
    --slot-ratio: 0.78;
    --angle: -9deg;
  }
  .portal-slot-work {
    --slot-x: 74%;
    --slot-y: 330px;
    --slot-width: 48%;
    --slot-ratio: 1.1;
    --angle: 8deg;
  }
  .portal-slot-strengths {
    --slot-x: 26%;
    --slot-y: 570px;
    --slot-width: 40%;
    --slot-ratio: 0.78;
    --angle: -5deg;
  }
  .portal-slot-studio {
    --slot-x: 76%;
    --slot-y: 605px;
    --slot-width: 44%;
    --slot-ratio: 1.2;
    --angle: 9deg;
  }
  .portal-slot-local-ai {
    --slot-x: 67%;
    --slot-y: 860px;
    --slot-width: 45%;
    --slot-ratio: 0.84;
    --angle: -8deg;
  }
  .portal-slot-notes {
    --slot-x: 26%;
    --slot-y: 965px;
    --slot-width: 43%;
    --slot-ratio: 1.15;
    --angle: 7deg;
  }
  .portal-slot-contact {
    --slot-x: 73%;
    --slot-y: 1100px;
    --slot-width: 41%;
    --slot-ratio: 1.15;
    --angle: -6deg;
  }
  .portal-slot {
    max-width: 240px;
  }
  .portal-card {
    border-radius: 10px;
  }
  .portal-card-index {
    top: 12px;
    left: 12px;
    font-size: 6px;
  }
  .portal-card-copy {
    left: 13px;
    right: 21px;
    bottom: 15px;
  }
  .portal-card h2 {
    font-size: 23px;
  }
  .portal-card-kicker {
    font-size: 6px;
  }
  .portal-card-description {
    font-size: 9px;
  }
  .portal-work h2 {
    font-size: 25px;
  }
  .portal-card-enter {
    font-size: 17px;
    right: 10px;
    bottom: 14px;
  }
  .portal-ai-chip {
    top: 30px;
    left: 12px;
    font-size: 6px;
  }
  .portal-art {
    inset-block-start: -14px;
  }
  .portal-space-orbit {
    width: 140%;
    height: 72%;
    left: -20%;
    top: 14%;
    transform: rotate(19deg);
  }
  .portal-selection > span {
    display: none;
  }
  .portal-footer {
    flex-wrap: wrap;
    padding-block: 18px 80px;
    min-height: 0;
    gap: 12px;
  }
  .portal-footer a {
    width: 100%;
    margin-right: 0;
  }
  .portal-cursor {
    display: none;
  }
  .portal-constellation {
    opacity: 0.4;
  }
}
@media (min-width: 600px) and (max-width: 999px) {
  .portal-main {
    height: 1440px;
  }
  .portal-slot-about {
    --slot-x: 25%;
    --slot-y: 320px;
  }
  .portal-slot-work {
    --slot-x: 69%;
    --slot-y: 395px;
  }
  .portal-slot-strengths {
    --slot-x: 29%;
    --slot-y: 650px;
  }
  .portal-slot-studio {
    --slot-x: 74%;
    --slot-y: 705px;
  }
  .portal-slot-local-ai {
    --slot-y: 970px;
  }
  .portal-slot-notes {
    --slot-x: 26%;
    --slot-y: 1110px;
  }
  .portal-slot-contact {
    --slot-x: 73%;
    --slot-y: 1280px;
  }
}
@media (max-width: 380px) {
  .portal-card h2 {
    font-size: 20px;
  }
  .portal-intro h1 {
    font-size: 22px;
  }
  .portal-card-description {
    font-size: 8px;
  }
  .portal-topbar .portal-contact {
    font-size: 11px;
    gap: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .portal-slot,
  .portal-card,
  .portal-card-copy,
  .portal-card .portal-art img {
    transition: none !important;
  }
  .portal-float {
    animation: none !important;
  }
  .portal-grid {
    transform: none !important;
  }
  .portal-card .portal-art img,
  .portal-card .portal-card-copy {
    transform: none !important;
    translate: none !important;
  }
  .portal-constellation,
  .portal-cursor {
    display: none;
  }
}
