@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

html, body {
  margin: 0;
  padding: 0;
  background: #000;
  overflow: hidden;
  height: 100%;
  width: 100%;
}

#scene-root {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

#scene-scale {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  transform-origin: center center;
  transform: translate(var(--scene-x), var(--scene-y)) scale(var(--scene-scale));
}

/* =========================================================
   VHS / CRT LOADER
   ========================================================= */
#loader {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  font-family: 'Array', sans-serif;
  color: #fff;
  overflow: hidden;
}

.intro-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  color: #fff;
  pointer-events: none;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
}

.utc-time {
  position: absolute;
  top: 2rem;
  left: 2rem;
  font-size: 0.75rem;
  color: #cfcfcf;
  animation: none;
}

.quote {
  position: static;
  max-width: 720px;
  width: 90%;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.8;
  animation: none;
  margin: 0;
}
.quote .author {
  display: block;
  margin-top: 1rem;
  font-size: 0.7rem;
  color: #9a9a9a;
}

.loader-bar {
  position: static;
  transform: none;
  width: min(420px, 72vw);
  height: 4px;
  background: rgba(255,255,255,0.15);
  overflow: hidden;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.loader-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: #fff;
  animation: loadProgress 5s forwards;
}
.loader-bar.is-hidden {
  opacity: 0;
  transform: none;
}

.close-btn {
  position: static;
  transform: none;
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: none;
  border: none;
  color: #fff;
  display: none;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  animation: none;
  --flip-depth: 18px;
}
.close-btn.is-visible {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

#loader .close-btn,
#loader .close-btn.icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
}

#loader .close-btn .face {
  font-family: inherit;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

@keyframes loadProgress {
  to { width: 100%; }
}

@keyframes opacity {
  0% { opacity: .6; }
  20% { opacity: .3; }
  35% { opacity: .5; }
  50% { opacity: .8; }
  60% { opacity: .4; }
  80% { opacity: .7; }
  100% { opacity: .6; }
}

/* ===== FOREGROUND ROW ===== */
.fg-strip {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 14vh;
  overflow: hidden;
  pointer-events: none;
  z-index: 6;
}

.fg-track {
  position: absolute;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  height: 100%;
  width: max-content;
  will-change: transform;
  animation: scrollLeft 70s linear infinite;
  animation-play-state: paused;
}

.fg-unit {
  position: relative;
  height: 100%;
  flex-shrink: 0;
}

.fg-unit img,
.mg-unit img,
.bg-unit img {
  width: auto;
  aspect-ratio: 32 / 7;
}

.fg-unit + .fg-unit {
  margin-left: -60px;
}

.fg-unit img.lightA {
  height: 100%;
  display: block;
}

.fg-unit img.lightB {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 100%;
  opacity: 0;
}

@keyframes scrollLeft {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ===== MIDGROUND ROW ===== */
.mg-strip {
  position: absolute;
  bottom: 2vh;
  left: 0;
  width: 100%;
  height: 18vh;
  overflow: hidden;
  pointer-events: none;
  z-index: 5;
}

.mg-track {
  position: absolute;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  height: 100%;
  width: max-content;
  will-change: transform;
  animation: scrollLeft 110s linear infinite;
  filter: brightness(0.8);
  animation-play-state: paused;
}

.mg-unit {
  position: relative;
  height: 100%;
  flex-shrink: 0;
}

.mg-unit + .mg-unit {
  margin-left: -40px;
}

.mg-unit img.lightA {
  height: 100%;
  display: block;
}

.mg-unit img.lightB {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 100%;
  opacity: 0;
}

/* ===== STAR FIELD ===== */
#stars {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 1; /* stars above deep space */
  pointer-events: none;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  opacity: 0.6;
  animation: blink 3s infinite ease-in-out, drift linear infinite;
}

@keyframes blink {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

@keyframes drift {
  from { transform: translateY(0); }
  to   { transform: translateY(40px); }
}

/* =========================================================
   DEEP SPACE COMETS (BEHIND STARS)
   ========================================================= */

#comet-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0; /* behind stars */
}

/* Wrapper gets positioned + moved (JS will animate it) */
.comet-wrap {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform, opacity;
}

/* The comet visual itself (rotated to match direction) */
.comet {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;

  /* “hot nucleus” look */
  background: radial-gradient(
    circle at 35% 35%,
    rgba(255,255,255,0.95) 0%,
    rgba(255,255,255,0.45) 20%,
    currentColor 55%,
    rgba(0,0,0,0) 75%
  );

  /* bloom */
  filter: blur(0.2px);
  box-shadow:
    0 0 10px currentColor,
    0 0 26px currentColor,
    0 0 60px currentColor;

  /* direction control (JS will set --angle) */
  transform: rotate(var(--angle, -45deg));
  transform-origin: center;
  will-change: transform;
}

/* Tail plume (soft) */
.comet::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 340px;
  height: 14px;
  transform: translate(-100%, -50%);
  background: radial-gradient(
    closest-side,
    rgba(255,255,255,0.18),
    rgba(255,255,255,0.06) 55%,
    rgba(0,0,0,0) 100%
  );
  filter: blur(6px);
  opacity: 0.75;
}

/* Tail core (brighter streak) */
.comet::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 5px;
  transform: translate(-100%, -50%);
  background: linear-gradient(
    to right,
    rgba(0,0,0,0) 0%,
    rgba(255,255,255,0.15) 35%,
    currentColor 100%
  );
  filter: blur(1.2px);
  opacity: 0.9;
}

/* =========================================================
   IMPACT GLOW (HALF-CIRCLE AT BOTTOM HIT POINT)
   ========================================================= */

.impact {
  position: fixed;
  bottom: 0;
  left: 50%;
  width: 320px;
  height: 160px;
  transform: translate(-50%, 45%) scale(0.2);
  transform-origin: 50% 100%;
  pointer-events: none;
  opacity: 0;

  /* half-dome light */
  background: radial-gradient(
    circle at 50% 100%,
    rgba(255,255,255,0.38) 0%,
    currentColor 22%,
    rgba(0,0,0,0) 70%
  );

  filter: blur(6px);
  mix-blend-mode: screen; /* modern compositing look */
  will-change: transform, opacity;
}

