/* ==========================================================================
   FOLIO - PHOTOGRAPHER PORTFOLIO TEMPLATE STYLES
   Premium quality CSS with full design system
   ========================================================================== */

/* ==========================================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ========================================================================== */

:root {
    /* Brand Colors - Minimal B&W with accent */
    --color-primary: #0A0A0A;
    --color-primary-light: #262626;
    --color-accent: #0A0A0A;
    --color-accent-light: #404040;

    /* Neutral Colors */
    --color-white: #FFFFFF;
    --color-black: #000000;
    --color-neutral-50: #FAFAFA;
    --color-neutral-100: #F5F5F5;
    --color-neutral-200: #E5E5E5;
    --color-neutral-300: #D4D4D4;
    --color-neutral-400: #A3A3A3;
    --color-neutral-500: #737373;
    --color-neutral-600: #525252;
    --color-neutral-700: #404040;
    --color-neutral-800: #262626;
    --color-neutral-900: #171717;
    --color-neutral-950: #0A0A0A;

    /* Typography Scale */
    --text-hero: clamp(3rem, 10vw, 7rem);
    --text-display: clamp(2.5rem, 6vw, 5rem);
    --text-h1: clamp(2rem, 4vw, 3.5rem);
    --text-h2: clamp(1.75rem, 3vw, 2.5rem);
    --text-h3: clamp(1.25rem, 2vw, 1.75rem);
    --text-h4: 1.125rem;
    --text-body: 1rem;
    --text-small: 0.875rem;
    --text-xs: 0.75rem;

    /* Spacing Scale (8px base) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Mode Variables */
.dark {
    --color-primary: #FAFAFA;
    --color-primary-light: #E5E5E5;
    --color-accent: #FAFAFA;
    --color-accent-light: #D4D4D4;

    --color-white: #0A0A0A;
    --color-black: #FFFFFF;
    --color-neutral-50: #171717;
    --color-neutral-100: #262626;
    --color-neutral-200: #404040;
    --color-neutral-300: #525252;
    --color-neutral-400: #737373;
    --color-neutral-500: #A3A3A3;
    --color-neutral-600: #D4D4D4;
    --color-neutral-700: #E5E5E5;
    --color-neutral-800: #F5F5F5;
    --color-neutral-900: #FAFAFA;
    --color-neutral-950: #FFFFFF;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.5);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   GLOBAL STYLES
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Selection */
::selection {
    background: var(--color-primary);
    color: var(--color-white);
}

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

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Focus visible styles */
:focus-visible {
    outline: 2px solid #0A0A0A;
    outline-offset: 2px;
}

.dark :focus-visible {
    outline-color: #FAFAFA;
}

/* ==========================================================================
   SCROLL REVEAL ANIMATIONS
   ========================================================================== */

/* Fade up (default) */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Fade from left */
.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

/* Fade from right */
.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* Scale in */
.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Blur in */
.reveal-blur {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-blur.active {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

/* Stagger delays for grid items */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ==========================================================================
   HOVER ANIMATIONS
   ========================================================================== */

/* Card lift */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.dark .hover-lift:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Image zoom */
.hover-zoom {
    overflow: hidden;
}

.hover-zoom img {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-zoom:hover img {
    transform: scale(1.05);
}

/* Shine effect */
.hover-shine {
    position: relative;
    overflow: hidden;
}

.hover-shine::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: left 0.5s ease;
}

.hover-shine:hover::before {
    left: 100%;
}

/* ==========================================================================
   CONTINUOUS ANIMATIONS
   ========================================================================== */

/* Subtle bounce */
@keyframes subtle-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.animate-bounce-subtle {
    animation: subtle-bounce 2s ease-in-out infinite;
}

/* Floating animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Pulse ring */
@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

.pulse-ring {
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Gradient shift */
@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
}

/* ==========================================================================
   MASONRY GRID (for portfolio page)
   ========================================================================== */

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    grid-auto-flow: dense;
}

@media (min-width: 768px) {
    .masonry-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.gallery-item {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-item.hidden {
    opacity: 0;
    transform: scale(0.9);
    position: absolute;
    pointer-events: none;
}

/* ==========================================================================
   LIGHTBOX
   ========================================================================== */

#lightbox {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#lightbox-img {
    animation: lightboxZoom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes lightboxZoom {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Lightbox controls */
#lightbox button {
    transition: all 0.2s ease;
}

#lightbox button:hover {
    transform: scale(1.1);
}

#lightbox button:active {
    transform: scale(0.95);
}

/* ==========================================================================
   FILTER BUTTONS (Portfolio page)
   ========================================================================== */

.filter-btn {
    transition: all 0.3s ease;
}

.filter-btn.active {
    background-color: #0A0A0A;
    color: #FAFAFA;
    border-color: #0A0A0A;
}

.dark .filter-btn.active {
    background-color: #FAFAFA;
    color: #0A0A0A;
    border-color: #FAFAFA;
}

/* ==========================================================================
   FORM STYLES
   ========================================================================== */

/* Input focus states */
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #0A0A0A;
    outline-offset: 2px;
}

.dark input:focus,
.dark textarea:focus,
.dark select:focus {
    outline-color: #FAFAFA;
}

/* Form validation */
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

input:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
    border-color: #22c55e;
}

/* Honeypot field (hidden from view) */
input[name="_gotcha"] {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
}

/* ==========================================================================
   LOADING STATES
   ========================================================================== */

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-left-color: #0A0A0A;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.dark .loading-spinner {
    border-color: rgba(255, 255, 255, 0.1);
    border-left-color: #FAFAFA;
}

