/* ==========================================================================
   Spac2 Design Studio — Ultra-Minimalist Creative Suite CSS
   Path: /design/css/design.css
   ========================================================================== */

:root {
  --bg-root: #050507;
  --bg-surface: rgba(20, 20, 26, 0.65);
  --bg-surface-hover: rgba(30, 30, 40, 0.85);
  --bg-glass: rgba(15, 15, 20, 0.75);

  --border-glass: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.2);
  --border-focus: rgba(255, 255, 255, 0.35);

  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-tertiary: #52525b;

  --accent-coral: #f43f5e;
  --accent-glow: rgba(244, 63, 94, 0.25);

  --radius-squircle: 22px;
  --radius-pill: 999px;

  --ease-spring: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-fast: cubic-bezier(0.16, 1, 0.3, 1);

  --transition: all 0.24s var(--ease-fast);
  --transition-smooth: all 0.35s var(--ease-spring);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg-root);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.05) 0%, transparent 60%),
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(244, 63, 94, 0.04) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  position: relative;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Ambient Canvas */
#designCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.75;
}

/* Viewport Layout */
.studio-viewport {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

/* ==========================================================================
   Minimal Top Navigation Bar (Sticky Floating Glass Capsule)
   ========================================================================== */
.studio-nav {
  position: sticky;
  top: 0.85rem;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 1rem;
  background: rgba(10, 12, 16, 0.75);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.08) inset;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.05rem;
  transition: var(--transition);
}

.nav-back-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateX(-2px);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  object-fit: cover;
}

.brand-label {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.nav-btn.sound-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.nav-btn.sound-muted {
  color: var(--text-tertiary);
  opacity: 0.6;
}

/* User Avatar Button (Matches Spac2 Header Standard) */
.header-btn.avatar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px;
  position: relative;
  cursor: pointer;
  overflow: visible;
  transition: var(--transition);
}

.header-btn.avatar-btn:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.04);
}

.header-btn.avatar-btn img,
.header-btn.avatar-btn .user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9999px;
  display: block;
}

.header-btn.avatar-btn .avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(145deg, #2c303a, #181a1f);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-btn.avatar-btn .avatar-placeholder svg {
  width: 20px;
  height: 20px;
  stroke: #cbd0df;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-btn.avatar-btn .avatar-initial {
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  user-select: none;
}

.header-btn.avatar-btn .header-avatar-verified-white {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #000000;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6), 0 2px 4px rgba(0, 0, 0, 0.8);
  z-index: 5;
  pointer-events: none;
}

.header-btn.avatar-btn .header-avatar-verified-white svg {
  width: 10px;
  height: 10px;
  fill: #000000;
  stroke: none;
}

.header-btn.avatar-btn .header-avatar-unverified-warn {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fef08a 0%, #fbbf24 50%, #d97706 100%);
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #000000;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.7), 0 2px 4px rgba(0, 0, 0, 0.8);
  z-index: 5;
  pointer-events: none;
}

.header-btn.avatar-btn .header-avatar-unverified-warn svg {
  width: 10px;
  height: 10px;
  stroke: #000000;
  stroke-width: 3.2;
}

/* ==========================================================================
   Hero Section: Pure Typography & Air
   ========================================================================== */
.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 0.5rem 0 0;
}

.hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: #ffffff;
  line-height: 1.1;
  background: linear-gradient(180deg, #ffffff 0%, #a1a1aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   Search & Category Dock
   ========================================================================== */
.dock-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  width: 100%;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  padding: 0.45rem 1rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: var(--transition);
}

.search-box:focus-within {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04);
}

.search-icon {
  color: var(--text-tertiary);
  font-size: 1.05rem;
  margin-right: 0.6rem;
  flex-shrink: 0;
}

.search-field {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
}

.search-field::placeholder {
  color: var(--text-tertiary);
}

.search-key-hint {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  margin-left: 0.4rem;
  user-select: none;
}

.search-reset-btn {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.05rem;
  cursor: pointer;
  padding: 0 0.2rem;
  display: none;
  line-height: 1;
}

.search-reset-btn:hover {
  color: #fff;
}

.category-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.category-pill {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.category-pill:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.category-pill.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* ==========================================================================
   Tools Grid (Ultra-Clean Squircle Cards)
   ========================================================================== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  width: 100%;
}

.tool-card {
  position: relative;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-squircle);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: var(--transition-smooth);
}

.tool-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
}

.card-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  overflow: hidden;
  background: #14141a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
}

.tool-card:hover .card-icon-box {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.25);
}

.card-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-top-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-card-fav {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-card-fav:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-card-fav.active {
  color: #fb7185;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.5rem;
}

.card-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}

.card-arrow {
  color: var(--text-tertiary);
  font-size: 1rem;
  transition: var(--transition);
}

.tool-card:hover .card-arrow {
  color: #ffffff;
  transform: translate(2px, -2px);
}

/* Skeleton Loading */
.card-skeleton {
  height: 155px;
  border-radius: var(--radius-squircle);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  animation: pulseSkeleton 1.8s infinite ease-in-out;
}

@keyframes pulseSkeleton {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* ==========================================================================
   Ecosystem Modal
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: 80vh;
  background: #111116;
  border: 1px solid var(--border-glass);
  border-radius: 28px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
  overflow-y: auto;
  transform: scale(0.95);
  transition: var(--transition-smooth);
}

.modal-overlay.show .modal-card {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.modal-head-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #ffffff;
}

.modal-head-text {
  display: flex;
  flex-direction: column;
}

.modal-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
}

.modal-subheading {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.ecosystem-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.65rem;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.ecosystem-app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  padding: 0.85rem 0.4rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  text-decoration: none;
  color: #fff;
  transition: var(--transition);
}

.ecosystem-app-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.ecosystem-app-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  overflow: hidden;
  background: #191920;
}

.ecosystem-app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ecosystem-app-name {
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.25;
}

/* ==========================================================================
   Minimal Toast & Footer
   ========================================================================== */
.studio-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(20, 20, 26, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0.6rem 1.3rem;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 2000;
  opacity: 0;
  transition: var(--transition-smooth);
  pointer-events: none;
}

.studio-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.studio-footer {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.studio-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.studio-footer a:hover {
  color: #fff;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 768px) {
  .studio-viewport {
    padding: 0.85rem 0.85rem 3rem;
    gap: 1.75rem;
  }
  .hero-title {
    font-size: 2.15rem;
  }
  .hero-subtitle {
    font-size: 0.95rem;
  }
  .tools-grid {
    grid-template-columns: 1fr;
  }
}
