@tailwind base;
@tailwind components;
@tailwind utilities;

/* =============================================
   ROOT / DESIGN TOKENS
   ============================================= */
/* =============================================
   ROOT / DESIGN TOKENS (MazeHQ & Huncwot Quality)
   ============================================= */
:root {
    --bg-deep:       #030509;
    --bg-panel:      rgba(10, 14, 23, 0.75);
    --text-main:     #f8fafc;
    --text-muted:    #8b99ae;
    --accent-blue:   #3b82f6;
    --accent-cyan:   #06b6d4;
    --accent-neon:   #38bdf8;
    --border:        rgba(255, 255, 255, 0.07);
    --border-hover:  rgba(6, 182, 212, 0.4);
    --bg-card:       rgba(12, 17, 28, 0.65);
    --transition:    cubic-bezier(0.16, 1, 0.3, 1);
    --glow-cyan:     0 0 30px rgba(6, 182, 212, 0.25);
    --glow-blue:     0 0 40px rgba(59, 130, 246, 0.25);
}

/* =============================================
   BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background-color: var(--bg-deep); color: var(--text-main); }
body { font-family: 'Space Grotesk', sans-serif; background-color: var(--bg-deep); overflow-x: hidden; }
img, svg { max-width: 100%; height: auto; }

/* Hide cursor on desktop where custom cursor is active */
@media (min-width: 768px) { body { cursor: none; } }

/* =============================================
   SCROLLBAR (High-Precision Tech Style)
   ============================================= */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(6, 182, 212, 0.3); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(6, 182, 212, 0.7); box-shadow: 0 0 10px var(--accent-cyan); }

/* =============================================
   NOISE TEXTURE & CYBER MESH
   ============================================= */
body::after {
    content: '';
    position: fixed; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
    pointer-events: none; z-index: 50; opacity: 0.55;
}

/* Subtly glowing deep cosmic atmosphere */
.mesh-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden; z-index: -1; pointer-events: none;
}
.mesh-blob {
    position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.22;
    animation: float 25s infinite alternate ease-in-out;
    will-change: transform;
}
.mesh-blob.blue { background: var(--accent-blue); width: 45vw; height: 45vw; top: -15%; left: -10%; }
.mesh-blob.cyan { background: var(--accent-cyan); width: 38vw; height: 38vw; bottom: -15%; right: -8%; animation-delay: -12s; }
.mesh-blob.center { background: rgba(56, 189, 248, 0.4); width: 30vw; height: 30vw; top: 35%; right: 10%; filter: blur(120px); opacity: 0.18; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(6%, 8%) scale(1.12); }
}

/* =============================================
   TYPOGRAPHY
   ============================================= */
.section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-blue);
}