/* ===== BACKGROUND ROW ===== */
.bg-strip {
  position: absolute;
  bottom: 10vh;
  left: 0;
  width: 100%;
  height: 20vh;
  overflow: hidden;
  pointer-events: none;
  z-index: 4; /* ✅ above fog */
}

.bg-track {
  position: absolute;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  height: 100%;
  width: max-content;
  will-change: transform;
  animation: scrollLeft 260s linear infinite;
  filter: brightness(0.7);
  animation-play-state: paused;
}

.bg-unit {
  position: relative;
  height: 100%;
  flex-shrink: 0;
}

.bg-unit + .bg-unit {
  margin-left: -20px;
}

.bg-unit img.lightA {
  height: 100%;
  display: block;
}

.bg-unit img.lightB {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 100%;
  opacity: 0;
}

/* ===== GROUND FOG ===== */
#ground-fog {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 30vh;
  pointer-events: none;
  z-index: 3; /* fog above ground */
  overflow: hidden;

  mask-image: linear-gradient(
    to top,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 65%,
    rgba(0,0,0,0) 100%
  );
  -webkit-mask-image: linear-gradient(
    to top,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 65%,
    rgba(0,0,0,0) 100%
  );
}

#ground-fog::before,
#ground-fog::after {
  content: '';
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 20% 60%, rgba(180,180,180,0.25), transparent 60%),
    radial-gradient(circle at 70% 50%, rgba(160,160,160,0.22), transparent 65%),
    radial-gradient(circle at 45% 70%, rgba(200,200,200,0.18), transparent 70%);
  filter: blur(60px);
  animation: fogDrift 140s linear infinite;
}

#ground-fog::after {
  animation-duration: 220s;
  opacity: 0.6;
}

@keyframes fogDrift {
  from { transform: translateX(-10%) translateY(0); }
  to   { transform: translateX(10%) translateY(-5%); }
}

.landing-motion-paused #scene-root *,
.landing-motion-paused #stars *,
.landing-motion-paused #comet-layer * {
  animation-play-state: paused !important;
}

/* ===== SKY LIGHTS - FRONT ===== */
#sky-lights-front {
  position: absolute;
  inset: -40vh 0;
  pointer-events: none;
  z-index: 5;
  overflow: visible;
}

/* ===== SKY LIGHTS - BACK ===== */
#sky-lights-back {
  position: absolute;
  inset: -40vh 0;
  pointer-events: none;
  z-index: 4;
  overflow: visible;
}

/* ===== SKY LIGHT BASE ===== */
.sky-light {
  position: absolute;
  top: -10vh;
  bottom: -10vh;
  width: 6px;
  height: 100%;
  transform-origin: bottom center;
  pointer-events: none;
  isolation: isolate;
}

/* GREEN - gentle upward sweep */
@keyframes beamSwayGreen {
  0%   { transform: rotate(6deg); }
  50%  { transform: rotate(14deg); }
  100% { transform: rotate(6deg); }
}

/* PURPLE - reversed + more downward */
@keyframes beamSwayPurple {
  0%   { transform: rotate(-22deg); }
  50%  { transform: rotate(-16deg); }
  100% { transform: rotate(-22deg); }
}

/* ORANGE - massive sweeping motion */
@keyframes beamSwayOrange {
  0%   { transform: rotate(45deg); }
  50%  { transform: rotate(-5deg); }
  100% { transform: rotate(45deg); }
}

/* SKY BLUE - slow drift toward left */
@keyframes beamSwaySkyBlue {
  0%   { transform: rotate(10deg); }
  50%  { transform: rotate(-6deg); }
  100% { transform: rotate(10deg); }
}

@keyframes beamPulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

/* GREEN (RIGHT) - lateral wave, left + right */
@keyframes beamSwayGreenSide {
  0%   { transform: rotate(-26deg); }
  50%  { transform: rotate(8deg); }
  100% { transform: rotate(-26deg); }
}

/* LIGHT PURPLE - lateral wave (side to side) */
@keyframes beamWaveLavender {
  0%   { transform: rotate(-20deg) translateX(0); }
  50%  { transform: rotate(8deg) translateX(-40px); }
  100% { transform: rotate(-20deg) translateX(0); }
}

/* GREEN beam */
.sky-light.green {
  left: 5vw;
  animation:
    beamSwayGreen 11s ease-in-out infinite,
    beamPulse 4.5s ease-in-out infinite;
  background: linear-gradient(
    to top,
    rgba(20, 241, 149, 1.0) 0%,
    rgba(20, 241, 149, 0.7) 20%,
    rgba(20, 241, 149, 0.35) 45%,
    rgba(20, 241, 149, 0.15) 70%,
    rgba(20, 241, 149, 0.06) 100%
  );
  filter: blur(1px) drop-shadow(0 0 12px rgba(20, 241, 149, 0.35));
}

/* GREEN beam - right side, waving left + right */
.sky-light.green.green-right {
  left: 92vw;
  animation:
    beamSwayGreenSide 13s ease-in-out infinite,
    beamPulse 4.8s ease-in-out infinite;
}

/* PURPLE beam */
.sky-light.purple {
  left: 70vw;
  animation:
    beamSwayPurple 14s ease-in-out infinite,
    beamPulse 3.8s ease-in-out infinite;
  background: linear-gradient(
    to top,
    rgba(153, 69, 255, 1.0) 0%,
    rgba(153, 69, 255, 0.7) 20%,
    rgba(153, 69, 255, 0.35) 45%,
    rgba(153, 69, 255, 0.15) 70%,
    rgba(153, 69, 255, 0.06) 100%
  );
  filter: blur(1px) drop-shadow(0 0 12px rgba(153, 69, 255, 0.35));
}

/* ORANGE beam */
.sky-light.orange {
  left: 58vw;
  animation:
    beamSwayOrange 18s ease-in-out infinite,
    beamPulse 4.2s ease-in-out infinite;
  background: linear-gradient(
    to top,
    rgba(255, 165, 70, 1.0) 0%,
    rgba(255, 165, 70, 0.7) 22%,
    rgba(255, 165, 70, 0.35) 48%,
    rgba(255, 165, 70, 0.15) 72%,
    rgba(255, 165, 70, 0.06) 100%
  );
  filter: blur(1px) drop-shadow(0 0 12px rgba(255, 165, 70, 0.35));
}

