/* Portal p6 — desktop-scale, short-screen no-scroll */

body.is-portal {
  --portal-blue: #7eb6ff;
  --portal-amber: #efc28a;
  --portal-ink: #f6f1e8;
  --portal-mute: #b7b0a4;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 90% 60% at 50% -5%, rgba(72, 118, 200, 0.34), transparent 58%),
    radial-gradient(ellipse 55% 45% at 92% 78%, rgba(210, 140, 70, 0.16), transparent 52%),
    radial-gradient(ellipse 48% 42% at 6% 72%, rgba(68, 130, 210, 0.14), transparent 48%),
    radial-gradient(ellipse 40% 30% at 50% 55%, rgba(120, 150, 220, 0.08), transparent 70%),
    #06070b;
}

/* Glass header / footer */
body.is-portal .portal-header.site-header,
body.is-portal .site-header {
  background: rgba(6, 7, 11, 0.42);
  border-bottom-color: transparent;
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
body.is-portal .site-header.is-scrolled {
  border-bottom-color: rgba(235, 230, 220, 0.08);
  background: rgba(6, 7, 11, 0.72);
}
body.is-portal .portal-footer.site-footer,
body.is-portal .site-footer {
  position: relative;
  z-index: 2;
  margin-top: 0;
  padding: 1.35rem 0 1.6rem;
  border-top: 1px solid rgba(235, 230, 220, 0.08);
  background: rgba(6, 7, 11, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
body.is-portal .site-footer p { margin: 0.15rem 0; }
body.is-portal .site-footer .muted { color: rgba(183, 176, 164, 0.75); }

/* Stage */
.portal-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.portal-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.portal-aurora {
  position: absolute;
  inset: -10% -5%;
  background:
    radial-gradient(ellipse 42% 36% at 28% 32%, rgba(90, 150, 255, 0.28), transparent 62%),
    radial-gradient(ellipse 38% 34% at 74% 28%, rgba(160, 120, 255, 0.14), transparent 60%),
    radial-gradient(ellipse 46% 40% at 62% 72%, rgba(230, 160, 90, 0.16), transparent 58%),
    radial-gradient(ellipse 30% 28% at 18% 78%, rgba(60, 180, 200, 0.12), transparent 65%);
  filter: blur(28px);
  opacity: 0.9;
  animation: auroraDrift 18s ease-in-out infinite alternate;
  mix-blend-mode: screen;
}
.portal-orbs {
  position: absolute;
  inset: 0;
}
.portal-orbs::before,
.portal-orbs::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
}
.portal-orbs::before {
  width: min(42vw, 420px);
  height: min(42vw, 420px);
  left: 8%;
  top: 18%;
  background: radial-gradient(circle, rgba(110, 168, 255, 0.45), transparent 68%);
  animation: orbFloatA 14s ease-in-out infinite;
}
.portal-orbs::after {
  width: min(36vw, 360px);
  height: min(36vw, 360px);
  right: 6%;
  bottom: 14%;
  background: radial-gradient(circle, rgba(230, 170, 100, 0.38), transparent 68%);
  animation: orbFloatB 16s ease-in-out infinite;
}
@keyframes auroraDrift {
  0% { transform: translate3d(-2%, -1%, 0) scale(1); }
  100% { transform: translate3d(3%, 2%, 0) scale(1.06); }
}
@keyframes orbFloatA {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(4%, 6%); }
}
@keyframes orbFloatB {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-5%, -4%); }
}

.portal-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 72% 62% at 50% 48%, transparent 18%, rgba(4, 5, 8, 0.45) 68%, rgba(2, 3, 6, 0.86) 100%),
    linear-gradient(180deg, rgba(6, 7, 11, 0.5) 0%, transparent 16%, transparent 82%, rgba(6, 7, 11, 0.62) 100%);
}
.portal-sweep {
  position: absolute;
  inset: -20% -30%;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(110, 168, 255, 0.07) 46%,
    rgba(242, 238, 230, 0.16) 50%,
    rgba(230, 184, 122, 0.08) 54%,
    transparent 60%
  );
  transform: translateX(-40%) skewX(-12deg);
  opacity: 0;
  animation: portalSweep 2.4s var(--ease) 0.35s forwards;
  mix-blend-mode: soft-light;
}
@keyframes portalSweep {
  0% { opacity: 0; transform: translateX(-55%) skewX(-12deg); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translateX(55%) skewX(-12deg); }
}

