/* 
  GENORA STUDIOS - ELITE UI OVERHAUL (v4.0)
  High-End Marketplace Design System
*/

@layer reset, base, features, composition, utilities;

@layer base {
    :root {
        --color-bg: #030509;
        --color-glass: rgba(10, 12, 20, 0.9); /* More Opaque */
        --color-glass-heavy: rgba(5, 7, 10, 0.98);
        --color-accent: #a855f7; /* Purple */
        --color-text: #fafafa;
        --color-text-muted: #94a3b8;
        --color-border: rgba(255, 255, 255, 0.08);
        --font-heading: 'Syne', sans-serif;
        --font-body: 'DM Sans', sans-serif;
        --container-max: 1400px;
        --transition-slow: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
        --transition-fast: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
        
        --card-background: var(--color-glass);
        --card-foreground: #fff;
        --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
        --ease-in-expo: cubic-bezier(0.95, 0.05, 0.795, 0.035);
    }

    * { margin: 0; padding: 0; box-sizing: border-box; }
    body {
        background-color: var(--color-bg);
        color: var(--color-text);
        font-family: var(--font-body);
        line-height: 1.6;
        overflow-x: hidden;
    }

    h1, h2, h3, h4 { font-family: var(--font-heading); color: #fff; line-height: 1.1; letter-spacing: -2px; }
    a { text-decoration: none; color: inherit; transition: var(--transition-fast); }
    img { max-width: 100%; height: auto; display: block; -webkit-user-drag: none; -khtml-user-drag: none; -moz-user-drag: none; -o-user-drag: none; user-drag: none; }

    .container {
        width: 100%;
        max-width: var(--container-max);
        margin: 0 auto;
        padding: 0 40px;
    }

    /* Top Atmosphere Wrapper */
    .top-atmosphere {
        position: relative;
        background-image: 
            radial-gradient(circle at center, rgba(5, 7, 10, 0.2) 0%, rgba(5, 7, 10, 0.75) 100%),
            url('../images/wallpapers/wallpaper_minecraft_ocean_monument_1920x1080.png');
        background-size: cover;
        background-position: center;
        background-attachment: fixed;
        min-height: 80vh; /* Reduced Depth for better visibility */
    }

    header { height: 120px; display: flex; align-items: center; z-index: 1000; width: 100%; }
    .nav-inner { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 40px; }
    .logo { height: 60px; display: flex; align-items: center; }
    .logo img { height: 100%; width: auto; display: block; }
    .nav-links { display: flex; gap: 3rem; list-style: none; }
    .nav-links a { font-weight: 700; font-size: 0.8rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 2px; position: relative; }
    .nav-links a:hover,
    .nav-links a.active { 
        color: var(--color-accent); 
        text-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
    }
    
    .nav-links a.active::after {
        content: "";
        position: absolute;
        bottom: -8px; left: 0;
        width: 100%; height: 2px;
        background: var(--color-accent);
        box-shadow: 0 0 10px var(--color-accent);
    }

    .hero { min-height: 75vh; display: flex; align-items: center; justify-content: center; text-align: center; }
    .hero-title { font-size: clamp(3rem, 10vw, 7.5rem); font-weight: 800; background: linear-gradient(180deg, #fff 40%, rgba(255,255,255,0.2) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

    /* Marquee Improvements */
    .marquee-container {
        background: rgba(13, 17, 30, 0.4);
        backdrop-filter: blur(20px);
        border-top: 1px solid var(--color-border);
        padding: 1.5rem 0;
        overflow: hidden;
        white-space: nowrap;
        position: relative;
        z-index: 3;
    }
    .marquee-text { display: inline-block; animation: marquee-scroll 60s linear infinite; font-size: 0.9rem; font-weight: 800; text-transform: uppercase; letter-spacing: 4px; color: var(--color-accent); }
    @keyframes marquee-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

    .glass-panel {
        background: var(--color-glass);
        backdrop-filter: blur(40px);
        border: 1px solid var(--color-border);
        border-radius: 40px;
        padding: clamp(30px, 6vw, 80px);
        margin-bottom: 60px;
    }
}

@layer features {
  @scope (.scope.product-cards) to (.scope) {
    :scope {
      container: --scope / inline-size;
    }

    ._card-list {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
      grid-auto-rows: min-content; /* Helps subgrid if used vertically, but we use standard flow here for max compatibility */
      gap: 30px;
    }

    ._card {
      --_accent: var(--color-accent);
      --_row-gap: 0.5rem;
      --_padding: 24px;
      --_radius: 40px;
      --_inner-radius: calc(var(--_radius) - var(--_padding));
      --_category-radius: 16px;
      --_duration: 350ms;
      --_has-hocus-on: ;
      --_has-hocus-off: initial;

      display: flex;
      flex-direction: column;
      padding: var(--_padding);
      border-radius: var(--_radius);
      box-shadow: 0 10px 30px rgba(0,0,0,0.5);
      background-color: var(--card-background);
      backdrop-filter: blur(20px);
      transition: background-color 0.4s var(--ease-out-expo), 
                  border-color 0.4s var(--ease-out-expo),
                  transform 0.4s var(--ease-out-expo);
      position: relative;
      overflow: hidden;

      &:hover {
        transform: scale(1.05); /* Panel grows */
        background-color: rgba(255, 255, 255, 0.05); 
        border-color: var(--color-accent);
        z-index: 10;
      }
    }

    ._thumbnail-stack {
      position: relative;
      border-radius: var(--_inner-radius);
      overflow: hidden;
      aspect-ratio: 16/10;
      background: #000;
      margin-bottom: 1.5rem;

      & > img {
        width: 100%; height: 100%; object-fit: cover;
        position: absolute; inset: 0;
        transition: transform 0.4s var(--ease-out-expo);
      }

      /* Counter-scale image: panel grows 1.05, image shrinks 0.95 to stay stable */
      ._card:hover & > img {
        transform: scale(0.95);
      }
    }

    img._bg-img {
       opacity: 0.3;
       filter: blur(20px);
       transition: opacity var(--_duration) var(--ease-out-expo);
    }

    img._main-img {
      z-index: 1;
      @media (prefers-reduced-motion: no-preference) {
        transition: clip-path var(--_duration) var(--ease-out-expo),
                    transform 0.4s var(--ease-out-expo);
      }
    }

    ._card:hover img._main-img {
       clip-path: inset(0 round var(--_inner-radius));
    }

    ._heading { 
        font-family: var(--font-heading);
        font-size: 1.5rem; 
        font-weight: 800; 
        letter-spacing: -1px; 
        color: #fff;
        margin-bottom: 8px;
    }
    
    ._price {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      padding: 8px 18px;
      border-radius: 50px;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--color-border);
      font-size: 0.8rem;
      align-self: flex-start;
      margin-bottom: 20px;
    }

    ._rating {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-bottom: 8px;
    }
    .rating-value {
      font-weight: 800;
      font-size: 0.9rem;
      color: #fff;
    }
    .stars {
      display: flex;
      gap: 2px;
      color: var(--color-accent);
      font-size: 0.75rem;
    }
    .rating-count {
      color: var(--color-text-muted);
      font-size: 0.75rem;
      font-weight: 500;
    }

    .mc-label {
      color: var(--color-text-muted);
      text-transform: uppercase;
      letter-spacing: 1px;
      font-weight: 700;
      font-size: 0.65rem;
    }

    .mc-value {
      color: var(--color-accent);
      font-weight: 800;
      font-size: 0.9rem;
    }

    ._category {
      position: absolute;
      top: 0; left: 0;
      z-index: 10;
      padding: 10px 22px;
      background-color: var(--color-accent); /* Orange Background */
      border-bottom-right-radius: var(--_category-radius);
      color: #000; /* Contrast Text */
      font-weight: 900;
      font-size: 0.7rem;
      text-transform: uppercase;
      letter-spacing: 2px;
      box-shadow: 10px 10px 30px rgba(0,0,0,0.5);

      &::before, &::after {
        content: "";
        position: absolute;
        width: var(--_category-radius);
        height: var(--_category-radius);
        background-color: var(--color-accent);
        mask-image: radial-gradient(circle at 100% 100%, transparent var(--_category-radius), red calc(var(--_category-radius) + 1px));
        -webkit-mask-image: radial-gradient(circle at 100% 100%, transparent var(--_category-radius), red calc(var(--_category-radius) + 1px));
      }
      &::before { top: 0; left: 100%; }
      &::after { top: 100%; left: 0; }
    }

    ._description { 
        color: var(--color-text-muted); 
        font-size: 0.9rem; 
        line-height: 1.6; 
        margin-bottom: 2rem; 
        opacity: 0.7;
        flex-grow: 1; /* Pushes button to bottom */
    }
  }

  @scope (.scope.purchase-button) to (.scope) {
    :scope {
      --_background: var(--color-accent);
      --_foreground: #000;
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 1.1em;
      border-radius: 50px;
      background-color: var(--_background);
      color: var(--_foreground);
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 2px;
      font-size: 0.75rem;
      transition: transform 0.2s ease;
      cursor: pointer;
      width: 100%;

      &:hover {
        transform: scale(1.02);
      }
    }
  }
}

@layer composition {
  .grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 30px;
  }
}

@layer utilities {
  .-line-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* Elite Buttons & Panels */
.btn-spark {
    position: relative;
    display: inline-flex;
    padding: 1.2rem 3rem;
    background: var(--color-accent);
    color: #000;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn-spark:hover {
    transform: translateY(-2px);
}

.section-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 3rem;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s var(--ease-out-expo), transform 1s var(--ease-out-expo);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* About & Contact Specific Layout Refinements */
#about { 
    padding: 220px 0;
    position: relative;
    background-image: 
        radial-gradient(circle at center, rgba(5, 7, 10, 0.45) 0%, rgba(5, 7, 10, 1) 130%),
        url('../images/wallpapers/wallpaper_minecraft_village_pillage_1920x1080.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: 1;
}

#about::before, #about::after, #contact::before, #contact::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 300px;
    z-index: -1;
    pointer-events: none;
}

#about::before, #contact::before {
    top: 0;
    background: linear-gradient(to bottom, var(--color-bg) 0%, transparent 100%);
}

