/* Firstsource blue stage — #1E2247 / #DF6014 */
:root {
  --fs-navy: #1e2247;
  --fs-navy-deep: #12153a;
  --fs-blue: #2c3870;
  --fs-orange: #df6014;
  --fs-orange-deep: #b84a0c;
  --ink: #eef0f8;
  --ink-soft: rgba(238, 240, 248, 0.78);
  --muted: rgba(238, 240, 248, 0.55);
  --card: #ffffff;
  --rule: rgba(255, 255, 255, 0.14);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Source Sans 3", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --cube: 148px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body.theme-blue {
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--fs-navy-deep);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

.stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.stage-wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 85% 10%, rgba(223, 96, 20, 0.2), transparent 55%),
    radial-gradient(ellipse 55% 50% at 15% 85%, rgba(70, 110, 220, 0.16), transparent 55%),
    linear-gradient(160deg, #141833 0%, #1e2247 42%, #16204a 100%);
}
.stage-grid {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
}
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
}
.glow-a {
  width: 280px; height: 280px;
  right: 12%; top: 18%;
  background: rgba(223, 96, 20, 0.16);
  animation: drift 12s ease-in-out infinite;
}
.glow-b {
  width: 320px; height: 320px;
  left: 8%; bottom: 10%;
  background: rgba(90, 140, 255, 0.12);
  animation: drift 15s ease-in-out 1s infinite reverse;
}

.orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.orbit-a {
  width: min(68vw, 580px);
  height: min(68vw, 580px);
  right: -14%;
  top: -20%;
  border-color: rgba(223, 96, 20, 0.22);
  animation: spin 48s linear infinite;
}
.orbit-b {
  width: min(48vw, 400px);
  height: min(48vw, 400px);
  left: -10%;
  bottom: 6%;
  animation: spin 64s linear infinite reverse;
}
.orbit-a::before,
.orbit-b::before {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  top: 14%;
  left: 50%;
}
.orbit-a::before {
  background: var(--fs-orange);
  box-shadow: 0 0 0 6px rgba(223, 96, 20, 0.18);
}
.orbit-b::before {
  background: rgba(255,255,255,0.75);
  box-shadow: 0 0 0 6px rgba(255,255,255,0.1);
  top: 70%;
}

.signal-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.65;
}
.signal {
  fill: none;
  stroke-width: 1.2;
  stroke-linecap: round;
}
.s1 { stroke: rgba(223, 96, 20, 0.4); stroke-dasharray: 8 14; animation: dash 16s linear infinite; }
.s2 { stroke: rgba(255, 255, 255, 0.18); stroke-dasharray: 4 12; animation: dash 22s linear infinite reverse; }
.s3 { stroke: rgba(223, 96, 20, 0.22); stroke-dasharray: 2 10; animation: dash 26s linear infinite; }
.s4 { stroke: rgba(140, 170, 255, 0.22); stroke-dasharray: 6 16; animation: dash 30s linear infinite reverse; }

