/* CSS Custom Properties (Variables) */
:root {
    --color-background: #FFFFFF;
    --color-primary: #000000;
    --color-accent: #1E3A8A;
    --color-accent-hover: #0F172A;
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-background);
    color: var(--color-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    height: 100vh;
}

/* Interactive Blueprint Background */
.background-blueprint {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
    --mouse-x: 0px;
    --mouse-y: 0px;
    --cell-x: 0;
    --cell-y: 0;
}

.background-blueprint::before,
.background-blueprint::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
}

.background-blueprint::before {
    background: 
        linear-gradient(90deg, transparent 0%, var(--color-accent) 1px, transparent 1px),
        linear-gradient(0deg, transparent 0%, var(--color-accent) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.08;
    transition: opacity var(--transition-medium);
    animation: gridPulse 4s ease-in-out infinite;
}

.background-blueprint::after {
    background: 
        linear-gradient(45deg, transparent 0%, var(--color-accent) 1px, transparent 1px),
        linear-gradient(-45deg, transparent 0%, var(--color-accent) 1px, transparent 1px);
    background-size: 90px 90px;
    opacity: 0.03;
    transition: opacity var(--transition-medium);
}

/* Enhanced grid visibility on hover */
.background-blueprint.hover::before {
    opacity: 0.2;
    filter: drop-shadow(0 0 6px var(--color-accent));
}

.background-blueprint.hover::after {
    opacity: 0.06;
    filter: drop-shadow(0 0 4px var(--color-accent));
}



@keyframes gridPulse {
    0%, 100% {
        opacity: 0.08;
    }
    50% {
        opacity: 0.15;
    }
}



/* Logo */
.logo {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 1000;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 2rem;
    color: var(--color-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 48px;
}

.logo:hover {
    transform: scale(1.1);
    color: var(--color-accent);
}

.logo-icon {
    width: 48px;
    height: 48px;
}

/* Scrolling Text Container */
.scrolling-text-container {
    width: 100vw;
    overflow: hidden;
    position: relative;
    margin-left: calc(-50vw + 50%);
}

/* Navigation Icon */
.nav-icon {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    cursor: pointer;
    transition: var(--transition-fast);
}

.nav-icon:hover {
    transform: scale(1.1);
}

.nav-icon:active {
    transform: scale(0.95);
}

.hamburger {
    width: 30px;
    height: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--color-primary);
    transition: var(--transition-fast);
    border-radius: 1px;
}

.hamburger:hover span {
    background-color: var(--color-accent);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    position: relative;
    opacity: 1;
}

.hero-content {
    width: 100%;
    max-width: none;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.main-headline {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    letter-spacing: 0.5em;
    margin-bottom: 1rem;
    text-transform: uppercase;
    background: linear-gradient(45deg, var(--color-primary), var(--color-accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textGlow 3s ease-in-out infinite alternate, textScroll 20s linear infinite;
    position: relative;
    white-space: nowrap;
    display: inline-block;
    width: max-content;
}

.main-headline::before,
.main-headline::after {
    content: 'X';
    position: absolute;
    font-size: 0.3em;
    color: rgba(255, 255, 255, 0.3);
    animation: textGlow 3s ease-in-out infinite alternate;
}

.main-headline::before {
    left: -2em;
    top: 0.2em;
}

.main-headline::after {
    right: -2em;
    bottom: 0.2em;
}

.text-tile {
    display: inline-block;
    margin-right: 4em;
}

.secondary-text {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 300;
    letter-spacing: 0.6em;
    margin-bottom: 3rem;
    opacity: 0.8;
    text-transform: uppercase;
    position: relative;
    white-space: nowrap;
    display: inline-block;
    width: max-content;
    animation: textScroll 25s linear infinite reverse;
}

.secondary-text::before,
.secondary-text::after {
    content: '.';
    position: absolute;
    font-size: 0.8em;
    color: rgba(30, 58, 138, 0.6);
    animation: textGlow 3s ease-in-out infinite alternate;
}

.secondary-text::before {
    left: -1.5em;
    top: 0.1em;
}

.secondary-text::after {
    right: -1.5em;
    bottom: 0.1em;
}

.cta-button {
    background-color: var(--color-accent);
    color: var(--color-background);
    border: none;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: var(--font-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: var(--transition-medium);
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition-medium);
}

.cta-button:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:active {
    transform: translateY(0) scale(0.98);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-medium);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-nav ul {
    list-style: none;
    text-align: center;
}

.modal-nav li {
    margin: 1.5rem 0;
    opacity: 0;
    transform: translateY(20px);
    animation: slideInUp 0.5s ease forwards;
}

.modal-nav li:nth-child(1) { animation-delay: 0.1s; }
.modal-nav li:nth-child(2) { animation-delay: 0.2s; }
.modal-nav li:nth-child(3) { animation-delay: 0.3s; }

.nav-link {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 2rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: var(--transition-fast);
    position: relative;
    display: inline-block;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-accent);
    transition: var(--transition-medium);
}

.nav-link:hover {
    color: var(--color-accent);
    transform: translateX(10px);
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.nav-link:hover::after {
    width: 100%;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes textGlow {
    from {
        filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.2));
    }
    to {
        filter: drop-shadow(0 0 20px rgba(30, 58, 138, 0.4));
    }
}

@keyframes textScroll {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-33.33%);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Projects Page Styles */
.projects-hero {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    position: relative;
    transition: filter var(--transition-medium);
}

.projects-content {
    width: 100%;
    max-width: 1200px;
    position: relative;
    overflow: hidden;
    padding-top: 4rem;
    opacity: 1;
}

.projects-headline {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    text-transform: uppercase;
    background: linear-gradient(45deg, var(--color-primary), var(--color-accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textGlow 3s ease-in-out infinite alternate;
    margin-bottom: 2rem;
}

.projects-subtitle {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 300;
    letter-spacing: 0.2em;
    margin-bottom: 4rem;
    opacity: 0.8;
    text-transform: uppercase;
    color: var(--color-primary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.project-tile {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--color-accent);
    border-radius: 8px;
    padding: 2rem;
    text-align: left;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.project-tile:hover {
    transform: translateY(-2px);
    border-color: var(--color-accent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 1);
}

.project-tile h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-tile p {
    font-size: 1rem;
    color: rgba(0, 0, 0, 0.8);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-link {
    background-color: transparent;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: var(--transition-medium);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.project-link:hover {
    background-color: var(--color-accent);
    color: var(--color-background);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.project-link:active {
    transform: translateY(0) scale(0.98);
}

/* Additional security measures */
.projects-hero.locked .project-tile,
.projects-hero.locked .project-link,
.projects-hero.locked button,
.projects-hero.locked a {
    cursor: not-allowed;
    pointer-events: none;
}

/* Locked state for projects page */
.projects-hero.locked {
    filter: blur(20px);
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    transition: filter var(--transition-medium);
}

.projects-hero.locked * {
    pointer-events: none;
    cursor: not-allowed;
}

/* Prevent any interaction with locked content */
.projects-hero.locked input,
.projects-hero.locked textarea,
.projects-hero.locked select {
    pointer-events: none;
    cursor: not-allowed;
}

/* Password Protection Overlay */
.password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.password-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 3rem;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(30, 58, 138, 0.2);
    position: relative;
}

.password-container h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.password-container p {
    font-size: 1.1rem;
    color: rgba(0, 0, 0, 0.7);
    margin-bottom: 2rem;
}

.password-input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    transform: none;
    transition: none;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    user-select: none;
    pointer-events: auto;
}

.password-input-group input {
    padding: 1rem;
    padding-right: 3rem;
    border: 2px solid var(--color-accent);
    border-radius: 6px;
    font-size: 1rem;
    font-family: var(--font-primary);
    background: white;
    color: var(--color-primary);
    transition: none;
    width: 100%;
}

.password-input-group input:focus {
    outline: none;
    border-color: var(--color-accent-hover);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.password-input-group button {
    background-color: var(--color-accent);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition-medium);
}

.password-input-group button:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.password-error {
    color: #dc2626;
    font-size: 0.9rem;
    margin-top: 1rem;
    opacity: 0;
    transition: var(--transition-fast);
    min-height: 1.2rem;
}

.password-error.show {
    opacity: 1;
}

.password-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: color 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-close:hover {
    color: var(--color-accent);
}

.password-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-medium);
    visibility: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo {
        top: 1rem;
        left: 1rem;
    }
    
    .nav-icon {
        top: 1rem;
        right: 1rem;
    }
    
    .hamburger {
        width: 25px;
        height: 18px;
    }
    
    .hero {
        padding: 1rem;
    }
    
    .main-headline {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }
    
    .secondary-text {
        font-size: clamp(1.2rem, 5vw, 2rem);
    }
    
    .cta-button {
        padding: 0.8rem 2.5rem;
        font-size: 1rem;
    }
    
    .nav-link {
        font-size: 1.5rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 2rem;
    }
    
    .project-tile {
        padding: 1.5rem;
    }
    
    .projects-headline {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }
    
    .projects-subtitle {
        font-size: clamp(1.2rem, 5vw, 2rem);
        margin-bottom: 3rem;
    }
    
    .password-container {
        padding: 2rem;
        margin: 1rem;
    }
    
    .password-container h2 {
        font-size: 1.5rem;
    }
    
    .password-container p {
        font-size: 1rem;
    }
    
    .password-close {
        top: 0.75rem;
        right: 0.75rem;
        font-size: 1.5rem;
        width: 35px;
        height: 35px;
    }
    
    .password-toggle {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .logo {
        top: 0.75rem;
        left: 0.75rem;
    }
    
    .nav-icon {
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .hero {
        padding: 0.5rem;
    }
    
    .main-headline {
        font-size: clamp(2rem, 12vw, 3rem);
    }
    
    .secondary-text {
        font-size: clamp(1rem, 6vw, 1.5rem);
    }
    
    .cta-button {
        padding: 0.7rem 2rem;
        font-size: 0.9rem;
    }
    
    .projects-grid {
        gap: 1rem;
        margin-top: 1.5rem;
    }
    
    .project-tile {
        padding: 1rem;
    }
    
    .projects-headline {
        font-size: clamp(2rem, 12vw, 3rem);
    }
    
    .projects-subtitle {
        font-size: clamp(1rem, 6vw, 1.5rem);
        margin-bottom: 2rem;
    }
    
    .password-container {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    
    .password-container h2 {
        font-size: 1.3rem;
    }
    
    .password-container p {
        font-size: 0.9rem;
    }
    
    .password-input-group button {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .password-close {
        top: 0.5rem;
        right: 0.5rem;
        font-size: 1.25rem;
        width: 30px;
        height: 30px;
    }
    
    .password-toggle {
        font-size: 14px;
    }
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .background-blueprint::before {
        background-size: 40px 40px;
    }
    
    .background-blueprint::after {
        background-size: 60px 60px;
    }
}
