/* =============================================
   PRAJWOL WAIJU — Sound Engineer Portfolio
   Custom Styles
   ============================================= */

/* CSS VARIABLES */
:root {
    --ink: #0d0d0d;
    --paper: #f5f0e8;
    --accent: #c8a96e;
    --accent-dark: #9a7840;
    --muted: #7a7060;
    --rule: #d4c9b0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--paper);
    color: var(--ink);
    font-family: 'Barlow', sans-serif;
    font-weight: 300;
    overflow-x: hidden;
}

/* NOISE TEXTURE OVERLAY */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 999;
    opacity: 0.5;
}

/* =============================================
   NAV
   ============================================= */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(13, 13, 13, 0.92);
    backdrop-filter: blur(8px);
}

.nav-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--paper);
    letter-spacing: 0.05em;
}

.nav-mono {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    color: var(--accent);
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

/* =============================================
   HERO
   ============================================= */
.hero-bg {
    background-color: var(--ink);
    position: relative;
    overflow: hidden;
}

.hero-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* =============================================
   ANIMATED SOUNDWAVE
   ============================================= */
.soundwave {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 48px;
}

.soundwave span {
    display: block;
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
    animation: wave 1.4s ease-in-out infinite;
    opacity: 0.7;
}

.soundwave span:nth-child(1) {
    height: 12px;
    animation-delay: 0s;
}

.soundwave span:nth-child(2) {
    height: 28px;
    animation-delay: 0.1s;
}

.soundwave span:nth-child(3) {
    height: 40px;
    animation-delay: 0.2s;
}

.soundwave span:nth-child(4) {
    height: 22px;
    animation-delay: 0.3s;
}

.soundwave span:nth-child(5) {
    height: 44px;
    animation-delay: 0.4s;
}

.soundwave span:nth-child(6) {
    height: 18px;
    animation-delay: 0.5s;
}

.soundwave span:nth-child(7) {
    height: 36px;
    animation-delay: 0.6s;
}

.soundwave span:nth-child(8) {
    height: 48px;
    animation-delay: 0.7s;
}

.soundwave span:nth-child(9) {
    height: 30px;
    animation-delay: 0.8s;
}

.soundwave span:nth-child(10) {
    height: 20px;
    animation-delay: 0.9s;
}

.soundwave span:nth-child(11) {
    height: 42px;
    animation-delay: 1.0s;
}

.soundwave span:nth-child(12) {
    height: 14px;
    animation-delay: 1.1s;
}

@keyframes wave {

    0%,
    100% {
        transform: scaleY(1);
        opacity: 0.7;
    }

    50% {
        transform: scaleY(0.35);
        opacity: 0.3;
    }
}

/* =============================================
   CHAPTER SECTIONS
   ============================================= */
.chapter-rule {
    width: 64px;
    height: 2px;
    background: var(--accent);
    margin-bottom: 1.5rem;
}

.chapter-number {
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.chapter-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--ink);
}

.chapter-body {
    font-family: 'Barlow', sans-serif;
    font-weight: 300;
    font-size: 1.05rem;
    line-height: 1.85;
    color: #3a3328;
}

/* Alternating two-column layout */
.chapter-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-bottom: 1px solid var(--rule);
}

.chapter-card.reverse {
    direction: rtl;
}

.chapter-card.reverse>* {
    direction: ltr;
}

.chapter-text-block {
    padding: 5rem 4rem;
}

.chapter-visual-block {
    position: relative;
    overflow: hidden;
    min-height: 420px;
    background: var(--ink);
}

.chapter-visual-block img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.55;
    transition: opacity 0.4s, transform 0.5s;
}

.chapter-card:hover .chapter-visual-block img {
    opacity: 0.7;
    transform: scale(1.04);
}

.year-badge {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.35rem 0.85rem;
    background: rgba(13, 13, 13, 0.6);
}

/* =============================================
   GALLERY
   ============================================= */
.gallery-section {
    background: var(--ink);
    padding: 5rem 0;
}

.gallery-heading {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--paper);
}

.gallery-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    color: var(--muted);
    letter-spacing: 0.3em;
}

.gallery-header {
    display: flex;
    align-items: baseline;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
    gap: 6px;
}

.gallery-grid .img-tall {
    grid-row: span 2;
}

.gallery-img {
    overflow: hidden;
    background: var(--ink);
    aspect-ratio: 4/3;
}

.gallery-img.tall {
    aspect-ratio: unset;
    min-height: 500px;
}

.gallery-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.75;
    transition: opacity 0.4s, transform 0.5s;
    display: block;
}

.gallery-img:hover img {
    opacity: 1;
    transform: scale(1.06);
}

/* =============================================
   FOOTER
   ============================================= */
.footer-bg {
    background: var(--ink);
    color: var(--paper);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.footer-heading {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--paper);
    line-height: 1.1;
}

.footer-subtext {
    font-family: 'Barlow', sans-serif;
    font-weight: 300;
    font-size: 0.95rem;
    color: var(--muted);
    margin-top: 1.2rem;
    line-height: 1.8;
    max-width: 340px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    justify-content: center;
    padding-top: 0.5rem;
}

.footer-bottom {
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid #2a2520;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom span {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    color: var(--muted);
    letter-spacing: 0.25em;
}

/* Social links */
.social-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--rule);
    text-decoration: none;
    font-family: 'DM Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    transition: color 0.2s;
}

.social-link:hover {
    color: var(--accent);
}

.social-link .icon-circle {
    width: 40px;
    height: 40px;
    border: 1px solid currentColor;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1rem;
    transition: background 0.2s, color 0.2s;
}

.social-link:hover .icon-circle {
    background: var(--accent);
    color: var(--ink);
    border-color: var(--accent);
}

/* =============================================
   HERO INLINE ELEMENTS (utility classes)
   ============================================= */
.hero-tagline {
    font-family: 'Barlow', sans-serif;
    font-weight: 300;
    font-size: 1.1rem;
    color: #a09880;
    max-width: 480px;
    margin-top: 2rem;
    line-height: 1.8;
}

.hero-rule-line {
    width: 80px;
    height: 1px;
    background: var(--accent);
}

.hero-year {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    color: var(--muted);
    letter-spacing: 0.3em;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3rem, 9vw, 8rem);
    font-weight: 900;
    line-height: 0.92;
    color: var(--paper);
    letter-spacing: -0.02em;
}

/* =============================================
   SCROLL FADE-IN ANIMATION
   ============================================= */
.fade-up {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
    .chapter-card {
        grid-template-columns: 1fr;
        direction: ltr !important;
    }

    .chapter-text-block {
        padding: 3rem 2rem;
    }

    .chapter-visual-block {
        min-height: 260px;
    }

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

    .gallery-grid .img-tall {
        grid-row: span 1;
    }

    .gallery-img.tall {
        aspect-ratio: 4/3;
        min-height: unset;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .nav-inner {
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 560px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}