/* ===== BASE & RESET ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #FAF7F2;
    --bg-warm: #F5F0E8;
    --bg-line: #e6dfd6;
    --text: #1A1A1A;
    --text-light: #6B6460;
    --accent: #3D3530;
    --border: #E0DAD2;
    --card-bg: #FFFFFF;
    --tag-bg: #EDEAE5;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Montserrat', sans-serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text);
    background-color: var(--bg);
    --bg-angle: -14deg;
    --bg-shift-x: 0px;
    --bg-shift-y: 0px;
    position: relative;
    isolation: isolate;
    line-height: 1.7;
    font-weight: 300;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    inset: -25vh -20vw;
    z-index: -1;
    pointer-events: none;
    opacity: 0.85;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1800' height='1400' viewBox='0 0 1800 1400'%3E%3Cg fill='none' stroke='%23e6dfd6' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M-220 180C40 120 200 180 420 250s380 90 600 30 420-90 690-25 390 70 530 30'/%3E%3Cpath d='M-240 250C20 190 180 250 400 320s380 90 600 30 420-90 690-25 390 70 530 30'/%3E%3Cpath d='M-260 320C0 260 160 320 380 390s380 90 600 30 420-90 690-25 390 70 530 30'/%3E%3Cpath d='M-280 390C-20 330 140 390 360 460s380 90 600 30 420-90 690-25 390 70 530 30'/%3E%3Cpath d='M-300 690C-40 630 120 690 340 760s380 90 600 30 420-90 690-25 390 70 530 30'/%3E%3Cpath d='M-320 760C-60 700 100 760 320 830s380 90 600 30 420-90 690-25 390 70 530 30'/%3E%3Cpath d='M-340 830C-80 770 80 830 300 900s380 90 600 30 420-90 690-25 390 70 530 30'/%3E%3Cpath d='M-360 900C-100 840 60 900 280 970s380 90 600 30 420-90 690-25 390 70 530 30'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    transform: translate(var(--bg-shift-x), var(--bg-shift-y)) rotate(var(--bg-angle));
    transform-origin: center;
}

body.page-home {
    --bg-angle: -16deg;
    --bg-shift-x: -5vw;
    --bg-shift-y: -2vh;
}

body.page-gallery {
    --bg-angle: -11deg;
    --bg-shift-x: 4vw;
    --bg-shift-y: -8vh;
}

body.page-authors {
    --bg-angle: -19deg;
    --bg-shift-x: 6vw;
    --bg-shift-y: 4vh;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ===== NAVIGATION ===== */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 247, 242, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-toggle {
    display: none;
    border: 0;
    background: transparent;
    width: 42px;
    height: 42px;
    padding: 0;
    color: var(--accent);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 1.5px;
    background: currentColor;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav.menu-open .nav-toggle span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.nav.menu-open .nav-toggle span:nth-child(2) {
    opacity: 0;
}

.nav.menu-open .nav-toggle span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

.nav-link {
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-light);
    padding: 0.25rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--text);
    transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
}

.nav-link.active::after,
.nav-link:hover::after {
    width: 100%;
}

/* ===== HERO (index.html) ===== */
.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem 3rem;
    max-width: 680px;
    margin: 0 auto;
    position: relative;
    animation: fadeUp 0.8s ease both;
}

.hero-decoration {
    position: absolute;
    top: -1rem;
    right: -6rem;
    width: 200px;
    height: 200px;
    color: var(--border);
    opacity: 0.5;
    animation: spinSlow 60s linear infinite;
    pointer-events: none;
}

.hero-orbit {
    width: 100%;
    height: 100%;
}

.hero-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 3.2rem;
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.hero-title-accent {
    font-style: italic;
    font-weight: 400;
    color: var(--text-light);
}

.hero-divider {
    width: 48px;
    height: 1px;
    background: var(--border);
    margin: 0 auto 1.5rem;
}

.hero-description {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1rem;
    max-width: 520px;
}

.hero-subdesc {
    font-size: 0.85rem;
    color: var(--text-light);
    opacity: 0.7;
    line-height: 1.7;
    margin-bottom: 2.5rem;
    max-width: 480px;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.8rem;
    border: 1px solid var(--accent);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    transition: all 0.3s ease;
    margin-bottom: 3rem;
}

.hero-cta:hover {
    background: var(--accent);
    color: var(--bg);
}

.hero-cta svg {
    transition: transform 0.3s ease;
}

.hero-cta:hover svg {
    transform: translateX(4px);
}

.hero-contact {
    margin-top: -1.4rem;
    margin-bottom: 2.2rem;
    max-width: 460px;
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--text-light);
    opacity: 0.88;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-light);
}