#about::after, #contact::after {
    bottom: 0;
    background: linear-gradient(to top, var(--color-bg) 0%, transparent 100%);
}

#about .container, #contact .container {
    position: relative;
    z-index: 2;
}

.pillar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-top: 60px;
}

.pillar-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 30px;
    transition: transform 0.4s var(--ease-out-expo), border-color 0.4s var(--ease-out-expo);
    
    &:hover {
        transform: translateY(-10px);
        border-color: var(--color-accent);
        background: rgba(255, 255, 255, 0.05);
    }

    i {
        font-size: 2.5rem;
        color: var(--color-accent);
        margin-bottom: 25px;
        display: block;
    }

    h3 {
        font-family: var(--font-heading);
        font-size: 1.5rem;
        margin-bottom: 18px;
        color: #fff;
        letter-spacing: normal;
        line-height: 1.25;
    }

    p {
        color: var(--color-text-muted);
        font-size: 1rem;
        line-height: 1.7;
    }
}

#contact { 
    padding: 220px 0 250px;
    position: relative;
    background-image: 
        radial-gradient(circle at center, rgba(5, 7, 10, 0.45) 0%, rgba(5, 7, 10, 1) 130%),
        url('../images/wallpapers/wallpaper_minecraft_mineshaft_1920x1080.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: 1;
}