.float-chip {
  position: absolute;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(30, 34, 71, 0.55);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.chip-1 { top: 16%; right: 8%; color: #ffb483; border-color: rgba(223, 96, 20, 0.35); animation: floaty 7s ease-in-out infinite; }
.chip-2 { top: 30%; right: 18%; animation: floaty 8.5s ease-in-out 0.5s infinite; }
.chip-3 { bottom: 26%; left: 6%; animation: floaty 9s ease-in-out 1s infinite; }
.chip-4 { bottom: 14%; left: 18%; animation: floaty 7.5s ease-in-out 1.3s infinite; color: #ffb483; border-color: rgba(223, 96, 20, 0.3); }
.chip-5 { top: 48%; left: 6%; animation: floaty 8s ease-in-out 0.8s infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dash { to { stroke-dashoffset: -280; } }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(18px, -22px); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.4; }
}
@keyframes spinCube {
  from { transform: rotateX(-18deg) rotateY(0deg); }
  to { transform: rotateX(-18deg) rotateY(360deg); }
}
@keyframes spinCubeAlt {
  from { transform: rotateX(16deg) rotateY(180deg); }
  to { transform: rotateX(16deg) rotateY(-180deg); }
}
@keyframes wordFloat {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50% { transform: translateY(-8px); opacity: 1; }
}

.portal-top,
.portal-main,
.portal-foot { position: relative; z-index: 1; }

.portal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.75rem;
  max-width: 1180px;
  margin: 0 auto;
  animation: rise 0.5s ease both;
}
.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--fs-navy);
  background: rgba(255, 255, 255, 0.96);
  padding: 0.4rem 0.75rem 0.4rem 0.55rem;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.portal-logo {
  height: 34px;
  width: auto;
  display: block;
}
.portal-brand-mark {
  font-family: var(--serif);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--fs-navy);
  padding-left: 0.65rem;
  border-left: 1px solid rgba(30, 34, 71, 0.15);
}
.portal-top-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.portal-pill {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
}
.portal-pill:first-child {
  background: rgba(223, 96, 20, 0.22);
  color: #ffb483;
}
.portal-badge {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
}

.portal-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.75rem 1.75rem 4rem;
}

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 1.25rem 2rem;
  align-items: center;
  min-height: 0;
  margin-bottom: 1.35rem;
  padding-top: 0.35rem;
  animation: rise 0.55s ease 0.05s both;
}
.hero-copy { max-width: 36rem; }
.portal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffb483;
  margin-bottom: 0.65rem;
}
.pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--fs-orange);
  animation: pulse 1.8s ease-in-out infinite;
}
.portal-hero h1 {
  font-family: var(--serif);
  font-size: clamp(1.85rem, 3.6vw, 2.7rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: #fff;
  margin-bottom: 0.7rem;
}
.portal-lede {
  font-size: 0.98rem;
  color: var(--ink-soft);
  margin-bottom: 0.9rem;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.5rem;
  margin: 0.85rem 0 0.15rem;
  max-width: 36rem;
}
.hero-chip {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(30, 34, 71, 0.55);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.82);
}
.hero-chip.is-hot {
  color: #ffb483;
  border-color: rgba(223, 96, 20, 0.35);
}

.word-field {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
  margin-top: 0.35rem;
}
.word-chip {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.78);
  animation: wordFloat 5.5s ease-in-out infinite;
}
.word-chip:nth-child(odd) { animation-duration: 6.4s; }
.word-chip:nth-child(3n) { animation-duration: 7.2s; color: #ffb483; border-color: rgba(223, 96, 20, 0.35); }
.word-chip:nth-child(4n) { animation-delay: 0.8s; }
.word-chip.hot {
  background: rgba(223, 96, 20, 0.16);
  border-color: rgba(223, 96, 20, 0.4);
  color: #ffc49a;
  font-weight: 600;
}

.hero-viz {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2.25rem;
  flex-wrap: wrap;
  perspective: 1000px;
  padding: 0.4rem 0 0.6rem;
}
.cube-block {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.7rem;
}
.cube-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin: 0;
  position: relative;
  z-index: 2;
}
.cube-scene {
  width: calc(var(--cube) * 1.48);
  height: calc(var(--cube) * 1.58);
  margin: 0 auto;
  display: grid;
  place-items: center;
  perspective: 900px;
}
.cube {
  width: var(--cube);
  height: var(--cube);
  position: relative;
  transform-style: preserve-3d;
}
.cube-spin-a { animation: spinCube 18s linear infinite; }
.cube-spin-b { animation: spinCubeAlt 22s linear infinite; }
.cube:hover { animation-play-state: paused; }