/* Layout — fill viewport, tight center stage */
body.is-portal .portal {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 2.2vh, 2rem) 0 clamp(0.6rem, 1.6vh, 1.25rem);
  min-height: 0;
}
body.is-portal .portal-inner {
  position: relative;
  width: min(1680px, calc(100% - 3.5rem));
  display: grid;
  gap: clamp(1.35rem, 2.8vh, 2.2rem);
  align-content: center;
}
body.is-portal .portal-identity {
  max-width: 44rem;
  margin-inline: auto;
}
body.is-portal .portal-identity .eyebrow {
  color: rgba(190, 205, 235, 0.72);
  letter-spacing: 0.28em;
  margin-bottom: 0.55rem;
}
body.is-portal .portal-identity .who {
  color: var(--portal-mute);
  font-size: clamp(1.05rem, 1.35vw, 1.2rem);
}
body.is-portal .portal-identity .hint {
  color: rgba(200, 194, 184, 0.72);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: clamp(0.78rem, 0.95vw, 0.9rem);
  margin-top: 1rem;
}

.name-stage {
  position: relative;
  display: grid;
  place-items: center;
  margin: 0.1rem 0 0.75rem;
  min-height: clamp(5rem, 8vh, 6.5rem);
}
.name-stage .orbit {
  position: absolute;
  width: min(22rem, 48vw);
  height: min(22rem, 48vw);
  border-radius: 50%;
  border: 1px solid rgba(170, 200, 255, 0.14);
  box-shadow:
    0 0 40px rgba(110, 168, 255, 0.08) inset,
    0 0 60px rgba(230, 184, 122, 0.05);
  animation: orbitPulse 6s ease-in-out infinite;
  pointer-events: none;
}
.name-stage .orbit::before {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 1px dashed rgba(230, 184, 122, 0.18);
  animation: orbitSpin 28s linear infinite;
}
@keyframes orbitPulse {
  0%, 100% { opacity: 0.55; transform: scale(0.96); }
  50% { opacity: 0.95; transform: scale(1); }
}
@keyframes orbitSpin {
  to { transform: rotate(360deg); }
}

body.is-portal .portal-identity h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(3rem, 6.2vw, 4.5rem);
  letter-spacing: 0.14em;
  margin: 0;
  background: linear-gradient(180deg, #fffaf2 0%, #e8dcc8 48%, #b9a88f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 28px rgba(180, 200, 255, 0.22));
}
body.is-portal .portal-identity h1::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.7rem;
  width: 4.25rem;
  height: 1px;
  transform: translateX(-50%) scaleX(0);
  background: linear-gradient(90deg, transparent, var(--portal-blue), var(--portal-amber), transparent);
  animation: portalLine 1s var(--ease) 0.7s forwards;
  opacity: 0.9;
}
@keyframes portalLine {
  to { transform: translateX(-50%) scaleX(1); }
}

/* Entrance choreography */
.portal-identity .eyebrow,
.portal-identity .name-stage,
.portal-identity .who,
.portal-identity .hint,
.door {
  opacity: 0;
  transform: translateY(20px);
  filter: blur(6px);
  animation: portalRise 0.95s var(--ease) forwards;
}
.portal-identity .eyebrow { animation-delay: 0.1s; }
.portal-identity .name-stage { animation-delay: 0.24s; }
.portal-identity .who { animation-delay: 0.4s; }
.portal-identity .hint { animation-delay: 0.55s; }
.doors .door:nth-child(1) { animation-delay: 0.7s; }
.doors .door:nth-child(2) { animation-delay: 0.86s; }

