/* || CYBERPUNK / GLITCH DESIGN SYSTEM */
/* High-Tech, Low-Life - Digital Dystopia Aesthetic */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Share+Tech+Mono&display=swap');

/* || CSS CUSTOM PROPERTIES - CYBERPUNK PALETTE */
:root {
    /* Core Colors - Void System */
    --background: #0a0a0f;
    --foreground: #e0e0e0;
    --card: #12121a;
    --muted: #1c1c2e;
    --mutedForeground: #6b7280;

    /* Neon Accents */
    --accent: #00ff88;           /* PRIMARY - Electric green */
    --accentSecondary: #ff00ff;   /* SECONDARY - Hot magenta */
    --accentTertiary: #00d4ff;    /* TERTIARY - Cyan */

    /* UI Elements */
    --border: #2a2a3a;
    --input: #12121a;
    --ring: #00ff88;
    --destructive: #ff3366;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;
    --space-2xl: 8rem;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-index layers */
    --z-scanline: 1000;
    --z-noise: 1;
    --z-content: 10;
    --z-marquee: 5;
}

/* || RESET & BASE */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* || BODY */
body {
    font-family: 'Share Tech Mono', 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* || SCANLINE OVERLAY */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: var(--z-scanline);
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.3) 2px,
        rgba(0, 0, 0, 0.3) 4px
    );
    opacity: 0.06;
    mix-blend-mode: overlay;
    animation: scanlineScroll 25s linear infinite;
}

/* || NOISE TEXTURE OVERLAY */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: var(--z-noise);
    opacity: 0.08;
    mix-blend-mode: overlay;
}

.noise-overlay svg {
    width: 100%;
    height: 100%;
}

/* || CIRCUIT/GRID BACKGROUND */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(0, 255, 136, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 136, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* || LOGO LINE ART OVERLAY */
.logo-overlay {
    position: fixed;
    bottom: 5%;
    right: 5%;
    width: min(50vw, 600px);
    height: auto;
    pointer-events: none;
    z-index: 2;
    opacity: 0.1;
}

.logo-overlay img {
    width: 100%;
    height: auto;
    display: block;
}

/* || KEYFRAME ANIMATIONS */
@keyframes blink {
    50% { opacity: 0; }
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(2px, -2px); }
    60% { transform: translate(-1px, -1px); }
    80% { transform: translate(1px, 1px); }
}

@keyframes rgbShift {
    0%, 100% {
        text-shadow: -2px 0 #ff00ff, 2px 0 #00d4ff;
    }
    50% {
        text-shadow: 2px 0 #ff00ff, -2px 0 #00d4ff;
    }
}

@keyframes scanlineScroll {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

@keyframes boot-sequence {
    0% {
        opacity: 0.6;
        filter: blur(2px);
        transform: scale(0.98);
    }
    100% {
        opacity: 0.6;
        filter: blur(0);
        transform: scale(1);
    }
}

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

/* || HERO HEADER - COMPACT BAR */
.hero-header {
    padding: 0.75rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--accent);
    background: var(--background);
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hero-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--accent) 30%,
        var(--accent) 70%,
        transparent
    );
    box-shadow: 0 0 10px var(--accent);
}

.hero-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--foreground);
    margin-bottom: 0;
    position: relative;
    animation: fadeInUp 600ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Accent highlight on header */
.hero-header .hero-accent {
    color: var(--accent);
    text-shadow:
        0 0 10px var(--accent),
        0 0 20px var(--accent),
        0 0 40px var(--accent);
    animation: rgbShift 4s infinite;
    position: relative;
    display: inline-block;
}

/* Glitch effect on accent only */
.hero-header .hero-accent::before,
.hero-header .hero-accent::after {
    content: '// PORTAL';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    line-height: 0.95;
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    z-index: -1;
}

.hero-header .hero-accent::before {
    color: #ff00ff;
    animation: glitch 4s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    opacity: 0.5;
}

.hero-header .hero-accent::after {
    color: #00d4ff;
    animation: glitch 3s infinite reverse;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
    opacity: 0.5;
}

.hero-header p {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.75rem, 1.5vw, 0.875rem);
    font-weight: 400;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    display: inline;
    margin-left: auto;
    animation: fadeInUp 600ms cubic-bezier(0.4, 0, 0.2, 1) 150ms both;
}