.face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0.75rem;
  border-radius: 12px;
  backface-visibility: hidden;
  overflow: hidden;
  text-align: center;
  background-image: none !important;
  backdrop-filter: blur(14px) saturate(1.35);
  -webkit-backdrop-filter: blur(14px) saturate(1.35);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    0 8px 28px rgba(18, 21, 58, 0.22);
}
.face.front  {
  background: linear-gradient(145deg, rgba(223, 96, 20, 0.42), rgba(255, 176, 120, 0.28));
  border-color: rgba(255, 190, 140, 0.55);
}
.face.back   {
  background: linear-gradient(145deg, rgba(120, 170, 255, 0.4), rgba(70, 120, 220, 0.28));
  border-color: rgba(170, 205, 255, 0.5);
}
.face.right  {
  background: linear-gradient(145deg, rgba(255, 160, 90, 0.38), rgba(223, 96, 20, 0.3));
  border-color: rgba(255, 200, 150, 0.5);
}
.face.left   {
  background: linear-gradient(145deg, rgba(100, 160, 255, 0.38), rgba(90, 140, 255, 0.26));
  border-color: rgba(160, 200, 255, 0.48);
}
.face.top    {
  background: linear-gradient(145deg, rgba(255, 190, 140, 0.36), rgba(255, 210, 170, 0.22));
  border-color: rgba(255, 220, 190, 0.55);
}
.face.bottom {
  background: linear-gradient(145deg, rgba(150, 190, 255, 0.36), rgba(110, 150, 230, 0.24));
  border-color: rgba(190, 215, 255, 0.5);
}
.face span {
  position: relative;
  z-index: 1;
  font-family: var(--sans);
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 1px 10px rgba(18, 21, 58, 0.45);
  max-width: 92%;
}
.face.front  { transform: translateZ(calc(var(--cube) / 2)); }
.face.back   { transform: rotateY(180deg) translateZ(calc(var(--cube) / 2)); }
.face.right  { transform: rotateY(90deg) translateZ(calc(var(--cube) / 2)); }
.face.left   { transform: rotateY(-90deg) translateZ(calc(var(--cube) / 2)); }
.face.top    { transform: rotateX(90deg) translateZ(calc(var(--cube) / 2)); }
.face.bottom { transform: rotateX(-90deg) translateZ(calc(var(--cube) / 2)); }

.portal-modules {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 1.15rem 1.25rem 1.25rem;
  backdrop-filter: blur(10px);
  animation: rise 0.55s ease 0.18s both;
}
.portal-modules-head { margin-bottom: 0.85rem; }
.portal-modules-head h2 {
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 400;
  color: #fff;
  margin-bottom: 0.3rem;
}
.portal-modules-head p {
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 36rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}
.mod-card {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(18, 21, 58, 0.55);
  border-radius: 12px;
  padding: 1.2rem 1.25rem 1.1rem;
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: start;
  transition: transform 0.18s, border-color 0.18s, background 0.18s;
  font: inherit;
  color: inherit;
  width: 100%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.mod-card::before {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: 0;
  background-image: var(--mod-bg);
  background-size: cover;
  background-position: center;
  filter: blur(5px) saturate(1.2);
  transform: scale(1.04);
  pointer-events: none;
  transition: filter 0.18s, transform 0.18s;
}
.mod-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(155deg, rgba(18, 21, 58, 0.38) 0%, rgba(18, 21, 58, 0.62) 100%);
  transition: background 0.18s;
}
.mod-num,
.mod-body,
.mod-side {
  position: relative;
  z-index: 1;
}
.mod-num { grid-column: 1; }
.mod-body { grid-column: 2; }
.mod-side { grid-column: 3; }
a.mod-card {
  text-decoration: none;
  color: inherit;
}
.mod-card:hover:not(.is-locked) {
  transform: translateY(-2px);
  border-color: rgba(223, 96, 20, 0.55);
}
.mod-card:hover:not(.is-locked)::before {
  filter: blur(2px) saturate(1.28);
  transform: scale(1.06);
}
.mod-card:hover:not(.is-locked)::after {
  background: linear-gradient(155deg, rgba(18, 21, 58, 0.28) 0%, rgba(18, 21, 58, 0.52) 100%);
}
.mod-card.is-locked {
  cursor: not-allowed;
  opacity: 1;
  filter: none;
}
.mod-card.is-locked::before {
  filter: blur(6px) saturate(1.05);
  opacity: 0.95;
}
.mod-card.is-locked::after {
  background: linear-gradient(155deg, rgba(18, 21, 58, 0.5) 0%, rgba(18, 21, 58, 0.7) 100%);
}
.mod-card.is-locked:hover { transform: none; border-color: rgba(255,255,255,0.16); }
.mod-card.is-open { border-color: rgba(223, 96, 20, 0.55); }
.mod-card.is-open::after {
  background: linear-gradient(155deg, rgba(18, 21, 58, 0.32) 0%, rgba(18, 21, 58, 0.58) 100%);
}
.mod-num {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffb483;
  padding-top: 0.2rem;
}
.mod-body h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: #fff;
  margin-bottom: 0.35rem;
  line-height: 1.2;
}
.mod-body p {
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.mod-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}
.mod-pill {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.22rem 0.45rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  color: var(--muted);
}
.mod-pill.live {
  background: rgba(223, 96, 20, 0.2);
  color: #ffb483;
}
.mod-status {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  padding-top: 0.25rem;
}
.mod-card.is-open .mod-status {
  color: #ffb483;
  font-weight: 600;
}
.mod-lock {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
}
.mod-lock svg { width: 15px; height: 15px; }

