:root {
  --bg: #07090d;
  --ink: #f7f3e8;
  --muted: #a5abb8;
  --cinematic-strong: #ffdf8a;
  --line: rgba(255, 255, 255, 0.16);
  --panel: rgba(8, 11, 17, 0.46);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  background: var(--bg);
  animation-duration: 520ms;
  animation-timing-function: var(--ease);
}

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

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Manrope, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% 15%, rgba(81, 136, 205, 0.24), transparent 30%),
    radial-gradient(circle at 80% 22%, rgba(242, 200, 121, 0.14), transparent 28%),
    linear-gradient(135deg, #06080c 0%, #0d1118 50%, #050608 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.entrance-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  isolation: isolate;
  overflow: hidden;
}

.portal-canvas,
.atmosphere,
.aperture,
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.portal-canvas {
  z-index: -4;
  width: 100%;
  height: 100%;
  /* The iris rings overlap near screen centre, so keep them a faint
     backdrop rather than competing with the cards. They bloom back up
     during the exit zoom (see .is-exiting rule below). */
  opacity: 0.3;
  transition: opacity 760ms var(--ease);
}

.atmosphere {
  z-index: -3;
  opacity: 0.7;
  filter: blur(4px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}

.atmosphere--left {
  background:
    linear-gradient(90deg, rgba(219, 232, 248, 0.14), transparent 45%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 88px);
}

.atmosphere--center {
  background:
    radial-gradient(circle at 50% 45%, rgba(242, 200, 121, 0.16), transparent 32%),
    radial-gradient(circle at 50% 60%, rgba(255, 169, 66, 0.08), transparent 40%);
}

.atmosphere--right {
  background:
    linear-gradient(270deg, rgba(201, 162, 106, 0.16), transparent 46%),
    radial-gradient(circle at 75% 52%, rgba(201, 162, 106, 0.2), transparent 28%);
}

.aperture {
  z-index: -2;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(255, 255, 255, 0.14) 50%, transparent calc(50% + 1px)),
    linear-gradient(180deg, transparent 50%, rgba(255, 255, 255, 0.045) 50%, transparent calc(50% + 1px)),
    radial-gradient(ellipse at center, transparent 0 28%, rgba(7, 9, 13, 0.42) 63%, rgba(7, 9, 13, 0.86) 100%);
  mask-image: radial-gradient(ellipse at center, black 0 68%, transparent 82%);
  opacity: 0.84;
}

.grain {
  z-index: -1;
  opacity: 0.16;
  background-image:
    linear-gradient(115deg, rgba(255, 255, 255, 0.06), transparent 28%),
    repeating-radial-gradient(circle at 18% 26%, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 5px);
  mix-blend-mode: overlay;
}

.entrance-shell::before,
.entrance-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.entrance-shell::before {
  background:
    linear-gradient(90deg, rgba(7, 9, 13, 0.82), transparent 26%, transparent 74%, rgba(7, 9, 13, 0.82)),
    radial-gradient(circle at center, transparent 32%, rgba(0, 0, 0, 0.62));
}

.entrance-shell::after {
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin: clamp(0.75rem, 1.8vw, 1.5rem);
}

.entrance-stage {
  width: min(1160px, calc(100% - 2rem));
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: minmax(1.5rem, 0.88fr) auto auto auto auto minmax(1rem, 0.74fr);
  align-items: center;
  justify-items: center;
  padding: clamp(1.25rem, 3vw, 2.5rem) 0;
  text-align: center;
}

.entrance-kicker,
.entrance-note,
.transition-message {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: clamp(0.66rem, 1vw, 0.82rem);
  color: rgba(247, 243, 232, 0.58);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.entrance-kicker {
  grid-row: 2;
  margin: 0 0 0.75rem;
}

.entrance-title {
  grid-row: 3;
  margin: 0;
  font-family: Syne, Manrope, sans-serif;
  font-size: clamp(2.65rem, 8.2vw, 7rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0;
  text-wrap: balance;
}

.entrance-subtitle {
  grid-row: 4;
  margin: 0.9rem 0 clamp(1.35rem, 3vw, 2.35rem);
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.3rem);
}

.portal-options {
  grid-row: 5;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.8vw, 1.25rem);
  perspective: 1400px;
}

