/* earth-view-3 — visionOS-style glassmorphism with tilt/parallax */

:root {
  --glass-bg: rgba(15, 23, 42, 0.42);
  --glass-border: rgba(148, 163, 184, 0.45);
  --text: rgba(255, 255, 255, 0.96);
  --text-muted: rgba(255, 255, 255, 0.6);
  --accent: #7dd3fc;
  --radius: 24px;
  --radius-sm: 16px;
  --blur: 26px;
  --blur-strong: 42px;
  --shadow: 0 26px 60px -18px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  /* DSKY (Apollo AGC display) */
  --dsky-green: #00ff41;
  --dsky-green-dim: #00aa2a;
  --dsky-bg: #0c0f0c;
  --dsky-bezel: #2a302a;
  --dsky-recess: #0a0d0a;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Outfit', sans-serif;
  background: #05050a;
  color: var(--text);
  overflow: hidden;
}

body {
  perspective: 1400px;
  transform-style: preserve-3d;
}

.site-watermark {
  position: fixed;
  top: 14px;
  left: 18px;
  z-index: 60;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.72);
  text-shadow: 0 0 10px rgba(15, 23, 42, 0.85);
  pointer-events: none;
}

/* Boot overlay */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #020302;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.7s ease;
}

.boot-screen.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.boot-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.7s ease;
}

/* Boot skip: nuclear launch switch, same row as control strip */
.boot-skip.mcc-launch-switch {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  background: linear-gradient(180deg, #2a1515 0%, #1a0a0a 100%);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.06),
    inset 0 -2px 6px rgba(0, 0, 0, 0.6),
    0 4px 12px rgba(0, 0, 0, 0.5);
  border: 2px solid #4a2020;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.boot-skip.mcc-launch-switch:hover {
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.08),
    inset 0 -2px 6px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(220, 60, 50, 0.35);
}

.boot-skip.mcc-launch-switch:active {
  transform: scale(0.96);
}

.mcc-launch-guard {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: #cc4444;
  text-shadow: 0 0 8px rgba(220, 80, 60, 0.6);
}

/* Command Center: glassmorphic + retro missile/rocket control panel */
.boot-terminal.command-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(540px, calc(100vw - 40px));
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.mcc-room.mcc-glass {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 260px 56px 56px;
  gap: 14px;
  height: 428px;
  background: rgba(8, 10, 12, 0.32);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 0 0 1px rgba(255, 200, 80, 0.03);
}

.mcc-panel-skip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
}

.mcc-control-strip {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 20px;
  padding: 0;
  margin: 0;
  border-radius: 8px;
  background: transparent;
  border: none;
}

.mcc-strip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 56px;
  gap: 4px;
}

.mcc-strip-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 200, 80, 0.75);
}

.mcc-knob {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #3a3d42, #1a1c20);
  border: 2px solid #2a2d32;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.08),
    inset 0 -1px 2px rgba(0, 0, 0, 0.5),
    0 2px 6px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mcc-knob:hover {
  transform: scale(1.08);
}

.mcc-knob:active {
  transform: scale(0.96);
}

.mcc-knob-sm {
  width: 16px;
  height: 16px;
  border-width: 1px;
}

.mcc-control-strip button.mcc-knob,
.mcc-control-strip button.mcc-toggle,
.mcc-control-strip button.mcc-switch,
.mcc-panel-head button.mcc-knob,
.mcc-panel-head button.mcc-toggle,
.mcc-panel-head button.mcc-switch {
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  appearance: none;
}

.mcc-toggle {
  width: 24px;
  height: 12px;
  border-radius: 999px;
  background: #1a1c20;
  border: 1px solid #2a2d32;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.15s ease;
}

.mcc-toggle:hover {
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 200, 80, 0.2);
}

.mcc-toggle::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 10px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #4a5568, #2d3748);
  border: 0px solid #1a1c20;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease;
}

