/* ============================================
   Template: portfolio-creative  (DEMO skin — "Selma Nordbø")
   Image-forward creative portfolio for a freelance photographer.
   Codecraft Web demo — fictional persona. Understated chrome so the
   photography leads. To re-theme a client: swap the :root palette.
   ============================================ */

:root {
    --bg-primary: #faf9f7;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --border: #e9e6e0;
    --border-light: #ddd8cf;
    --text-primary: #1a1714;
    --text-secondary: #4a4540;
    --text-muted: #8a8379;
    --accent: #b08968;
    --accent-hover: #977254;
    --accent-glow: rgba(176, 137, 104, 0.10);
    --accent-secondary: #1a1714;
    --gradient-accent: linear-gradient(135deg, #b08968, #8a6d52);
    --shadow-sm: 0 1px 3px rgba(26, 23, 20, 0.05), 0 1px 2px rgba(26, 23, 20, 0.04);
    --shadow-md: 0 18px 50px rgba(26, 23, 20, 0.12);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    --radius: 4px;
    --radius-sm: 3px;
    --radius-lg: 6px;
    --transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1280px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 72px;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    padding-bottom: 40px; /* room for the fixed demo bar */
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 32px;
}

/* ---- Navigation (minimal, transparent) ---- */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

#navbar.scrolled {
    border-bottom-color: var(--border);
    background: rgba(250, 249, 247, 0.86);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-logo {
    display: flex;
    flex-direction: column;
    line-height: 1;
    z-index: 1001;
}

.logo-name {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: 0.01em;
    color: var(--text-primary);
}

.logo-sub {
    font-size: 0.62rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.28em;
    margin-top: 3px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 34px;
}

.nav-links a {
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-secondary);
    transition: color var(--transition);
    position: relative;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width var(--transition);
}

.nav-links a:hover::after { width: 100%; }

.lang-toggle {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-toggle:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.lang-toggle .lang-flag.active { color: var(--accent); }
.lang-divider { color: var(--border-light); font-weight: 300; }

.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.nav-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
    border-radius: 2px;
}