.portal-foot {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.75rem 2rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.unlock-dialog {
  border: none;
  border-radius: 14px;
  padding: 0;
  max-width: 420px;
  width: calc(100vw - 2rem);
  background: transparent;
  box-shadow: 0 24px 64px rgba(10, 12, 30, 0.45);
}
.unlock-dialog::backdrop {
  background: rgba(10, 12, 30, 0.65);
  backdrop-filter: blur(4px);
}
.unlock-sheet {
  background: #fff;
  border-radius: 14px;
  padding: 1.35rem 1.4rem 1.4rem;
  color: #1e2247;
}
.unlock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}
.unlock-head h3 {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 400;
  color: #1e2247;
}
.unlock-x {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #6b7190;
  cursor: pointer;
}
.unlock-mod-name {
  font-size: 0.9rem;
  color: #3d4466;
  margin-bottom: 1rem;
}
.unlock-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7190;
  margin-bottom: 0.4rem;
}
#unlock-input {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(30, 34, 71, 0.15);
  border-radius: 8px;
  outline: none;
  background: #fafbfc;
  color: #1e2247;
}
#unlock-input:focus {
  border-color: var(--fs-orange);
  box-shadow: 0 0 0 3px rgba(223, 96, 20, 0.15);
}
.unlock-error {
  margin-top: 0.55rem;
  font-size: 0.85rem;
  color: var(--fs-orange-deep);
}
.unlock-error.hidden { display: none; }
.unlock-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 1.15rem;
}
.btn-ghost,
.btn-primary {
  appearance: none;
  border-radius: 7px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  cursor: pointer;
}
.btn-ghost {
  border: 1px solid rgba(30, 34, 71, 0.15);
  background: transparent;
  color: #3d4466;
}
.btn-primary {
  border: none;
  background: var(--fs-orange);
  color: #fff;
}
.btn-primary:hover { background: var(--fs-orange-deep); }

@media (max-width: 960px) {
  .portal-hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .hero-viz { order: -1; }
  --cube: 140px;
}
@media (max-width: 820px) {
  .module-grid { grid-template-columns: 1fr; }
  .portal-top { padding: 1rem 1.15rem; }
  .portal-main { padding: 0.5rem 1.15rem 3rem; }
  .portal-brand-mark { font-size: 1.15rem; }
  .portal-badge { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cube-spin-a, .cube-spin-b, .word-chip, .pulse, .glow,
  .orbit, .signal, .float-chip { animation: none !important; }
}
