/* hero.css */

/* --- OFFLINE FONT DEFINITIONS --- */
@font-face {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: 400;
  src: url('../../public/fonts/material-symbols-outlined.woff2') format('woff2');
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 18px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}

@font-face {
  font-family: 'Fira Code';
  font-style: normal;
  font-weight: 400;
  src: url('../../public/fonts/fira-code-v27-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Fira Code';
  font-style: normal;
  font-weight: 500;
  src: url('../../public/fonts/fira-code-v27-latin-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  src: url('../../public/fonts/inter-v20-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  src: url('../../public/fonts/inter-v20-latin-600.woff2') format('woff2');
}

/* --- MAIN STYLES --- */

@layer reset, base, components, layout, deadscreen;

@layer reset {
    html {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
        height: 100%;
    }

	body { 
        margin: 0; 
        padding: 0; 
        overflow: hidden; 
        height: 100vh;
        height: 100dvh; 
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

	* { box-sizing: border-box; }

	button { 
        font-family: inherit; 
        cursor: pointer; 
        border: none;
        -webkit-appearance: none;
        appearance: none;
        margin: 0;
    }

    a { text-decoration: none; color: inherit; }
}

@layer base {
	:root {
		--bg-color: #000000;
		--text-primary: #ffffff;
		--text-secondary: #888888;
        --accent-color: #00ff88;
        
        --font-main: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        --font-code: "Fira Code", monospace;
	}

	body {
		background: var(--bg-color);
		font-family: var(--font-main);
		color: var(--text-primary);
        width: 100%;
        user-select: none; 
        -webkit-user-select: none;
	}
}

@layer components {
    #grid-canvas {
        position: fixed;
        inset: 0;
        z-index: -1;
        width: 100%;
        height: 100%;
        background-color: var(--bg-color);
        -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 90%);
        mask-image: radial-gradient(circle at center, black 30%, transparent 90%);
        touch-action: none; 
    }

    .status-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        padding: 0.2rem 0.6rem; 
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(4px);
        margin-bottom: 1rem;
        animation: slideUpFade 1.2s cubic-bezier(0.25, 1, 0.3, 1) 0s both;
        
        position: relative;
        z-index: 10;
        cursor: default;
    }

    .status-badge span {
        font-family: var(--font-code);
        font-size: 0.6rem;
        color: #ddd;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-weight: 500;
    }

    .pulse-light {
        width: 4px;
        height: 4px;
        background-color: var(--accent-color);
        border-radius: 50%;
        box-shadow: 0 0 5px var(--accent-color);
        animation: pulse 2s infinite;
    }

    @keyframes pulse {
        0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7); }
        70% { box-shadow: 0 0 0 5px rgba(0, 255, 136, 0); }
        100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
    }

	@layer button {
		button {
			background: var(--text-primary);
   			color: var(--bg-color);
			border-radius: 3px;
			padding: clamp(0.4em, 1.5vw, 0.6em) clamp(0.6em, 1.5vw, 1.2em);
			display: flex;
            justify-content: center;
			gap: 0.4rem;
			align-items: center;
			font-weight: 600;
			transition: all 0.2s ease;
            font-family: var(--font-main);
            font-size: clamp(0.7rem, 1.5vw, 0.85rem);
            letter-spacing: 0.02em;
            white-space: nowrap;
            position: relative;
            z-index: 10; 

            &:focus-visible {
                outline: 2px solid var(--accent-color);
                outline-offset: 2px;
            }

			&:hover {
				background: #cccccc;
                transform: translateY(-2px);
                box-shadow: 0 5px 15px rgba(255,255,255,0.2);
			}
			
			&.secondary {
				background: transparent;
				color: var(--text-primary);
				border: 1px solid rgba(255,255,255,0.3);
				
				&:hover {
					border-color: var(--text-primary);
					background: rgba(255,255,255,0.1);
				}
			}
		}

        @media (max-width: 768px) {
            button:active {
                transform: scale(0.96);
                transition: transform 0.05s ease-out;
            }
        }

        .desktop-text {
            display: inline;
        }
        @media (max-width: 480px) {
            .desktop-text {
                display: none;
            }
        }
	}
}

@layer layout {
	section.center {
		height: 100vh;
        height: 100dvh;
        width: 100%;
        
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		text-align: center;
        position: relative;
        z-index: 1;
        padding: 0 1.5rem;
	}

    #welcome {
        width: 100%;
        max-width: 600px;
        margin-inline: auto;
        position: relative;
        z-index: 10; 

        h1 {
            font-size: clamp(0.9rem, 2.5vw, 1.2rem);
            font-weight: 300;
            color: var(--text-secondary);
            margin: 0 0 0.5rem 0;
            line-height: 1.2;
            cursor: default;

            .highlight {
                display: block;
                font-size: clamp(1.8rem, 6vw, 3rem);
                font-weight: 600;
                color: var(--text-primary);
                margin-top: 0.1rem;
                letter-spacing: -0.03em;
                
                animation: slideUpFade 1.2s cubic-bezier(0.25, 1, 0.3, 1) 0.2s both; 
                will-change: transform, opacity, filter;
                transition: text-shadow 0.3s ease;
            }
            
            .highlight:hover {
                text-shadow: 0 0 15px rgba(255, 255, 255, 0.6), 
                             0 0 30px rgba(255, 255, 255, 0.2);
            }
        }

        p {
            font-size: clamp(0.9rem, 2vw, 1.1rem);
            color: var(--text-primary);
            font-weight: 400;
            margin: 0 0 clamp(1.5rem, 4vw, 2rem) 0;

            animation: slideUpFade 1.2s cubic-bezier(0.25, 1, 0.3, 1) 0.4s both;
            will-change: transform, opacity, filter;
            
            span {
                display: block;
                font-family: var(--font-code);
                font-size: clamp(0.65rem, 1.5vw, 0.75rem);
                color: var(--text-secondary);
                margin-top: 0.5rem;
                letter-spacing: 0.05em;
                text-transform: uppercase;
                line-height: 1.4;
            }
        }

        .cta {
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap; 
            gap: 0.6rem;
            justify-content: center;
            width: 100%;
            max-width: 380px;
            margin: 0 auto;

            animation: slideUpFade 1.2s cubic-bezier(0.25, 1, 0.3, 1) 0.6s both;
            will-change: transform, opacity, filter;

            button {
                flex: 1;
                white-space: nowrap; 
            }
        }
        
        @media (max-width: 340px) {
            .cta {
                flex-wrap: wrap;
            }
            .cta button {
                flex: 1 1 100%;
            }
        }
    }

    @keyframes slideUpFade {
        0% { opacity: 0; transform: translateY(40px); filter: blur(12px); }
        100% { opacity: 1; transform: translateY(0); filter: blur(0); }
    }
}

@layer deadscreen {
    #dead-screen {
        display: none;
    }

    @keyframes cry-animation {
        0% { transform: translateY(0); opacity: 0; }
        20% { opacity: 1; }
        100% { transform: translateY(20px); opacity: 0; }
    }

    @media (max-width: 300px), (max-height: 300px) {
        #welcome, #grid-canvas {
            display: none !important;
        }

        #dead-screen {
            position: fixed;
            inset: 0;
            background: #000;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
            padding: 1rem;
        }

        #dead-screen h2 {
            font-family: var(--font-code);
            font-size: 1rem;
            margin-top: 1rem;
            color: var(--text-primary);
            text-transform: uppercase;
        }

        .sad-face {
            width: 60px;
            height: 60px;
        }

        .tear {
            animation: cry-animation 2s infinite ease-in;
        }
    }
}