/* ============================================================
   nazly.com — Dark/cinematic portfolio stylesheet
   ============================================================ */

/* ── Design tokens ──────────────────────────────────────────────────────── */
:root {
    /* Colour palette */
    --c-bg:          #0a0a0a;       /* Near-black page background */
    --c-surface:     #111111;       /* Slightly lifted surfaces */
    --c-surface-2:   #181818;       /* Cards, inputs */
    --c-border:      #1e1e1e;       /* Subtle dividers */
    --c-text:        #dcdcdc;       /* Primary body text */
    --c-muted:       #787878;       /* De-emphasised text */
    --c-accent:      #c8a96e;       /* Warm gold — cinematic */
    --c-accent-dim:  rgba(200, 169, 110, 0.12); /* Accent tint for hover fills */

    /* Typography */
    --font-sans:  'Inter', system-ui, -apple-system, sans-serif;
    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;

    /* Layout */
    --nav-h:        60px;
    --gap-xs:       4px;
    --gap-sm:       8px;
    --gap-md:       1.5rem;
    --section-pad:  clamp(64px, 9vw, 128px);
    --content-max:  1400px;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    /* Offset anchors so fixed nav doesn't obscure section headings */
    scroll-padding-top: var(--nav-h);
}

body {
    background-color: var(--c-bg);
    color: var(--c-text);
    font-family: var(--font-sans);
    font-weight: 300;
    font-size: 1rem;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

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

ul, ol { list-style: none; }

/* ── Navigation ─────────────────────────────────────────────────────────── */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(1rem, 4vw, 3rem);
    background: rgba(10, 10, 10, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--c-border);
    transition: background 0.3s ease;
}

.site-nav.scrolled {
    background: rgba(10, 10, 10, 0.96);
}

.nav-logo {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--c-accent);
    transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.8; }

.site-nav ul {
    display: flex;
    gap: 2.25rem;
}

.site-nav ul a {
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--c-muted);
    transition: color 0.2s;
}
.site-nav ul a:hover { color: var(--c-text); }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
    position: relative;
    height: 100dvh;        /* Dynamic viewport height — accounts for mobile browser chrome */
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    isolation: isolate;
}

/* Background image layer */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: var(--hero-bg, none);
    background-size: cover;
    background-position: center center;
    filter: brightness(0.30) saturate(0.8);
    transform: scale(1.04);   /* Slight oversize — hides gap during subtle zoom */
    transition: transform 22s ease-out;
}

.hero:hover::before {
    transform: scale(1.08);   /* Slow Ken Burns drift on hover */
}

/* Gradient vignette over the background */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.55) 100%),
        linear-gradient(to bottom, rgba(0,0,0,0.25) 0%, transparent 40%, rgba(0,0,0,0.5) 100%);
}

.hero-content {
    position: relative;
    padding: 2rem clamp(1.5rem, 5vw, 3rem);
    max-width: 680px;
}

.hero-eyebrow {
    font-size: clamp(0.7rem, 1.5vw, 0.85rem);
    font-weight: 400;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--c-accent);
    margin-bottom: 1.25rem;
}

.hero-content h1 {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 10vw, 6.5rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: 0.04em;
    color: #ffffff;
    margin-bottom: 1.25rem;
}

.hero-sub {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(1rem, 2.5vw, 1.45rem);
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2.75rem;
    line-height: 1.5;
}

.hero-cta {
    display: inline-block;
    padding: 0.8rem 2.75rem;
    border: 1px solid var(--c-accent);
    color: var(--c-accent);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transition: background 0.25s ease, color 0.25s ease;
}

.hero-cta:hover,
.hero-cta:focus-visible {
    background: var(--c-accent);
    color: var(--c-bg);
    outline: none;
}

/* Animated scroll arrow */
.hero-scroll-hint {
    position: absolute;
    bottom: 2.25rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.scroll-arrow {
    display: block;
    width: 20px;
    height: 20px;
    border-right: 1.5px solid var(--c-accent);
    border-bottom: 1.5px solid var(--c-accent);
    transform: rotate(45deg);
    animation: scroll-bounce 2s ease-in-out infinite;
    opacity: 0.7;
}

@keyframes scroll-bounce {
    0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.7; }
    50%       { transform: rotate(45deg) translate(4px, 4px); opacity: 0.3; }
}

/* ── Photography ─────────────────────────────────────────────────────────── */
.photography {
    padding-top: var(--section-pad);
    padding-bottom: var(--section-pad);
    background: var(--c-bg);
}

.section-header {
    text-align: center;
    margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
    padding: 0 1rem;
}

.section-header h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.9rem, 4vw, 3rem);
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--c-text);
    position: relative;
    display: inline-block;
}

/* Decorative underline on section title */
.section-header h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background: var(--c-accent);
    margin: 0.75rem auto 0;
}

