/* Duffield Digital - Main Site Styles */
/* Dark, moody, cyberpunk aesthetic */

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

html, body {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: #0a0a0a;
    color: #00d9ff;
    position: relative;
}

/* Dystopian background */
.dystopian-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background:
        linear-gradient(180deg,
            rgba(10, 10, 30, 0.95) 0%,
            rgba(20, 10, 40, 0.9) 25%,
            rgba(30, 15, 60, 0.85) 50%,
            rgba(20, 10, 40, 0.9) 75%,
            rgba(10, 10, 30, 0.95) 100%
        ),
        radial-gradient(ellipse at 20% 30%, rgba(0, 100, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(176, 38, 255, 0.15) 0%, transparent 50%),
        linear-gradient(45deg, #0a0a0a 25%, transparent 25%),
        linear-gradient(-45deg, #0a0a0a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #0f0f0f 75%),
        linear-gradient(-45deg, transparent 75%, #0f0f0f 75%);
    background-size: 100% 100%, 100% 100%, 100% 100%, 60px 60px, 60px 60px, 60px 60px, 60px 60px;
    background-position: 0 0, 0 0, 0 0, 0 0, 30px 0, 30px 30px, 0 30px;
    opacity: 0.8;
}

/* Cyberpunk grid effect */
.cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-image:
        linear-gradient(rgba(0, 217, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 217, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridScroll 20s linear infinite;
    pointer-events: none;
}

@keyframes gridScroll {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

/* Scan line effect */
.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 217, 255, 0.05) 50%,
        transparent 100%
    );
    background-size: 100% 4px;
    animation: scanline 8s linear infinite;
    pointer-events: none;
}

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

/* Noise texture overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    opacity: 0.03;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)"/></svg>');
    animation: noise 0.2s infinite;
    pointer-events: none;
}

@keyframes noise {
    0%, 100% { opacity: 0.03; }
    50% { opacity: 0.05; }
}

/* Main container */
.container {
    position: relative;
    z-index: 10;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 2rem;
    padding-top: 4rem;
    padding-bottom: 2rem;
}

/* Glitch wrapper */
.glitch-wrapper {
    text-align: center;
    max-width: 1200px;
    width: 100%;
}

/* Dystopian text styling */
.dystopian-text {
    margin-top: 16rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(10, 10, 10, 0.7);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 4px;
    box-shadow:
        0 0 20px rgba(0, 217, 255, 0.1),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

.dystopian-text::before {
    content: attr(data-glitch);
    position: absolute;
    top: -30px;
    left: 20px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
    letter-spacing: 3px;
}

.dystopian-text p {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #a0d8f0;
    margin-bottom: 1.5rem;
    text-align: justify;
    opacity: 0;
    animation: fadeInText 1.5s ease-out forwards;
}

.dystopian-text p:last-child {
    margin-bottom: 0;
}

/* Text fade animations */
@keyframes fadeInText {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.text-paragraph {
    opacity: 0;
    transition: opacity 1s ease-out, transform 1s ease-out;
    transform: translateY(20px);
}

.text-paragraph.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Cyberpunk title */
.cyber-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.75rem, 2.5vw, 2rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    text-align: right;
}

/* Neon text effects */
.neon-text {
    color: #00d9ff;
    text-shadow:
        0 0 10px rgba(0, 217, 255, 0.8),
        0 0 20px rgba(0, 217, 255, 0.6),
        0 0 30px rgba(0, 217, 255, 0.4),
        0 0 40px rgba(0, 217, 255, 0.2);
    animation: neonFlicker 3s infinite alternate;
}

.neon-text-alt {
    color: #b026ff;
    text-shadow:
        0 0 10px rgba(176, 38, 255, 0.8),
        0 0 20px rgba(176, 38, 255, 0.6),
        0 0 30px rgba(176, 38, 255, 0.4),
        0 0 40px rgba(176, 38, 255, 0.2);
    animation: neonFlicker 3s infinite alternate-reverse;
}

@keyframes neonFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        filter: brightness(1);
        opacity: 1;
    }
    20%, 24%, 55% {
        filter: brightness(0.8);
        opacity: 0.9;
    }
}

/* Glitch effect on title */
.cyber-title::before,
.cyber-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    text-align: right;
}

.cyber-title::before {
    animation: glitch-1 2.5s infinite;
    color: #ff00ff;
    z-index: -1;
}

.cyber-title::after {
    animation: glitch-2 2s infinite;
    color: #00ffff;
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 100% {
        transform: translate(0);
    }
    33% {
        transform: translate(-2px, 2px);
    }
    66% {
        transform: translate(2px, -2px);
    }
}

@keyframes glitch-2 {
    0%, 100% {
        transform: translate(0);
    }
    33% {
        transform: translate(3px, -3px);
    }
    66% {
        transform: translate(-3px, 3px);
    }
}