.gradient-text {
    background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.gradient-text-accent {
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =============================================
   HOVER LINE
   ============================================= */
.hover-line { position: relative; }
.hover-line::after {
    content: ''; position: absolute;
    bottom: -2px; left: 0;
    width: 0; height: 1px;
    background: var(--accent-blue);
    transition: width 0.35s var(--transition);
}
.hover-line:hover::after { width: 100%; }

/* =============================================
   GLASS CARD (Glowing borders)
   ============================================= */
.glass-panel {
    background: rgba(15, 15, 20, 0.85);
    border: 1px solid var(--border);
    transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s var(--transition);
}
.glass-panel:hover, .glass-panel.group:hover {
    border-color: var(--border-hover);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.1);
}

/* =============================================
   SATURN 2.0 — HIGH-TECH CYBER CENTERPIECE
   ============================================= */
.saturn-bg {
    position: absolute;
    top: 50%; right: -2%;
    transform: translateY(-50%);
    width: clamp(720px, 68vw, 1150px);
    height: clamp(720px, 68vw, 1150px);
    pointer-events: none;
    z-index: 5;
    transform-style: preserve-3d;
    opacity: 1;
    transition: filter 0.5s ease;
}

@media (max-width: 1200px) {
    .saturn-bg {
        right: -12%;
        width: clamp(600px, 75vw, 900px); height: clamp(600px, 75vw, 900px);
    }
}
@media (max-width: 767px) {
    .saturn-bg {
        right: 50%; top: 38%;
        transform: translate(50%, -50%);
        width: min(135vw, 640px); height: min(135vw, 640px);
        opacity: 0.95; /* Super widoczność także na telefonach! */
    }
}

.saturn-container {
    width: 100%; height: 100%;
    perspective: 1800px; transform-style: preserve-3d;
    display: flex; justify-content: center; align-items: center;
}

/* Oświetlenie i poświata samej kuli Saturna */
.saturn-planet {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 28%; height: 28%;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 30%, #2563eb 0%, #1e3a8a 35%, #091223 75%, #03050a 100%);
    border: 1px solid rgba(103, 232, 249, 0.45);
    box-shadow: 
        inset -12px -12px 30px rgba(0, 0, 0, 0.95),
        inset 10px 10px 25px rgba(103, 232, 249, 0.7),
        inset 0 0 50px rgba(59, 130, 246, 0.5),
        0 0 80px rgba(6, 182, 212, 0.5),
        0 0 160px rgba(59, 130, 246, 0.35);
    z-index: 10; overflow: hidden;
}

/* Subtelny pasmo atmosferyczne na powierzchni */
.saturn-planet::before {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(
        -18deg,
        transparent 0%,
        transparent 8%,
        rgba(6, 182, 212, 0.08) 9%,
        rgba(6, 182, 212, 0.08) 12%,
        transparent 13%
    );
    border-radius: 50%;
    mix-blend-mode: overlay;
    pointer-events: none;
}

.planet-shadow {
    position: absolute; inset: 0;
    background: radial-gradient(circle at 28% 28%, transparent 40%, rgba(2, 6, 23, 0.92) 80%);
}

.saturn-ring-container {
    position: absolute; width: 100%; height: 100%;
    transform-style: preserve-3d;
    transform: rotateX(71deg) rotateY(-10deg) rotateZ(3deg);
}

.binary-ring {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%; transform-style: preserve-3d;
    filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.5));
}

.binary-ring.r1 { 
    width: 98%; height: 98%; 
    border: 1px solid rgba(103, 232, 249, 0.25);
}
.binary-ring.r2 { 
    width: 79%; height: 79%; 
    animation: ring-spin 120s linear infinite reverse; 
    border: 2px solid rgba(59, 130, 246, 0.35); 
    box-shadow: inset 0 0 25px rgba(6, 182, 212, 0.2), 0 0 25px rgba(59, 130, 246, 0.3);
}
.binary-ring.r3 { 
    width: 60%; height: 60%; 
    border: 2px dashed rgba(103, 232, 249, 0.5); 
    animation: ring-spin 80s linear infinite;
}
.binary-ring.r4 {
    width: 44%; height: 44%;
    border: 1px dotted rgba(255, 255, 255, 0.3);
}

@keyframes ring-spin {
    from { transform: translate(-50%, -50%) rotateZ(0deg); }
    to   { transform: translate(-50%, -50%) rotateZ(360deg); }
}

.binary-text {
    font-family: 'JetBrains Mono', monospace; font-size: 8.5px; font-weight: 600;
    fill: rgba(103, 232, 249, 0.75); letter-spacing: 4.5px;
    filter: drop-shadow(0 0 5px rgba(6, 182, 212, 0.8));
}

.moon-titan, .moon-enceladus, .moon-mimas {
    position: absolute; border-radius: 50%; top: 50%; left: 50%; z-index: 15;
}
.moon-titan {
    width: 8px; height: 8px; background: #67e8f9;
    box-shadow: 0 0 16px #06b6d4, 0 0 28px #fff;
    animation: orbit-titan 28s linear infinite;
}
.moon-enceladus {
    width: 6px; height: 6px; background: #60a5fa;
    box-shadow: 0 0 12px #3b82f6, 0 0 22px #fff;
    animation: orbit-enceladus 18s linear infinite reverse;
}
.moon-mimas {
    width: 4px; height: 4px; background: #fff;
    box-shadow: 0 0 8px #fff;
    animation: orbit-mimas 12s linear infinite;
}

