/* ============================================
   PROTOTYPE DESIGN SYSTEM
   Inspired by: Portal, Prototype, Nothing Phone,
   Retrofuturism, Minimalism, Brutalism
   ============================================ */

:root {
    /* Core Palette - Proto prefixed (design system) */
    --proto-black: #000000;
    --proto-white: #FFFFFF;
    --proto-gray-100: #F5F5F5;
    --proto-gray-200: #E0E0E0;
    --proto-gray-300: #BDBDBD;
    --proto-gray-400: #888888;
    --proto-gray-600: #555555;
    --proto-gray-800: #1A1A1A;
    --proto-gray-900: #0D0D0D;

    /* Core Palette - Non-prefixed aliases (page compatibility) */
    --black: #000000;
    --white: #FFFFFF;
    --gray-200: #C5C5C5;
    --gray-300: #B0B0B0;
    --gray-400: #888888;
    --gray-600: #555555;
    --gray-800: #1A1A1A;
    --gray-900: #0D0D0D;

    /* Accent Colors - Portal/Prototype inspired */
    --proto-blue: #4A9EFF;
    --proto-orange: #FF8C42;
    --proto-cyan: #00D9FF;
    --proto-red: #FF4757;
    --proto-green: #2ECC71;

    /* Accent Colors - LaB brand accents */
    --lab-orange: #F97316;
    --lab-green: #22C55E;
    --lab-purple: #A855F7;
    --accent-blue: #4A9EFF;

    /* Grid & Lines */
    --proto-grid-size: 100px;
    --proto-line-color: rgba(255, 255, 255, 0.08);
    --proto-line-accent: rgba(74, 158, 255, 0.15);
    --proto-corner-size: 20px;
    --proto-corner-thickness: 2px;

    /* Animations */
    --proto-ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --proto-ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --proto-duration-fast: 200ms;
    --proto-duration-normal: 400ms;
    --proto-duration-slow: 800ms;

    /* Effects */
    --proto-glow: 0 0 20px rgba(74, 158, 255, 0.3);
    --proto-glow-strong: 0 0 30px rgba(74, 158, 255, 0.5), 0 0 60px rgba(74, 158, 255, 0.2);
    --proto-scanline-opacity: 0.03;
}

/* ============================================
   GLOBAL ENHANCEMENTS
   ============================================ */

/* Subtle scanline overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    opacity: var(--proto-scanline-opacity);
    animation: scanline-drift 8s linear infinite;
}

@keyframes scanline-drift {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* Subtle grid background for sections */
.proto-grid {
    position: relative;
}

.proto-grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(var(--proto-line-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--proto-line-color) 1px, transparent 1px);
    background-size: var(--proto-grid-size) var(--proto-grid-size);
    pointer-events: none;
    opacity: 0.5;
}

/* ============================================
   CORNER BRACKETS
   ============================================ */

.proto-corners {
    position: relative;
}

.proto-corners::before,
.proto-corners::after {
    content: '';
    position: absolute;
    width: var(--proto-corner-size);
    height: var(--proto-corner-size);
    pointer-events: none;
}

