/* xity.quest - Grainy Urban Portfolio */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --bg-violet: #141018;
    --tile-dark: #1C1820;
    --aurora-violet: #6040C0;
    --aurora-rose: #C04080;
    --aurora-amber: #E0A040;
    --grain-color: rgba(240, 232, 224, 0.04);
    --candle-glow: rgba(224, 160, 64, 0.15);
    --text-light: #F0E8E0;
    --text-body: #C8C0B8;
    --coord-purple: #A090F0;
}

body {
    background: var(--bg-violet);
    color: var(--text-light);
    font-family: 'Work Sans', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    font-weight: 400;
    overflow-x: hidden;
}

/* Grain Filter SVG */
.grain-filter {
    position: absolute;
    width: 0;
    height: 0;
}

/* Header */
.site-header {
    text-align: center;
    padding: 4rem 2rem 2rem;
}
.site-title {
    font-family: 'Abril Fatface', serif;
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    font-weight: 400;
    color: var(--text-light);
    opacity: 0;
    animation: fadeIn 0.6s ease forwards 0.3s;
}
@keyframes fadeIn { to { opacity: 1; } }
.site-sub {
    font-family: 'Azeret Mono', monospace;
    font-size: 0.8rem;
    color: var(--coord-purple);
    letter-spacing: 0.04em;
    margin-top: 0.5rem;
}

/* Aurora Divider */
.aurora-divider {
    height: 8px;
    background: linear-gradient(90deg, var(--aurora-violet), var(--aurora-rose), var(--aurora-amber));
    opacity: 0.6;
    animation: auroraFlash 15s ease-in-out infinite;
}
@keyframes auroraFlash {
    0%, 90%, 100% { opacity: 0.6; }
    95% { opacity: 1; }
}

/* Portfolio Grid */
.portfolio-grid {
    max-width: 1080px;
    margin: 0 auto;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    position: relative;
}

/* Candle Glow Points */
.candle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, var(--candle-glow), transparent);
    pointer-events: none;
    z-index: 0;
    animation: candlePulse 5s ease-in-out infinite;
}
.candle-1 { width: 80px; height: 80px; top: 0; left: 25%; animation-delay: 0s; }
.candle-2 { width: 60px; height: 60px; top: 30%; right: 25%; animation-delay: 1.2s; }
.candle-3 { width: 100px; height: 100px; bottom: 30%; left: 50%; animation-delay: 2.5s; }
.candle-4 { width: 70px; height: 70px; bottom: 5%; right: 10%; animation-delay: 3.8s; }
@keyframes candlePulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Tiles */
.tile {
    background: var(--tile-dark);
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease;
    filter: sepia(0.4) contrast(1.1);
}
.tile.visible {
    opacity: 1;
    transform: scale(1);
    filter: sepia(0.4) contrast(1.1);
}
.tile:hover {
    transform: translateY(-4px) scale(1);
    box-shadow: 0 8px 24px rgba(96, 64, 192, 0.2);
}

.tile-hero { grid-column: span 2; grid-row: span 2; }
.tile-wide { grid-column: span 2; }
.tile-standard { grid-column: span 1; }

/* Grain Overlay */
.tile-grain {
    position: absolute;
    inset: -10%;
    filter: url(#grain);
    opacity: 0.15;
    pointer-events: none;
    z-index: 2;
    animation: grainShift 10s linear infinite;
}
@keyframes grainShift {
    0% { transform: translateX(0); }
    100% { transform: translateX(10px); }
}

/* Vignette */
.tile::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(20, 16, 24, 0.6) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Tile Content */
.tile-content {
    position: relative;
    z-index: 3;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 200px;
}
.tile-hero .tile-content { min-height: 300px; }
.tile-coord {
    font-family: 'Azeret Mono', monospace;
    font-size: 0.8rem;
    color: var(--coord-purple);
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 0.5rem;
}
.tile-title {
    font-family: 'Abril Fatface', serif;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    font-weight: 400;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}
.tile-body {
    font-family: 'Work Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--text-body);
    line-height: 1.7;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 3rem 2rem;
}
.footer-text {
    font-family: 'Azeret Mono', monospace;
    font-size: 0.8rem;
    color: var(--coord-purple);
    letter-spacing: 0.04em;
}

@media (max-width: 768px) {
    .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
    .tile-hero { grid-column: span 2; grid-row: span 1; }
    .tile-wide { grid-column: span 2; }
}
@media (max-width: 480px) {
    .portfolio-grid { grid-template-columns: 1fr; }
    .tile-hero, .tile-wide { grid-column: span 1; }
}