/* SKY BLUE beam (back layer, near green, drifting left) */
.sky-light.skyblue {
  left: 19vw;
  animation:
    beamSwaySkyBlue 16s ease-in-out infinite,
    beamPulse 5.2s ease-in-out infinite;
  background: linear-gradient(
    to top,
    rgba(120, 200, 255, 0.95) 0%,
    rgba(120, 200, 255, 0.65) 22%,
    rgba(120, 200, 255, 0.35) 48%,
    rgba(120, 200, 255, 0.14) 72%,
    rgba(120, 200, 255, 0.05) 100%
  );
  filter: blur(1.2px) drop-shadow(0 0 10px rgba(120, 200, 255, 0.28));
}

/* LIGHT PURPLE beam - mid depth, side-to-side wave */
.sky-light.lavender {
  left: 50vw;
  height: 95%;
  animation:
    beamWaveLavender 14s ease-in-out infinite,
    beamPulse 5.6s ease-in-out infinite;
  background: linear-gradient(
    to top,
    rgba(200, 160, 255, 0.9) 0%,
    rgba(200, 160, 255, 0.6) 22%,
    rgba(200, 160, 255, 0.32) 48%,
    rgba(200, 160, 255, 0.14) 72%,
    rgba(200, 160, 255, 0.05) 100%
  );
  filter:
    blur(1.4px)
    drop-shadow(0 0 10px rgba(200, 160, 255, 0.28));
}

/* =========================================================
   ORBITAL RELAY - LEFT (FAR BACKGROUND)
   ========================================================= */

#orbital-left img {
  width: 80%;
  height: 80%;
  display: block;
  will-change: transform;
  filter:
    brightness(0.35)
    contrast(0.95)
    saturate(0.85);
}

/* =========================================================
   ORBITAL RELAY - RIGHT (FAR BACKGROUND)
   ========================================================= */

#orbital-right img {
  width: 80%;
  height: 80%;
  display: block;
  will-change: transform;
  filter:
    brightness(0.32)
    contrast(0.95)
    saturate(0.85);
}

/* =========================================================
   LEFT GLASS UI PANEL
   ========================================================= */

:root {
  --ui-glass-dark: rgba(6, 8, 12, 0.72);
  --ui-panel-stroke: rgba(140, 210, 255, 0.22);
  --ui-panel-glow: rgba(110, 180, 255, 0.26);
  --ui-text: #e6f1ff;
  --ui-muted: rgba(230, 241, 255, 0.55);
  --vh: 1vh;
  --impact-width-factor: 0.9;
  --impact-height-ratio: 0.5;
  --impact-blur: 18;
  --impact-peak-opacity: 0.95;
  --impact-scale-start: 0.08;
  --impact-scale-peak: 1.05;
  --impact-scale-end: 1.35;
}

.ui-panel {
  position: fixed;
  left: var(--ui-left);
  top: var(--ui-top);
  width: var(--ui-width);
  height: auto;
  padding: var(--ui-pad);
  display: flex;
  flex-direction: column;
  gap: var(--ui-gap);
  color: var(--ui-text);
  font-family: "Satoshi", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  background:
    radial-gradient(circle at 20% 15%, rgba(130, 200, 255, 0.08), transparent 45%),
    linear-gradient(140deg, rgba(18, 24, 34, 0.72), rgba(6, 8, 12, 0.62));
  border-radius: 0;
  border: 1px solid var(--ui-panel-stroke);
  z-index: 12;
  pointer-events: auto;
  overflow: hidden;
  backdrop-filter: blur(10px) saturate(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(1.05);
  box-shadow:
    0 0 22px var(--ui-panel-glow),
    0 12px 30px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 0 40px rgba(0, 0, 0, 0.45);
  isolation: isolate;
}

.ui-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 0;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.03) 0px,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 2px,
      transparent 4px
    ),
    repeating-radial-gradient(
      circle at 20% 20%,
      rgba(255, 255, 255, 0.03) 0 1px,
      rgba(0, 0, 0, 0.04) 1px 2px
    );
  opacity: 0.18;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
}

.ui-panel::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 0;
  padding: 1px;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(120, 200, 255, 0) 70deg,
    rgba(140, 220, 255, 0.55) 110deg,
    rgba(120, 200, 255, 0) 150deg,
    transparent 360deg
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.6;
  animation: borderSweep 8s linear infinite;
  pointer-events: none;
  z-index: 1;
}

.ui-panel > * {
  position: relative;
  z-index: 2;
}

.ui-panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.title-strip {
  display: flex;
  align-items: center;
}

.title-boxes {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.title-box {
  width: clamp(18px, 2.2vw, 26px);
  height: clamp(22px, 2.6vw, 30px);
  background: #0a0d12;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0;
  color: #f1f5ff;
  font-size: clamp(10px, 1.1vw, 13px);
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.12em;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.6);
}

.title-box.is-empty::after {
  content: ".";
  opacity: 0.18;
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(9px, 1vw, 11px);
  letter-spacing: 0.2em;
  color: var(--ui-muted);
  white-space: nowrap;
}

.sound-label {
  opacity: 0.7;
}

.sound-option {
  background: none;
  border: none;
  color: var(--ui-muted);
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
}

.sound-option.is-active {
  color: var(--ui-text);
  text-shadow: 0 0 8px rgba(120, 200, 255, 0.35);
}

.sound-option:focus-visible {
  outline: 1px solid rgba(120, 200, 255, 0.6);
  outline-offset: 2px;
}

.ui-terminal {
  flex: 0 0 auto;
  height: auto;
  padding: var(--ui-terminal-pad);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.2)),
    var(--ui-glass-dark);
  border: 1px solid rgba(130, 190, 255, 0.12);
  position: relative;
  overflow: hidden;
  container-type: inline-size;
  line-height: var(--ui-terminal-line);
  font-size: var(--ui-terminal-font);
  letter-spacing: 0.12em;
  text-shadow: 0 0 6px rgba(120, 200, 255, 0.18);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 18px rgba(90, 170, 255, 0.12);
}

