/* ========================================
   MAIN.CSS — Design System & Global Styles
   GaDev.it — Giuseppe Apolito
   ======================================== */

/* --- CSS Variables --- */
:root {
    /* Colors */
    --bg-primary: #050A14;
    --bg-secondary: #0A1628;
    --bg-tertiary: #0F1D35;
    --accent-cyan: #00F0FF;
    --accent-violet: #7B2FFF;
    --accent-green: #00FF88;
    --text-primary: #E8F4FF;
    --text-secondary: #7A9AB8;
    --text-muted: #4A6A85;
    --surface-card: rgba(255, 255, 255, 0.04);
    --surface-card-hover: rgba(255, 255, 255, 0.08);
    --border-card: rgba(0, 240, 255, 0.15);
    --border-card-hover: rgba(0, 240, 255, 0.4);
    --shadow-glow-cyan: 0 0 20px rgba(0, 240, 255, 0.15);
    --shadow-glow-violet: 0 0 20px rgba(123, 47, 255, 0.15);
    --shadow-glow-green: 0 0 20px rgba(0, 255, 136, 0.15);
    --gradient-primary: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
    --gradient-hero: linear-gradient(135deg, #050A14 0%, #0A1628 50%, #0F0A28 100%);
    --gradient-stats: linear-gradient(135deg, #0A0520 0%, #150A30 50%, #0A1628 100%);
    
    /* Typography */
    --font-display: 'Orbitron', sans-serif;
    --font-heading: 'Rajdhani', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-code: 'JetBrains Mono', monospace;

    /* Sizes */
    --nav-height: 70px;
    --container-max: 1280px;
    --container-padding: 2rem;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 20px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* --- Reset --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
    font-size: 16px;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    cursor: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Show default cursor on touch devices */
@media (pointer: coarse) {
    body { cursor: auto; }
    .custom-cursor, .custom-cursor-dot { display: none !important; }
}

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

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

ul { list-style: none; }

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

@media (pointer: coarse) {
    button, a { cursor: pointer; }
}

input, select, textarea {
    font-family: var(--font-body);
}

/* --- Layout --- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.section {
    padding: 120px 0;
    position: relative;
}

/* --- Custom Cursor --- */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    border: 2px solid var(--accent-cyan);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: width 0.15s, height 0.15s, border-color 0.15s, opacity 0.15s;
    opacity: 0;
    mix-blend-mode: difference;
}

.custom-cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background: var(--accent-cyan);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10001;
    transform: translate(-50%, -50%);
    transition: width 0.1s, height 0.1s, background 0.1s;
    opacity: 0;
}

body:hover .custom-cursor,
body:hover .custom-cursor-dot {
    opacity: 1;
}

.custom-cursor.hovering {
    width: 50px;
    height: 50px;
    border-color: var(--accent-green);
}

.custom-cursor-dot.hovering {
    width: 10px;
    height: 10px;
    background: var(--accent-green);
}

/* --- Particle Canvas --- */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- Grid Background --- */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* --- Section Headers --- */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-tag {
    font-family: var(--font-code);
    color: var(--accent-cyan);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 12px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.section-line {
    width: 80px;
    height: 3px;
    background: var(--gradient-primary);
    margin: 20px auto 0;
    border-radius: 2px;
}

/* --- Reveal Animation Class --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* --- Icon sizing --- */
.icon-inline {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
}

/* --- Selection --- */
::selection {
    background: rgba(0, 240, 255, 0.3);
    color: var(--text-primary);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 240, 255, 0.4);
}

/* --- Focus visible --- */
:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 4px;
}

/* --- Link-accent class --- */
.link-accent {
    color: var(--accent-cyan);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.link-accent:hover {
    color: var(--accent-green);
}

/* --- Honeypot --- */
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}
