/* ==========================================================================
   MiniSocia Studio - Fully Black Minimalist Stylesheet & Animated Intro
   ========================================================================== */

:root {
  /* Pure Pitch Black Theme Palette */
  --bg-main: #000000;
  --bg-surface: #070707;
  --bg-elevated: #0d0d0d;
  --bg-icon-square: #0a0a0a;

  --border-subtle: #1c1c1c;
  --border-icon: #1e1e1e;
  --border-focus: #333333;
  --border-highlight: #444444;

  --text-primary: #ffffff;
  --text-secondary: #909090;
  --text-muted: #555555;
  --text-inverse: #000000;

  --accent-white: #ffffff;

  /* Squircle Dimensions */
  --squircle-radius: 20px;
  --icon-size: 92px;

  /* Fonts */
  --font-logo-vampiro: "Vampiro One", cursive;
  --font-logo-poppins: "Poppins", sans-serif;
  --font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Transitions */
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-main); /* Fully Black */
  background-image: none; /* No gradients, pure solid black */
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Intro Animated Splash Screen (From User's Code)
   ========================================================================== */
.intro-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999999;
  overflow: hidden;
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.65s ease;
}

.intro-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Container for Logo + Loader */
.intro-screen .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 35px;
}

.intro-screen .logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Animation for Logo Circle */
.intro-screen .circle-wrapper {
  position: relative;
  width: 125px;
  height: 125px;
  animation: fadeInScale 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

.intro-screen .circle {
  width: 125px;
  height: 125px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.intro-screen .main-text {
  font-family: var(--font-logo-vampiro);
  color: #ffffff;
  font-size: 43px;
  font-weight: 400;
  line-height: 0.85;
  text-align: center;
}

/* Animation for "Studio" Text */
.intro-screen .studio {
  font-family: var(--font-logo-poppins);
  color: #ffffff;
  font-size: 48px;
  font-weight: 200;
  letter-spacing: 1px;
  opacity: 0;
  animation: slideInRight 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

/* Loading Spinner Styling */
.intro-screen .loader-circle {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top: 2px solid #ffffff;
  border-radius: 50%;
  opacity: 0;
  animation: fadeIn 0.8s ease 1s forwards, spin 1s linear infinite;
}

/* Keyframe Animations from User's Snippet */
@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInRight {
  0% {
    opacity: 0;
    transform: translateX(-30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   Page Content Entrance Transition (Reveals after intro)
   ========================================================================== */
body:not(.app-loaded) .sticky-header,
body:not(.app-loaded) .main-wrapper,
body:not(.app-loaded) .footer {
  opacity: 0;
  transform: translateY(14px);
}

.sticky-header,
.main-wrapper,
.footer {
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

body.app-loaded .sticky-header,
body.app-loaded .main-wrapper,
body.app-loaded .footer {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Sticky Header: Locks Navbar AND Category Filters during scroll
   ========================================================================== */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: none;
  transition: box-shadow var(--transition-fast), opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.sticky-header.scrolled {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.8);
}

/* Navbar Top Row */
.navbar-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 16px 28px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Top Left Logo in Navbar (Compact scale without TM) */
.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  min-width: 160px;
  transition: transform var(--transition-smooth), opacity var(--transition-fast);
}

.nav-logo:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.nav-logo .circle-wrapper {
  position: relative;
  width: 44px;
  height: 44px;
}

.nav-logo .circle {
  width: 44px;
  height: 44px;
  border: 1.6px solid var(--accent-white);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
}

.nav-logo .main-text {
  font-family: var(--font-logo-vampiro);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 400;
  line-height: 0.84;
  text-align: center;
  letter-spacing: -0.2px;
}

.nav-logo .studio {
  font-family: var(--font-logo-poppins);
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 200;
  letter-spacing: 1.5px;
  text-transform: capitalize;
}

/* Center Search Bar */
.nav-search-wrapper {
  flex: 1;
  max-width: 520px;
  margin: 0 auto;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 42px;
  padding: 0 16px;
  background: #080808;
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  transition: all var(--transition-fast);
}

.search-bar:focus-within {
  background: #0e0e0e;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.search-icon {
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.search-bar:focus-within .search-icon {
  color: var(--text-primary);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 400;
}

.search-input::placeholder {
  color: #555555;
  font-weight: 400;
}

/* Spacer for perfect desktop balance */
.nav-spacer {
  min-width: 160px;
  flex-shrink: 0;
  display: block;
}

/* Category Filter Bar (Inside Sticky Header, No HR) */
.filter-header-bar {
  width: 100%;
  padding-bottom: 12px;
}

.filter-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: none;
}

.filter-scroll-wrapper {
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  mask-image: linear-gradient(to right, black 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
  padding: 4px 0;
  flex: 1;
}

.filter-scroll-wrapper::-webkit-scrollbar {
  display: none;
}

.filter-pills {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.filter-pill {
  padding: 7px 15px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  background: #080808;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
}

.filter-pill:hover {
  background: #141414;
  border-color: var(--border-highlight);
  color: var(--text-primary);
}

.filter-pill.active {
  background: #ffffff;
  color: #000000;
  font-weight: 600;
  border-color: #ffffff;
}

/* Sort Dropdown */
.sort-wrapper {
  position: relative;
  flex-shrink: 0;
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: #080808;
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
}

.sort-btn:hover {
  background: #141414;
  border-color: var(--border-highlight);
}

.chevron-icon {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.sort-btn[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

.sort-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 160px;
  background: #0a0a0a;
  border: 1px solid #222222;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.9);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
}

.sort-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sort-item {
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sort-item:hover {
  background: #151515;
  color: var(--text-primary);
}

.sort-item.active {
  color: #ffffff;
  font-weight: 600;
  background: #202020;
}

/* ==========================================================================
   Main Content: App Icons Grid
   ========================================================================== */
.main-wrapper {
  flex: 1;
  max-width: 1360px;
  margin: 0 auto;
  width: 100%;
  padding: 36px 28px 80px;
}

.icons-section {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* 6 compact icons across on desktop */
.icons-grid {
  display: grid;
  grid-template-columns: repeat(6, var(--icon-size));
  gap: 28px;
  justify-content: center;
}

/* Flat solid empty squircle against pure black background */
.app-icon-square {
  width: var(--icon-size);
  height: var(--icon-size);
  border-radius: var(--squircle-radius);
  background: var(--bg-icon-square);
  border: 1px solid var(--border-icon);
  box-shadow: none;
  cursor: pointer;
  user-select: none;
  transition: border-color var(--transition-fast), transform var(--transition-fast), background-color var(--transition-fast);
}

.app-icon-square:hover {
  border-color: #444444;
  transform: translateY(-3px);
  background: #141414;
}

/* ==========================================================================
   Dribbble-Style Studio Footer (Pure Black)
   ========================================================================== */
.footer {
  width: 100%;
  background: #000000;
  border-top: none; /* HR removed */
  padding: 56px 28px 44px;
  margin-top: auto;
}

.footer-container {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* Top Row: Logo | Center Studio Text Links | Social Media Icons */
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

/* Footer Logo */
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity var(--transition-fast);
}

.footer-logo:hover {
  opacity: 0.85;
}

.circle-mini {
  width: 34px;
  height: 34px;
  border: 1.4px solid var(--accent-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.mini-main-text {
  font-family: var(--font-logo-vampiro);
  color: var(--text-primary);
  font-size: 11.5px;
  line-height: 0.84;
  text-align: center;
  letter-spacing: -0.2px;
}

.mini-studio {
  font-family: var(--font-logo-poppins);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 200;
  letter-spacing: 1.2px;
}

/* Center Studio Text Buttons */
.footer-center-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-nav-link {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}

.footer-nav-link:hover {
  opacity: 0.65;
}

/* Right Social Media Icons */
.footer-socials {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.social-icon-link {
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.social-icon-link:hover {
  opacity: 0.65;
  transform: translateY(-2px);
}

/* Bottom Row: Legal / Copyright on Left | Studio Specs on Right */
.footer-bottom {
  margin-top: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13.5px;
}

.footer-bottom-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--text-muted);
}

.footer-copy {
  color: var(--text-muted);
}

.footer-bottom-right {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-bottom-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-bottom-link:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   Responsive Breakpoints: Desktop & Mobile optimization
   ========================================================================== */

/* Tablets & Small Desktops (up to 992px) */
@media (max-width: 992px) {
  .footer-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .footer-center-nav {
    gap: 20px 24px;
  }

  .footer-bottom {
    margin-top: 36px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

/* Medium Tablets & Phones (up to 860px) */
@media (max-width: 860px) {
  .navbar-container {
    flex-wrap: wrap;
    padding: 14px 18px 8px;
    gap: 14px;
  }

  .nav-logo {
    min-width: auto;
  }

  .nav-spacer {
    display: none;
  }

  .nav-search-wrapper {
    order: 3;
    width: 100%;
    max-width: 100%;
  }

  .filter-container {
    padding: 0 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .filter-scroll-wrapper {
    width: 100%;
  }

  .sort-wrapper {
    align-self: flex-end;
  }

  .main-wrapper {
    padding: 24px 16px 50px;
  }

  :root {
    --icon-size: 84px;
    --squircle-radius: 18px;
  }

  .icons-grid {
    grid-template-columns: repeat(3, var(--icon-size));
    gap: 20px;
  }

  .footer {
    padding: 40px 18px 32px;
  }
}

/* Small Mobile (up to 440px) */
@media (max-width: 440px) {
  :root {
    --icon-size: 76px;
    --squircle-radius: 16px;
  }

  .icons-grid {
    grid-template-columns: repeat(3, var(--icon-size));
    gap: 14px;
  }

  .intro-screen .circle-wrapper,
  .intro-screen .circle {
    width: 95px;
    height: 95px;
  }

  .intro-screen .main-text {
    font-size: 32px;
  }

  .intro-screen .studio {
    font-size: 36px;
  }

  .nav-logo .circle-wrapper {
    width: 38px;
    height: 38px;
  }

  .nav-logo .circle {
    width: 38px;
    height: 38px;
  }

  .nav-logo .main-text {
    font-size: 13px;
  }

  .nav-logo .studio {
    font-size: 17px;
  }

  .footer-center-nav {
    gap: 14px 18px;
  }

  .footer-bottom-left, .footer-bottom-right {
    gap: 14px;
  }
}