/* ─ Masonry grid (CSS columns — no JavaScript layout needed) ─ */
.masonry-grid {
    columns: 4 240px;
    column-gap: var(--gap-sm);
    padding: 0 clamp(8px, 2vw, 24px);
    max-width: var(--content-max);
    margin: 0 auto;
}

.masonry-item {
    display: block;
    break-inside: avoid;      /* Critical: prevents a photo splitting across columns */
    -webkit-column-break-inside: avoid;
    margin-bottom: var(--gap-sm);
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
    background: var(--c-surface);
    /* Subtle reveal as items enter the viewport */
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 0.4s ease;
    filter: brightness(0.88) saturate(0.95);
    will-change: transform;
}

.masonry-item:hover img,
.masonry-item:focus-visible img {
    transform: scale(1.045);
    filter: brightness(1.0) saturate(1.05);
}

.masonry-item:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}

/* Caption overlay — fades in on hover */
.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 0.9rem 0.75rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.85);
    opacity: 0;
    transform: translateY(3px);
    transition: opacity 0.32s ease, transform 0.32s ease;
    pointer-events: none;
}

.masonry-item:hover .photo-caption,
.masonry-item:focus-visible .photo-caption {
    opacity: 1;
    transform: translateY(0);
}

/* Photo count line below the grid */
.photo-count {
    text-align: center;
    margin-top: clamp(2rem, 4vw, 3.5rem);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--c-muted);
}

/* Empty state */
.photos-empty {
    text-align: center;
    padding: 5rem 2rem;
    font-style: italic;
    color: var(--c-muted);
    font-size: 1rem;
}

/* ── Responsive masonry column counts ────────────────────────────────────── */
@media (max-width: 1100px) { .masonry-grid { columns: 3 220px; } }
@media (max-width: 720px)  { .masonry-grid { columns: 2 160px; column-gap: var(--gap-xs); } }
@media (max-width: 380px)  { .masonry-grid { columns: 1; } }

/* ── About ──────────────────────────────────────────────────────────────── */
.about {
    padding: var(--section-pad) clamp(1.25rem, 6vw, 4rem);
    background: var(--c-surface);
    border-top: 1px solid var(--c-border);
}

.about-inner {
    max-width: 860px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2.5rem, 7vw, 6rem);
    align-items: start;
}

.bio h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.7rem, 3.5vw, 2.5rem);
    font-weight: 400;
    color: var(--c-text);
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.bio h2::after {
    content: '';
    display: block;
    width: 32px;
    height: 1px;
    background: var(--c-accent);
    margin-top: 0.65rem;
}

.bio p {
    color: var(--c-muted);
    font-size: 0.975rem;
    line-height: 1.85;
}

/* Professional link cards */
.link-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    /* Align visually with bio text (below the h2 + rule) */
    padding-top: 4rem;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--c-border);
    background: var(--c-bg);
    color: var(--c-muted);
    font-size: 0.82rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    transition:
        border-color 0.22s ease,
        color 0.22s ease,
        background 0.22s ease;
}

.link-card:hover,
.link-card:focus-visible {
    border-color: var(--c-accent);
    color: var(--c-accent);
    background: var(--c-accent-dim);
    outline: none;
}

.link-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.link-icon svg {
    width: 100%;
    height: 100%;
}

.link-label {
    white-space: nowrap;
}

@media (max-width: 680px) {
    .about-inner    { grid-template-columns: 1fr; }
    .link-grid      { padding-top: 0; }
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
    padding: 2rem 1.5rem;
    text-align: center;
    background: var(--c-bg);
    border-top: 1px solid var(--c-border);
    color: var(--c-muted);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

/* ── PhotoSwipe v5 — cinematic overrides ─────────────────────────────────── */
.pswp {
    --pswp-bg:                    #080808;
    --pswp-placeholder-color:     #111;
    --pswp-icon-color:            #c8a96e;
    --pswp-icon-color-secondary:  #555;
    --pswp-icon-stroke-color:     #c8a96e;
    --pswp-icon-stroke-width:     1.5px;
}

/* Caption element registered via JS */
.pswp__caption-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 1.5rem 1.25rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-align: center;
    pointer-events: none;
}

/* ── Focus ring (keyboard accessibility) ─────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 3px;
}

/* ── Utility: skip-to-content (accessibility) ────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 999;
    padding: 0.5rem 1rem;
    background: var(--c-accent);
    color: var(--c-bg);
    font-size: 0.85rem;
    font-weight: 500;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 1rem;
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    html                { scroll-behavior: auto; }
    .hero::before       { transition: none; }
    .hero:hover::before { transform: scale(1.04); }   /* No Ken Burns */
    .scroll-arrow       { animation: none; }
    .masonry-item img   { transition: filter 0.2s ease; }
    .photo-caption      { transition: opacity 0.2s ease; }
}