.nav-hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ---- Placeholder image blocks ---- */
.img-ph {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: linear-gradient(150deg, #efe9e1 0%, #e4dacd 45%, #d8cabb 100%);
    color: #8a6d52;
    overflow: hidden;
}

/* soft second tint variants so the wall isn't monotone */
.img-ph.tint-a { background: linear-gradient(155deg, #ece3d8 0%, #ddd0c0 100%); }
.img-ph.tint-b { background: linear-gradient(150deg, #e8ddd0 0%, #d3c3b0 100%); }
.img-ph.tint-c { background: linear-gradient(160deg, #f1ece4 0%, #ddcfbd 100%); }
.img-ph.tint-d { background: linear-gradient(145deg, #e4d8c8 0%, #cdbba6 100%); }

.img-ph::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(255,255,255,0.35), transparent 70%);
    pointer-events: none;
}

.img-ph svg {
    width: 46px;
    height: 46px;
    opacity: 0.5;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.4;
    position: relative;
    z-index: 1;
}

.img-ph-cap {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-style: italic;
    letter-spacing: 0.02em;
    opacity: 0.72;
    position: relative;
    z-index: 1;
    padding: 0 20px;
    text-align: center;
}

/* ---- Hero ---- */
#hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    position: relative;
}

.hero-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 120px 64px 80px;
    position: relative;
}

.hero-eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    color: var(--accent);
    margin-bottom: 28px;
}

.hero-name {
    font-family: var(--font-serif);
    font-size: clamp(3.4rem, 7vw, 6rem);
    font-weight: 500;
    line-height: 0.98;
    letter-spacing: -0.01em;
    margin-bottom: 24px;
}

.hero-name em {
    font-style: italic;
    color: var(--accent);
}

.hero-tagline {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 440px;
    line-height: 1.85;
    margin-bottom: 40px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-meta {
    margin-top: 56px;
    display: flex;
    gap: 40px;
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
}

.hero-meta span { display: block; }
.hero-meta .hero-meta-k {
    color: var(--text-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.7rem;
    margin-bottom: 4px;
}

.hero-image {
    position: relative;
    min-height: 60vh;
}

.hero-image .img-ph { height: 100%; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 30px;
    border-radius: 40px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--accent-secondary);
    color: #faf9f7;
}

.btn-primary:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-light);
}

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

.btn-full { width: 100%; }

/* ---- Section shells ---- */
section { padding: 130px 0; }

.section-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.24em;
    margin-bottom: 18px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(2.4rem, 4.5vw, 3.6rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.01em;
    margin-bottom: 20px;
    max-width: 760px;
}

.section-lead {
    color: var(--text-secondary);
    font-size: 1.02rem;
    line-height: 1.85;
    max-width: 620px;
    margin-bottom: 64px;
}

/* ---- Gallery (masonry / asymmetric) ---- */
#gallery { background: var(--bg-primary); }

.gallery-head { margin-bottom: 64px; }

.gallery-masonry {
    columns: 3;
    column-gap: 20px;
}

.gallery-item {
    position: relative;
    break-inside: avoid;
    margin-bottom: 20px;
    cursor: pointer;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

/* varied aspect ratios via padding boxes */
.gallery-item .img-ph {
    position: absolute;
    inset: 0;
    transition: transform 0.7s cubic-bezier(0.2, 0, 0.2, 1);
}

.ratio-box { position: relative; width: 100%; }
.r-portrait { padding-top: 133%; }   /* 3:4 */
.r-tall     { padding-top: 150%; }   /* 2:3 */
.r-square   { padding-top: 100%; }   /* 1:1 */
.r-landscape{ padding-top: 70%; }    /* ~7:5 */
.r-wide     { padding-top: 62%; }

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

.gallery-caption {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 22px;
    background: linear-gradient(to top, rgba(26,23,20,0.66) 0%, rgba(26,23,20,0.12) 45%, transparent 75%);
    opacity: 0;
    transition: opacity var(--transition);
    z-index: 2;
}

.gallery-item:hover .gallery-caption { opacity: 1; }

.gallery-caption-title {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 500;
    color: #faf9f7;
    line-height: 1.15;
}

.gallery-caption-meta {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: rgba(250,249,247,0.75);
    margin-top: 6px;
}

.gallery-view {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(250,249,247,0.92);
    opacity: 0;
    transform: scale(0.8);
    transition: var(--transition);
    z-index: 2;
}

.gallery-view svg { width: 18px; height: 18px; stroke: var(--text-primary); fill: none; stroke-width: 2; }
.gallery-item:hover .gallery-view { opacity: 1; transform: scale(1); }

/* ---- Categories / services ---- */
#categories { background: var(--bg-secondary); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.category-card {
    position: relative;
    padding: 40px 28px 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    transition: var(--transition);
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2px;
    background: var(--gradient-accent);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform var(--transition);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-light);
}

.category-card:hover::before { transform: scaleY(1); }

.category-num {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-style: italic;
    color: var(--accent);
    margin-bottom: 18px;
}

.category-card h3 {
    font-family: var(--font-serif);
    font-size: 1.7rem;
    font-weight: 500;
    margin-bottom: 12px;
}

.category-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ---- About ---- */
#about { background: var(--bg-primary); }

.about-grid {
    display: grid;
    grid-template-columns: 0.85fr 1fr;
    gap: 72px;
    align-items: center;
}

.about-portrait {
    position: relative;
}

.about-portrait .ratio-box { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); }
.about-portrait .img-ph { position: absolute; inset: 0; }

.about-portrait-tag {
    position: absolute;
    bottom: 24px;
    left: -20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 14px 22px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.about-portrait-tag .apt-name {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
}

.about-portrait-tag .apt-role {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    margin-top: 2px;
}

.about-text h2 {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 3.6vw, 2.8rem);
    font-weight: 500;
    line-height: 1.1;
    margin-bottom: 24px;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 18px;
    font-size: 1rem;
    line-height: 1.85;
}

.about-signature {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-style: italic;
    color: var(--accent);
    margin-top: 24px;
}

/* ---- Contact ---- */
#contact { background: var(--bg-secondary); border-top: 1px solid var(--border); }

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 72px;
    align-items: start;
}

