/* ==========================================================================
   Shivangi Kashyap | Photography Portfolio
   Layout: slim side rail that expands on hover, multi-page site
   ========================================================================== */

/* CSS Reset & Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #0f0f0f;
    --card-bg: #1a1a1a;
    --text-primary: #f3f3f3;
    --text-secondary: #9a9a9a;
    --accent-color: #d4af37;
    --line: rgba(255, 255, 255, 0.08);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --transition: all 0.4s var(--ease);

    /* Side navigation sizes */
    --rail-w: 56px;   /* width of the always-visible slim rail */
    --nav-w: 340px;   /* width when expanded */
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* leave room for the slim rail; the expanded nav overlays the page */
    padding-left: var(--rail-w);
}

main {
    flex: 1;
}

h1, h2, h3, .rail-name, .menu > li > a {
    font-family: 'Playfair Display', serif;
}

img {
    max-width: 100%;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ==========================================================================
   Side navigation
   ========================================================================== */
.side-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rail-w);
    z-index: 1000;
    overflow: hidden;
    background-color: rgba(12, 12, 12, 0.94);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--line);
    transition: width 0.55s var(--ease), box-shadow 0.55s var(--ease);
}

/* Expanded: mouse hover, keyboard focus, or tapped open on touch screens */
.side-nav:is(:hover, .open, :has(:focus-visible)) {
    width: var(--nav-w);
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.55);
}

/* --- The always-visible rail --- */
.rail {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rail-w);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 1.75rem 0 2rem;
}

.rail-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.9rem;
    background: none;
    border: 0;
    cursor: pointer;
}

.tick {
    display: block;
    width: 14px;
    height: 1px;
    background-color: var(--text-secondary);
    transition: width 0.4s var(--ease), background-color 0.4s var(--ease);
}

.tick.is-active {
    width: 26px;
    background-color: var(--accent-color);
}

.side-nav:is(:hover, .open, :has(:focus-visible)) .tick:not(.is-active) {
    width: 20px;
}

.rail-name {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.05rem;
    letter-spacing: 0.12em;
    white-space: nowrap;
    transition: color 0.3s var(--ease);
}

.rail-name:hover {
    color: var(--text-primary);
}

/* --- The expanding panel --- */
.panel {
    position: absolute;
    top: 0;
    left: var(--rail-w);
    bottom: 0;
    width: calc(var(--nav-w) - var(--rail-w));
    padding: 3rem 2rem 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0s linear 0.3s;
}

.side-nav:is(:hover, .open, :has(:focus-visible)) .panel {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.35s ease 0.12s, visibility 0s;
}

.menu,
.submenu,
.panel-links {
    list-style: none;
}

.menu {
    margin: auto 0;
}

.menu > li {
    margin-bottom: 1.1rem;
    opacity: 0;
    transform: translateX(-16px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.side-nav:is(:hover, .open, :has(:focus-visible)) .menu > li {
    opacity: 1;
    transform: none;
    transition: opacity 0.5s ease, transform 0.6s var(--ease);
    transition-delay: calc(0.12s + var(--i) * 0.06s);
}

.menu > li > a {
    display: inline-block;
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.25;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s var(--ease);
}

.menu > li > a:hover,
.menu > li > a.is-section {
    color: var(--text-primary);
}

.menu a[aria-current="page"] {
    color: var(--accent-color);
}

.submenu {
    margin: 0.5rem 0 0.6rem 0.15rem;
    padding-left: 1rem;
    border-left: 1px solid var(--line);
}

.submenu a {
    display: inline-block;
    padding: 0.2rem 0;
    font-size: 0.98rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s var(--ease);
}

.submenu a:hover {
    color: var(--text-primary);
}

.panel-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.panel-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.3s var(--ease);
}

.panel-links a:hover {
    color: var(--accent-color);
}

/* Keyboard focus */
.side-nav a:focus-visible,
.rail-toggle:focus-visible,
.text-link:focus-visible,
.cover:focus-visible,
.category-switch a:focus-visible,
.gallery-item:focus-visible,
.email-btn:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
}

/* Dims the page while the nav is open */
.nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 900;
    background-color: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s var(--ease);
}

.side-nav:is(:hover, .open, :has(:focus-visible)) + .nav-scrim {
    opacity: 1;
}

.side-nav.open + .nav-scrim {
    pointer-events: auto;
}

/* ==========================================================================
   Home
   ========================================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 2rem;
    background: radial-gradient(circle at center, #1f1f1f 0%, var(--bg-color) 70%);
}

.hero-content .subtitle {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.85rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 400;
    max-width: 800px;
    line-height: 1.2;
}

.section {
    padding: 6rem 0 7rem;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.section-head h2 {
    font-size: 2.2rem;
    font-weight: 400;
}

.text-link {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 2px;
    transition: var(--transition);
}

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

/* ==========================================================================
   Inner page header (Portfolio, categories, About, Contact)
   ========================================================================== */
