/* ============================================
   WebGridSoftPrime.com - Main Stylesheet
   Dark Minimalist Tech Style
   ============================================ */

:root {
    --color-bg: #050608;
    --color-bg-alt: #0a0c12;
    --color-bg-card: #0e1018;
    --color-bg-elevated: #14171f;
    --color-border: #1f2330;
    --color-border-light: #2a2e3e;
    --color-text: #e8ebf2;
    --color-text-muted: #8a92a8;
    --color-text-dim: #5b6478;
    --color-accent: #00f0ff;
    --color-accent-2: #7c5cff;
    --color-accent-3: #00ff9d;
    --color-warn: #ffb547;
    --color-error: #ff5577;
    --gradient-primary: linear-gradient(135deg, #00f0ff 0%, #7c5cff 100%);
    --gradient-secondary: linear-gradient(135deg, #00ff9d 0%, #00f0ff 100%);
    --gradient-dark: linear-gradient(180deg, #050608 0%, #0a0c12 100%);
    --shadow-glow: 0 0 40px rgba(0, 240, 255, 0.15);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 12px 40px rgba(0, 240, 255, 0.12);
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', Consolas, 'Roboto Mono', monospace;
    --font-sans: 'Inter', 'Helvetica Neue', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --max-width: 1280px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

::selection {
    background: var(--color-accent);
    color: var(--color-bg);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-alt);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border-light);
    border-radius: 4px;
    transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent);
}

button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
}

img, svg {
    max-width: 100%;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* ============================================
   Background Grid & Decorative Elements
   ============================================ */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(31, 35, 48, 0.4) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 35, 48, 0.4) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    pointer-events: none;
}

.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    pointer-events: none;
    z-index: -1;
}

.bg-glow--cyan {
    top: -200px;
    left: -200px;
    background: var(--color-accent);
    animation: floatGlow 20s ease-in-out infinite;
}

.bg-glow--purple {
    bottom: -200px;
    right: -200px;
    background: var(--color-accent-2);
    animation: floatGlow 25s ease-in-out infinite reverse;
}

@keyframes floatGlow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(100px, -50px) scale(1.2); }
    66% { transform: translate(-100px, 50px) scale(0.9); }
}

#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.05;
    pointer-events: none;
}

/* ============================================
   Layout Container
   ============================================ */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 32px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
}

/* ============================================
   Navigation
   ============================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(5, 6, 8, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--color-border);
    transition: all var(--transition-base);
}

.nav.scrolled {
    background: rgba(5, 6, 8, 0.95);
    border-bottom-color: var(--color-border-light);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.02em;
}

.nav-brand .logo {
    width: 32px;
    height: 32px;
    transition: transform var(--transition-base);
}

.nav-brand:hover .logo {
    transform: rotate(180deg);
}

.nav-brand .brand-text {
    color: var(--color-text);
}

.nav-brand .brand-text .accent {
    color: var(--color-accent);
}

.nav-brand .brand-tag {
    font-size: 10px;
    color: var(--color-text-dim);
    margin-left: 8px;
    padding: 2px 6px;
    border: 1px solid var(--color-border);
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.nav-menu a {
    display: block;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--color-text-muted);
    border-radius: 6px;
    position: relative;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 16px;
    right: 16px;
    height: 1px;
    background: var(--color-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base);
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--color-text);
}

.nav-menu a:hover::before,
.nav-menu a.active::before {
    transform: scaleX(1);
}

.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: all var(--transition-base);
}

.nav-toggle.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 900px) {
    .nav-menu {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: rgba(5, 6, 8, 0.98);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--color-border);
        padding: 16px;
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: all var(--transition-base);
    }

    .nav-menu.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-menu a {
        padding: 14px 16px;
        font-size: 15px;
        border-radius: 0;
        border-bottom: 1px solid var(--color-border);
    }

    .nav-menu a:last-child {
        border-bottom: none;
    }

    .nav-toggle {
        display: flex;
    }
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    overflow: hidden;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: center;
    width: 100%;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    margin-bottom: 28px;
    border: 1px solid var(--color-border-light);
    border-radius: 100px;
    background: rgba(20, 23, 31, 0.5);
    backdrop-filter: blur(10px);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--color-accent);
    letter-spacing: 0.05em;
}

.hero-badge .pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--color-accent);
    border-radius: 50%;
    position: relative;
}

.hero-badge .pulse-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 1px solid var(--color-accent);
    border-radius: 50%;
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

.hero-title {
    font-size: clamp(28px, 4vw, 52px);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.03em;
}

.hero-title .line {
    display: block;
    overflow: hidden;
}

.hero-title .word {
    display: inline-block;
    transform: translateY(100%);
    animation: revealWord 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-title .word:nth-child(2) { animation-delay: 0.1s; }
.hero-title .word:nth-child(3) { animation-delay: 0.2s; }
.hero-title .word:nth-child(4) { animation-delay: 0.3s; }
.hero-title .word:nth-child(5) { animation-delay: 0.4s; }
.hero-title .word:nth-child(6) { animation-delay: 0.5s; }

@keyframes revealWord {
    to { transform: translateY(0); }
}

.hero-title .gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 200% 200%;
    animation: gradientShift 8s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-subtitle {
    font-size: clamp(15px, 1.6vw, 17px);
    color: var(--color-text-muted);
    max-width: 580px;
    margin-bottom: 32px;
    line-height: 1.7;
    opacity: 0;
    animation: fadeInUp 1s 0.8s forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    opacity: 0;
    animation: fadeInUp 1s 1s forwards;
}

/* ============================================
   Hero Visual
   ============================================ */
