/* ============================================
   Deivid Tech Website Styles
   ============================================ */

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

:root {
    --bg-dark: #0b0e13;
    --bg-secondary: #0d1018;
    --text-primary: #e4e8f0;
    --text-muted: #6b7a94;
    --accent: #64b4ff;
    --accent-dim: rgba(100, 180, 255, 0.6);
    --accent-warm: #f0a050;
    --border-subtle: rgba(100, 180, 255, 0.08);
    --border-glow: rgba(100, 180, 255, 0.15);
    --font-heading: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-body: 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--accent) 20%, var(--accent) 80%, transparent 100%);
    z-index: 1000;
    opacity: 0.6;
}

/* ============================================
   PROTECTED: Circuit Background Canvas
   DO NOT MODIFY these styles.
   See DESIGN.md for specifications.
   ============================================ */
#circuit-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}
/* ============================================
   END PROTECTED SECTION
   ============================================ */

/* ============================================
   Navigation Bar (z-index: 100)
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2.5rem;
    background: linear-gradient(to bottom,
        rgba(11, 14, 19, 0.95) 0%,
        rgba(11, 14, 19, 0.8) 50%,
        transparent 100%);
    backdrop-filter: blur(12px);
    transition: padding 0.3s ease, border-color 0.3s ease;
    border-bottom: 1px solid transparent;
}

.nav-brand {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent);
    display: inline-block;
    flex-shrink: 0;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a.active {
    color: var(--accent);
    padding-bottom: 4px;
    border-bottom: 1px solid var(--accent);
}

.navbar.scrolled {
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-subtle);
}

/* Hamburger Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-muted);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   Main Content Area (z-index: 1+)
   All content sections go here, above background
   ============================================ */
.content {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

/* ============================================
   Responsive Styles
   ============================================ */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem 1.5rem;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(11, 14, 19, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: right 0.3s ease;
        z-index: 100;
    }

    .nav-links.mobile-open {
        right: 0;
    }

    .nav-links a {
        font-size: 0.9rem;
    }

    .nav-brand {
        font-size: 0.9rem;
    }

    .hero {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .section {
        padding: 4rem 1.5rem;
    }

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

    .services-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
        margin: 0 auto;
    }

    .contact-links {
        flex-direction: column;
        align-items: stretch;
        max-width: 320px;
        margin: 0 auto;
    }

    .contact-link {
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 0.85rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .service-card {
        padding: 1.5rem;
    }

    .hero-scroll {
        bottom: 2rem;
    }
}

/* ============================================
   Scroll Reveal Animation
   ============================================ */
[data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

.services-grid [data-reveal]:nth-child(2) { transition-delay: 0.1s; }
.services-grid [data-reveal]:nth-child(3) { transition-delay: 0.2s; }
.services-grid [data-reveal]:nth-child(4) { transition-delay: 0.3s; }

/* ============================================
   Hero Section
   ============================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-left: 8vw;
    padding-right: 2rem;
}

.hero-content {
    max-width: 600px;
}

.hero-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(15px);
    animation: heroFadeIn 0.6s ease 0.2s forwards;
}

.tag-marker {
    color: var(--accent-dim);
    margin-right: 0.5rem;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

.hero-title .line {
    display: block;
    opacity: 0;
    transform: translateY(15px);
}

.hero-title .line:nth-child(1) {
    animation: heroFadeIn 0.6s ease 0.35s forwards;
}

.hero-title .line:nth-child(2) {
    animation: heroFadeIn 0.6s ease 0.5s forwards;
}

.accent-text {
    color: var(--accent);
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(15px);
    animation: heroFadeIn 0.6s ease 0.65s forwards;
}

.hero-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    opacity: 0;
    transform: translateY(15px);
    animation: heroFadeIn 0.6s ease 0.8s forwards;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-warm);
    box-shadow: 0 0 8px rgba(240, 160, 80, 0.5);
    animation: pulseStatus 2s infinite;
}

.status-text {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--text-muted);
}

@keyframes pulseStatus {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(240, 160, 80, 0.5); }
    50% { opacity: 0.6; box-shadow: 0 0 4px rgba(240, 160, 80, 0.3); }
}

@keyframes heroFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Indicator */
.hero-scroll {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    animation: heroFadeIn 0.6s ease 1.2s forwards;
}

.hero-scroll.animate-ready {
    animation: none;
    opacity: 1;
    transform: translateX(-50%);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-scroll.animate-ready.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(15px);
    pointer-events: none;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: var(--accent-dim);
    animation: scrollPulse 2s ease-in-out infinite;
}

.scroll-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: var(--text-muted);
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(1.2); }
}