.mcc-toggle-on::after {
  transform: translateX(10px);
  background: linear-gradient(180deg, #68d391, #38a169);
  box-shadow: 0 0 8px rgba(72, 187, 120, 0.4);
}

.mcc-toggle-sm {
  width: 18px;
  height: 10px;
}

.mcc-toggle-sm::after {
  width: 6px;
  height: 6px;
}

.mcc-toggle-sm.mcc-toggle-on::after {
  transform: translateX(8px);
}

.mcc-switch {
  width: 20px;
  height: 28px;
  border-radius: 3px;
  background: linear-gradient(180deg, #2a2d32 0%, #1a1c20 100%);
  border: 1px solid #3a3d42;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 2px 6px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mcc-switch:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 2px 6px rgba(0, 0, 0, 0.4),
    0 0 10px rgba(255, 200, 80, 0.15);
}

.mcc-switch:active {
  transform: scale(0.97);
}

.mcc-switch-sm {
  width: 14px;
  height: 16px;
}

.mcc-switch-on {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 12px rgba(255, 200, 80, 0.25);
}

.mcc-knob-active {
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.08), inset 0 -1px 2px rgba(0, 0, 0, 0.5), 0 0 12px rgba(255, 200, 80, 0.2);
}

.mcc-panel {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 12px 14px;
  min-height: 64px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.mcc-panel-main {
  grid-column: 1 / -1;
  height: 260px;
  min-height: 260px;
  max-height: 260px;
  overflow-y: auto;
  padding: 12px 14px;
}

.mcc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 200, 80, 0.18);
}

.mcc-panel-title {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: rgba(255, 200, 80, 0.85);
  text-transform: uppercase;
  margin: 0;
  padding: 0;
  border: none;
}

.mcc-log {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.72rem;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: rgba(255, 200, 80, 0.9);
  text-shadow: 0 0 8px rgba(255, 200, 80, 0.15);
  font-variant-numeric: tabular-nums;
}

.mcc-status {
  font-size: 0.74rem;
  color: rgba(255, 200, 80, 0.9);
  text-shadow: 0 0 6px rgba(255, 200, 80, 0.2);
}

/* Background: globe or video */
.viewport {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.viewport-globe-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 100vw;
  min-height: 100vh;
  pointer-events: none;
}

.viewport-globe-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100vh;
}

.viewport-video-wrap {
  position: absolute;
  inset: -4%;
  width: 108%;
  height: 108%;
}

.viewport-video-inner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.viewport-video-inner.hidden {
  visibility: hidden;
  pointer-events: none;
}

.viewport-video-inner video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.viewport-video-wrap.hidden {
  visibility: hidden;
  pointer-events: none;
}

.viewport-globe-wrap.hidden {
  visibility: hidden;
  pointer-events: none;
}

.viewport-bg-toggle {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
  pointer-events: auto;
}

.viewport-bg-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.viewport-bg-btn:hover {
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.08);
}

.viewport-bg-btn.active {
  background: rgba(125, 211, 252, 0.25);
  color: var(--accent);
}

/* ISS Tracker: flight-simulator cockpit overlay — positioned grid, parallax like dock/panel */
.iss-cockpit-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
  perspective: 2000px;
  transform-style: preserve-3d;
  transition: transform 0.12s ease-out;
}

.iss-cockpit-overlay.hidden {
  visibility: hidden;
  pointer-events: none;
}

/* ISS HUD: fighter-jet style — no panels, just data + glow */
.cockpit-panel {
  position: absolute;
  padding: 4px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  min-width: 0;
  pointer-events: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: transform 0.2s ease;
  transform-origin: center center;
  z-index: 1;
}

.cockpit-panel:hover {
  min-width: 0;
  padding: 4px 0;
  box-shadow: none;
}

.cockpit-panel-tl:hover { transform: scale(1.02); }
.cockpit-panel-tr:hover { transform: scale(1.02); }
.cockpit-panel-ml:hover { transform: translateY(-50%) scale(1.02); }
.cockpit-panel-mr:hover { transform: translateY(-50%) scale(1.02); }
.cockpit-panel-bl:hover { transform: scale(1.02); }
.cockpit-panel-br:hover { transform: scale(1.02); }
.cockpit-panel-bc:hover { transform: translateX(-50%) scale(1.02); }
.cockpit-panel-map:hover { transform: translateX(-50%) scale(1.01); }

.cockpit-panel-title {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(0, 255, 200, 0.7);
  margin-bottom: 2px;
  padding-bottom: 0;
  border-bottom: none;
  text-shadow: 0 0 8px rgba(0, 255, 200, 0.4);
}

.cockpit-panel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
}

.cockpit-panel-detail {
  display: none;
}

.cockpit-label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.7rem;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.2);
}

.cockpit-value {
  color: rgba(0, 255, 255, 0.95);
  font-weight: 500;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5), 0 0 20px rgba(0, 255, 255, 0.2);
}

.cockpit-value-large {
  font-size: 1rem;
  letter-spacing: 0.02em;
}

/* Explicit positions so panels don’t stack — top/left/right/bottom per panel */
.cockpit-panel-tl {
  top: 24px;
  left: 24px;
  right: auto;
  bottom: auto;
}

.cockpit-panel-tr {
  top: 24px;
  left: auto;
  right: 24px;
  bottom: auto;
}