.portal-option {
  position: relative;
  min-height: clamp(12rem, 26vh, 17.5rem);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  align-items: end;
  padding: clamp(1rem, 2.2vw, 1.7rem);
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 42%), var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
  transform: translateZ(0);
  transition:
    border-color 720ms var(--ease),
    background 720ms var(--ease),
    transform 860ms var(--ease),
    box-shadow 860ms var(--ease),
    opacity 720ms var(--ease),
    filter 720ms var(--ease);
}

.portal-option::before,
.portal-option::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.portal-option::before {
  inset: 0;
  opacity: 0.58;
  transition: opacity 760ms var(--ease), transform 980ms var(--ease);
}

.portal-option::after {
  inset: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  opacity: 0.42;
  transform: scale(0.985);
  transition: opacity 760ms var(--ease), transform 760ms var(--ease);
}

.portal-preview,
.portal-impact {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.portal-preview {
  opacity: 0;
  transform: translateY(0.45rem) scale(0.98);
  transition: opacity 840ms var(--ease), transform 920ms var(--ease);
}

.portal-option:hover .portal-preview,
.portal-option:focus-visible .portal-preview,
.portal-option.is-active .portal-preview {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.portal-impact {
  opacity: 0;
}

.portal-impact::before,
.portal-impact::after {
  content: "";
  position: absolute;
  inset: auto;
  border-radius: 999px;
}

.portal-impact::before {
  top: 16%;
  left: 50%;
  width: 16rem;
  height: 16rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  transform: translate(-50%, -50%) scale(0.42);
}

.portal-impact::after {
  top: 0;
  bottom: 0;
  width: 7rem;
  border-radius: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: translateX(-160%) skewX(-18deg);
}

.portal-option:hover .portal-impact,
.portal-option:focus-visible .portal-impact,
.portal-option.is-active .portal-impact {
  opacity: 1;
}

.portal-option:hover .portal-impact::before,
.portal-option:focus-visible .portal-impact::before,
.portal-option.is-active .portal-impact::before {
  animation: portal-ripple 1.7s var(--ease) infinite;
}

.portal-option:hover .portal-impact::after,
.portal-option:focus-visible .portal-impact::after,
.portal-option.is-active .portal-impact::after {
  animation: portal-sweep 2.2s var(--ease) infinite;
}

.portal-option--classic::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 38%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(125, 170, 220, 0.16) 0 1px, transparent 1px 42px);
}

.portal-option--cinematic::before {
  background:
    radial-gradient(circle at 76% 24%, rgba(255, 224, 148, 0.34), transparent 24%),
    linear-gradient(135deg, transparent 20%, rgba(242, 200, 121, 0.18), transparent 58%),
    repeating-linear-gradient(115deg, rgba(242, 200, 121, 0.11) 0 1px, transparent 1px 44px);
}

.portal-option--premiere::before {
  background:
    radial-gradient(circle at 50% 48%, rgba(201, 162, 106, 0.3), transparent 34%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 28%, transparent 72%, rgba(0, 0, 0, 0.5)),
    repeating-linear-gradient(0deg, rgba(201, 162, 106, 0.07) 0 1px, transparent 1px 38px);
}

.preview-line,
.preview-card,
.preview-chip,
.preview-beam,
.preview-glow,
.preview-word,
.preview-letterbox,
.preview-ring,
.preview-flare {
  position: absolute;
  display: block;
}

.preview-line {
  top: 24%;
  left: 8%;
  width: 34%;
  height: 1px;
  background: rgba(235, 245, 255, 0.42);
  box-shadow: 0 1.2rem 0 rgba(235, 245, 255, 0.18), 0 2.4rem 0 rgba(235, 245, 255, 0.12);
}

.preview-line--wide {
  top: 16%;
  width: 52%;
}

.preview-card {
  right: 9%;
  width: 28%;
  height: 27%;
  border: 1px solid rgba(235, 245, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 32%),
    rgba(160, 196, 235, 0.08);
}

.preview-card--one {
  top: 18%;
}

.preview-card--two {
  top: 48%;
  transform: translateX(-22%);
}

.preview-chip {
  left: 9%;
  bottom: 18%;
  min-width: 5.3rem;
  padding: 0.38rem 0.5rem;
  border: 1px solid rgba(235, 245, 255, 0.28);
  color: rgba(235, 245, 255, 0.72);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.05);
}