.ui-terminal::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 0;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.02) 0px,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 2px,
      transparent 5px
    );
  opacity: 0.35;
  pointer-events: none;
}

.ui-terminal::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: rgba(200, 230, 255, 0.18);
  opacity: 0.6;
  pointer-events: none;
}

.ui-terminal p {
  margin: 0;
}

.ui-copy {
  margin: 0;
  white-space: nowrap;
}

.ui-copy--mobile {
  display: none;
}

@container (max-width: 420px) {
  .ui-copy--desktop {
    display: none;
  }

  .ui-copy--mobile {
    display: block;
  }
}

@keyframes borderSweep {
  to { transform: rotate(1turn); }
}

/* ===== BUTTON GRID (fits panel bottom) ===== */
.ui-btn-grid{
  display: flex;
  gap: var(--ui-btn-gap);
  align-items: center;
}

.ui-btn-grid .wide{
  flex: 1 1 var(--ui-btn-projects-max);
  min-width: var(--ui-btn-projects-min);
  width: auto;
}
.ui-btn-grid .icon{
  flex: 0 0 var(--ui-btn-icon);
}
.ui-btn-grid .caps{
  flex: 0 2 var(--ui-btn-caps-max);
  min-width: var(--ui-btn-caps-min);
  width: auto;
}

/* ===== BASE FLIP BUTTON ===== */
.flip-btn{
  position: relative;
  height: var(--ui-btn-h);
  --flip-depth: 26px;
  text-decoration: none;
  display: block;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(0deg);
  transition: transform 0.85s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
  border-radius: 0;
}

.flip-btn.wide{ width: 100%; min-width: 0; }
.flip-btn.icon{ min-width: var(--ui-btn-icon); width: var(--ui-btn-icon); }

.flip-btn:hover{
  transform: perspective(900px) rotateX(360deg);
}

.flip-btn:active{
  transform: perspective(900px) rotateX(360deg) translateY(1px);
}

/* Faces */
.flip-btn .face{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: "Satoshi", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 0;
  box-sizing: border-box;
  border: 1px solid rgba(140, 210, 255, 0.18);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.05),
    0 0 14px rgba(90,170,255,0.16),
    0 10px 24px rgba(0,0,0,0.4);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.28)),
    rgba(9,12,16,0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.90);
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* 3D face positions */
.flip-btn .f1{ transform: rotateX(360deg) translateZ(var(--flip-depth)); }
.flip-btn .f2{ transform: rotateX(270deg) translateZ(var(--flip-depth)); }
.flip-btn .f3{ transform: rotateX(180deg) translateZ(var(--flip-depth)); }
.flip-btn .f4{ transform: rotateX(90deg)  translateZ(var(--flip-depth)); }

/* Corner target marks */
.btn-terminal{
  --corner-size: 12px;
  --corner-thickness: 2px;
  --corner-color: rgba(140, 210, 255, 0.4);
}

.btn-terminal .face::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(var(--corner-color) 0 0) left top/var(--corner-size) var(--corner-thickness),
    linear-gradient(var(--corner-color) 0 0) left top/var(--corner-thickness) var(--corner-size),
    linear-gradient(var(--corner-color) 0 0) right top/var(--corner-size) var(--corner-thickness),
    linear-gradient(var(--corner-color) 0 0) right top/var(--corner-thickness) var(--corner-size),
    linear-gradient(var(--corner-color) 0 0) left bottom/var(--corner-size) var(--corner-thickness),
    linear-gradient(var(--corner-color) 0 0) left bottom/var(--corner-thickness) var(--corner-size),
    linear-gradient(var(--corner-color) 0 0) right bottom/var(--corner-size) var(--corner-thickness),
    linear-gradient(var(--corner-color) 0 0) right bottom/var(--corner-thickness) var(--corner-size);
  background-repeat: no-repeat;
  opacity: 0.7;
  filter: drop-shadow(0 0 6px rgba(120,200,255,0.18));
}

/* ===== MICRO GLITCH BURST ===== */
.flip-btn::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius: 0;
  pointer-events:none;
  opacity:0;
  background:
    linear-gradient(90deg, rgba(0,255,255,0.25), rgba(255,0,255,0.18), rgba(0,255,120,0.18));
  mix-blend-mode: screen;
}

.flip-btn:hover::after{
  animation: glitchFlash 0.16s steps(2,end) 1;
}

.flip-btn:active::after{
  animation: glitchFlashActive 0.1s steps(2,end) 1;
}

.flip-btn.glitch-out::after{
  animation: glitchFlashOut 0.18s steps(2,end) 1;
}

@keyframes glitchFlash{
  0%   { opacity:0; transform: translateX(0); clip-path: inset(0 0 0 0); }
  25%  { opacity:1; transform: translateX(-2px); clip-path: inset(10% 0 62% 0); }
  55%  { opacity:1; transform: translateX(2px);  clip-path: inset(58% 0 18% 0); }
  100% { opacity:0; transform: translateX(0); clip-path: inset(0 0 0 0); }
}

@keyframes glitchFlashActive{
  0%   { opacity:0; transform: translateX(0); clip-path: inset(0 0 0 0); }
  30%  { opacity:1; transform: translateX(2px); clip-path: inset(12% 0 58% 0); }
  70%  { opacity:1; transform: translateX(-2px); clip-path: inset(56% 0 18% 0); }
  100% { opacity:0; transform: translateX(0); clip-path: inset(0 0 0 0); }
}

@keyframes glitchFlashOut{
  0%   { opacity:0; transform: translateX(0); clip-path: inset(0 0 0 0); }
  30%  { opacity:1; transform: translateX(2px); clip-path: inset(14% 0 56% 0); }
  65%  { opacity:1; transform: translateX(-2px); clip-path: inset(52% 0 20% 0); }
  100% { opacity:0; transform: translateX(0); clip-path: inset(0 0 0 0); }
}
/* Hover state (shared) */
.btn-terminal:hover .face,
.btn-terminal:active .face{
  background:
    radial-gradient(circle at 30% 20%, rgba(180,255,255,0.16), transparent 40%),
    linear-gradient(90deg, rgba(160,80,255,0.28), rgba(0,255,160,0.22)),
    rgba(9,12,16,0.7);
  border-color: rgba(160, 230, 255, 0.4);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.08),
    0 0 20px rgba(120,200,255,0.22),
    0 10px 24px rgba(0,0,0,0.4);
}