.hero-visual {
    position: relative;
    width: 100%;
    max-width: 380px;
    aspect-ratio: 1 / 1;
    z-index: 1;
    justify-self: end;
    animation: float 6s ease-in-out infinite;
}

.hero-visual::before {
    content: '';
    position: absolute;
    inset: -40px;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.18) 0%, transparent 65%);
    border-radius: 50%;
    animation: rotateGlow 20s linear infinite;
    z-index: -1;
}

@keyframes rotateGlow {
    to { transform: rotate(360deg); }
}

.hero-visual svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 30px rgba(0, 240, 255, 0.15));
}

@media (max-width: 900px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-visual {
        max-width: 320px;
        margin: 0 auto;
        justify-self: center;
        order: -1;
    }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-text);
    color: var(--color-bg);
    border: 1px solid var(--color-text);
}

.btn-primary:hover {
    background: var(--color-accent);
    color: var(--color-bg);
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 240, 255, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border-light);
}

.btn-ghost:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    transform: translateY(-2px);
}

.btn .arrow {
    transition: transform var(--transition-base);
}

.btn:hover .arrow {
    transform: translateX(4px);
}

/* ============================================
   Section Common
   ============================================ */
section {
    padding: 120px 0;
    position: relative;
}

.section-header {
    margin-bottom: 72px;
    max-width: 720px;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 20px;
}

.section-label::before {
    content: '';
    width: 32px;
    height: 1px;
    background: var(--color-accent);
}

.section-title {
    font-size: clamp(32px, 4.5vw, 56px);
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.03em;
}

.section-title .gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.section-description {
    font-size: 17px;
    color: var(--color-text-muted);
    line-height: 1.7;
}

@media (max-width: 768px) {
    section {
        padding: 80px 0;
    }

    .section-header {
        margin-bottom: 48px;
    }
}

/* ============================================
   Stats Section (Hero Stats)
   ============================================ */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--color-border);
    opacity: 0;
    animation: fadeInUp 1s 1.2s forwards;
}

.stat-item {
    padding: 0 24px;
    border-left: 1px solid var(--color-border);
}

.stat-item:first-child {
    border-left: none;
    padding-left: 0;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 36px;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat-label {
    font-size: 12px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

@media (max-width: 768px) {
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px 16px;
    }

    .stat-item {
        padding: 0;
        border-left: none;
    }
}

/* ============================================
   Cards / Grid Layouts
   ============================================ */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 900px) {
    .grid-3, .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 32px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.card:hover {
    border-color: var(--color-border-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.2);
    color: var(--color-accent);
    transition: all var(--transition-base);
}

.card:hover .card-icon {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--color-accent);
    transform: scale(1.05);
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.card-description {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.7;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--color-accent);
}

.card-link .arrow {
    transition: transform var(--transition-base);
}

.card-link:hover .arrow {
    transform: translateX(4px);
}

/* ============================================
   App Matrix - 3 column 2 row grid
   ============================================ */
.app-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 900px) {
    .app-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .app-grid {
        grid-template-columns: 1fr;
    }
}

.app-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 28px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.app-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.app-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(124, 92, 255, 0.1));
    border: 1px solid rgba(0, 240, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--color-accent);
}

.app-card-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
}

.app-card-category {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.app-card-description {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.app-card-platforms {
    display: flex;
    gap: 6px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.platform-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 3px 8px;
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    padding: 80px 0 32px;
    position: relative;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-brand .logo {
    width: 36px;
    height: 36px;
    margin-bottom: 20px;
}

.footer-brand p {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.7;
    max-width: 320px;
    margin-bottom: 24px;
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--color-text-dim);
}

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

.footer-contact a:hover {
    color: var(--color-accent);
}

.footer-column h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text);
    margin-bottom: 20px;
    font-family: var(--font-mono);
    font-weight: 600;
}

.footer-column ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-column a {
    font-size: 14px;
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.footer-column a:hover {
    color: var(--color-accent);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
    font-size: 12px;
    color: var(--color-text-dim);
    font-family: var(--font-mono);
}

.footer-legal {
    display: flex;
    gap: 24px;
}

.footer-legal a {
    color: var(--color-text-dim);
}

.footer-legal a:hover {
    color: var(--color-accent);
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .footer-brand {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-brand {
        grid-column: span 1;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

/* ============================================
   Reveal Animation
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--transition-slow), transform 0.8s var(--transition-slow);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ============================================
   Cursor Glow Effect
   ============================================ */
.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.08) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    z-index: 0;
    transition: opacity var(--transition-base);
    mix-blend-mode: screen;
}

@media (max-width: 768px) {
    .cursor-glow {
        display: none;
    }
}