@font-face {
    font-family: 'Sorts Mill Goudy';
    src: url('./fonts/SortsMillGoudy-Regular.woff2') format('woff2'),
         url('./fonts/SortsMillGoudy-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Raleway';
    src: url('./fonts/Raleway-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
}

:root {
    --primary-color: #070803;
    --secondary-font: 'Raleway';
    --cta-primary-color: #f08080;
    --max-width: 1000px;
}

body {
    font-family: var(--secondary-font), sans-serif;
    font-weight: 300;
    background-color: #FFF5EE;
    color: #070803;
    overflow-x: hidden;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid rgba(7, 8, 3, 0.25);
    transition: border-color 0.2s ease, opacity 0.2s ease;
}

a:hover {
    border-bottom-color: var(--primary-color);
    opacity: 0.65;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 200;
}

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

.site-header {
    margin: 0 auto;
    max-width: var(--max-width);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    position: relative;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1000;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Navigation */
.nav {
    display: flex;
    gap: 1rem;
}

.nav a {
    text-decoration: none;
    color: var(--primary-color);
    /* flat-style nav buttons: no border or shadow for a minimalist gallery look */
    border: none;
    border-bottom: none;
    border-radius: 6px; /* keep slight rounding for touch targets */
    box-shadow: none;
    transition: opacity 0.2s ease;
    font-size: 1rem;
    font-family: var(--secondary-font), sans-serif;
    margin-left: 1.25rem;
}

.nav a:hover {
    border-bottom: none;
    opacity: 0.65;
}

/* CTA handled by .btn-submit elsewhere; remove .nav a.cta specific rules */

/* Mobile Navigation */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 100%;
        background: rgba(255, 245, 238, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 2rem;
        gap: 1.5rem;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        /* slide animation for opening/closing and delayed visibility toggle so it doesn't snap closed mid-animation */
        transition: right 0.3s ease, visibility 0s linear 0.3s;
        z-index: 999;
        visibility: hidden;
        pointer-events: none; /* don't allow interaction while hidden */
    }

    .nav.active {
        right: 0;
        visibility: visible;
        padding: 0;
        /* when active (opening), make it visible immediately and accept pointer events */
        transition: right 0.3s ease, visibility 0s linear 0s;
        pointer-events: auto;
    }

    .nav a {
        width: auto;
        text-align: center;
        border: none;
        background: transparent;
        box-shadow: none;
        font-size: 1.5rem;
        padding: 0.5rem 1rem;
    }

    /* no .nav a.cta rules */

    .site-header {
        padding: .5rem 1.5rem 1rem .4rem;
    }
}

/* Logo */
.logo {
    display: inline-flex;
    flex-direction: column;
    margin: 0;
    font-family: 'Sorts Mill Goudy', serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    text-decoration: none;
    border-bottom: none;
    color: inherit;
}

.logo:hover {
    opacity: 1;
}

.logo-line {
    display: flex;
    align-items: center;
    justify-content: left;
    border-top: 2px solid var(--primary-color);
    font-size: 2rem;
    font-weight: normal;
    line-height: 1;
    padding: .5rem .1rem .2rem .1rem;
}

.logo-line:last-child {
    border-bottom: 2px solid var(--primary-color);
}

/* Portfolio */
/* Portfolio Grid */

.portfolio-grid {
    display: grid;
    gap: 1rem;
}

/* Mobile: 1 column */
@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

/* Desktop: 3 columns */
@media (min-width: 769px) {
    .portfolio-grid {
        margin-top: 1rem;
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Base item */
.item {
    overflow: hidden;
}

/* Square aspect ratio */
.item img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.item.tall {
    grid-row: span 2;
}

.item.tall img {
    aspect-ratio: 1 / 2;
}

/* Large items span 2 columns on desktop */
@media (min-width: 769px) {
    .item.large {
        grid-column: span 2;
        grid-row: span 2;
    }
}

/* ===== Fullscreen Viewer ===== */
.viewer {
    position: fixed;
    inset: 0;
    background: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.viewer img {
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.viewer.visible {
    opacity: 1;
}

.viewer.visible img {
    opacity: 1;
    transform: scale(1);
}

.viewer.loading img {
    filter: blur(6px) saturate(0.9);
    transform: scale(1.02);
    transition: filter 0.35s ease, transform 0.35s ease;
}

.viewer.visible img {
    filter: none;
    transform: scale(1);
}

.viewer.hide-cursor {
    cursor: none;
}

.viewer.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;  /* crucial: don't block clicks when hidden */
}

.portfolio-grid img {
    cursor: pointer;
}

.viewer.loading::after {
    content: '';
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,0.15);
    border-top-color: rgba(255,255,255,0.9);
    border-radius: 50%;
    position: absolute;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Ensure picture/img use responsive sizing and no extra gap */
.portfolio-grid picture, .portfolio-grid img {
    display: block;
    width: 100%;
}

/* Commission steps */
.commission-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: var(--max-width);
    margin: 0.75rem auto 0;
}

.commission-step {
    padding: 1.75rem 0;
}

.step-rule {
    width: 100%;
    height: 1px;
    background: rgba(128, 0, 0, 0.1);
    margin-bottom: 1.25rem;
}

.step-body {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.step-number {
    font-family: 'Sorts Mill Goudy', serif;
    font-size: 3rem;
    font-weight: normal;
    color: #800000;
    opacity: 0.25;
    line-height: 1;
    flex-shrink: 0;
    width: 3rem;
    text-align: right;
}

.step-text {
    flex: 1;
    padding-top: 0.2rem;
}

.step-body .step-text p {
    margin: 0;
}

.step-heading {
    font-family: 'Sorts Mill Goudy', serif;
    font-weight: normal;
    font-size: 1.5rem;
    color: #800000;
    margin: 0 0 0.4rem 0;
    letter-spacing: 0.03em;
}

.commission-step p {
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--primary-color);
    margin: 0;
    text-indent: 0;
}

@media (max-width: 1024px) {
    .commission-steps {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .step-number {
        font-size: 2.25rem;
        width: 2.5rem;
    }
}


/* Commissions page */
.commissions-section {
    max-width: var(--max-width);
    margin: 0 auto;
    overflow: visible;
}

.commissions-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    padding-bottom: 3rem;
}

.commissions-hero-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem; /* tighter spacing between header and paragraph */
}

.commissions-hero-image {
    overflow: hidden;
}

.commissions-hero-image picture,
.commissions-hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

.commissions-subsection {
    padding: 2rem 0 1rem;
    border-bottom: 1px solid rgba(7, 8, 3, 0.1);
    margin-bottom: 1rem;
}

/* Gradient transition into the pricing section */
.commissions-subsection--gradient {
    position: relative;
    border-bottom: none;
    /* Full-bleed background */
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-top: 2rem;
    background: linear-gradient(
        to bottom,
        #faeee6 0%,
        #f5e6db 35%,
        #f0ddd1 65%,
        #ebd4c7 100%
    );
    padding-top: 3rem;
    padding-bottom: 2rem;
}

/* Constrain the text content back to the same margins as other subsections */
.commissions-subsection--gradient .commissions-header,
.commissions-subsection--gradient p,
.commissions-subsection--gradient .commission-steps {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
}

@media (max-width: 1024px) {
    .commissions-subsection--gradient .commissions-header,
    .commissions-subsection--gradient p,
    .commissions-subsection--gradient .commission-steps {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    /* Remove extra vertical gap between hero and gradient subsection on small screens */
    .commissions-hero {
        padding-bottom: 0; /* remove desktop-only breathing room so section sits flush */
    }

    .commissions-subsection--gradient {
        margin-top: 0; /* bring gradient right up under the hero */
    }
}

.commissions-header {
    color: #800000;
    font-family: 'Sorts Mill Goudy', serif;
    font-size: 2.75rem;
    font-weight: 200;
    margin-top: 0;
    margin-bottom: 0; /* remove extra gap under header */
}

.commissions-subsection p,
.commissions-hero-text p {
    font-family: var(--secondary-font), sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    max-width: 65ch;
    margin-bottom: 0.35rem; /* slightly tighter in hero */
}

/* Make anchor CTA look identical to .btn-submit */
a.btn-submit {
    display: inline-block;
    text-decoration: none;
    border-bottom: none;
    text-align: center;
    align-self: flex-start;
    margin: 1rem 0;
}

a.btn-submit:hover {
    border-bottom: none;
    opacity: 1;
}

/* Responsive adjustments for Commissions hero */
@media (max-width: 768px) {
    .commissions-hero {
        grid-template-columns: 1fr;
        gap: 3rem; /* increase space between text block and image */
        padding: 1rem 0; /* moderate vertical breathing room */
    }

    .commissions-hero-text {
        gap: 1.5rem; /* more vertical space between heading, paragraph, and CTA */
        padding: 0; /* remove extra horizontal padding so text aligns with container */
    }

    .commissions-header {
        font-size: 1.9rem;
        line-height: 1.1;
    }

    .commissions-hero-text p {
        font-size: 1rem;
        max-width: none;
        margin-bottom: 1rem; /* slightly larger gap after paragraph for breathing */
    }

    /* Make the hero image full-bleed on mobile (edge-to-edge) */
    .commissions-hero-image {
        width: 100vw;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
        box-sizing: border-box;
        overflow: hidden;
        border-radius: 0; /* no rounding on full-bleed */
        box-shadow: none;
    }

    .commissions-hero-image picture,
    .commissions-hero-image img {
        width: 100%;
        height: 45vh; /* slightly taller to keep image presence while spacing increases */
        object-fit: cover;
        display: block;
        box-sizing: border-box;
    }

    /* Make the CTA a comfortable full-width button on mobile */
    .commissions-hero-text a.btn-submit {
        display: block;
        width: 100%;
        max-width: none;
        margin: 1.25rem 0 0 0; /* more space above the button */
    }

    /* Add breathing room at the page edges on mobile so content/images don't touch the screen */
    .container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

/* Small tablets: apply mobile full-bleed behavior up to 1024px */
@media (max-width: 1024px) {
    .commissions-hero {
        grid-template-columns: 1fr;
        gap: 2.5rem; /* increase spacing between stacked sections on tablets */
        padding: 1rem 0;
    }

    .commissions-hero-text {
        gap: 1rem;
        padding: 0; /* remove horizontal padding on tablet so text aligns with container */
    }

    .commissions-header {
        font-size: 2rem;
        line-height: 1.1;
    }

    .commissions-hero-text p {
        font-size: 1.05rem;
        max-width: none;
        margin-bottom: 0.9rem;
    }

    /* Make the hero image full-bleed on small tablets as well */
    .commissions-hero-image {
        width: 100vw;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
        box-sizing: border-box;
        overflow: hidden;
        border-radius: 0;
        box-shadow: none;
    }

    .commissions-hero-image picture,
    .commissions-hero-image img {
        width: 100%;
        height: 44vh; /* slightly taller on tablets for proportion */
        object-fit: cover;
        display: block;
        box-sizing: border-box;
    }

    /* Make the CTA comfortable and full-width on tablet */
    .commissions-hero-text a.btn-submit {
        display: block;
        width: 100%;
        max-width: none;
        margin: 0.5rem 0 0 0;
        box-sizing: border-box;
    }

    /* Keep page breathing room */
    .container {
        padding-left: .5rem;
        padding-right: .5rem;
    }
}

/* Desktop: keep the hero image constrained (no full-bleed) */
@media (min-width: 1025px) {
    .commissions-hero {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        align-items: center;
    }

    /* Keep the hero image simple on desktop: no mat, no frame, no shadow */
    .commissions-hero-image {
        width: auto;
        position: static;
        left: auto;
        right: auto;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
        overflow: hidden;
        padding: 0; /* remove any mat padding */
        background: transparent; /* no mat background */
        border-radius: 0; /* no rounding */
        box-shadow: none; /* no shadow */
    }

    .commissions-hero-image picture,
    .commissions-hero-image img {
        width: 100%;
        height: auto;
        max-height: 80vh;
        object-fit: cover;
        display: block;
        box-sizing: border-box;
        border-radius: 0; /* ensure artwork has no rounding */
    }

    /* No hover transforms or additional decoration */
}

/* Reduce default paragraph margins for tighter vertical rhythm */
p {
    margin-top: 0;
    margin-bottom: 0.25rem; /* tightened spacing for a denser layout */
}

/* Footer */
.site-footer {
    margin: 0 auto;
    max-width: var(--max-width);
    text-align: center;
    padding: 2rem;
    font-family: var(--secondary-font), sans-serif;
    font-size: 0.85rem;
    color: #555;
}

/* Contact subsection */
.contact-container {
    max-width: var(--max-width);
    margin: 0 auto;
}

.contact-header {
    color: #800000;
    font-family: 'Sorts Mill Goudy', serif;
    font-size: 2.75rem; /* ~44px */
    font-weight: 200;
    margin-bottom: 1.25rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: stretch;
}

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

    .contact-header {
        font-size: 2rem;
    }
}

.contact-text {
    display: flex;
    align-items: center;
    padding-right: .5rem;
}

@media (min-width: 769px) {
    /* On desktop, align the intro text to the top so it visually sits a bit higher */
    .contact-text {
        align-items: flex-start;
        padding-top: 0.35rem; /* small lift to fine-tune vertical position */
    }
}

.contact-text p {
    font-family: var(--secondary-font), sans-serif;
    font-size: 1.25rem; /* ~20px */
    line-height: 1.6;
    margin: 0;
    padding-bottom: 0; /* remove extra space */
}

.contact-form label {
    display: block;
    font-family: var(--secondary-font), sans-serif;
    font-size: 1rem; /* 16px */
    margin-bottom: 0.5rem;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    font-family: var(--secondary-font), sans-serif;
    font-weight: 300;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: #FEFEFE;
    color: var(--primary-color);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    border-color: rgba(240, 128, 128, 0.5);
    box-shadow: 0 0 0 3px rgba(240, 128, 128, 0.15);
}

.contact-form textarea {
    resize: vertical;
}

.contact-form .form-row {
    margin-bottom: 1rem;
}

.form-actions {
    margin-top: 0.5rem;
}

.btn-submit {
    background: var(--cta-primary-color);
    color: var(--primary-color);
    border: none;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    font-family: var(--secondary-font), sans-serif;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
    display: block;
    margin: 0 auto;
    box-sizing: border-box; /* include padding in width calculations to prevent overflow */
}

/* Terms form - reuse contact input styles and horizontal layout on desktop */
.terms-form label {
    display: block;
    font-family: var(--secondary-font), sans-serif;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.terms-form input[type="text"],
.terms-form input[type="date"] {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    font-family: var(--secondary-font), sans-serif;
    font-weight: 300;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: #FEFEFE;
    color: var(--primary-color);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.terms-form input[type="text"]:focus,
.terms-form input[type="date"]:focus {
    border-color: rgba(240, 128, 128, 0.5);
    box-shadow: 0 0 0 3px rgba(240, 128, 128, 0.15);
}

.terms-acknowledge {
    margin-top: 1.5rem;
}

.terms-row {
    margin-bottom: 1rem;
}

@media (min-width: 769px) {
    .terms-form {
        display: flex;
        gap: 1rem;
        align-items: end;
    }

    .terms-row {
        flex: 1 1 40%;
        margin-bottom: 0;
    }

    .form-actions {
        margin-top: 0;
    }
}

.site-footer a {
    color: #555;
    text-decoration: none;
    border-bottom: 1px solid rgba(85, 85, 85, 0.35);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.site-footer a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.reference-subheading {
    font-family: 'Sorts Mill Goudy', serif;
    font-weight: normal;
    font-size: 1.5rem;
    color: #800000;
    margin: 2rem 0 0.75rem;
}

/* Pricing page */
.pricing-section .commissions-header {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.pricing-intro {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 55ch;
}

/* Pricing layout: default (mobile) stacks */
.pricing-section {
    padding-top: 2.5rem; /* ensure breathing room above */
    padding-bottom: 2.5rem; /* breathing room below */
    margin-bottom: 2.5rem; /* keep space between pricing and following sections */
}

.pricing-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 769px) {
    /* Desktop/laptop: two columns (pricing | meta) each taking half the content width */
    .pricing-layout {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
        align-items: start;

        /* Card-like treatment for a gallery feel */
        background: linear-gradient(180deg, #fffdfb 0%, #fffaf7 100%);
        padding: 2rem;
        border-radius: 10px;
        box-shadow: 0 12px 30px rgba(7,8,3,0.06);
        border: 1px solid rgba(7,8,3,0.04);
    }
}

/* Ensure grid children can shrink and sit at the top of their column */
.pricing-layout > * {
    min-width: 0;
    align-self: start;
}

/* Left column: pricing list constrained so it feels intentionally sized */
.pricing-grid {
    display: block;
    width: 100%;
    max-width: 460px; /* keeps the price list compact */
}

/* Style individual price rows for more air and refinement */
.pricing-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 0;
    border-top: 1px solid rgba(7,8,3,0.06);
}

.pricing-item:first-of-type {
    border-top: none;
}

.pricing-size {
    font-family: var(--secondary-font), sans-serif;
    font-weight: 200; /* lighter weight for a refined look */
    font-size: 1rem;
    color: var(--primary-color);
    white-space: nowrap;
}

.pricing-price {
    font-family: 'Sorts Mill Goudy', serif;
    font-size: 1.8rem; /* slightly larger for emphasis */
    font-weight: normal;
    color: #800000;
}

.pricing-rule {
    flex: 1;
    height: 1px;
    background: rgba(7,8,3,0.06);
    display: block;
    align-self: center;
}

/* Right column: meta stacked, with a subtle left padding to separate from pricing */
.pricing-meta {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-left: 0.5rem;
}

.pricing-meta-item {
    align-self: start;
    padding: 0.25rem 0;
}

/* Make sure small screens keep the card look but without overflowing */
@media (max-width: 768px) {
    .pricing-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        background: transparent;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        border: none;
    }

    .pricing-meta {
        padding-left: 0;
    }

    .pricing-grid {
        max-width: 100%;
    }
}

/* Terms page */
.terms-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 0 3rem;
}

.terms-section .commissions-header {
    margin-bottom: 2rem;
}

.terms-body p {
    font-family: var(--secondary-font), sans-serif;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--primary-color);
    margin-bottom: 1.25rem;
}