.btn-terminal:hover,
.btn-terminal:active{
  --corner-color: rgba(170, 235, 255, 0.9);
}

.btn-label,
.btn-inline-text,
.btn-face-text{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  white-space: pre;
}

.btn-label .ch,
.btn-inline-text .ch,
.btn-face-text .ch{
  display: inline-block;
  --dx: 0px;
  --dy: 0px;
  --rot: 0deg;
  --drift-delay: 0ms;
}

.btn-label .ch--space,
.btn-inline-text .ch--space,
.btn-face-text .ch--space{
  width: 0.34em;
}

.flip-btn .face > :is(.btn-inline-label, .btn-inline-text, .btn-label, .btn-face-text, .btn-ic, .caps-logo, .wallet-option__icon-box, .wallet-option__content){
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-btn .f1 > :is(.btn-inline-label, .btn-inline-text, .btn-label, .btn-face-text, .btn-ic, .caps-logo, .wallet-option__icon-box, .wallet-option__content){
  transform: rotateX(0deg);
}

.flip-btn .f2 > :is(.btn-inline-label, .btn-inline-text, .btn-label, .btn-face-text, .btn-ic, .caps-logo, .wallet-option__icon-box, .wallet-option__content){
  transform: rotateX(90deg);
}

.flip-btn .f3 > :is(.btn-inline-label, .btn-inline-text, .btn-label, .btn-face-text, .btn-ic, .caps-logo, .wallet-option__icon-box, .wallet-option__content){
  transform: rotateX(180deg);
}

.flip-btn .f4 > :is(.btn-inline-label, .btn-inline-text, .btn-label, .btn-face-text, .btn-ic, .caps-logo, .wallet-option__icon-box, .wallet-option__content){
  transform: rotateX(270deg);
}

.btn-terminal:hover .ch,
.btn-terminal:active .ch{
  animation: letterDrift 2.2s ease-in-out infinite alternate;
  animation-delay: var(--drift-delay);
}

.btn-terminal.wide .ch:nth-child(1){ --dx: 2px; --dy: -1px; --rot: 0.6deg; --drift-delay: 0ms; }
.btn-terminal.wide .ch:nth-child(2){ --dx: -2px; --dy: 1px; --rot: -0.6deg; --drift-delay: 40ms; }
.btn-terminal.wide .ch:nth-child(3){ --dx: 1px; --dy: -2px; --rot: 0.4deg; --drift-delay: 80ms; }
.btn-terminal.wide .ch:nth-child(4){ --dx: -1px; --dy: 2px; --rot: -0.5deg; --drift-delay: 120ms; }
.btn-terminal.wide .ch:nth-child(5){ --dx: 3px; --dy: 0px; --rot: 0.8deg; --drift-delay: 160ms; }
.btn-terminal.wide .ch:nth-child(6){ --dx: -3px; --dy: 0px; --rot: -0.8deg; --drift-delay: 200ms; }
.btn-terminal.wide .ch:nth-child(7){ --dx: 1px; --dy: 2px; --rot: 0.5deg; --drift-delay: 240ms; }
.btn-terminal.wide .ch:nth-child(8){ --dx: -1px; --dy: -2px; --rot: -0.5deg; --drift-delay: 280ms; }

.btn-terminal.icon:hover .btn-ic{
  animation: iconDrift 2.4s ease-in-out infinite;
}

.btn-terminal.caps:hover .caps-logo{
  animation: logoDrift 2.4s ease-in-out infinite;
}

@keyframes letterDrift{
  from { transform: translate(0, 0) rotate(0deg); }
  to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); }
}

@keyframes iconDrift{
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(2px, -1px) rotate(0.6deg); }
  100% { transform: translate(-2px, 1px) rotate(-0.6deg); }
}

@keyframes logoDrift{
  0% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(calc(-50% + 2px), calc(-50% - 1px)) rotate(0.6deg) scale(1); }
  100% { transform: translate(calc(-50% - 2px), calc(-50% + 1px)) rotate(-0.6deg) scale(1); }
}

@keyframes inlineTextDrift{
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(2px, -1px) rotate(0.4deg); }
}

@keyframes inlineIconDrift{
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(2px, -1px) rotate(0.6deg); }
  100% { transform: translate(-2px, 1px) rotate(-0.6deg); }
}

/* Icons */
.btn-ic{
  width: 22px;
  height: 22px;
  fill: rgba(255,255,255,0.90);
  filter: drop-shadow(0 0 6px rgba(120,190,255,0.15));
}

/* ===== CAPS BUTTON: text -> logo swap on hover ===== */
.flip-btn.caps .caps-logo{
  position:absolute;
  left: 50%;
  top: 50%;
  width: 30px;
  height: 30px;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  transition: transform 0.12s ease;
}

.btn-inline-label{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-inline-text,
.btn-inline-icon{
  transition: transform 180ms ease;
}

.btn-inline-icon{
  width: 22px;
  height: 22px;
  display: block;
  filter: drop-shadow(0 0 8px rgba(120,190,255,0.18));
}

.btn-terminal:hover .btn-inline-icon,
.btn-terminal:active .btn-inline-icon{
  animation: inlineIconDrift 2.4s ease-in-out infinite;
}

.points-fab{
  position: fixed;
  right: clamp(28px, 3vw, 52px);
  bottom: clamp(28px, 3.4vh, 44px);
  width: clamp(272px, 19vw, 344px);
  height: clamp(50px, 6vh, 58px);
  z-index: 14;
}

.projects-modal{
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 3vw, 36px);
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 240ms ease,
    visibility 240ms ease;
}