/* ==========================================================================
   SMOOTH SCROLLING
   ========================================================================== */

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* ==========================================================================
   DARK MODE TRANSITIONS
   ========================================================================== */

body,
nav,
footer,
section,
div,
button,
input,
textarea {
    transition-property: background-color, border-color, color;
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

/* ==========================================================================
   CUSTOM SCROLLBAR (Optional, minimal design)
   ========================================================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #FAFAFA;
}

.dark ::-webkit-scrollbar-track {
    background: #0A0A0A;
}

::-webkit-scrollbar-thumb {
    background: #d4d4d4;
    border-radius: 5px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #404040;
}

::-webkit-scrollbar-thumb:hover {
    background: #a3a3a3;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #525252;
}

/* ==========================================================================
   RESPONSIVE IMAGE LOADING
   ========================================================================== */

img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ==========================================================================
   REDUCED MOTION (REQUIRED FOR ACCESSIBILITY)
   ========================================================================== */

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

    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale,
    .reveal-blur {
        opacity: 1;
        transform: none;
        filter: none;
    }

    .hover-lift:hover {
        transform: none;
    }

    .hover-zoom:hover img {
        transform: none;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    nav,
    footer,
    #theme-toggle,
    #mobile-menu-btn,
    #lightbox {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    a {
        text-decoration: underline;
    }

    img {
        max-width: 100%;
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS
   ========================================================================== */

/* GPU acceleration for animated elements */
.reveal,
.reveal-left,
.reveal-right,
.reveal-scale,
.reveal-blur,
.hover-lift,
.hover-zoom img {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Content visibility for long pages */
section {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

/* ==========================================================================
   CUSTOM UTILITIES
   ========================================================================== */

/* Gradient text effect */
.text-gradient {
    background: linear-gradient(135deg, #0A0A0A 0%, #525252 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dark .text-gradient {
    background: linear-gradient(135deg, #FAFAFA 0%, #d4d4d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Aspect ratio utilities (fallback for older browsers) */
.aspect-square {
    aspect-ratio: 1 / 1;
}

.aspect-video {
    aspect-ratio: 16 / 9;
}

.aspect-portrait {
    aspect-ratio: 3 / 4;
}

/* ==========================================================================
   MOBILE MENU ANIMATION
   ========================================================================== */

#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

#mobile-menu:not(.hidden) {
    max-height: 500px;
}
