/* SOVEREIGN SHATTERED ENGINE - STYLESHEET V3.7 (DOOR-SWING MATRIX)
   Mandate: Zero-Latency / Hardware-Accelerated UI
   Aesthetic: London Studio Night / Systematic Thinker 
   Compliance: Full Cross-Engine Resilience
*/

:root {
  --sovereign-gold: #ffc300;
  --progressive-orange: #000000;
  --bg-core: #000000;
  --gold-glow: rgb(0 0 0 / 40%);
  --orange-glow: rgb(255 255 255 / 30%);
  --surface-dark: #0a0a0a;
  --text-muted: #888;
}

/* --- DOM UTILITY CLASSES --- */
.hidden { display: none !important; }

/* --- THE GPU CORE --- */
.gpu-accelerated {
  transform: translate3d(0,0,0);
  will-change: transform, opacity, filter, box-shadow;
  backface-visibility: hidden;
  perspective: 1000px;
  transition: all 0.8s cubic-bezier(0.7, 0, 0.3, 1);
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-core);
  color: #ff0000;
  overflow: hidden; /* Locks viewport for PWA feel */
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  width: 100vw;
  perspective: 2000px; /* REQUIRED FOR THE 3D DOOR SWING DEPTH */
}

/* --- SHARD: GATEKEEPER (LOGIN) --- */
#gatekeeper {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--bg-core);
  /* THE DOOR HINGE PHYSICS */
  transform-origin: left center;
  transition: transform 1.2s cubic-bezier(0.645, 0.045, 0.355, 1), opacity 1.2s ease;
}

.branding-vault { text-align: center; margin-bottom: 50px; }

.logo-wrapper {
  position: relative; width: 180px; height: 180px; margin: 0 auto 24px auto;
  filter: drop-shadow(0px 0px 15px #004bff) drop-shadow(0px 15px 70px rgb(255 0 0));
  animation: floatLogo 5s cubic-bezier(0.4, 0, 1, 1) infinite;
}

@keyframes floatLogo {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -6px, 0); }
}

.phoenix-texture { width: 100%; height: 100%; object-fit: contain; display: block; }

.phoenix-liquid-overlay {
  position: absolute; inset: 0;
  -webkit-mask-image: url('/icons/logo-systematic-thinker-hq.png'); -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center;
  mask-image: url('/icons/logo-systematic-thinker-hq.png'); mask-size: contain; mask-repeat: no-repeat; mask-position: center;
  background: linear-gradient(to right, rgba(191, 149, 63, 0) 9%, rgb(171 166 117 / 50%) 40%, rgba(255, 255, 255, 0.1) 50%, rgba(252, 246, 186, 0.5) 70%, rgba(191, 149, 63, 0) 100%);
  background-size: 200% auto;
  animation: liquidGoldFlow  8.1s cubic-bezier(0.4, 0, 1, 1) infinite;
  mix-blend-mode: color-dodge; 
}

.future-text { font-size: 0.75rem; font-weight: 300; letter-spacing: 0.6rem; color: var(--sovereign-gold); text-transform: uppercase; }

/* --- SHARD: AUTH SENTINEL --- */
.auth-sentinel { display: flex; flex-direction: column; align-items: center; gap: 25px; width: 100%; max-width: 320px; }
#sovereign-key::placeholder { color: #555; font-size: 0.8rem; letter-spacing: 0.2rem; }
#sovereign-key {
  background: transparent; border: none; border-bottom: 1px solid #000000; color: #fff;
  text-align: center; font-size: 0.9rem; letter-spacing: 0.25rem; outline: none;
  width: 100%; padding: 12px; transition: border-color 0.4s ease;
}
#sovereign-key:focus { border-color: var(--sovereign-gold); }

.gold-glow {
  background: var(--sovereign-gold); border: none; color: #000; font-weight: 900;
  font-size: 0.9rem; letter-spacing: 0.25rem; padding: 18px 50px; border-radius: 2px;
  cursor: pointer; box-shadow: 0 0 20px var(--gold-glow); animation: sovereignPulse 2.5s infinite;
}
.gold-glow:hover { transform: translate3d(0, -3px, 0); box-shadow: 0 0 35px var(--sovereign-gold); }
#auth-feedback { font-size: 0.65rem; letter-spacing: 0.15rem; color: #444; text-transform: uppercase; height: 1rem; }

