:root {
    /* Main Color Palette */
    --color-primary: #2A2A2A;
    /* Dark Gray - darkest */
    --color-secondary: #3A3A3A;
    /* Gray - medium dark */
    --color-accent: #4A4A4A;
    /* Light Gray - medium */
    --color-highlight: #5A5A5A;
    /* Lighter Gray - bright */
    --color-white: #FFFFFF;
    /* White */
    --color-background: #2A2A2A;
    /* Dark Gray - darkest */

    /* Background Gradients - Linear gradient with many stops to prevent banding */
    --gradient-primary: linear-gradient(135deg, #1A1A1A 0%, #1B1B1B 10%, #1C1C1C 20%, #1D1D1D 30%, #1E1E1E 40%, #1F1F1F 50%, #202020 60%, #212121 70%, #222222 80%, #232323 90%, #2A2A2A 100%);
    --gradient-accent: linear-gradient(45deg, var(--color-accent), var(--color-highlight));
    --gradient-text: linear-gradient(45deg, var(--color-white), #e2e8f0);

    /* Transparent Variants */
    --color-primary-10: rgba(42, 42, 42, 0.1);
    --color-primary-20: rgba(42, 42, 42, 0.2);
    --color-primary-30: rgba(42, 42, 42, 0.3);
    --color-primary-50: rgba(42, 42, 42, 0.5);
    --color-primary-80: rgba(42, 42, 42, 0.8);
    --color-primary-95: rgba(42, 42, 42, 0.95);

    --color-accent-10: rgba(74, 74, 74, 0.1);
    --color-accent-15: rgba(74, 74, 74, 0.15);
    --color-accent-20: rgba(74, 74, 74, 0.2);
    --color-accent-25: rgba(74, 74, 74, 0.25);
    --color-accent-30: rgba(74, 74, 74, 0.3);
    --color-accent-40: rgba(74, 74, 74, 0.4);
    --color-accent-50: rgba(74, 74, 74, 0.5);
    --color-accent-80: rgba(74, 74, 74, 0.8);
    --color-accent-95: rgba(74, 74, 74, 0.95);

    --color-highlight-20: rgba(90, 90, 90, 0.2);
    --color-highlight-30: rgba(90, 90, 90, 0.3);
    --color-highlight-40: rgba(90, 90, 90, 0.4);
    --color-highlight-50: rgba(90, 90, 90, 0.5);
}

/* Global styles */

@font-face {
    font-family: 'Terminal Grotesque';
    src: url('../terminal-grotesque-webfont.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

html,
body {
    /* Ensure background fills viewport and matches nav bar */
    background: var(--gradient-primary);
    background-color: #1A1A1A;
    background-attachment: fixed;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    min-height: 100vh;
    /* Prevent automatic scrolling to hash targets */
    scroll-behavior: auto;
    /* Add safe area for iOS notch */
    padding-top: env(safe-area-inset-top);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Ubuntu', sans-serif;
    font-weight: 300;
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Main Container Layout */
.main-container {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 80px);
    /* Account for nav bar overlap */
    overflow: visible;
    padding-top: 0;
    margin-top: -80px;
    /* Pull content up to reduce gap with nav */
}

/* Pages Container */
.pages-container {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 60vh;
    overflow: visible;
}

.page {
    position: relative;
    width: 100%;
    min-height: 60vh;
    padding: 20px 40px;
    /* Give some breathing room */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    z-index: 1;
    overflow-y: visible;
    overflow-x: hidden;
}

.page.active {
    z-index: 2;
}

/* Only use absolute positioning during transitions */
.page.transitioning {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 100vh;
    overflow: visible;
}

.page-content {
    max-width: 1600px;
    width: 100%;
    text-align: center;
    text-align: center;
    padding-bottom: 60px;
}

#photos .page-content {
    max-width: 95%;
}

/* Typography */
h1 {
    font-size: clamp(2em, 8vw, 3em);
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--color-white);
}

.subtitle {
    font-size: clamp(1.2em, 4vw, 1.5em);
    margin-bottom: 40px;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.description {
    font-size: clamp(1em, 3vw, 1.1em);
    line-height: 1.8;
    margin-bottom: 40px;
    color: #e2e8f0;
}

.name-title {
    font-size: clamp(2.5em, 10vw, 4em);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: #ffffff;
    text-align: center;
    font-family: 'Terminal Grotesque', Arial Black, Arial, sans-serif;
    font-weight: bold;
}

.about-description {
    font-size: clamp(1.2em, 3.5vw, 1.3em);
    line-height: 1.7;
    margin-bottom: 30px;
    color: #e2e8f0;
    text-align: left;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.intro-section {
    margin-bottom: 40px;
}

.intro-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 5px;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}

.intro-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-photo {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    border: 2px solid rgba(74, 74, 74, 0.3);
}

/* Responsive design for intro section */
@media (max-width: 768px) {
    .intro-content {
        grid-template-columns: 1fr;
        gap: 15px;
        text-align: center;
    }

    .intro-image {
        order: -1;
        /* Put image first on mobile */
    }

    .about-photo {
        max-width: 250px;
    }
}

/* Features Grid */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
    width: 100%;
}

.feature {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 6px;
    border: 1px solid rgba(74, 74, 74, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(74, 74, 74, 0.2);
}

.feature h3 {
    color: var(--color-white);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.feature p {
    line-height: 1.6;
    color: #cbd5e0;
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 40px;
    width: 100%;
}

.photo-card {
    aspect-ratio: 1;
    background: linear-gradient(45deg, #3A3A3A, #4A4A4A);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.photo-card:hover {
    transform: scale(1.05);
}

/* Photo Gallery Specific Styles */
.photos-title-terminal {
    font-family: 'Terminal Grotesque', Arial Black, Arial, sans-serif !important;
    font-weight: bold !important;
    text-transform: uppercase;
    letter-spacing: 4px;
}

.featured-photos-section {
    margin: 40px 0;
}

.photo-grid {
    display: grid;
    gap: 20px;
    margin: 30px 0;
}

.featured-grid {
    grid-template-columns: repeat(3, 1fr);
}

.recent-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.photo-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(74, 74, 74, 0.2);
    cursor: pointer;
}

.photo-placeholder {
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #2d3748, #4a5568);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
    font-size: 1.2em;
    font-weight: 500;
    background-size: cover;
    background-position: center;
}

.photo-info {
    padding: 20px;
    font-family: 'Ubuntu', sans-serif;
}

.photo-title {
    font-family: 'Terminal Grotesque', Arial Black, Arial, sans-serif !important;
    font-weight: bold;
    font-size: 1.1em;
    color: #ffffff;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.photo-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #e2e8f0;
}

.location {
    font-size: 0.9em;
    color: #a0aec0;
    margin-bottom: 10px;
    font-style: italic;
}

.photo-description {
    font-size: 0.9em;
    line-height: 1.4;
    color: #e2e8f0;
    max-height: 4.2em;
    /* 3 lines */
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.photo-description.expanded {
    max-height: none;
}

.photo-description:not(.expanded)::after {
    content: '...';
    position: absolute;
    right: 0;
    bottom: 0;
    background: inherit;
    padding-left: 20px;
    color: inherit;
}

.recent-uploads-section {
    margin-top: 0px;
    padding-top: 0px;
}

.recent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.recent-title {
    font-family: 'Terminal Grotesque', Arial Black, Arial, sans-serif !important;
    font-weight: bold !important;
    font-size: clamp(1.8em, 6vw, 2.5em);
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 0;
}

.gallery-button {
    background: rgba(34, 68, 102, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 18px 60px;
    border-radius: 50px;
    font-family: 'Terminal Grotesque', Arial Black, Arial, sans-serif;
    font-weight: bold;
    font-size: 1.3em;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gallery-button:hover {
    background: rgba(34, 68, 102, 0.8);
    transform: translateY(-2px);
    box-shadow:
        0 15px 30px rgba(0, 0, 0, 0.4),
        inset 0 0 25px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Archive */
.archive-list {
    text-align: left;
    margin-top: 40px;
    width: 100%;
}

/* Archive Typography */
.archive-main-title {
    font-family: 'Terminal Grotesque', monospace !important;
    font-size: 2.5em;
    color: #ffffff;
    margin-bottom: 10px;
}

.archive-subtitle {
    font-family: 'Ubuntu', sans-serif !important;
    font-size: 1.1em;
    color: #b0b0b0;
    margin-bottom: 40px;
}

.archive-section-title {
    font-family: 'Terminal Grotesque', monospace !important;
    font-size: 1.8em;
    color: #ffffff;
    margin-bottom: 20px;
}

/* External Links Section */
.external-links-section {
    margin: 40px 0;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.external-links-title {
    font-family: 'Terminal Grotesque', monospace !important;
    font-size: 1.5em;
    color: #ffffff;
    margin-bottom: 20px;
}

.external-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.external-link-button {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: rgba(74, 74, 74, 0.1);
    border: 1px solid rgba(74, 74, 74, 0.3);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    color: inherit;
}

.external-link-button:hover {
    background: rgba(74, 74, 74, 0.2);
    border-color: rgba(74, 74, 74, 0.5);
    transform: translateY(-2px);
}

.link-title {
    font-family: 'Terminal Grotesque', monospace !important;
    font-size: 1.1em;
    color: var(--color-white);
    margin-bottom: 5px;
}

.link-description {
    font-family: 'Ubuntu', sans-serif !important;
    font-size: 0.9em;
    color: #b0b0b0;
}

/* Instagram Feed Section */
.instagram-feed-section {
    margin: 40px 0;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.instagram-feed-title {
    font-family: 'Terminal Grotesque', monospace !important;
    font-size: 1.5em;
    color: #ffffff;
    margin-bottom: 20px;
}

.instagram-feed-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
}

.instagram-placeholder-text {
    font-family: 'Ubuntu', sans-serif !important;
    color: #808080;
    font-style: italic;
}

.instagram-feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.instagram-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    font-family: 'Ubuntu', sans-serif !important;
    color: #808080;
    font-style: italic;
}

.instagram-post {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    position: relative;
}

.instagram-post:hover {
    transform: translateY(-5px);
    border-color: rgba(74, 74, 74, 0.3);
}

/* Carousel Container */
.instagram-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    /* Makes it square */
    overflow: hidden;
}

.instagram-carousel-images {
    display: flex;
    transition: transform 0.3s ease;
    height: 100%;
}

.instagram-post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

/* Carousel Controls */
.carousel-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.instagram-post:hover .carousel-controls {
    opacity: 1;
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-controls:hover {
    background: rgba(74, 74, 74, 0.8);
}

/* Carousel Indicators */
.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s ease;
}

.carousel-dot.active {
    background: rgba(74, 74, 74, 1);
}

/* Multiple images indicator */
.multiple-images-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-family: 'Terminal Grotesque', monospace;
    z-index: 10;
}

.instagram-post-content {
    padding: 15px;
}

.instagram-post-caption {
    font-family: 'Ubuntu', sans-serif !important;
    color: #d0d0d0;
    font-size: 0.9em;
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    overflow: hidden;
}

.instagram-post-date {
    font-family: 'Terminal Grotesque', monospace !important;
    color: var(--color-white);
    font-size: 0.8em;
}

/* Instagram Posts Grid */
.instagram-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 1024px) {
    .instagram-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 600px) {
    .instagram-posts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Square aspect ratio is maintained by aspect-ratio: 1/1 above */
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 20px;
}

.load-more-button {
    background: linear-gradient(45deg, #3A3A3A, #2A2A2A);
    border: none;
    border-radius: 16px;
    padding: 12px 24px;
    font-family: 'Terminal Grotesque', monospace !important;
    color: white;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 74, 74, 0.3);
}

.load-more-button:hover {
    background: linear-gradient(45deg, #7c3aed, #6b21a8);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 33, 168, 0.4);
}

/* Copy to Clipboard Notification */
.copy-notification {
    background: rgba(74, 74, 74, 0.95);
    color: white;
    padding: 12px 24px;
    border-radius: 16px;
    font-family: 'Ubuntu', sans-serif;
    font-size: 0.9em;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 8px 32px rgba(74, 74, 74, 0.3);
    transition: all 0.5s ease;
    transform: translateY(10px);
    white-space: nowrap;
    will-change: transform, opacity;
    -webkit-transform: translateY(10px);
    -webkit-transition: all 0.5s ease;
}

.copy-notification.show {
    opacity: 1;
    transform: translateY(-10px);
    -webkit-transform: translateY(-10px);
}

.copy-notification.fade-out {
    opacity: 0;
    transform: translateY(-30px);
    -webkit-transform: translateY(-30px);
}

/* Responsive Photo Grids */
@media (max-width: 1200px) {

    .featured-grid,
    .recent-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .featured-grid,
    .recent-grid {
        grid-template-columns: 1fr;
    }

    .photo-grid {
        gap: 25px;
    }

    /* Archive responsive styles */
    .archive-main-title {
        font-size: 2em;
    }

    .external-links-section,
    .instagram-feed-section {
        padding: 20px;
        margin: 30px 0;
    }

    .external-links-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .external-link-button {
        padding: 15px;
    }

    #behold-widget {
        min-height: 300px;
    }
}

/* Photo Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: hidden;
}

.modal-content {
    position: relative;
    margin: 2% auto;
    background-color: #ffffff;
    border: 2px solid #000;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.modal-image-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background-color: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.3s ease;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
}

.close-btn {
    position: absolute;
    top: 10px;
    left: 15px;
    font-size: 30px;
    color: #0080ff;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    color: #ff4444;
    background: rgba(0, 0, 0, 0.9);
}

.modal-info {
    padding: 20px;
    background-color: #f8f8f8;
    border-top: 1px solid #000;
    max-height: 200px;
    overflow-y: auto;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.modal-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #000;
    transition: color 0.3s ease;
}

.modal-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.modal-location {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.modal-description {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    transition: color 0.3s ease;
}

/* Modal Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        margin: 1% auto;
        width: 98%;
        height: 98vh;
    }

    .modal-info {
        max-height: 150px;
        padding: 15px;
    }

    .modal-title {
        font-size: 16px;
    }
}