.cockpit-panel-ml {
  top: 50%;
  left: 24px;
  right: auto;
  bottom: auto;
  transform: translateY(-50%);
}

.cockpit-panel-mr {
  top: 50%;
  left: auto;
  right: 24px;
  bottom: auto;
  transform: translateY(-50%);
}

.cockpit-panel-bl {
  top: auto;
  left: 24px;
  right: auto;
  bottom: 120px;
}

.cockpit-panel-br {
  top: auto;
  left: auto;
  right: 24px;
  bottom: 120px;
}

.cockpit-panel-bc {
  top: auto;
  left: 50%;
  right: auto;
  bottom: 120px;
  transform: translateX(-50%);
}

.cockpit-panel-bc:hover {
  transform: translateX(-50%) scale(1.08);
}

.cockpit-panel-br:hover {
  transform: scale(1.08);
}

/* Map: top center, below the TL/TR row so it doesn’t overlap */
.cockpit-panel-map {
  top: 100px;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translateX(-50%);
  min-width: 720px;
  max-width: min(960px, 100vw);
}

.cockpit-map-wrap {
  position: relative;
  margin-top: 6px;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid rgba(0, 255, 200, 0.25);
  background: rgba(0, 0, 0, 0.2);
  box-shadow: 0 0 12px rgba(0, 255, 200, 0.1);
  min-height: 300px;
  aspect-ratio: 2 / 1;
}

.cockpit-map-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.cockpit-map-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
  pointer-events: none;
  background: transparent;
}

.viewport-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.7s ease;
}

.viewport-live {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.viewport-live-frame {
  width: 100%;
  height: 100%;
  border: none;
  transform: scale(1.25);
  transform-origin: center;
  pointer-events: none;
}

.viewport-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 50%, transparent 30%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}

/* Welcome terminal */
.welcome-terminal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  will-change: transform;
}

.welcome-terminal-inner {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur-strong)) saturate(190%);
  -webkit-backdrop-filter: blur(var(--blur-strong)) saturate(190%);
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  padding: 48px 56px;
  min-width: 320px;
  text-align: center;
  transition: transform 0.15s var(--ease), box-shadow 0.25s var(--ease), opacity 0.35s var(--ease);
}

.welcome-title {
  margin: 0 0 8px;
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.welcome-subtitle {
  margin: 0 0 22px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.welcome-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.85;
}

.welcome-terminal.hide {
  pointer-events: none;
}

.welcome-terminal.hide .welcome-terminal-inner {
  opacity: 0;
  transform: translate3d(0, -20px, 0) scale(0.96);
}

/* Workspace */
.workspace {
  position: fixed;
  inset: 0;
  padding: 24px;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.7s ease;
}

body.is-ready .viewport {
  opacity: 1;
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

body.is-ready .workspace {
  opacity: 1;
  pointer-events: auto;
}

.workspace::-webkit-scrollbar {
  width: 8px;
}

.workspace::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}

/* Main panel: smooth expand-up / shrink-down (genie-like, no dramatic pinch) */
.main-panel {
  position: relative;
  width: fit-content;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: visible;
  transform-origin: 50% 100%;
  transform: translate3d(0, 0, 0);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s var(--ease), width 0.6s cubic-bezier(0.22, 1, 0.36, 1), height 0.6s cubic-bezier(0.22, 1, 0.36, 1), min-height 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  perspective: 1200px;
}

.main-panel.is-expanded {
  width: min(980px, calc(100vw - 48px));
  height: 88vh;
  min-height: 420px;
  transform: translate3d(0, -95px, 0);
}

/* Glass widget base */
.glass-widget {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur)) saturate(170%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(170%);
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

/* Panel has rounded corners on all sides; dock sits inside with matching bottom radius */
.main-panel.glass-widget {
  border-radius: var(--radius);
  transition: transform 1.05s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s var(--ease);
}

.glass-widget:hover {
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.main-panel-header {
  padding: 0 24px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0);
  transition: max-height 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), padding 0.6s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.5s var(--ease);
}

.main-panel.is-expanded .main-panel-header {
  padding: 20px 24px 14px;
  max-height: 120px;
  opacity: 1;
}