.stat-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
}

/* ===== PAGE HEADER (gallery & authors) ===== */
.page {
    flex: 1;
    padding: 3rem 3rem 4rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    animation: fadeUp 0.6s ease both;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.page-title {
    font-family: var(--font-display);
    font-size: 2.8rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ===== GALLERY FILTERS ===== */
.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}

.filter-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 0.45rem 1.1rem;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.25s ease;
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--text);
}

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

/* ===== GALLERY GRID ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.gallery-grid--photos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeUp 0.5s ease both;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
}

.card-image {
    aspect-ratio: 4 / 3;
    background: var(--bg-warm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image--photo {
    aspect-ratio: 4 / 5;
    background: #f1ebe3;
}

.card-image--photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card--photo .card-body {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.card--photo .card-author {
    font-size: 0.82rem;
}

.card-placeholder {
    color: var(--text-light);
    opacity: 0.4;
}

.card-body {
    padding: 1.25rem;
}

.card-tag {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-light);
    background: var(--tag-bg);
    padding: 0.2rem 0.6rem;
    display: inline-block;
    margin-bottom: 0.6rem;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.5rem;
}

.card-author {
    font-size: 0.78rem;
    color: var(--text-light);
}

/* ===== AUTHORS GRID ===== */
.authors-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.author-card {
    display: flex;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeUp 0.5s ease both;
}

.author-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.author-avatar {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    opacity: 0.6;
}

.author-info {
    min-width: 0;
}

.author-name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.author-course {
    font-size: 0.75rem;
    color: var(--text-light);
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.author-bio {
    font-size: 0.82rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 0.6rem;
}

.author-link {
    color: var(--accent);
    border-bottom: 1px solid rgba(61, 53, 48, 0.25);
    transition: border-color 0.25s ease, color 0.25s ease;
}

.author-link:hover {
    color: var(--text);
    border-color: var(--text);
}

.author-projects {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.6;
}

.author-note {
    margin-top: 0.55rem;
    font-size: 0.72rem;
    color: var(--text-light);
    font-style: italic;
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-light);
    letter-spacing: 0.04em;
}

.footer-contact {
    margin-top: 0.45rem;
    font-size: 0.72rem;
    opacity: 0.82;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* staggered card animation */
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }
.card:nth-child(7) { animation-delay: 0.35s; }
.card:nth-child(8) { animation-delay: 0.4s; }
.card:nth-child(9) { animation-delay: 0.45s; }

.author-card:nth-child(1) { animation-delay: 0.05s; }
.author-card:nth-child(2) { animation-delay: 0.1s; }
.author-card:nth-child(3) { animation-delay: 0.15s; }
.author-card:nth-child(4) { animation-delay: 0.2s; }
.author-card:nth-child(5) { animation-delay: 0.25s; }
.author-card:nth-child(6) { animation-delay: 0.3s; }
.author-card:nth-child(7) { animation-delay: 0.35s; }
.author-card:nth-child(8) { animation-delay: 0.4s; }
.author-card:nth-child(9) { animation-delay: 0.45s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .authors-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .nav {
        display: grid;
        grid-template-columns: 42px 1fr 42px;
        align-items: center;
        padding: 1rem 1.5rem;
        gap: 0.5rem;
    }

    .nav-toggle {
        display: inline-flex;
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
    }

    .nav-logo {
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
        text-align: center;
        font-size: 1.05rem;
        letter-spacing: 0.06em;
    }

    .nav-links {
        grid-column: 1 / -1;
        grid-row: 2;
        display: grid;
        gap: 0.8rem;
        justify-items: center;
        padding-top: 0.9rem;
        margin-top: 0.5rem;
        border-top: 1px solid var(--border);
    }

    .nav-links[hidden] {
        display: none;
    }

    .nav-link {
        font-size: 0.74rem;
    }

    .hero {
        padding: 3rem 1.5rem 2rem;
    }
    .hero-title {
        font-size: 2.2rem;
    }
    .hero-decoration {
        display: none;
    }
    .hero-stats {
        gap: 1.2rem;
    }
    .hero-contact {
        margin-top: -1rem;
        margin-bottom: 1.8rem;
        font-size: 0.75rem;
    }
    .page {
        padding: 2rem 1.5rem 3rem;
    }
    .page-title {
        font-size: 2rem;
    }
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    .gallery-grid--photos {
        grid-template-columns: 1fr;
    }
    .gallery-filters {
        gap: 0.35rem;
    }
    .filter-btn {
        font-size: 0.68rem;
        padding: 0.35rem 0.8rem;
    }
    .author-card {
        padding: 1.15rem;
    }
}