/* || TOOLS SECTION */
.tools {
    padding: var(--space-2xl) var(--space-md) var(--space-2xl);
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    flex: 1;
    background: radial-gradient(ellipse at top, rgba(0, 255, 136, 0.03) 0%, transparent 60%);
}

.tools-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    animation: fadeInUp 600ms cubic-bezier(0.4, 0, 0.2, 1) 300ms both;
}

.tools-label {
    display: inline-block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-sm);
    border: 1px solid var(--accent);
    padding: 0.25rem 0.75rem;
    text-shadow: 0 0 6px var(--accent);
}

.system-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: rgba(0, 255, 136, 0.6);
    display: block;
    margin-bottom: var(--space-xs);
    animation: boot-sequence 350ms ease-out forwards;
    animation-delay: 200ms;
}

.tools h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--foreground);
    text-shadow: 0 0 15px rgba(255, 0, 255, 0.5);
}

/* || CARDS GRID */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    max-width: 1400px;
    margin: 0 auto;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
}

@media (min-width: 768px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }
}

/* || CARD DESIGN */
.card {
    position: relative;
    background: var(--card);
    background-image:
        linear-gradient(rgba(0, 255, 136, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 136, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    border: 1px solid var(--border);
    padding: var(--space-2xl);
    transition:
        transform var(--transition-base),
        border-color var(--transition-base),
        box-shadow var(--transition-base);
    text-decoration: none;
    display: block;
    color: inherit;
    overflow: hidden;
    outline: none;
    animation: fadeInUp 600ms cubic-bezier(0.4, 0, 0.2, 1) both;
    -webkit-tap-highlight-color: transparent;
    clip-path: polygon(
        15px 0,
        100% 0,
        100% calc(100% - 15px),
        calc(100% - 15px) 100%,
        0 100%,
        0 15px
    );
}

.cards-grid .card:nth-child(1) { animation-delay: 450ms; }
.cards-grid .card:nth-child(2) { animation-delay: 550ms; }
.cards-grid .card:nth-child(3) { animation-delay: 650ms; }
.cards-grid .card:nth-child(4) { animation-delay: 750ms; }

.card:hover {
    border-color: var(--accent);
    box-shadow:
        0 0 10px var(--accent),
        0 0 20px rgba(0, 255, 136, 0.5),
        0 0 40px rgba(0, 255, 136, 0.3),
        inset 0 0 30px rgba(0, 255, 136, 0.15);
    transform: translateY(-4px) scale(1.02);
}

/* Card corner accents - FIXED for mobile */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border-top: 2px solid var(--accent);
    border-left: 2px solid var(--accent);
    opacity: 0.4;
    transform: translate(0, 0);
    transition:
        opacity var(--transition-base),
        transform var(--transition-base);
    pointer-events: none;
    background: transparent;
}

.card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid var(--accent);
    border-right: 2px solid var(--accent);
    opacity: 0.4;
    transform: translate(0, 0);
    transition:
        opacity var(--transition-base),
        transform var(--transition-base);
    pointer-events: none;
    background: transparent;
}

.card:hover::before,
.card:hover::after {
    opacity: 1;
    transform: translate(0, 0);
}

.card-content {
    position: relative;
    z-index: 1;
}

.card-number {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.05em;
    color: var(--mutedForeground);
    margin-bottom: var(--space-md);
    transition: all var(--transition-base);
}

.card:hover .card-number {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent);
    opacity: 0.5;
}

.card h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.25rem, 2.5vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: var(--space-sm);
    transition: all var(--transition-base);
}

.card:hover h3 {
    color: var(--accent);
    text-shadow: 0 0 8px var(--accent);
}

.card p {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.875rem, 1.25vw, 1rem);
    font-weight: 400;
    line-height: 1.7;
    color: var(--mutedForeground);
    transition: all var(--transition-base);
}

.card:hover p {
    color: var(--foreground);
}

/* Terminal-style arrow indicator */
.card-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: var(--space-md);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accentTertiary);
    transition: all var(--transition-base);
}

.card-arrow::before {
    content: '>';
    margin-right: 0.25rem;
}

.card-arrow::after {
    content: '→';
    transition: transform var(--transition-base);
}

.card:hover .card-arrow {
    color: var(--accent);
    text-shadow: 0 0 6px var(--accent);
}

.card:hover .card-arrow::after {
    transform: translateX(6px);
}