.preview-chip--alt {
  left: auto;
  right: 12%;
  bottom: 13%;
}

.preview-beam {
  width: 42%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 218, 128, 0.72), transparent);
  box-shadow: 0 0 24px rgba(255, 190, 78, 0.34);
  transform: rotate(-24deg);
}

.preview-beam--one {
  top: 24%;
  right: 8%;
}

.preview-beam--two {
  top: 46%;
  left: 12%;
  opacity: 0.7;
}

.preview-glow {
  top: 18%;
  right: 14%;
  width: 8rem;
  height: 8rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 220, 132, 0.42), transparent 65%);
  filter: blur(10px);
}

.preview-word {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: rgba(255, 226, 150, 0.66);
  text-transform: uppercase;
}

.preview-word--one {
  left: 13%;
  bottom: 26%;
}

.preview-word--two {
  right: 20%;
  bottom: 18%;
}

.preview-word--three {
  right: 13%;
  top: 18%;
}

.preview-letterbox {
  left: 0;
  right: 0;
  height: 14%;
  background: rgba(0, 0, 0, 0.78);
}

.preview-letterbox--top {
  top: 0;
}

.preview-letterbox--bottom {
  bottom: 0;
}

.preview-ring {
  top: 50%;
  left: 50%;
  width: 4.4rem;
  height: 4.4rem;
  transform: translate(-50%, -56%);
  border: 1px solid rgba(201, 162, 106, 0.65);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Syne", Georgia, serif;
  font-style: italic;
  font-size: 1.6rem;
  color: rgba(236, 228, 214, 0.85);
}

.preview-ring::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px dashed rgba(201, 162, 106, 0.3);
  border-radius: 999px;
}

.portal-option--premiere:hover .preview-ring,
.portal-option--premiere.is-active .preview-ring {
  animation: premiere-ring-pulse 2.4s var(--ease) infinite;
}

@keyframes premiere-ring-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 162, 106, 0.32); }
  50% { box-shadow: 0 0 0 12px rgba(201, 162, 106, 0); }
}

.preview-flare {
  top: 16%;
  left: 14%;
  width: 6rem;
  height: 6rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(201, 162, 106, 0.4), transparent 65%);
  filter: blur(12px);
}

.portal-option:hover,
.portal-option:focus-visible,
.portal-option.is-active {
  transform: translateY(-0.5rem) rotateX(2deg) scale(1.018);
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.52);
}

.portal-option:hover::before,
.portal-option:focus-visible::before,
.portal-option.is-active::before {
  opacity: 0.88;
  transform: scale(1.04);
}

.portal-option:hover::after,
.portal-option:focus-visible::after,
.portal-option.is-active::after {
  opacity: 0.96;
  transform: scale(1);
}

.portal-option:focus-visible {
  outline: 3px solid var(--cinematic-strong);
  outline-offset: 5px;
}

.portal-option--classic:hover,
.portal-option--classic:focus-visible,
.portal-option--classic.is-active {
  border-color: rgba(232, 241, 255, 0.72);
}

.portal-option--cinematic:hover,
.portal-option--cinematic:focus-visible,
.portal-option--cinematic.is-active {
  border-color: rgba(242, 200, 121, 0.82);
}

.portal-option--premiere:hover,
.portal-option--premiere:focus-visible,
.portal-option--premiere.is-active {
  border-color: rgba(201, 162, 106, 0.9);
}

.portal-option__index,
.portal-option__label,
.portal-option__desc,
.portal-option__action {
  position: relative;
  z-index: 2;
}

.portal-option__index {
  justify-self: start;
  align-self: start;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  color: rgba(247, 243, 232, 0.54);
}

.portal-option__label {
  display: block;
  margin-top: 2.8rem;
  font-family: Syne, Manrope, sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.portal-option__desc {
  display: block;
  margin-top: 0.8rem;
  color: rgba(247, 243, 232, 0.76);
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
}

.portal-option__action {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-top: 1.4rem;
  padding: 0 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 700;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.065);
  transition: background 620ms var(--ease), border-color 620ms var(--ease), transform 720ms var(--ease);
}

.portal-option:hover .portal-option__action,
.portal-option:focus-visible .portal-option__action,
.portal-option.is-active .portal-option__action {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.38);
  transform: translateX(0.2rem);
}

