/* Using High-Quality Image-Based Custom Text System */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: #f9f9f9;
    color: #1a1a1a;
    line-height: 1.6;
    overflow-x: hidden;
}

/* High-Quality Image-Based Custom Text */
.hq-text-container {
    color: inherit;
}

.hq-letter-img {
    transition: all 0.3s ease;
    filter: brightness(1) contrast(1);
}

.hq-text-container:hover .hq-letter-img {
    filter: brightness(0.9) contrast(1.1) drop-shadow(2px 2px 4px rgba(0,0,0,0.2));
}

/* Inherit color styling from parent elements */
.hero-title {
    color: #1a1a1a;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.1);
}

.hero-subtitle {
    color: #1a1a1a;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

.custom-font-small {
    color: #333;
}

/* Text behavior styles */
.hq-text-hero {
    margin-bottom: 40px;
    text-align: center;
}

.hq-text-large {
    margin-bottom: 20px;
    text-align: center;
}

.hq-text-small {
    display: inline;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, #fff 0%, #f0f0f0 50%, #fff 100%);
    overflow: hidden;
}

.hero-bg-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    background:
        radial-gradient(circle at 20% 50%, #000 2px, transparent 2px),
        radial-gradient(circle at 80% 50%, #000 1px, transparent 1px),
        linear-gradient(45deg, transparent 40%, rgba(0,0,0,0.1) 50%, transparent 60%);
    background-size: 200px 200px, 100px 100px, 50px 50px;
    animation: textureMove 20s linear infinite;
}

@keyframes textureMove {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(-50px) translateY(-50px); }
}

.hero-content {
    text-align: center;
    z-index: 2;
    position: relative;
    top: -15%;
}

.hero-title {
    margin-bottom: 40px;
    text-align: center;
}

.hero-subtitle {
    margin-bottom: 20px;
    text-align: center;
}

@keyframes letterGlow {
    0% { filter: contrast(1.2) brightness(0.8) drop-shadow(0 0 10px rgba(0,0,0,0.3)); }
    100% { filter: contrast(1.2) brightness(0.6) drop-shadow(0 0 20px rgba(0,0,0,0.6)); }
}

/* Symmetrical Gallery Rows in Hero */
.hero-gallery {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gallery-row {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.hero-nft {
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.95);
    border: 2px solid #333;
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    animation: floating 6s ease-in-out infinite;
}

.hero-nft:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    border-color: #666;
}

.hero-nft img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    filter: grayscale(100%) contrast(1.2);
    transition: filter 0.3s ease;
}

.hero-nft:hover img {
    filter: grayscale(0%) contrast(1.1);
}

/* Staggered animation delays for gallery rows */
.gallery-row-1 .hero-nft:nth-child(1) { animation-delay: -1s; }
.gallery-row-1 .hero-nft:nth-child(2) { animation-delay: -1.5s; }
.gallery-row-1 .hero-nft:nth-child(3) { animation-delay: -2s; }
.gallery-row-1 .hero-nft:nth-child(4) { animation-delay: -2.5s; }
.gallery-row-1 .hero-nft:nth-child(5) { animation-delay: -3s; }
.gallery-row-1 .hero-nft:nth-child(6) { animation-delay: -3.5s; }
.gallery-row-1 .hero-nft:nth-child(7) { animation-delay: -4s; }

.gallery-row-2 .hero-nft:nth-child(1) { animation-delay: -4.5s; }
.gallery-row-2 .hero-nft:nth-child(2) { animation-delay: -5s; }
.gallery-row-2 .hero-nft:nth-child(3) { animation-delay: -5.5s; }
.gallery-row-2 .hero-nft:nth-child(4) { animation-delay: -6s; }
.gallery-row-2 .hero-nft:nth-child(5) { animation-delay: -6.5s; }
.gallery-row-2 .hero-nft:nth-child(6) { animation-delay: -7s; }
.gallery-row-2 .hero-nft:nth-child(7) { animation-delay: -7.5s; }

@keyframes floating {
    0%, 100% { transform: translateY(0px); }
    33% { transform: translateY(-8px); }
    66% { transform: translateY(4px); }
}


/* Custom inline letters in text - now just inherits normal text behavior */
.custom-inline {
    /* No special styling needed - behaves like normal text */
}

/* NFT Generator Section */
.nft-generator {
    padding: 100px 0;
    background: linear-gradient(135deg, #f0f0f0 0%, #fff 50%, #f0f0f0 100%);
    border-top: 3px solid #ccc;
}

.nft-generator h2 {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 60px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #1a1a1a;
}

.generator-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.generator-controls {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.letter-selectors h3,
.trait-selectors h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.letter-inputs {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.letter-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.letter-selector label {
    font-weight: bold;
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.letter-dropdown {
    width: 80px;
    height: 50px;
    font-size: 1.5rem;
    text-align: center;
    background: #fff;
    border: 2px solid #333;
    border-radius: 4px;
    color: #333;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.letter-dropdown:focus {
    outline: none;
    border-color: #666;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.trait-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.trait-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trait-selector label {
    font-weight: bold;
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.trait-dropdown {
    padding: 8px 12px;
    background: #fff;
    border: 2px solid #ccc;
    border-radius: 4px;
    color: #333;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
}

.trait-dropdown:focus {
    outline: none;
    border-color: #666;
    box-shadow: 0 0 8px rgba(0,0,0,0.1);
}

.generator-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.generator-btn {
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

.generator-btn.primary {
    background: #333;
    color: #fff;
    border: 2px solid #333;
}

.generator-btn.primary:hover {
    background: #555;
    border-color: #555;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.generator-btn.secondary {
    background: transparent;
    color: #333;
    border: 2px solid #333;
}

.generator-btn.secondary:hover {
    background: #333;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.generator-preview {
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-container {
    position: relative;
    background: #fff;
    border: 3px solid #333;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.nft-canvas {
    display: block;
    width: 400px;
    height: 400px;
    max-width: 100%;
    border-radius: 4px;
    background: #f9f9f9;
    border: 1px solid #ddd;
}

.preview-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.preview-loading.show {
    display: flex;
}

.loading-text {
    font-size: 1.2rem;
    font-weight: bold;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Responsive Design for Generator */
@media (max-width: 1024px) {
    .generator-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

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

@media (max-width: 900px) {
    .trait-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nft-generator {
        padding: 60px 0;
    }

    .nft-generator h2 {
        font-size: 2rem;
    }

    .letter-inputs {
        flex-direction: column;
        align-items: center;
    }

    .trait-grid {
        grid-template-columns: 1fr;
    }

    .generator-actions {
        flex-direction: column;
        align-items: center;
    }
}

/* Narrative Section */
.narrative {
    padding: 100px 0;
    background: #fff;
    position: relative;
}

.narrative::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 98px,
            rgba(0,0,0,0.02) 100px
        );
}

.narrative-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.2rem;
    line-height: 1.8;
    position: relative;
    z-index: 2;
}

.narrative-content p {
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.5);
}

.narrative-ending {
    font-size: 1.4rem;
    font-weight: bold;
    text-align: center;
    border: 2px solid #333;
    padding: 30px;
    background: rgba(0,0,0,0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
        padding: 15px 30px;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .custom-letter {
        width: 80px;
        height: 80px;
    }

    .hero-letters {
        gap: 20px;
    }

    .narrative-content {
        font-size: 1rem;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

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