@keyframes orbit-titan {
    0% { transform: translate(-50%, -50%) rotate(0deg) translateX(46%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg) translateX(46%) rotate(-360deg); }
}
@keyframes orbit-enceladus {
    0% { transform: translate(-50%, -50%) rotate(0deg) translateX(36%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg) translateX(36%) rotate(-360deg); }
}
@keyframes orbit-mimas {
    0% { transform: translate(-50%, -50%) rotate(120deg) translateX(27%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(480deg) translateX(27%) rotate(-360deg); }
}

/* =============================================
   NAVIGATION
   ============================================= */
.nav-link {
    position: relative;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase;
    color: var(--text-muted); transition: color 0.3s ease;
}
.nav-link::after {
    content: ''; position: absolute; bottom: -4px; left: 0;
    width: 0; height: 1px; background: var(--accent-blue);
    transition: width 0.32s var(--transition);
}
.nav-link:hover { color: var(--text-main); }
.nav-link:hover::after { width: 100%; }

/* =============================================
   BUTTONS (Clip-path)
   ============================================= */
.btn-primary {
    position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-blue); color: #fff;
    font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase;
    padding: 1rem 2rem;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: transform 0.3s var(--transition), background 0.3s ease, box-shadow 0.3s ease;
}
.btn-primary::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%); transition: transform 0.6s ease;
}
.btn-primary:hover {
    transform: translateY(-2px);
    background: var(--accent-cyan);
    box-shadow: 0 10px 20px -10px var(--accent-cyan);
}
.btn-primary:hover::before { transform: translateX(100%); }

.btn-ghost {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid rgba(59, 130, 246, 0.3); color: var(--text-main);
    font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase;
    padding: 1rem 2rem;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: all 0.3s var(--transition);
}
.btn-ghost:hover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

/* =============================================
   TECH TAGS
   ============================================= */
.tech-tag {
    font-family: 'JetBrains Mono', monospace; font-size: 0.65rem; letter-spacing: 0.05em;
    padding: 0.3rem 0.6rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--text-muted);
    background: rgba(59, 130, 246, 0.05);
    border-radius: 4px;
    transition: all 0.3s;
}
.group:hover .tech-tag, .project-item:hover .tech-tag {
    border-color: var(--accent-blue); color: var(--text-main); background: rgba(59, 130, 246, 0.15);
}

/* =============================================
   CUSTOM CURSOR
   ============================================= */
#custom-cursor {
    width: 6px; height: 6px; background: var(--accent-blue);
    transition: transform 0.1s ease; box-shadow: 0 0 10px var(--accent-blue);
}
#custom-cursor-trail {
    width: 32px; height: 32px; border: 1px solid rgba(59, 130, 246, 0.4);
    transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
#custom-cursor.cursor-hover { transform: translate(-50%,-50%) scale(0); }
#custom-cursor-trail.cursor-hover { 
    width: 48px; height: 48px; 
    border-color: var(--accent-cyan); 
    background: rgba(96, 165, 250, 0.1); 
}

/* =============================================
   SCROLL INDICATOR
   ============================================= */
@keyframes scroll-pulse {
    0%,100% { opacity: 0.3; transform: translateY(0); }
    50%     { opacity: 1;  transform: translateY(6px); }
}
.scroll-indicator .line { animation: scroll-pulse 2s ease-in-out infinite; width: 1px; height: 40px; background: linear-gradient(to bottom, var(--accent-blue), transparent); }

/* =============================================
   REVEAL ANIMATIONS
   ============================================= */
.reveal-up { opacity: 0; transform: translateY(40px); transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-up.active { opacity: 1; transform: translateY(0); }

/* =============================================
   TECH TICKER
   ============================================= */
.ticker-wrap { width: 100%; overflow: hidden; background: rgba(15, 15, 20, 0.8); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 1rem 0; }
.ticker { display: flex; width: max-content; animation: ticker 40s linear infinite; }
.ticker-item { font-family: 'JetBrains Mono', monospace; font-size: 1rem; color: var(--text-muted); padding: 0 2rem; display: flex; align-items: center; gap: 1rem; }
.ticker-item span { color: var(--accent-blue); }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* Fixes */
body.menu-open { overflow: hidden; }

/* =============================================
   METEORITE (ABOUT SECTION)
   ============================================= */
.meteorite-element {
    position: absolute;
    z-index: 1; /* Below text but above background */
    pointer-events: none;
    opacity: 0.8;
    filter: drop-shadow(0 0 30px rgba(6, 182, 212, 0.4));
    will-change: transform;
    mix-blend-mode: lighten; /* Removes the black background from the image */
}

/* =============================================
   MAZEHQ & HUNCWOT CYBER UI & HUD SYSTEM
   ============================================= */

/* Interaktywne wskaźniki HUD wokół Saturna i na karcie (Telemetry Pointers) */
.hud-pointer {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0;
    z-index: 25;
    pointer-events: auto;
}

.hud-dot {
    width: 8px; height: 8px;
    background-color: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-cyan), 0 0 20px #fff;
    position: relative;
    flex-shrink: 0;
}

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