/* Top-left corner */
.proto-corners::before {
    top: 0;
    left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

/* Bottom-right corner */
.proto-corners::after {
    bottom: 0;
    right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

/* All four corners variant */
.proto-corners-full {
    position: relative;
}

.proto-corners-full::before,
.proto-corners-full::after {
    content: '';
    position: absolute;
    width: var(--proto-corner-size);
    height: var(--proto-corner-size);
    pointer-events: none;
}

.proto-corners-full::before {
    top: 0;
    left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.proto-corners-full::after {
    bottom: 0;
    right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

/* Additional pseudo-elements via inline elements */
.proto-corner-tl,
.proto-corner-tr,
.proto-corner-bl,
.proto-corner-br {
    position: absolute;
    width: var(--proto-corner-size);
    height: var(--proto-corner-size);
    pointer-events: none;
}

.proto-corner-tl {
    top: 0;
    left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.proto-corner-tr {
    top: 0;
    right: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.proto-corner-bl {
    bottom: 0;
    left: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.proto-corner-br {
    bottom: 0;
    right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

/* ============================================
   ACCENT LINES
   ============================================ */

.proto-line {
    position: relative;
    display: inline-block;
}

.proto-line::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.3), transparent);
    animation: proto-line-glow 2s ease-in-out infinite;
}

@keyframes proto-line-glow {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

.proto-line-vertical {
    position: relative;
}

.proto-line-vertical::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent);
    animation: proto-line-vertical-glow 2s ease-in-out infinite;
}

@keyframes proto-line-vertical-glow {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* ============================================
   STATUS INDICATORS
   ============================================ */

.proto-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.proto-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--proto-green);
    box-shadow: 0 0 10px var(--proto-green);
    animation: proto-pulse 2s ease-in-out infinite;
}

.proto-status.warning::before {
    background: var(--proto-orange);
    box-shadow: 0 0 10px var(--proto-orange);
}

.proto-status.error::before {
    background: var(--proto-red);
    box-shadow: 0 0 10px var(--proto-red);
}

.proto-status.info::before {
    background: var(--proto-cyan);
    box-shadow: 0 0 10px var(--proto-cyan);
}

@keyframes proto-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

/* Glitch effects removed - not used in current implementation */

/* ============================================
   CARDS & CONTAINERS
   ============================================ */

.proto-card {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--proto-duration-normal) var(--proto-ease-smooth);
}

.proto-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.proto-card-glass {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   BUTTONS
   ============================================ */

.proto-btn {
    position: relative;
    padding: 12px 24px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--proto-duration-normal) var(--proto-ease-smooth);
}

.proto-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--proto-white);
    transition: left var(--proto-duration-normal) var(--proto-ease-smooth);
    z-index: -1;
}

.proto-btn:hover {
    color: var(--proto-black);
    border-color: var(--proto-white);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.1);
}

.proto-btn:hover::before {
    left: 0;
}

.proto-btn:active {
    transform: scale(0.98);
}

/* Loading indicators and data displays removed - not used in current implementation */

/* ============================================
   DIVIDERS
   ============================================ */

.proto-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--proto-line-color),
        transparent
    );
    margin: 2rem 0;
}

.proto-divider-accent {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

/* ============================================
   TEXT EFFECTS
   ============================================ */

.proto-text-glow {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.proto-text-mono {
    font-family: 'Space Mono', monospace;
    letter-spacing: 0.05em;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    :root {
        --proto-grid-size: 50px;
        --proto-corner-size: 16px;
    }
}

@media (max-width: 640px) {
    :root {
        --proto-grid-size: 30px;
        --proto-corner-size: 12px;
        --proto-scanline-opacity: 0.02;
    }

    body::before {
        display: none; /* Disable scanlines on mobile for performance */
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus states for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--proto-blue);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--proto-blue);
    outline-offset: 2px;
}

/* Focus states for interactive cards and components */
.proto-card:focus-visible,
.proto-btn:focus-visible,
.project:focus-visible,
.event-preview-card:focus-visible,
.resource-tile:focus-visible,
.prompt-card:focus-visible,
.mini-roller:focus-visible,
.filter-btn:focus-visible,
.type-option:focus-visible,
.style-option:focus-visible {
    outline: 2px solid var(--proto-blue);
    outline-offset: 4px;
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--proto-white);
    color: var(--proto-black);
    padding: 0.75rem 1.5rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    text-decoration: none;
    z-index: 10000;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 1rem;
}

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

/* ============================================
   BASE RESET & BODY
   ============================================ */

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--black);
    color: var(--gray-400);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ============================================
   SITE NAVIGATION
   ============================================ */

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 2rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    mix-blend-mode: difference;
}

.nav-logo {
    height: 26px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.nav-logo:hover {
    opacity: 0.5;
}

.nav-back {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: var(--white);
    text-decoration: none;
    letter-spacing: 1px;
    transition: opacity 0.3s ease;
}

.nav-back:hover {
    opacity: 0.5;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: opacity 0.3s ease;
}

.nav-links a:hover {
    opacity: 0.5;
}

.footer-nav {
    position: static;
    top: auto;
    right: auto;
    left: auto;
    padding: 0;
    mix-blend-mode: normal;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.proto-hidden {
    display: none;
}

.proto-invisible {
    visibility: hidden;
}

.proto-no-pointer {
    pointer-events: none;
}

.proto-clickable {
    cursor: pointer;
}

.proto-transition {
    transition: all var(--proto-duration-normal) var(--proto-ease-smooth);
}