/* --- SHARD: THE STAGE (INTERNAL DASHBOARD) --- */
#stage-container {
  width: 100%;
  height: 100vh;
  box-sizing: border-box;
  display: none; 
  opacity: 0;
  flex-direction: column;
  align-items: center; 
  background: radial-gradient(circle at top, #00101a 0%, var(--bg-core) 100%);
  padding-top: 120px; 
}

/* --- SHARD: FLOATING PILL HEADER --- */
.progressive-header {
  position: fixed;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  width: 95%;
  max-width: 1200px;
  height: 70px;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  background: rgba(15, 15, 35, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  z-index: 5000;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.brand-side { display: flex; align-items: center; gap: 12px; }
.brand-word-1 { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02rem; color: #fff; }
.header-icon { height: 28px; width: auto; filter: drop-shadow(0 0 10px rgba(255, 94, 58, 0.5)); }

/* BENTO TRIGGER UI */
.action-side { display: flex; align-items: center; gap: 15px; }
.action-icon {
  width: 45px; height: 45px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--progressive-orange); background: rgba(255, 255, 255, 0.05); 
  border: 1px solid rgba(255, 255, 255, 0.1); transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.action-icon:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(255, 94, 58, 0.3); border-color: rgba(255, 94, 58, 0.5); }

/* BENTO LAUNCHER MATRIX */
#bento-launcher {
  position: fixed; top: 105px; right: calc(50% - (min(95vw, 1200px) / 2) + 15px); /* Aligns with header right edge */
  background: rgba(10, 10, 10, 0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: 24px; border: 1px solid rgba(212, 175, 55, 0.3);
  z-index: 4000; width: 320px; padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,0.8);
  opacity: 0; transform: translateY(-20px); pointer-events: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#bento-launcher.active { opacity: 1; transform: translateY(0); pointer-events: auto; }

.bento-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.bento-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; color: #ccc; font-size: 0.65rem; font-weight: 800; text-transform: uppercase; 
  transition: transform 0.2s, color 0.2s, border-color 0.2s; text-align: center; height: 75px; 
  background: rgba(255,255,255,0.02); border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); cursor: pointer;
}
.bento-item:hover { transform: scale(1.05); color: var(--sovereign-gold); border-color: var(--sovereign-gold); background: rgba(212, 175, 55, 0.05); }
.bento-item svg { margin-bottom: 8px; width: 22px; height: 22px; }

/* HEADER MOBILE RESPONSIVENESS */
@media (max-width: 600px) {
  .progressive-header { top: 15px; width: 92%; padding: 0 20px; height: 60px; }
  .brand-word-1 { display: none; }
  .action-icon { width: 40px; height: 40px; }
  #bento-launcher { width: 90%; right: 5%; top: 85px; }
}