@keyframes portalRise {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* Doors — cinematic cards */
body.is-portal .doors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.35rem, 2.4vw, 2.25rem);
  perspective: 1600px;
  width: 100%;
}
body.is-portal .door {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: block;
  min-height: clamp(26rem, 54vh, 36rem);
  height: min(54vh, 36rem);
  padding: 0;
  border-radius: 1.35rem;
  border: 1px solid rgba(235, 230, 220, 0.16);
  background: rgba(12, 14, 20, 0.55);
  box-shadow:
    0 0 0 1px rgba(110, 168, 255, 0.05) inset,
    0 24px 60px rgba(0, 0, 0, 0.42);
  text-decoration: none;
  color: var(--portal-ink);
  transform-style: preserve-3d;
  transition:
    border-color 0.45s var(--ease),
    box-shadow 0.45s var(--ease),
    transform 0.45s var(--ease);
  will-change: transform;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
body.is-portal .door::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    140deg,
    rgba(140, 190, 255, 0.7),
    rgba(235, 230, 220, 0.1) 35%,
    rgba(230, 184, 122, 0.45) 72%,
    rgba(110, 168, 255, 0.25)
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.4;
  transition: opacity 0.45s var(--ease);
  pointer-events: none;
  z-index: 5;
}

.door-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.door-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  aspect-ratio: 3 / 2;
  transform: scale(1.04);
  transition: transform 1.1s var(--ease);
  filter: saturate(1.05) contrast(1.05);
}
.door-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 10, 18, 0.28) 0%, rgba(6, 10, 18, 0.18) 28%, rgba(6, 10, 18, 0.55) 62%, rgba(4, 6, 12, 0.92) 100%),
    linear-gradient(90deg, rgba(20, 50, 100, 0.22), transparent 45%);
}
.door-scrim--amber {
  background:
    linear-gradient(180deg, rgba(28, 18, 10, 0.35) 0%, rgba(20, 14, 8, 0.2) 30%, rgba(18, 12, 8, 0.55) 60%, rgba(10, 8, 6, 0.94) 100%),
    linear-gradient(90deg, rgba(120, 70, 20, 0.18), transparent 50%);
}

/* Notes paper door */
.door-media--paper {
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 220, 170, 0.14), transparent 40%),
    linear-gradient(155deg, #2a2118 0%, #17130f 45%, #100e0c 100%);
}
.paper-wash {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(230, 184, 122, 0.035) 28px
    ),
    radial-gradient(ellipse 70% 50% at 70% 20%, rgba(230, 184, 122, 0.12), transparent 55%);
  opacity: 0.9;
}
.paper-glyphs {
  position: absolute;
  inset: 12% 10% auto;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 3.8vw, 3rem);
  letter-spacing: 0.55em;
  color: rgba(239, 210, 160, 0.18);
  writing-mode: horizontal-tb;
  transform: rotate(-8deg);
  user-select: none;
  pointer-events: none;
  text-shadow: 0 0 30px rgba(230, 184, 122, 0.15);
}

.door-glow {
  position: absolute;
  inset: -35%;
  background: radial-gradient(circle at center, rgba(110, 168, 255, 0.28), transparent 55%);
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
}
.door[data-tone="amber"] .door-glow {
  background: radial-gradient(circle at center, rgba(230, 184, 122, 0.3), transparent 55%);
}

.door-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: inherit;
  height: 100%;
  padding: clamp(1.75rem, 2.4vh, 2.25rem) clamp(1.7rem, 2vw, 2.15rem) clamp(1.55rem, 2vh, 1.9rem);
}
.door-kicker {
  font-family: var(--latin);
  font-size: clamp(0.86rem, 1vw, 0.98rem);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(190, 210, 245, 0.78);
}
.door[data-tone="amber"] .door-kicker {
  color: rgba(239, 210, 160, 0.8);
}
.door-copy {
  margin-top: auto;
  padding-top: 4rem;
}
.door h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.35rem, 3.6vw, 3.15rem);
  margin: 0 0 0.7rem;
  letter-spacing: 0.08em;
  color: var(--portal-ink);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}