.contact-info h2 {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 3.6vw, 2.8rem);
    font-weight: 500;
    margin-bottom: 18px;
}

.contact-info > p {
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 1rem;
    line-height: 1.85;
    max-width: 440px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.contact-item svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 3px;
    stroke-width: 1.6;
}

.contact-item div { display: flex; flex-direction: column; }

.contact-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    margin-bottom: 3px;
}

.contact-item a { color: var(--text-primary); font-weight: 500; transition: color var(--transition); }
.contact-item a:hover { color: var(--accent); }

.contact-form-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 44px;
    box-shadow: var(--shadow-sm);
}

.form-group { margin-bottom: 22px; }

.form-group label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font);
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea { resize: vertical; min-height: 120px; }

/* ---- Footer ---- */
footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    padding: 56px 0 32px;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-wordmark {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 500;
}

.footer-bottom p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-social { display: flex; gap: 20px; }
.footer-social a {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-secondary);
    transition: color var(--transition);
}
.footer-social a:hover { color: var(--accent); }

/* ---- Lightbox ---- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.lightbox.open { display: flex; }

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(26, 23, 20, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.lightbox-frame {
    position: relative;
    z-index: 1;
    max-width: 720px;
    width: 100%;
    text-align: center;
}

.lightbox-stage {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}

.img-ph-lightbox { position: absolute; inset: 0; height: 100%; }
.lightbox-stage { position: relative; }

.lightbox-caption {
    margin-top: 22px;
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-style: italic;
    color: #faf9f7;
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 28px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(250,249,247,0.4);
    background: transparent;
    color: #faf9f7;
    font-size: 1.4rem;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-close:hover { background: rgba(250,249,247,0.12); border-color: #faf9f7; }

/* ---- Animations ---- */
.fade-in {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ---- Demo ribbon ---- */
.demo-ribbon {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #faf9f7;
    background: var(--gradient-accent);
    box-shadow: 0 -2px 16px rgba(26, 23, 20, 0.18);
}

.demo-ribbon a {
    color: #faf9f7;
    text-decoration: underline;
    text-underline-offset: 2px;
    opacity: 0.92;
}

.demo-ribbon a:hover { opacity: 1; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .gallery-masonry { columns: 2; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    #hero { grid-template-columns: 1fr; }
    .hero-image { min-height: 46vh; order: -1; }
    .hero-text { padding: 120px 40px 64px; }
    .about-grid { grid-template-columns: 1fr; gap: 48px; }
    .about-portrait { max-width: 420px; }
}

@media (max-width: 768px) {
    section { padding: 84px 0; }
    .container { padding: 0 24px; }
    .nav-container { padding: 0 24px; }

    .nav-hamburger { display: flex; }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg-secondary);
        flex-direction: column;
        justify-content: center;
        padding: 40px;
        gap: 28px;
        border-left: 1px solid var(--border);
        transition: right var(--transition);
    }

    .nav-links.open { right: 0; }
    .nav-links a { font-size: 0.95rem; }

    .gallery-masonry { columns: 1; }
    .category-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; gap: 44px; }

    .hero-text { padding: 104px 24px 56px; }
    .hero-meta { flex-wrap: wrap; gap: 28px; }
    .about-portrait-tag { left: 0; }
    .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; }
    .contact-form-wrap { padding: 28px; }
}