@keyframes hud-pulse {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(2.4); opacity: 0; }
}

.hud-line {
    height: 1px;
    background: linear-gradient(90deg, var(--accent-cyan), rgba(59, 130, 246, 0.4));
    position: relative;
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
    transition: width 0.8s var(--transition);
}

.hud-line.reverse {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.4), var(--accent-cyan));
}

.hud-badge {
    background: rgba(8, 12, 20, 0.92);
    border: 1px solid rgba(103, 232, 249, 0.35);
    padding: 6px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    color: #f8fafc;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(6, 182, 212, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: all 0.3s ease;
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

.hud-badge:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.4);
    transform: scale(1.04);
}

.hud-badge span.status-live {
    width: 6px; height: 6px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    display: inline-block;
}

/* Kąciki technologiczne "Cyber Brackets" dla sekcji i kart */
.cyber-card {
    position: relative;
    background: rgba(12, 16, 26, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px);
    transition: all 0.4s var(--transition);
    overflow: hidden;
}

.cyber-card::before,
.cyber-card::after {
    content: '';
    position: absolute;
    width: 12px; height: 12px;
    border: 1px solid var(--accent-cyan);
    opacity: 0.4;
    transition: all 0.3s ease;
    pointer-events: none;
}
.cyber-card::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.cyber-card::after { bottom: 0; right: 0; border-left: 0; border-top: 0; }

.cyber-card:hover {
    border-color: rgba(103, 232, 249, 0.35);
    box-shadow: 0 10px 40px -10px rgba(6, 182, 212, 0.2), inset 0 0 30px rgba(59, 130, 246, 0.08);
    transform: translateY(-4px);
}

.cyber-card:hover::before,
.cyber-card:hover::after {
    width: 24px; height: 24px;
    opacity: 1;
    box-shadow: 0 0 12px var(--accent-cyan);
}

/* Efekt scanliny cyfrowej w kartach */
.cyber-card-scan {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(6, 182, 212, 0.05) 50%, transparent 100%);
    background-size: 100% 200%;
    animation: scanline 6s ease-in-out infinite;
    pointer-events: none;
    opacity: 0.7;
}

@keyframes scanline {
    0% { background-position: 0% -100%; }
    100% { background-position: 0% 200%; }
}

/* Pozycja i zachowanie HUD Saturna na różnych rozdzielczościach */
.saturn-hud-1 { top: 18%; left: 15%; }
.saturn-hud-2 { top: 40%; right: 10%; }
.saturn-hud-3 { bottom: 22%; left: 22%; }
.saturn-hud-4 { bottom: 12%; right: 18%; }

@media (max-width: 1024px) {
    .saturn-hud-1 { top: 12%; left: 5%; }
    .saturn-hud-2 { top: 32%; right: 5%; }
    .saturn-hud-3 { bottom: 18%; left: 5%; }
    .saturn-hud-4 { bottom: 8%; right: 5%; }
}

@media (max-width: 640px) {
    .hud-line { width: 25px !important; }
    .hud-badge { font-size: 8.5px; padding: 4px 8px; }
    .saturn-hud-1 { top: 8%; left: 2%; }
    .saturn-hud-2 { top: 25%; right: 2%; }
    .saturn-hud-3 { bottom: 14%; left: 2%; }
    .saturn-hud-4 { display: none; /* Ukryjemy 4. znacznik na małych telefonach dla czystości ekaranu */ }
}

/* Autorskie animacje SVG dla Usług (Services) */
.svg-service-icon {
    width: 100%; height: 140px;
    overflow: visible;
    margin-bottom: 1.5rem;
}

.svg-node {
    fill: var(--accent-cyan);
    filter: drop-shadow(0 0 6px var(--accent-cyan));
    animation: node-pulse 3s infinite alternate ease-in-out;
}

.svg-wire {
    stroke: rgba(148, 163, 184, 0.25);
    stroke-width: 1.5;
    stroke-dasharray: 6 4;
    animation: wire-flow 20s linear infinite;
}

@keyframes node-pulse {
    0% { opacity: 0.4; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1.15); filter: drop-shadow(0 0 10px #38bdf8); }
}

@keyframes wire-flow {
    from { stroke-dashoffset: 200; }
    to { stroke-dashoffset: 0; }
}