/* Terminal boot sequence */
.terminal-boot {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    max-width: 600px;
}

.terminal-output {
    line-height: 1.6;
    text-align: left;
}

.terminal-output div {
    margin-bottom: 0.2rem;
}

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

/* Particles container */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #00d9ff;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0, 217, 255, 0.8);
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(var(--drift, 50px));
        opacity: 0;
    }
}

/* Interactive Console Footer */
.console-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    transition: transform 0.3s ease-out;
}

.console-footer.collapsed {
    transform: translateY(calc(100% - 40px));
}

.console-toggle {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: rgba(0, 217, 255, 0.9);
    border: 1px solid #00d9ff;
    border-bottom: none;
    color: #0a0a0a;
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

.console-toggle:hover {
    background: #00d9ff;
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.8);
}

.console-arrow {
    display: block;
    transition: transform 0.3s ease;
}

.console-footer.collapsed .console-arrow {
    transform: rotate(180deg);
}

.console-container {
    background: rgba(10, 10, 10, 0.95);
    border-top: 2px solid #00d9ff;
    height: 300px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -5px 30px rgba(0, 217, 255, 0.3);
}

.console-output {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.console-line {
    margin-bottom: 0.25rem;
    word-wrap: break-word;
}

.console-line.error {
    color: #ff0066;
    text-shadow: 0 0 5px rgba(255, 0, 102, 0.5);
}

.console-line.success {
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.console-line.info {
    color: #00d9ff;
    text-shadow: 0 0 5px rgba(0, 217, 255, 0.5);
}

.console-input-container {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(0, 217, 255, 0.3);
}

.console-prompt-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: #00d9ff;
    text-shadow: 0 0 5px rgba(0, 217, 255, 0.5);
    margin-right: 0.5rem;
    white-space: nowrap;
}

.console-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    caret-color: #00ff00;
}

.console-input::selection {
    background: rgba(0, 255, 0, 0.3);
}

/* Console scrollbar */
.console-output::-webkit-scrollbar {
    width: 8px;
}

.console-output::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
}

.console-output::-webkit-scrollbar-thumb {
    background: #00d9ff;
    border-radius: 4px;
}

.console-output::-webkit-scrollbar-thumb:hover {
    background: #00ffff;
}

/* Desktop optimizations */
@media (min-width: 1024px) {
    .container {
        padding: 3rem 4rem;
        padding-top: 6rem;
    }

    .terminal-boot {
        font-size: 0.85rem;
    }

    .dystopian-text {
        margin-top: 15rem;
        padding: 1.25rem;
        margin-bottom: 2.5rem;
        font-size: 1.15rem;
    }

    .dystopian-text p {
        font-size: 1.25rem;
        line-height: 2;
    }

    .cyber-title {
        font-size: clamp(1rem, 3vw, 2.5rem);
    }

    .glitch-wrapper {
        max-width: 1400px;
    }
}

/* Tablet and smaller desktop */
@media (max-width: 1023px) and (min-width: 769px) {
    .container {
        padding: 2.5rem;
        padding-top: 5rem;
    }

    .terminal-boot {
        font-size: 0.85rem;
    }

    .dystopian-text {
        margin-top: 14rem;
        margin-bottom: 1.5rem;
    }

    .dystopian-text p {
        font-size: 1.15rem;
    }

    .cyber-title {
        font-size: clamp(0.875rem, 2.75vw, 1.75rem);
    }
}

/* Mobile landscape and portrait tablet */
@media (max-width: 768px) {
    .dystopian-text {
        margin-top: 13rem;
        padding: 0.75rem;
        margin-bottom: 1rem;
    }

    .dystopian-text p {
        font-size: 1rem;
        text-align: left;
    }

    .cyber-title {
        font-size: clamp(0.625rem, 2vw, 1rem);
        top: 0.5rem;
        right: 0.5rem;
    }

    .terminal-boot {
        font-size: 0.7rem;
        top: 0.5rem;
        left: 0.5rem;
        max-width: 400px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }

    .cyber-title {
        font-size: clamp(0.5rem, 1.75vw, 0.75rem);
    }

    .terminal-boot {
        font-size: 0.65rem;
        max-width: 300px;
    }

    .dystopian-text {
        margin-top: 12rem;
        margin-bottom: 0.75rem;
    }

    .dystopian-text::before {
        font-size: 0.6rem;
        top: -25px;
    }
}

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

/* Print styles */
@media print {
    .cyber-grid,
    .scan-line,
    .noise-overlay,
    .dystopian-bg,
    .particles-container,
    .terminal-boot {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .cyber-title,
    .dystopian-text p {
        color: black;
        text-shadow: none;
    }
}