.entrance-note {
  grid-row: 6;
  align-self: end;
  margin: clamp(1rem, 2vw, 1.5rem) 0 0;
  transition: opacity 360ms var(--ease), transform 360ms var(--ease);
}

.transition-message {
  grid-row: 6;
  align-self: end;
  min-height: 0;
  margin: clamp(1rem, 2vw, 1.5rem) 0 0;
  color: rgba(247, 243, 232, 0.78);
  opacity: 0;
  transform: translateY(0.6rem);
  transition: opacity 360ms var(--ease), transform 360ms var(--ease);
}

.entrance-shell[data-hover="classic"] .atmosphere--left,
.entrance-shell[data-hover="cinematic"] .atmosphere--center,
.entrance-shell[data-hover="premiere"] .atmosphere--right {
  opacity: 1;
  transform: scale(1.03);
}

.entrance-shell.is-exiting {
  cursor: progress;
}

.entrance-shell.is-exiting .portal-option {
  transition-duration: 1150ms;
}

.entrance-shell.is-exiting .entrance-note {
  opacity: 0;
  transform: translateY(-0.4rem);
}

.entrance-shell.is-exiting .transition-message {
  opacity: 1;
  transform: translateY(0);
}

.entrance-shell.is-exiting .portal-option:not(.is-selected) {
  opacity: 0.055;
  filter: blur(2px) saturate(0.45);
  pointer-events: none;
  transform: translateY(0.35rem) scale(0.88);
}

.entrance-shell.is-exiting .portal-option.is-selected {
  z-index: 3;
  transform: translateY(-0.25rem) scale(1.075);
  border-color: rgba(255, 255, 255, 0.86);
}

/* Cards converge on the center column of the 3-wide grid during exit. */
.entrance-shell.is-exiting[data-selected="classic"] .portal-option.is-selected {
  transform: translateX(calc(100% + 1.25rem)) translateY(-0.25rem) scale(1.14);
}

.entrance-shell.is-exiting[data-selected="cinematic"] .portal-option.is-selected {
  transform: translateY(-0.25rem) scale(1.14);
}

.entrance-shell.is-exiting[data-selected="premiere"] .portal-option.is-selected {
  transform: translateX(calc(-100% - 1.25rem)) translateY(-0.25rem) scale(1.14);
}

/* On exit the scene isolates and zooms the chosen iris — let it bloom. */
.entrance-shell.is-exiting .portal-canvas {
  opacity: 0.92;
}

.entrance-shell.no-webgl .portal-canvas {
  display: none;
}

@keyframes portal-ripple {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.42);
  }

  24% {
    opacity: 0.72;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.18);
  }
}

@keyframes portal-sweep {
  0% {
    opacity: 0;
    transform: translateX(-160%) skewX(-18deg);
  }

  28% {
    opacity: 0.72;
  }

  74%,
  100% {
    opacity: 0;
    transform: translateX(220%) skewX(-18deg);
  }
}

@media (max-width: 760px) {
  body {
    overflow-y: auto;
  }

  .entrance-stage {
    min-height: auto;
    padding: 1.5rem 0;
    grid-template-rows: auto;
  }

  .entrance-shell {
    overflow: visible;
  }

  .entrance-kicker,
  .entrance-title,
  .entrance-subtitle,
  .portal-options,
  .entrance-note,
  .transition-message {
    grid-row: auto;
  }

  .portal-options {
    grid-template-columns: 1fr;
  }

  .portal-option {
    min-height: 11rem;
  }

  .portal-preview {
    opacity: 0.5;
    transform: none;
  }

  .portal-option__label {
    margin-top: 1.7rem;
  }

  /* Single-column layout: no sideways convergence, just lift in place. */
  .entrance-shell.is-exiting[data-selected="classic"] .portal-option.is-selected,
  .entrance-shell.is-exiting[data-selected="cinematic"] .portal-option.is-selected,
  .entrance-shell.is-exiting[data-selected="premiere"] .portal-option.is-selected {
    transform: translateY(-0.25rem) scale(1.05);
  }
}

@media (prefers-reduced-motion: reduce), (pointer: coarse) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .portal-canvas {
    display: none;
  }

  .aperture {
    opacity: 0.42;
  }

  .portal-option:hover,
  .portal-option:focus-visible,
  .portal-option.is-active {
    transform: none;
  }

  .portal-impact {
    display: none;
  }
}
