:root {
    --bg-color: #05060f;
    --text-main: #f0f6fc;
    --text-muted: #8b949e;
    --cyan: #00f0ff;
    --magenta: #ff0055;
    --purple: #9d00ff;
    --dark-alt: #0a0b16;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(10, 11, 22, 0.7);
    --font-body: 'Outfit', sans-serif;
    --font-display: 'Oxanium', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Effects */
.noise-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 100;
    opacity: 0.04;
    background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
}

.grid-background {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(to right, rgba(0, 240, 255, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    transform: perspective(600px) rotateX(60deg) scale(2.5);
    transform-origin: top;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    from { background-position: 0 0; }
    to { background-position: 0 50px; }
}

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

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

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--cyan);
    color: var(--bg-color);
    padding: 8px 16px;
    z-index: 1000;
    transition: top 0.3s;
    font-family: var(--font-display);
    text-decoration: none;
    font-weight: bold;
}

.skip-link:focus {
    top: 0;
}

/* Typography */
h1, h2, h3, h4, .logo-text, .sys-msg-raw {
    font-family: var(--font-display);
    text-transform: uppercase;
}

.blinking-cursor {
    color: var(--cyan);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 50;
    transition: all 0.3s ease;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 3rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.95rem;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::before {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    color: var(--cyan);
    overflow: hidden;
    width: 0;
    transition: width 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
}

.nav-link:hover::before, .nav-link.active::before {
    width: 100%;
}

/* Utility layout */
main {
    padding: 0 5%;
    max-width: 1400px;
    margin: 0 auto;
}

section {
    min-height: 100vh;
    padding: 120px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-header {
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 1.8rem;
    color: var(--cyan);
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.divider {
    height: 1px;
    width: 120px;
    background: var(--cyan);
    position: relative;
}
.divider::after {
    content: '';
    position: absolute;
    right: -5px;
    top: -2px;
    width: 5px;
    height: 5px;
    background: var(--magenta);
    box-shadow: 0 0 10px var(--magenta);
}

/* Buttons */
.btn {
    display: inline-flex;
    padding: 1rem 2rem;
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1px;
    position: relative;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all 0.3s ease;
}

.primary-btn {
    color: var(--bg-color);
    background: var(--cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%);
}

.primary-btn:hover {
    box-shadow: 0 0 35px rgba(0, 240, 255, 0.7);
    transform: translateY(-2px);
}

.secondary-btn {
    color: var(--text-main);
    border: 1px solid var(--text-muted);
}

.secondary-btn:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

/* Hero Section */
.hero {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.hero-content {
    flex: 1.2;
    max-width: 700px;
}

.sys-msg-raw {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.glitch {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    position: relative;
    text-shadow: 0 0 15px rgba(255,255,255,0.1);
}

.subtitle {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 550px;
}

.cta-group {
    display: flex;
    gap: 1.5rem;
}

/* 3D Sacred Geometry Visual */
.hero-visual {
    flex: 0.8;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 400px;
}

#geometry-canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

#geometry-canvas canvas {
    max-width: 100%;
    max-height: 100%;
    filter: drop-shadow(0 0 20px rgba(0, 240, 255, 0.2));
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.cyber-border {
    position: relative;
    background: var(--dark-alt);
    border: 1px solid var(--border-color);
    padding: 3rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cyber-border::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px;
    width: 15px;
    height: 15px;
    border-top: 2px solid var(--cyan);
    border-left: 2px solid var(--cyan);
    transition: all 0.3s ease;
}

.cyber-border::after {
    content: '';
    position: absolute;
    bottom: -1px; right: -1px;
    width: 15px;
    height: 15px;
    border-bottom: 2px solid var(--cyan);
    border-right: 2px solid var(--cyan);
    transition: all 0.3s ease;
}

.cyber-border:hover {
    border-color: rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.08);
    transform: translateY(-5px);
}

.cyber-border:hover::before, .cyber-border:hover::after {
    width: calc(100% + 2px);
    height: calc(100% + 2px);
    opacity: 0.5;
}

.card-icon {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--cyan);
    margin-bottom: 1.5rem;
    opacity: 0.6;
    text-shadow: 0 0 10px rgba(0,240,255,0.3);
}

.service-card h3 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
    letter-spacing: 1px;
}

.service-card p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Portfolio */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
}

.portfolio-item {
    padding: 0;
    overflow: hidden;
    cursor: crosshair;
}

.portfolio-img {
    height: 280px;
    width: 100%;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.bg-cyan { background: linear-gradient(135deg, #0a0b16 20%, var(--cyan) 150%); }
.bg-magenta { background: linear-gradient(135deg, #0a0b16 20%, var(--magenta) 150%); }
.bg-purple { background: linear-gradient(135deg, #0a0b16 20%, var(--purple) 150%); }

.portfolio-info {
    padding: 2rem;
    background: var(--dark-alt);
    border-top: 1px solid var(--border-color);
}

.portfolio-info h4 {
    color: var(--cyan);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.portfolio-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-family: var(--font-mono);
}

.portfolio-item:hover .portfolio-img {
    transform: scale(1.08);
}

/* Contact */
.contact-container {
    max-width: 650px;
    margin: 0 auto;
    width: 100%;
}

.input-group {
    position: relative;
    margin-bottom: 3rem;
}

.input-group input, .input-group textarea {
    width: 100%;
    padding: 1.2rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: var(--font-body);
    outline: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.input-group label {
    position: absolute;
    left: 1rem;
    top: 1.2rem;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 0.95rem;
    pointer-events: none;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.input-group input:focus, .input-group textarea:focus {
    border-color: var(--cyan);
    background: rgba(0, 240, 255, 0.05);
    box-shadow: inset 0 0 10px rgba(0,240,255,0.1);
}

.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label,
.input-group textarea:focus ~ label,
.input-group textarea:not(:placeholder-shown) ~ label {
    top: -1.7rem;
    left: 0;
    font-size: 0.85rem;
    color: var(--cyan);
}

.submit-btn {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 1.2rem;
}

.form-status {
    margin-top: 1.5rem;
    font-family: var(--font-display);
    font-size: 0.95rem;
    text-align: center;
    min-height: 20px;
    color: var(--cyan);
    letter-spacing: 1px;
}

/* Footer */
footer {
    padding: 4rem 5%;
    border-top: 1px solid var(--border-color);
    background: var(--dark-alt);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.footer-content p {
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.85rem;
}

/* Animations Trigger */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.fade-in.appear {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* Responsive Constraints */
@media (max-width: 1024px) {
    .glitch { font-size: 3rem; }
    .hero-visual { display: none; }
    .hero { text-align: center; }
    .cta-group { justify-content: center; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    main { padding: 0 1.5rem; }
    section { padding: 80px 0; }
    .glitch { font-size: 2.2rem; }
    .footer-content { flex-direction: column; gap: 1rem; text-align: center; }
}