/* ============================================
   Section Divider
   ============================================ */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    position: relative;
}

.section-divider span {
    display: block;
    width: 60%;
    max-width: 600px;
    height: 1px;
    background: var(--border-subtle);
    position: relative;
}

.section-divider span::before,
.section-divider span::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-dim);
}

.section-divider span::before { left: 0; }
.section-divider span::after { right: 0; }

/* ============================================
   Section Common Styles
   ============================================ */
.section {
    padding: 6rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

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

.section-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
}

.section-rule {
    width: 0;
    height: 1px;
    background: var(--accent);
    margin: 0 auto;
    transition: width 0.6s ease 0.3s;
}

[data-reveal].revealed .section-rule {
    width: 40px;
}

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

.service-card {
    position: relative;
    border: 1px solid var(--border-subtle);
    padding: 2rem;
    background: transparent;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.service-card:hover {
    border-color: var(--border-glow);
    box-shadow: 0 0 30px rgba(100, 180, 255, 0.03);
}

/* Corner accents */
.card-corner {
    position: absolute;
    width: 12px;
    height: 12px;
}

.card-corner--tl {
    top: -1px;
    left: -1px;
    border-top: 1px solid var(--accent-dim);
    border-left: 1px solid var(--accent-dim);
}

.card-corner--br {
    bottom: -1px;
    right: -1px;
    border-bottom: 1px solid var(--accent-dim);
    border-right: 1px solid var(--accent-dim);
}

.card-icon {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.card-desc {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
}

.card-tags li {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: var(--accent-dim);
    border: 1px solid var(--border-subtle);
    padding: 0.2rem 0.6rem;
}

/* ============================================
   Contact Section
   ============================================ */
.contact-content {
    text-align: center;
}

.contact-text {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 300;
    margin-bottom: 2.5rem;
}

.contact-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid var(--border-subtle);
    padding: 0.8rem 1.5rem;
    transition: border-color 0.3s ease, color 0.3s ease;
}

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

.link-arrow {
    transition: transform 0.3s ease;
}

.contact-link:hover .link-arrow {
    transform: translateX(4px);
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    text-align: center;
    padding: 4rem 2rem 3rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: var(--text-muted);
}

.footer-sep {
    margin: 0 0.75rem;
    opacity: 0.4;
}

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

    [data-reveal] {
        opacity: 1;
        transform: none;
    }

    .section-rule {
        width: 40px;
    }
}

/* ============================================
   Konami CRT Progress Bar
   ============================================ */
.konami-crt-bar {
    display: block;
    height: 3px;
    width: 0%;
    background: #33ff33;
    box-shadow: 0 0 6px rgba(51, 255, 51, 0.5);
    transition: width 0.15s ease;
}

/* ============================================
   CRT Monitor Effect (z-index: 200)
   ============================================ */

.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, background 0.3s ease;
}

.crt-overlay.active {
    opacity: 1;
    visibility: visible;
    background: rgba(0, 0, 0, 0.5);
}

.crt-monitor {
    width: 80%;
    max-width: 1100px;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.crt-monitor.power-on {
    transform: scale(1);
    opacity: 1;
}

.crt-bezel {
    background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 50%, #0f0f0f 100%);
    border-radius: 20px;
    padding: 20px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.8),
        inset 0 2px 0 rgba(255, 255, 255, 0.1),
        inset 0 -2px 0 rgba(0, 0, 0, 0.5);
}