.projects-modal[aria-hidden="false"]{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.projects-modal__backdrop{
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(12, 18, 28, 0.08), rgba(3, 6, 10, 0.82)),
    rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.projects-modal__panel{
  position: relative;
  width: min(92vw, 1240px);
  height: min(86vh, 860px);
  padding: clamp(16px, 2.2vw, 24px);
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vh, 22px);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 20% 15%, rgba(130, 200, 255, 0.08), transparent 45%),
    linear-gradient(140deg, rgba(18, 24, 34, 0.88), rgba(6, 8, 12, 0.82));
  border: 1px solid var(--ui-panel-stroke);
  box-shadow:
    0 0 22px var(--ui-panel-glow),
    0 12px 30px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 0 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
}

.projects-modal__panel::before{
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.03) 0px,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 2px,
      transparent 4px
    ),
    repeating-radial-gradient(
      circle at 20% 20%,
      rgba(255, 255, 255, 0.03) 0 1px,
      rgba(0, 0, 0, 0.04) 1px 2px
    );
  opacity: 0.18;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
}

.projects-modal__panel::after{
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1px;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(120, 200, 255, 0) 70deg,
    rgba(140, 220, 255, 0.55) 110deg,
    rgba(120, 200, 255, 0) 150deg,
    transparent 360deg
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.6;
  animation: borderSweep 8s linear infinite;
  pointer-events: none;
  z-index: 1;
}

.projects-modal__panel > *{
  position: relative;
  z-index: 2;
}

.projects-modal__header{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.projects-modal__title-wrap{
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
  max-width: min(980px, calc(100% - 70px));
}

.projects-modal__eyebrow{
  font-family: "Array", sans-serif;
  font-size: clamp(10px, 1vw, 12px);
  letter-spacing: 0.28em;
  color: var(--ui-muted);
  text-transform: uppercase;
}

.projects-modal__title{
  margin: 0;
  font-family: "Satoshi", sans-serif;
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.08;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ui-text);
  text-shadow: 0 0 12px rgba(110, 180, 255, 0.16);
}

.projects-modal__title--copy{
  font-size: clamp(13px, 0.95vw, 17px);
  line-height: 1.24;
  letter-spacing: 0.12em;
  max-width: 64ch;
}

.decrypted-text{
  display: block;
  width: 100%;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
}

.decrypted-text__char,
.decrypted-text__space{
  display: inline;
}

.decrypted-text__char.is-encrypted{
  opacity: 0.82;
}

.projects-modal__close{
  flex: 0 0 auto;
  width: 42px;
  min-width: 42px;
  height: 42px;
  --flip-depth: 21px;
}

.projects-modal__body{
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vh, 22px);
}

.dome-shell{
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  border: 1px solid rgba(130, 190, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.2)),
    var(--ui-glass-dark);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 18px rgba(90, 170, 255, 0.12);
}

.dome-shell__stars{
  display: none;
}

.dome-shell::before{
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--ui-panel-stroke) 0 0) left top/22px 2px,
    linear-gradient(var(--ui-panel-stroke) 0 0) left top/2px 22px,
    linear-gradient(var(--ui-panel-stroke) 0 0) right top/22px 2px,
    linear-gradient(var(--ui-panel-stroke) 0 0) right top/2px 22px,
    linear-gradient(var(--ui-panel-stroke) 0 0) left bottom/22px 2px,
    linear-gradient(var(--ui-panel-stroke) 0 0) left bottom/2px 22px,
    linear-gradient(var(--ui-panel-stroke) 0 0) right bottom/22px 2px,
    linear-gradient(var(--ui-panel-stroke) 0 0) right bottom/2px 22px;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 10px rgba(120, 200, 255, 0.24));
  opacity: 0.95;
  pointer-events: none;
  z-index: 1;
}

.dome-shell::after{
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top center, rgba(110, 180, 255, 0.1), transparent 42%),
    radial-gradient(circle at bottom center, rgba(20, 241, 149, 0.08), transparent 34%),
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.025) 0px,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 2px,
      transparent 5px
    );
  opacity: 0.72;
  pointer-events: none;
  z-index: 1;
}

.dome-shell__grid{
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  --radius: 520px;
  --viewer-pad: 72px;
  --circ: calc(var(--radius) * 3.14);
  --rot-y: calc((360deg / var(--segments-x, 30)) / 2);
  --rot-x: calc((360deg / var(--segments-y, 30)) / 2);
  --item-width: calc(var(--circ) / var(--segments-x, 30));
  --item-height: calc(var(--circ) / var(--segments-y, 30));
}

.dome-shell__grid *{
  box-sizing: border-box;
}

.dome-shell__grid.is-dragging{
  cursor: grabbing;
}

.dome-shell__grid .dg-sphere,
.dome-shell__grid .dg-item,
.dome-shell__grid .dg-item__image{
  transform-style: preserve-3d;
}

.dome-shell__grid .dg-main{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background: transparent;
  transition:
    filter 280ms ease,
    transform 280ms ease,
    opacity 280ms ease;
}

.dome-shell__grid .dg-stage{
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  perspective: calc(var(--radius) * 2);
  perspective-origin: 50% 50%;
  contain: layout paint size;
}

.dome-shell__grid .dg-sphere{
  transform: translateZ(calc(var(--radius) * -1));
  will-change: transform;
}

.dome-shell__grid .dg-overlay,
.dome-shell__grid .dg-overlay--blur{
  position: absolute;
  inset: 0;
  margin: auto;
  z-index: 3;
  pointer-events: none;
}