.page-header {
    padding-top: 7rem;
    padding-bottom: 3.5rem;
}

.crumb {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.crumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.crumb a:hover {
    color: var(--accent-color);
}

.page-header h1 {
    font-size: clamp(2.6rem, 5.5vw, 4.5rem);
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: 1.25rem;
}

.page-header .intro {
    max-width: 60ch;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ==========================================================================
   Portfolio overview: three category covers
   ========================================================================== */
.covers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding-bottom: 7rem;
}

.cover {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 8px;
    background-color: var(--card-bg);
    color: inherit;
    text-decoration: none;
}

.cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.9s var(--ease);
}

.cover:hover img {
    transform: scale(1.05);
}

.cover-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 5rem 1.75rem 1.75rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88), transparent);
}

.cover-text h2 {
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 0.35rem;
}

.cover-text p {
    color: #c9c9c9;
    font-size: 0.95rem;
}

.cover-count {
    display: block;
    margin-top: 0.8rem;
    color: var(--accent-color);
    font-size: 0.85rem;
}

/* ==========================================================================
   Gallery (category pages + home). Columns keep each photo's own proportions.
   ========================================================================== */
.gallery {
    column-width: 320px;
    column-gap: 1.5rem;
}

.gallery-item {
    position: relative;
    display: block;
    break-inside: avoid;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--card-bg);
    cursor: pointer;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.6s var(--ease);
}

.gallery-item:hover img {
    transform: scale(1.04);
}

.gallery-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem 1.5rem 1.25rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .overlay,
.gallery-item:focus-visible .overlay {
    opacity: 1;
}

.gallery-item .title {
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Other categories, shown at the foot of each category page */
.category-switch {
    padding-top: 5rem;
    padding-bottom: 7rem;
}

.category-switch h2 {
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.category-switch ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 3rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.category-switch a {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.category-switch a:hover {
    color: var(--accent-color);
}

/* ==========================================================================
   About
   ========================================================================== */
.about-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
    padding-bottom: 5rem;
}

.about-image img {
    width: 100%;
    border-radius: 8px;
    filter: grayscale(20%);
    aspect-ratio: 4 / 5;
    object-fit: cover;
    display: block;
}

.about-text h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
    max-width: 60ch;
}

.about-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    padding-top: 3.5rem;
    padding-bottom: 7rem;
    border-top: 1px solid var(--line);
}

.about-details h2 {
    font-size: 1.7rem;
    font-weight: 400;
    margin-bottom: 1rem;
}

.about-details p {
    color: var(--text-secondary);
    max-width: 60ch;
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    padding-bottom: 7rem;
    align-items: start;
}

.contact-info p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 44ch;
}

.email-btn {
    display: inline-block;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 500;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 4px;
    transition: var(--transition);
}

.email-btn:hover {
    color: var(--accent-color);
}

.contact__list {
    list-style: none;
    margin-top: 3rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.contact__list .avatar {
    border-radius: 50%;
    display: block;
    width: 72px;
    height: 72px;
    object-fit: cover;
}

.contact__list a {
    display: block;
    transition: var(--transition);
}

.contact__list a:hover {
    transform: translateY(-3px);
}

.contact__list a img {
    display: block;
}

.contact-form {
    display: grid;
    gap: 1.4rem;
}

.field label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.field input,
.field textarea {
    width: 100%;
    background-color: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.85rem 1rem;
    color: var(--text-primary);
    font: inherit;
    transition: border-color 0.3s var(--ease);
}

.field textarea {
    min-height: 170px;
    resize: vertical;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.btn {
    justify-self: start;
    background-color: var(--text-primary);
    color: var(--bg-color);
    border: 1px solid var(--text-primary);
    border-radius: 30px;
    padding: 0.75rem 1.9rem;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn:hover {
    background-color: transparent;
    color: var(--text-primary);
}

.form-note {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lightbox {
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.close-lightbox {
    position: absolute;
    top: 2rem;
    right: 2.5rem;
    color: var(--text-primary);
    font-size: 2.5rem;
    cursor: pointer;
    font-weight: 300;
    transition: var(--transition);
}

.close-lightbox:hover {
    color: var(--accent-color);
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-top: 1px solid var(--line);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
/* Touch screens have no hover, so the overlay titles are always visible */
@media (hover: none) {
    .gallery-item .overlay {
        opacity: 1;
    }
}

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

    .cover {
        aspect-ratio: 16 / 10;
    }

    .about-container,
    .about-details,
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 700px) {
    :root {
        --rail-w: 44px;
        --nav-w: min(88vw, 340px);
    }

    .container {
        padding: 0 1.25rem;
    }

    .page-header {
        padding-top: 5rem;
    }

    .menu > li > a {
        font-size: 1.7rem;
    }

    .gallery {
        column-width: 240px;
        column-gap: 1rem;
    }

    .gallery-item {
        margin-bottom: 1rem;
    }

    .rail-name {
        font-size: 0.95rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
        scroll-behavior: auto !important;
    }
}