.crt-bezel-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px 15px 10px;
}

.crt-model {
    font-family: 'Arial', sans-serif;
    font-size: 0.7rem;
    color: #555;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.crt-power-btn {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #333;
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.crt-power-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #33ff33;
    box-shadow: 0 0 8px #33ff33;
}

.crt-power-btn:hover {
    border-color: #444;
}

.crt-power-btn:hover::after {
    background: #ff3333;
    box-shadow: 0 0 8px #ff3333;
}

.crt-screen {
    position: relative;
    background: #000;
    border-radius: 10px;
    padding: 35px 50px;
    min-height: 450px;
    overflow: hidden;
    box-shadow:
        inset 0 0 100px rgba(0, 50, 0, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.8);
    transform: scaleY(0.01);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.crt-screen.active {
    transform: scaleY(1);
    opacity: 1;
}

/* Scanlines effect */
.crt-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    z-index: 2;
}

/* Screen flicker effect */
.crt-flicker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: rgba(18, 16, 16, 0);
    z-index: 1;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.27861; }
    5% { opacity: 0.34769; }
    10% { opacity: 0.23604; }
    15% { opacity: 0.90626; }
    20% { opacity: 0.18128; }
    25% { opacity: 0.83891; }
    30% { opacity: 0.65583; }
    35% { opacity: 0.67807; }
    40% { opacity: 0.26559; }
    45% { opacity: 0.84693; }
    50% { opacity: 0.96019; }
    55% { opacity: 0.08594; }
    60% { opacity: 0.20313; }
    65% { opacity: 0.71988; }
    70% { opacity: 0.53455; }
    75% { opacity: 0.37288; }
    80% { opacity: 0.71428; }
    85% { opacity: 0.70419; }
    90% { opacity: 0.7003; }
    95% { opacity: 0.36108; }
    100% { opacity: 0.24387; }
}

/* CRT content */
.crt-content {
    position: relative;
    z-index: 3;
    font-family: 'VT323', monospace;
    font-size: 1.15rem;
    color: #33ff33;
    text-shadow: 0 0 10px rgba(51, 255, 51, 0.7);
    line-height: 1.7;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.crt-content.visible {
    opacity: 1;
}

.crt-line {
    opacity: 0;
    transition: opacity 0.1s ease;
    margin: 0;
    padding: 2px 0;
}

.crt-header {
    color: #66ff66;
    font-size: 1.3rem;
}

.crt-dim {
    color: #228822;
}

.crt-blink {
    animation: blink 1s infinite;
}

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

/* Bezel bottom with vents */
.crt-bezel-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 15px 10px 5px 10px;
}

.crt-vent {
    width: 60px;
    height: 6px;
    background: linear-gradient(
        to bottom,
        #0a0a0a 0%,
        #1a1a1a 50%,
        #0a0a0a 100%
    );
    border-radius: 3px;
}

.crt-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #33ff33;
    box-shadow: 0 0 6px #33ff33;
    animation: pulse-led 2s infinite;
}

@keyframes pulse-led {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px #33ff33; }
    50% { opacity: 0.6; box-shadow: 0 0 3px #33ff33; }
}

/* CRT Responsive */
@media (max-width: 768px) {
    .crt-monitor {
        width: 92%;
    }

    .crt-screen {
        padding: 25px;
        min-height: 350px;
    }

    .crt-content {
        font-size: 1rem;
    }

    .crt-header {
        font-size: 1.15rem;
    }
}

@media (max-width: 480px) {
    .crt-bezel {
        padding: 12px;
        border-radius: 12px;
    }

    .crt-screen {
        padding: 18px;
        min-height: 280px;
        border-radius: 6px;
    }

    .crt-content {
        font-size: 0.9rem;
    }

    .crt-header {
        font-size: 1rem;
    }

    .crt-vent {
        width: 40px;
    }
}