.main-panel-label {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.main-panel-sub {
  font-size: 1rem;
  font-weight: 500;
}

.main-panel-body {
  padding: 0 24px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: max-height 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), padding 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.main-panel.is-expanded .main-panel-body {
  flex: 1;
  min-height: 0;
  padding: 20px 24px 18px;
  max-height: none;
  opacity: 1;
  overflow-y: auto;
  pointer-events: auto;
}

.main-panel-body.content-swap {
  animation: body-swap 260ms var(--ease);
}

/* Flip card: content area flips (front = list, back = post); dock stays fixed below so it’s always visible. */
.main-panel-flip-inner {
  position: relative;
  flex: 0 1 auto;
  max-height: 0;
  overflow: visible;
  transform-origin: 50% 100%;
  transform: scaleY(0);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), max-height 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.main-panel.is-expanded .main-panel-flip-inner {
  flex: 1 1 0%;
  min-height: 0;
  max-height: none;
  transform: scaleY(1);
}

.main-panel.is-expanded.is-flipped .main-panel-flip-inner {
  transform: scaleY(1) rotateY(180deg);
}

.main-panel-front,
.main-panel-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
}

.main-panel-front {
  background: var(--glass-bg);
  z-index: 1;
}

.main-panel-back {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
  background: var(--glass-bg);
  z-index: 0;
}

.main-panel-front .main-panel-body {
  flex: 1;
  min-height: 0;
}

.main-panel-back-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--glass-border);
}