form .form-group label {
    display: block;
    margin-bottom: 12px;
}

form input, form textarea {
    transition: all 0.3s ease;
}

form input:focus, form textarea:focus {
    border-color: var(--color-accent) !important;
    background: rgba(255,255,255,0.05) !important;
    outline: none;
}

/* Snap Filtering - Disable transitions for layout stability */
#projects-grid.snap-filtering .portfolio-card {
    transition: none !important;
}

/* Atmospheric Dividers & Spacers */
.section-divider {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--color-bg);
    overflow: hidden;
}

.section-divider::before {
    content: "";
    width: 300px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    opacity: 0.4;
}

.section-divider i {
    position: absolute;
    color: #fff;
    font-size: 1.4rem;
    opacity: 1;
    background: var(--color-bg);
    padding: 0 20px;
    text-shadow: 0 0 20px var(--color-accent);
}

.glass-panel {
    background: var(--color-glass) !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

/* Custom Professional Controls (Restored & Premium) */
.filter-btn {
    padding: 12px 30px; 
    border: 1px solid rgba(255,255,255,0.1); 
    background: rgba(13, 17, 30, 0.4); 
    color: var(--color-text-muted); 
    font-size: 0.75rem; 
    font-weight: 800; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    border-radius: 50px; 
    cursor: pointer; 
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); 
    backdrop-filter: blur(10px);
}

.filter-btn:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.filter-btn.active { 
    background: var(--color-accent); 
    color: #000; 
    border-color: var(--color-accent); 
    box-shadow: 0 10px 40px rgba(168, 85, 247, 0.4);
    transform: translateY(-2px);
}

.sort-select {
    padding: 12px 45px 12px 25px; 
    background: rgba(13, 17, 30, 0.4) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E") no-repeat calc(100% - 20px) center;
    border: 1px solid rgba(255, 255, 255, 0.1); 
    color: #fff; 
    font-size: 0.75rem; 
    font-weight: 800; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    border-radius: 50px; 
    cursor: pointer; 
    outline: none; 
    appearance: none; 
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.sort-select:focus {
    border-color: var(--color-accent);
}

/* Fix for Catalog overlap */
#projects-grid {
    padding-top: 40px;
}