/* --- MAIN CONTENT AREA --- */
#status-text {
  font-size: 4rem; font-weight: 900; margin: 0; letter-spacing: -0.1rem; text-align: center;
  background: linear-gradient(to bottom, #fff 40%, var(--progressive-orange) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.engine-tag { font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.4rem; margin-bottom: 60px; opacity: 0.6; text-align: center; }

/* --- SHARD: FEATURE FEED & MAGIC CARDS --- */
.feature-feed {
  width: 100%;
  max-width: 600px;
  height: calc(100vh - 120px); 
  overflow-y: auto;
  padding: 0 20px 100px 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center; 
  gap: 24px;
  scrollbar-width: none; 
}
.feature-feed::-webkit-scrollbar { display: none; }
.dashboard-title-group { text-align: center; margin-bottom: 20px; }

.magic-card {
  width: 100%; box-sizing: border-box;
  background: rgba(15, 15, 15, 0.6); border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px; padding: 30px; backdrop-filter: blur(10px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s;
}
.magic-card:hover { transform: translateY(-5px); border-color: rgba(212, 175, 55, 0.3); box-shadow: 0 20px 40px rgba(0,0,0,0.6); }
.card-kicker { display: block; color: var(--sovereign-gold); font-size: 0.7rem; letter-spacing: 0.15rem; text-transform: uppercase; margin-bottom: 10px; }
.magic-card h3 { margin: 0 0 10px 0; font-size: 1.4rem; font-weight: 800; }
.magic-card p { margin: 0; color: #aaa; font-size: 0.9rem; line-height: 1.5; }
.divider-group h3 { text-align: center; color: #555; font-size: 0.8rem; letter-spacing: 0.2rem; text-transform: uppercase; margin: 20px 0 0 0; }

.creator-terminal { border-color: rgba(227, 82, 5, 0.2); }
.pulse-dot { color: #00ff88; animation: pulseOpacity 2s infinite; }
.terminal-btn { width: 100%; margin-top: 20px; box-sizing: border-box; }

/* --- SHARD: DYNAMIC ASSET NODES --- */
.generated-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.generated-badge { background: rgba(227, 82, 5, 0.1); color: var(--progressive-orange); padding: 4px 10px; border-radius: 4px; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.15rem; text-transform: uppercase; border: 1px solid rgba(227, 82, 5, 0.2); }
.generated-price { font-size: 1.2rem; font-weight: 900; color: #00ff88; text-shadow: 0 0 15px rgba(0, 255, 136, 0.2); letter-spacing: 0.05rem; }
.manage-btn { background: transparent; border: 1px solid #333; color: #fff; width: 100%; box-sizing: border-box; padding: 12px; border-radius: 6px; margin-top: 20px; font-family: inherit; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.2rem; cursor: pointer; transition: all 0.3s ease; }
.manage-btn:hover { border-color: #e60064; color: #e60064; background: rgba(230, 0, 100, 0.05); box-shadow: 0 0 20px rgba(230, 0, 100, 0.15); }

/* --- SHARD: STUDIO MODAL --- */
.st-modal-overlay {
  position: fixed; inset: 0; z-index: 6000; background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(15px);
  display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.st-modal-overlay.active { opacity: 1; pointer-events: auto; }
.st-modal-card { background: #050505; border: 1px solid #222; border-radius: 16px; padding: 40px; width: 90%; max-width: 450px; position: relative; transform: translate3d(0, 30px, 0) scale(0.95); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-sizing: border-box; }
.st-modal-overlay.active .st-modal-card { transform: translate3d(0, 0, 0) scale(1); }
.btn-close-modal { position: absolute; top: 15px; right: 20px; background: transparent; border: none; color: #666; font-size: 28px; cursor: pointer; transition: color 0.2s; }
.btn-close-modal:hover { color: #fff; }
.modal-title { margin: 0 0 5px 0; font-size: 1.2rem; letter-spacing: 0.1rem; }
.accent-slash { color: var(--sovereign-gold); }
.modal-desc { color: #888; font-size: 0.85rem; margin-bottom: 25px; }
.st-input { width: 100%; background: #111; border: 1px solid #333; color: #fff; padding: 16px; border-radius: 8px; margin-bottom: 15px; font-family: inherit; box-sizing: border-box; font-size: 0.95rem; transition: border-color 0.3s; }
.st-input:focus { border-color: var(--sovereign-gold); outline: none; }
.modal-submit-btn { width: 100%; box-sizing: border-box; margin-top: 10px; }

/* REVENUE SHARD */
#payment-request-button { width: 100%; margin-bottom: 25px; box-sizing: border-box; }
#payment-element { width: 100%; padding: 24px; background: #050505; border: 1px solid #111; border-radius: 16px; box-sizing: border-box; }

/* --- ANIMATIONS & TRANSITIONS --- */
@keyframes liquidGoldFlow { 0% { background-position: 200% center; } 100% { background-position: 0% center; } }
@keyframes sovereignPulse { 0% { box-shadow: 0 0 10px var(--gold-glow); } 50% { box-shadow: 0 0 35px var(--sovereign-gold); } 100% { box-shadow: 0 0 10px var(--gold-glow); } }
@keyframes stageReveal { 0% { opacity: 0; transform: translate3d(0, 50px, 0) scale(0.95); } 100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); } }
@keyframes slideInRight { 0% { opacity: 0; transform: translate3d(40px, 0, 0); } 100% { opacity: 1; transform: translate3d(0, 0, 0); } }
@keyframes pulseOpacity { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* THE 3D DOOR SWING */
.gate-shattered { 
  transform: rotateY(-110deg) scale(1.05) !important; 
  opacity: 0 !important; 
  pointer-events: none; 
}
#stage-container.active { display: flex; animation: stageReveal 0.8s cubic-bezier(0.2, 1, 0.3, 1) forwards; }

/* RESPONSIVE TWEAKS */
@media (max-width: 600px) {
  #status-text { font-size: 2.2rem; }
  .logo-wrapper { width: 140px; height: 140px; }
}