.dome-shell__grid .dg-overlay{
  background-image: radial-gradient(rgba(235, 235, 235, 0) 65%, var(--overlay-blur-color, #060010) 100%);
}

.dome-shell__grid .dg-overlay--blur{
  -webkit-mask-image: radial-gradient(rgba(235, 235, 235, 0) 70%, var(--overlay-blur-color, #060010) 90%);
  mask-image: radial-gradient(rgba(235, 235, 235, 0) 70%, var(--overlay-blur-color, #060010) 90%);
  backdrop-filter: blur(3px);
}

.dome-shell__grid .dg-item{
  width: calc(var(--item-width) * var(--item-size-x));
  height: calc(var(--item-height) * var(--item-size-y));
  position: absolute;
  top: -999px;
  right: -999px;
  bottom: -999px;
  left: -999px;
  margin: auto;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  transition: transform 300ms;
  transform:
    rotateY(calc(var(--rot-y) * (var(--offset-x) + ((var(--item-size-x) - 1) / 2)) + var(--rot-y-delta, 0deg)))
    rotateX(calc(var(--rot-x) * (var(--offset-y) - ((var(--item-size-y) - 1) / 2)) + var(--rot-x-delta, 0deg)))
    translateZ(var(--radius));
}

.dome-shell__grid .dg-item__image{
  position: absolute;
  display: block;
  inset: 8px;
  border-radius: var(--tile-radius, 30px);
  background: #05060b;
  overflow: hidden;
  backface-visibility: hidden;
  transition: transform 300ms ease, filter 300ms ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  pointer-events: auto;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

.dome-shell__grid .dg-item__image:focus{
  outline: none;
}

.dome-shell__grid .dg-item__number{
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  backface-visibility: hidden;
  font-family: "Satoshi", sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
  color: rgba(237, 243, 255, 0.94);
  text-shadow:
    0 0 10px rgba(120, 200, 255, 0.14),
    0 0 26px rgba(255, 255, 255, 0.08);
}

.dome-shell__grid.is-viewing .dg-main{
  filter: blur(10px) saturate(0.65);
  transform: scale(0.965);
}

.dome-shell__grid .dg-edge-fade{
  position: absolute;
  left: 0;
  right: 0;
  height: 120px;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--overlay-blur-color, #060010));
}

.dome-shell__grid .dg-edge-fade--top{
  top: 0;
  transform: rotate(180deg);
}

.dome-shell__grid .dg-edge-fade--bottom{
  bottom: 0;
}

.dome-shell__viewer{
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.dome-shell__viewer.is-open{
  pointer-events: auto;
}

.dome-shell__viewer-scrim{
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  transition: opacity 220ms ease;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.dome-shell__viewer.is-open .dome-shell__viewer-scrim{
  opacity: 1;
}

.dome-shell__viewer-frame{
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(340px, 52vw);
  height: min(340px, 52vw);
  --viewer-announcement-gap: clamp(28px, 3vw, 42px);
  --viewer-announcement-width: clamp(190px, 16vw, 240px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  border-radius: 0;
}

.dome-shell__viewer-announcement{
  position: absolute;
  top: 50%;
  width: var(--viewer-announcement-width);
  pointer-events: none;
}

.dome-shell__viewer-announcement--left{
  right: calc(100% + var(--viewer-announcement-gap));
  transform: translateY(-50%);
}

.dome-shell__viewer-announcement--right{
  left: calc(100% + var(--viewer-announcement-gap));
  transform: translateY(-50%);
}

.dome-shell__viewer-announcement--stacked{
  display: none;
}

.dome-shell__viewer-announcement-text{
  display: block;
  font-family: "Satoshi", sans-serif;
  font-size: clamp(16px, 1.3vw, 22px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(245, 248, 255, 0.92);
  text-shadow:
    0 0 12px rgba(120, 200, 255, 0.12),
    0 0 28px rgba(255, 255, 255, 0.05);
}

.dome-shell__viewer-card{
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 !important;
  border: 1px solid rgba(160, 230, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(0,0,0,0.28)),
    rgba(8, 11, 16, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.05),
    0 0 18px rgba(120,200,255,0.16),
    0 18px 40px rgba(0,0,0,0.46);
  overflow: hidden;
}

.dome-shell__viewer-card img{
  display: none;
}

.dome-shell__viewer-number{
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Satoshi", sans-serif;
  font-weight: 700;
  font-size: clamp(84px, 12vw, 144px);
  line-height: 1;
  color: rgba(245, 248, 255, 0.96);
  text-shadow:
    0 0 18px rgba(120, 200, 255, 0.18),
    0 0 42px rgba(255, 255, 255, 0.08);
}

.dome-shell__viewer-card::before{
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--corner-color, rgba(170, 235, 255, 0.9)) 0 0) left top/18px 2px,
    linear-gradient(var(--corner-color, rgba(170, 235, 255, 0.9)) 0 0) left top/2px 18px,
    linear-gradient(var(--corner-color, rgba(170, 235, 255, 0.9)) 0 0) right top/18px 2px,
    linear-gradient(var(--corner-color, rgba(170, 235, 255, 0.9)) 0 0) right top/2px 18px,
    linear-gradient(var(--corner-color, rgba(170, 235, 255, 0.9)) 0 0) left bottom/18px 2px,
    linear-gradient(var(--corner-color, rgba(170, 235, 255, 0.9)) 0 0) left bottom/2px 18px,
    linear-gradient(var(--corner-color, rgba(170, 235, 255, 0.9)) 0 0) right bottom/18px 2px,
    linear-gradient(var(--corner-color, rgba(170, 235, 255, 0.9)) 0 0) right bottom/2px 18px;
  background-repeat: no-repeat;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(120,200,255,0.2));
}

.dome-shell__viewer-card::after{
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.08), transparent 40%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(0,0,0,0.18));
  opacity: 0.55;
  pointer-events: none;
}

.projects-modal__actions{
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(10px, 1vw, 14px);
}

.projects-modal__actions .flip-btn.wide{
  flex: 0 0 auto;
  width: clamp(150px, 16vw, 220px);
  min-width: 0;
}

@media (max-width: 1024px){
  .dome-shell__viewer-frame{
    width: min(320px, 74vw);
    height: min(320px, 74vw);
  }

  .dome-shell__viewer-announcement--left,
  .dome-shell__viewer-announcement--right{
    display: none;
  }

  .dome-shell__viewer-announcement--stacked{
    display: block;
    top: calc(100% + 22px);
    left: 50%;
    width: min(78vw, 340px);
    transform: translateX(-50%);
  }

  .dome-shell__viewer-announcement-text{
    font-size: clamp(15px, 2.5vw, 20px);
  }
}

@keyframes domeStarBlink{
  0%, 100% { opacity: 0.22; transform: scale(0.95); }
  20% { opacity: 0.68; transform: scale(1); }
  45% { opacity: 0.3; transform: scale(0.9); }
  70% { opacity: 0.92; transform: scale(1.05); }
}

@media (min-width: 1025px){
  .dome-shell__stars{
    position: absolute;
    top: 0;
    bottom: 0;
    width: clamp(120px, 13.5%, 180px);
    z-index: 2;
    display: block;
    pointer-events: none;
    opacity: 0.95;
  }

  .dome-shell__stars--left{
    left: 0;
  }

  .dome-shell__stars--right{
    right: 0;
  }

  .dome-shell__stars span{
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    animation: domeStarBlink 3.8s steps(2, end) infinite;
    filter: drop-shadow(0 0 6px rgba(180, 225, 255, 0.28));
  }

  .dome-shell__stars--left span:nth-child(1){
    background-image:
      radial-gradient(circle, rgba(220,240,255,0.95) 0 1px, transparent 1.8px),
      radial-gradient(circle, rgba(220,240,255,0.82) 0 1.2px, transparent 2px),
      radial-gradient(circle, rgba(180,220,255,0.7) 0 1px, transparent 1.8px),
      radial-gradient(circle, rgba(220,240,255,0.88) 0 1.4px, transparent 2.2px),
      radial-gradient(circle, rgba(180,220,255,0.76) 0 1px, transparent 1.8px);
    background-size: 4px 4px, 5px 5px, 4px 4px, 6px 6px, 4px 4px;
    background-position: 20% 16%, 52% 28%, 36% 52%, 62% 72%, 18% 84%;
    animation-delay: 0s;
  }

  .dome-shell__stars--left span:nth-child(2){
    background-image:
      radial-gradient(circle, rgba(220,240,255,0.92) 0 1px, transparent 1.8px),
      radial-gradient(circle, rgba(200,230,255,0.74) 0 1.1px, transparent 2px),
      radial-gradient(circle, rgba(220,240,255,0.88) 0 1.3px, transparent 2.1px),
      radial-gradient(circle, rgba(180,220,255,0.7) 0 1px, transparent 1.8px),
      radial-gradient(circle, rgba(220,240,255,0.9) 0 1px, transparent 1.8px);
    background-size: 4px 4px, 5px 5px, 6px 6px, 4px 4px, 4px 4px;
    background-position: 68% 12%, 28% 38%, 70% 48%, 40% 66%, 58% 90%;
    animation-delay: 1.1s;
  }

  .dome-shell__stars--left span:nth-child(3){
    background-image:
      radial-gradient(circle, rgba(220,240,255,0.78) 0 1px, transparent 1.8px),
      radial-gradient(circle, rgba(200,230,255,0.92) 0 1.2px, transparent 2px),
      radial-gradient(circle, rgba(220,240,255,0.76) 0 1px, transparent 1.8px),
      radial-gradient(circle, rgba(220,240,255,0.88) 0 1.4px, transparent 2.2px);
    background-size: 4px 4px, 5px 5px, 4px 4px, 6px 6px;
    background-position: 24% 26%, 58% 44%, 26% 62%, 54% 80%;
    animation-delay: 2.2s;
  }

  .dome-shell__stars--right span:nth-child(1){
    background-image:
      radial-gradient(circle, rgba(220,240,255,0.95) 0 1px, transparent 1.8px),
      radial-gradient(circle, rgba(220,240,255,0.82) 0 1.2px, transparent 2px),
      radial-gradient(circle, rgba(180,220,255,0.7) 0 1px, transparent 1.8px),
      radial-gradient(circle, rgba(220,240,255,0.88) 0 1.4px, transparent 2.2px),
      radial-gradient(circle, rgba(180,220,255,0.76) 0 1px, transparent 1.8px);
    background-size: 4px 4px, 5px 5px, 4px 4px, 6px 6px, 4px 4px;
    background-position: 76% 14%, 40% 24%, 68% 50%, 34% 70%, 80% 86%;
    animation-delay: 0.4s;
  }

  .dome-shell__stars--right span:nth-child(2){
    background-image:
      radial-gradient(circle, rgba(220,240,255,0.92) 0 1px, transparent 1.8px),
      radial-gradient(circle, rgba(200,230,255,0.74) 0 1.1px, transparent 2px),
      radial-gradient(circle, rgba(220,240,255,0.88) 0 1.3px, transparent 2.1px),
      radial-gradient(circle, rgba(180,220,255,0.7) 0 1px, transparent 1.8px),
      radial-gradient(circle, rgba(220,240,255,0.9) 0 1px, transparent 1.8px);
    background-size: 4px 4px, 5px 5px, 6px 6px, 4px 4px, 4px 4px;
    background-position: 34% 10%, 72% 36%, 30% 48%, 62% 68%, 44% 90%;
    animation-delay: 1.6s;
  }

  .dome-shell__stars--right span:nth-child(3){
    background-image:
      radial-gradient(circle, rgba(220,240,255,0.78) 0 1px, transparent 1.8px),
      radial-gradient(circle, rgba(200,230,255,0.92) 0 1.2px, transparent 2px),
      radial-gradient(circle, rgba(220,240,255,0.76) 0 1px, transparent 1.8px),
      radial-gradient(circle, rgba(220,240,255,0.88) 0 1.4px, transparent 2.2px);
    background-size: 4px 4px, 5px 5px, 4px 4px, 6px 6px;
    background-position: 70% 20%, 42% 42%, 74% 62%, 46% 82%;
    animation-delay: 2.5s;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .ui-panel::after,
  .projects-modal__panel::after,
  .flip-btn{ transition:none; }
  .flip-btn:hover{ transform:none; }
  .flip-btn:hover::after,
  .flip-btn:active::after,
  .flip-btn.glitch-out::after{ animation:none; }
  .btn-terminal:hover .ch,
  .btn-terminal.icon:hover .btn-ic{
    animation: none;
    transform: none;
  }
  .btn-terminal.caps:hover .caps-logo{
    animation: none;
    transform: translate(-50%, -50%) scale(1);
  }
  .btn-terminal:hover .btn-inline-text,
  .btn-terminal:active .btn-inline-text,
  .btn-terminal:hover .btn-inline-icon,
  .btn-terminal:active .btn-inline-icon{
    animation: none;
    transform: none;
  }
  .dome-shell__grid .dg-sphere,
  .dome-shell__viewer-scrim,
  .dome-shell__viewer-card,
  .dome-shell__grid .dg-item__image,
  .dome-shell__stars span{
    transition: none;
    animation: none;
  }
}