.door p {
  margin: 0;
  color: rgba(232, 226, 216, 0.86);
  font-size: clamp(1.02rem, 1.2vw, 1.18rem);
  max-width: 28rem;
  line-height: 1.6;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}
.door-go {
  margin-top: 1.6rem;
  font-size: clamp(0.92rem, 1.05vw, 1.05rem);
  letter-spacing: 0.14em;
  color: #c9d9ff;
  transition: letter-spacing 0.35s var(--ease), color 0.35s var(--ease), transform 0.35s var(--ease);
}
.door[data-tone="amber"] .door-go { color: #f0d2a8; }

/* Hover / focus */
body.is-portal .door:hover,
body.is-portal .door:focus-visible,
body.is-portal .door.is-hot {
  border-color: rgba(170, 200, 255, 0.4);
  box-shadow:
    0 0 0 1px rgba(110, 168, 255, 0.14) inset,
    0 0 50px rgba(110, 168, 255, 0.16),
    0 28px 70px rgba(0, 0, 0, 0.5);
  outline: none;
  color: var(--portal-ink);
}
body.is-portal .door[data-tone="amber"]:hover,
body.is-portal .door[data-tone="amber"]:focus-visible,
body.is-portal .door[data-tone="amber"].is-hot {
  border-color: rgba(230, 184, 122, 0.48);
  box-shadow:
    0 0 0 1px rgba(230, 184, 122, 0.14) inset,
    0 0 50px rgba(230, 184, 122, 0.16),
    0 28px 70px rgba(0, 0, 0, 0.5);
}
body.is-portal .door:hover::after,
body.is-portal .door:focus-visible::after,
body.is-portal .door.is-hot::after {
  opacity: 1;
}
body.is-portal .door:hover .door-glow,
body.is-portal .door:focus-visible .door-glow,
body.is-portal .door.is-hot .door-glow {
  opacity: 1;
}
body.is-portal .door:hover .door-img,
body.is-portal .door:focus-visible .door-img,
body.is-portal .door.is-hot .door-img {
  transform: scale(1.12);
}
body.is-portal .door:hover .door-go,
body.is-portal .door:focus-visible .door-go {
  letter-spacing: 0.22em;
  color: #eef3ff;
  transform: translateX(2px);
}
body.is-portal .door[data-tone="amber"]:hover .door-go,
body.is-portal .door[data-tone="amber"]:focus-visible .door-go {
  color: #ffe8c8;
}

/* Custom cursor glow — desktop */
.portal-cursor {
  position: fixed;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 80;
  background: radial-gradient(circle, rgba(180, 210, 255, 0.55) 0%, rgba(180, 210, 255, 0.12) 40%, transparent 70%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.15s ease;
  will-change: transform;
}
body.is-portal.has-cursor-glow { cursor: none; }
body.is-portal.has-cursor-glow a,
body.is-portal.has-cursor-glow button { cursor: none; }
body.is-portal.has-cursor-glow .portal-cursor.is-on { opacity: 1; }
body.is-portal.has-cursor-glow .portal-cursor.is-press { transform: scale(1.65); }

/* Large desktop: fill more of the screen */
@media (min-width: 1280px) {
  body.is-portal .portal-inner {
    width: min(1760px, calc(100% - 4rem));
  }
  body.is-portal .door {
    min-height: clamp(28rem, 56vh, 38rem);
    height: min(56vh, 38rem);
  }
}
@media (min-width: 1600px) and (min-height: 900px) {
  body.is-portal .portal-inner {
    width: min(1880px, calc(100% - 5rem));
  }
  body.is-portal .door {
    min-height: min(60vh, 42rem);
    height: min(60vh, 42rem);
  }
  body.is-portal .portal-identity h1 {
    font-size: clamp(3.4rem, 5vw, 5rem);
  }
}

/* Short desktop windows: keep one screen, no vertical scroll */
@media (max-height: 860px) and (min-width: 721px) {
  body.is-portal {
    overflow: hidden;
  }
  body.is-portal .portal {
    padding: 0.45rem 0 0.2rem;
  }
  body.is-portal .portal-inner {
    gap: 0.7rem;
  }
  body.is-portal .portal-identity .eyebrow {
    margin-bottom: 0.35rem;
  }
  body.is-portal .portal-identity .who {
    font-size: 0.95rem;
  }
  body.is-portal .portal-identity .hint {
    margin-top: 0.4rem;
  }
  .name-stage {
    margin: 0 0 0.25rem;
    min-height: 3.2rem;
  }
  .name-stage .orbit {
    width: min(14rem, 32vw);
    height: min(14rem, 32vw);
  }
  body.is-portal .portal-identity h1 {
    font-size: clamp(2.2rem, 4vw, 2.9rem);
  }
  body.is-portal .door {
    min-height: clamp(20rem, calc(100vh - 15.5rem), 28rem);
    height: clamp(20rem, calc(100vh - 15.5rem), 28rem);
  }
  .door-body {
    padding: 1.35rem 1.4rem 1.2rem;
  }
  .door-copy {
    padding-top: 1.75rem;
  }
  body.is-portal .portal-footer.site-footer,
  body.is-portal .site-footer {
    padding: 0.35rem 0 0.45rem;
  }
  body.is-portal .site-footer .muted,
  body.is-portal .footer-grid > :not(:first-child) {
    display: none;
  }
  body.is-portal .footer-grid {
    display: flex;
    justify-content: center;
    gap: 0;
  }
}

/* Mobile */
@media (max-width: 720px) {
  body.is-portal .portal {
    padding: 1.25rem 0 0.85rem;
    place-items: start center;
  }
  body.is-portal .portal-inner {
    width: min(100% - 1.75rem, 560px);
    gap: 1.5rem;
  }
  body.is-portal .doors {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  body.is-portal .door {
    min-height: 17.5rem;
    height: auto;
    border-radius: 1rem;
    transform: none !important;
  }
  .name-stage { min-height: 3.6rem; }
  .name-stage .orbit {
    width: min(14rem, 78vw);
    height: min(14rem, 78vw);
  }
  body.is-portal .portal-identity h1 {
    font-size: clamp(2.2rem, 10vw, 2.8rem);
  }
  .paper-glyphs {
    letter-spacing: 0.35em;
    font-size: 1.55rem;
  }
  .portal-aurora,
  .portal-orbs { opacity: 0.7; }
  .portal-cursor { display: none !important; }
  body.is-portal.has-cursor-glow,
  body.is-portal.has-cursor-glow a,
  body.is-portal.has-cursor-glow button {
    cursor: auto;
  }
  body.is-portal .portal-footer.site-footer,
  body.is-portal .site-footer {
    padding: 1.1rem 0 1.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-sweep,
  .portal-aurora,
  .portal-orbs { display: none; }
  .portal-identity .eyebrow,
  .portal-identity .name-stage,
  .portal-identity .who,
  .portal-identity .hint,
  .door {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    animation: none !important;
  }
  body.is-portal .portal-identity h1::after {
    transform: translateX(-50%) scaleX(1);
    animation: none;
  }
  .name-stage .orbit,
  .name-stage .orbit::before { animation: none; }
  body.is-portal .door {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }
  body.is-portal .door .door-img {
    transition: none;
    transform: scale(1.04);
  }
  .portal-stage canvas { display: none; }
  .portal-stage {
    background:
      radial-gradient(ellipse 70% 50% at 50% 30%, rgba(70, 110, 180, 0.28), transparent 60%),
      radial-gradient(ellipse 50% 40% at 80% 80%, rgba(180, 120, 60, 0.14), transparent 55%),
      #06070b;
  }
}