/* || FOOTER */
.footer {
    border-top: 1px solid var(--border);
    padding: var(--space-sm) var(--space-md);
    text-align: center;
    background-color: var(--card);
    flex-shrink: 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.footer-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--mutedForeground);
}

.footer-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: var(--mutedForeground);
    opacity: 0.5;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.lock-icon {
    width: 12px;
    height: 12px;
    stroke: var(--accent);
    opacity: 0.6;
}

.footer p {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.75rem, 1.25vw, 0.875rem);
    font-weight: 400;
    color: var(--mutedForeground);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* || FOCUS STATES (WCAG 2.2 ACCESSIBILITY) */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    box-shadow: 0 0 8px var(--accent);
    transition:
        outline-color 150ms ease,
        box-shadow 150ms ease,
        outline-offset 150ms ease;
}

a:focus-visible,
.card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    box-shadow: 0 0 10px var(--accent), 0 0 20px rgba(0, 255, 136, 0.4);
    transition:
        outline-color 150ms ease,
        box-shadow 150ms ease,
        outline-offset 150ms ease;
}

/* Remove outline for mouse users */
a:focus:not(:focus-visible),
.card:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
    transition:
        outline-color 150ms ease,
        box-shadow 150ms ease,
        outline-offset 150ms ease;
}

/* || REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    /* Disable chromatic aberration glitch on hero accent */
    .hero-header .hero-accent::before,
    .hero-header .hero-accent::after {
        display: none;
    }

    /* Disable rgbShift text shadow animation */
    .hero-header .hero-accent {
        animation: none;
        text-shadow: none;
    }

    /* Disable fadeInUp entry animation */
    .hero-header h1,
    .hero-header p,
    .tools-header,
    .card {
        animation: none;
    }

    /* Disable boot-sequence animation */
    .system-label {
        animation: none;
    }

    /* Disable scanline overlay */
    body::after {
        display: none;
    }

    /* Remove card hover transform - rely on color change only */
    .card:hover {
        transform: none;
    }

    /* Remove corner accent transform in reduced motion */
    .card::before,
    .card::after {
        transform: none;
    }

    .card:hover::before,
    .card:hover::after {
        transform: none;
    }

    /* Remove arrow slide animation */
    .card:hover .card-arrow::after {
        transform: none;
    }

    /* Reduce logo overlay glow effect */
    .logo-overlay {
        opacity: 0.3;
    }
}

/* || MOBILE ADJUSTMENTS */
@media (max-width: 640px) {
    .hero-header {
        padding: 0.625rem 1rem;
        gap: 0.5rem;
    }

    .hero-header h1 {
        font-size: clamp(0.875rem, 3vw, 1rem);
    }

    .hero-header p {
        font-size: clamp(0.625rem, 2vw, 0.75rem);
        letter-spacing: 0.1em;
    }

    .tools {
        padding: var(--space-md) var(--space-sm) var(--space-xl);
        background: transparent;
    }

    .tools-header {
        margin-bottom: var(--space-lg);
    }

    .card {
        padding: var(--space-lg) var(--space-md);
        background-color: var(--background);
        -webkit-tap-highlight-color: transparent;
    }

    /* Ensure corner accents remain transparent on mobile */
    .card::before,
    .card::after {
        background: transparent !important;
        will-change: transform;
        transform: translate3d(0, 0, 0);
    }

    .tools-label {
        font-size: 0.65rem;
    }

    .logo-overlay {
        width: min(70vw, 300px);
        bottom: 3%;
        right: 3%;
        opacity: 0.08;
    }
}

/* || ACCESSIBILITY - Colour Contrast (WCAG 2.2 AA) */
/*
 * Contrast ratios verified:
 * - Foreground (#E0E0E0) on Background (#0A0A0F): 13.8:1 (AAA)
 * - Accent Green (#00FF88) on Background (#0A0A0F): 7.5:1 (AAA)
 * - Accent Magenta (#FF00FF) on Background (#0A0A0F): 5.1:1 (AA)
 * - Accent Cyan (#00D4FF) on Background (#0A0A0F): 6.8:1 (AA)
 * - Muted Foreground (#6B7280) on Background (#0A0A0F): 4.5:1 (AA)
 * - Card (#12121A) on Background (#0A0A0F): 1.3:1 (UI chrome, not text)
 */