.main-panel-back-btn {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.main-panel-back-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.main-panel-back-btn:active {
  transform: scale(0.98);
}

.main-panel-back-title {
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.main-panel-back-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
}

@keyframes body-swap {
  from {
    opacity: 0.78;
    transform: translate3d(0, 10px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.widget-title {
  margin: 0;
  padding: 18px 20px 12px;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.widget-body {
  padding: 16px 20px 20px;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Blog (within main panel) */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.blog-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.18s var(--ease);
}

.blog-item:hover {
  background: rgba(255, 255, 255, 0.09);
}

.blog-item-content {
  flex: 1;
  min-width: 0;
}

.blog-item strong {
  display: block;
  margin-bottom: 4px;
}

.blog-item small {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.blog-read-more {
  flex-shrink: 0;
  padding: 8px 16px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.blog-read-more:hover {
  background: rgba(255, 255, 255, 0.14);
}

.blog-read-more:active {
  transform: scale(0.98);
}

.blog-item-skeleton {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Ideas + likes */
.ideas-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.idea-card {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.idea-text {
  margin: 0 0 12px;
  font-style: italic;
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.like-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.like-btn.liked {
  background: var(--accent);
  border-color: var(--accent);
  color: #020617;
}

.like-icon {
  font-size: 1rem;
}

/* Info */
.info-body p {
  margin: 0 0 12px;
}

.info-muted {
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* Contact */
.contact-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-input,
.contact-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.contact-input::placeholder,
.contact-textarea::placeholder {
  color: var(--text-muted);
}

.contact-send {
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #020617;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease), opacity 0.16s var(--ease);
}

.contact-send:hover {
  opacity: 0.96;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45);
}

.contact-send:active {
  transform: translateY(1px) scale(0.98);
}

/* ISS view */
.iss-body {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
}

.iss-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.iss-row:last-of-type {
  border-bottom: none;
}


.iss-label {
  color: var(--text-muted);
}

.iss-value {
  color: var(--accent);
}

.iss-visibility {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(125, 211, 252, 0.14);
  color: var(--accent);
  text-align: center;
  font-size: 0.78rem;
}

/* ISS world map: glassmorphic panel with real map + overlay */
.iss-map-wrap {
  position: relative;
  margin-top: 14px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(var(--blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  min-height: 160px;
}

.iss-map-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
}

.iss-map {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  max-height: 180px;
  pointer-events: none;
}

.ideas-twitter-loading,
.ideas-twitter-fallback {
  margin: 0;
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.ideas-twitter-fallback a {
  color: var(--accent);
  text-decoration: none;
}

.ideas-twitter-fallback a:hover {
  text-decoration: underline;
}

/* Experience panel */
.experience-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.experience-item {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.experience-role {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.experience-org {
  color: var(--accent);
  font-size: 0.86rem;
  margin-bottom: 4px;
}

.experience-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.experience-desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text);
}

/* Ideas panel: carousel (Twitter only) + blog list below */
.ideas-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ideas-carousel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
}

.ideas-blog-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ideas-blog-title {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.carousel-viewport {
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.carousel-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
  box-sizing: border-box;
}

.twitter-card {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.twitter-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.twitter-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(125, 211, 252, 0.2);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  flex-shrink: 0;
}

.twitter-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.twitter-card-handle {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.twitter-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.twitter-card-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  flex: 1;
}

.twitter-card-cta {
  align-self: flex-start;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

a.twitter-card-cta:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
}

button.twitter-card-cta:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
}

.carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 0;
}

.carousel-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.05);
}

.carousel-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.carousel-dot:hover {
  background: rgba(255, 255, 255, 0.4);
}

.carousel-dot.active {
  background: var(--accent);
  transform: scale(1.2);
}

/* Earth fly-by placeholder */
.earth-body {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.earth-placeholder {
  padding: 22px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text-muted);
  font-size: 0.86rem;
  text-align: center;
}

/* Dock: shrinks downwards with panel when collapsing (same 0.6s as flip-inner). */
.dock {
  flex-shrink: 0;
  position: relative;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  max-height: 120px;
  overflow: hidden;
  transition: max-height 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), padding 0.6s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.5s var(--ease);
}

.dock-inner {
  width: fit-content;
  margin: 0 auto;
  background: transparent;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.main-panel.is-expanded .dock-inner {
  width: 100%;
}

.dock-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  padding: 16px 20px;
}

.dock-item {
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.dock-item:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.dock-item:active {
  transform: translateY(0);
}

.dock-item.active {
  background: rgba(255, 255, 255, 0.96);
  color: #020617;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

/* Responsive: mobile-friendly UI (touch targets, readable text, no overflow) */
@media (max-width: 768px) {
  .viewport-bg-toggle {
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100vw - 24px);
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    border-radius: 8px;
  }

  .viewport-bg-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 12px;
    font-size: 0.68rem;
    letter-spacing: 0.02em;
  }

  .workspace {
    padding: 12px;
  }

  .main-panel {
    max-height: calc(100vh - 24px);
  }

  .main-panel.is-expanded .main-panel-body {
    max-height: 70vh;
  }

  .main-panel.is-expanded {
    width: calc(100vw - 24px);
    height: 85vh;
    transform: translate3d(0, -72px, 0) scale(1);
  }

  .main-panel-header {
    padding: 14px 16px;
  }

  .main-panel-label {
    font-size: 1rem;
  }

  .main-panel-sub {
    font-size: 0.8rem;
  }

  .dock {
    padding: 12px 16px;
  }

  .dock-buttons {
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
  }

  .dock-item {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 18px;
    font-size: 0.82rem;
  }

  /* Cockpit overlay: smaller panels, tighter layout */
  .cockpit-panel {
    font-size: 0.72rem;
    padding: 6px 0;
  }

  .cockpit-panel-title {
    font-size: 0.52rem;
    letter-spacing: 0.12em;
  }

  .cockpit-panel-tl,
  .cockpit-panel-tr {
    top: 12px;
    left: 12px;
    right: 12px;
  }

  .cockpit-panel-tr {
    left: auto;
    right: 12px;
  }

  .cockpit-panel-ml {
    left: 12px;
  }

  .cockpit-panel-mr {
    right: 12px;
  }

  .cockpit-panel-bl,
  .cockpit-panel-br,
  .cockpit-panel-bc {
    bottom: 96px;
  }

  .cockpit-panel-bl {
    left: 12px;
  }

  .cockpit-panel-br {
    right: 12px;
  }

  .cockpit-panel-map {
    top: 80px;
    min-width: 0;
    width: 100vw;
    max-width: 100vw;
    left: 50%;
    transform: translateX(-50%);
  }

  .cockpit-map-wrap {
    min-height: 240px;
  }

  .cockpit-value-large {
    font-size: 0.9rem;
  }

  /* Boot / MCC: fit small screens */
  .boot-terminal.command-center {
    width: min(100vw - 24px, 540px);
  }

  .mcc-room.mcc-glass {
    height: auto;
    min-height: 360px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 12px;
    gap: 12px;
    grid-template-rows: 220px 52px 52px;
  }

  .mcc-panel-main {
    height: 220px;
    min-height: 220px;
    max-height: 220px;
    padding: 12px 14px;
  }

  .mcc-panel {
    min-height: 52px;
    padding: 10px 12px;
  }
}

/* Blog post reading: mobile-friendly typography and spacing */
@media (max-width: 768px) {
  .main-panel-back-header {
    padding: 14px 16px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .main-panel-back-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 16px;
    font-size: 0.88rem;
  }

  .main-panel-back-title {
    font-size: 0.95rem;
    white-space: normal;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
  }

  .main-panel-back-body {
    padding: 20px 16px;
    font-size: 1rem;
    line-height: 1.7;
    max-width: 100%;
    overflow-wrap: break-word;
  }

  .main-panel-back-body h1,
  .main-panel-back-body h2,
  .main-panel-back-body h3 {
    margin-top: 1.2em;
    margin-bottom: 0.5em;
    line-height: 1.3;
  }

  .main-panel-back-body p {
    margin-bottom: 1em;
  }

  .main-panel-back-body a {
    word-break: break-word;
  }

  .main-panel-back-body iframe,
  .main-panel-back-body video {
    max-width: 100%;
    height: auto;
  }
}
