/* 
 * NemoJPN Premium - Main Stylesheet
 * 
 * Contains critical custom styles for masonry grids, 
 * font variables, and layout constraints replicating Tailwind behavior. 
 */

:root {
    --background: #0a0a0a;
    --foreground: #e5e5e5;
    --muted: #a3a3a3;
    --white: #ffffff;
    --black: #000000;
    --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
    --font-serif: 'Playfair Display', ui-serif, Georgia, serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--background);
    color: var(--foreground);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    margin: 0;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    font-weight: 400;
}

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

.cursor-pointer {
    cursor: pointer;
}

.whitespace-nowrap {
    white-space: nowrap;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Typography Utilities */
.font-sans {
    font-family: var(--font-sans);
}

.font-serif {
    font-family: var(--font-serif);
}

.text-muted {
    color: var(--muted);
}

.text-foreground {
    color: var(--foreground);
}

.text-white {
    color: var(--white);
}

.text-black {
    color: var(--black);
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.text-5xl {
    font-size: 3rem;
    line-height: 1;
}

.text-6xl {
    font-size: 3.75rem;
    line-height: 1;
}

.text-8xl {
    font-size: 6rem;
    line-height: 1;
}

.text-9xl {
    font-size: 8rem;
    line-height: 1;
}

.font-light {
    font-weight: 300;
}

.uppercase {
    text-transform: uppercase;
}

.tracking-widest {
    letter-spacing: 0.1em;
}

.tracking-\[0\.2em\] {
    letter-spacing: 0.2em;
}

.leading-relaxed {
    line-height: 1.625;
}

.leading-tight {
    line-height: 1.25;
}

.text-center {
    text-align: center;
}

/* Layout & Sizing */
.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.h-auto {
    height: auto;
}

.h-\[600px\] {
    height: 600px;
}

.max-w-7xl {
    max-width: 80rem;
}

.max-w-4xl {
    max-width: 56rem;
}

.max-w-xl {
    max-width: 36rem;
}

.max-w-none {
    max-width: none;
}

.min-h-screen {
    min-height: 100vh;
}

.min-h-\[60vh\] {
    min-height: 60vh;
}

.min-h-\[50vh\] {
    min-height: 50vh;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.mt-16 {
    margin-top: 4rem;
}

.mt-24 {
    margin-top: 6rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mb-12 {
    margin-bottom: 3rem;
}

.mb-16 {
    margin-bottom: 4rem;
}

.py-24 {
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.py-12 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.px-8 {
    padding-left: 2rem;
    padding-right: 2rem;
}

.px-12 {
    padding-left: 3rem;
    padding-right: 3rem;
}

.p-6 {
    padding: 1.5rem;
}

.pb-1 {
    padding-bottom: 0.25rem;
}

.pb-4 {
    padding-bottom: 1rem;
}

.pt-12 {
    padding-top: 3rem;
}

/* Flexbox */
.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

.flex-col {
    flex-direction: column;
}

.flex-row {
    flex-direction: row;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-grow {
    flex-grow: 1;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

.min-w-0 {
    min-width: 0;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-8 {
    gap: 2rem;
}

.gap-12 {
    gap: 3rem;
}

.gap-24 {
    gap: 6rem;
}

.space-y-4>*+* {
    margin-top: 1rem;
}

.space-y-6>*+* {
    margin-top: 1.5rem;
}

.space-x-6>*+* {
    margin-left: 1.5rem;
}

.space-x-8>*+* {
    margin-left: 2rem;
}

/* Grid */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

/* Position & Display */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.sticky {
    position: sticky;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.top-0 {
    top: 0;
}

.top-24 {
    top: 6rem;
}

.left-0 {
    left: 0;
}

.bottom-0 {
    bottom: 0;
}

.z-0 {
    z-index: 0;
}

.z-10 {
    z-index: 10;
}

.z-50 {
    z-index: 50;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.hidden {
    display: none;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-x-hidden {
    overflow-x: hidden;
}

/* Backgrounds & Borders */
.bg-background {
    background-color: var(--background);
}

.bg-background\/80 {
    background-color: rgba(10, 10, 10, 0.8);
}

.bg-background\/95 {
    background-color: rgba(10, 10, 10, 0.95);
}

.bg-white {
    background-color: var(--white);
}

.bg-white\/5 {
    background-color: rgba(255, 255, 255, 0.05);
}

.bg-black {
    background-color: var(--black);
}

.border-b {
    border-bottom-width: 1px;
}

.border-b-2 {
    border-bottom-width: 2px;
}

.border-t {
    border-top-width: 1px;
}

.border-transparent {
    border-color: transparent;
}

.border-white\/5 {
    border-color: rgba(255, 255, 255, 0.05);
}

.border-white\/30 {
    border-color: rgba(255, 255, 255, 0.3);
}

/* Opacity & Visuals */
.opacity-0 {
    opacity: 0;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-60 {
    opacity: 0.6;
}

.opacity-80 {
    opacity: 0.8;
}

.opacity-100 {
    opacity: 1;
}

.backdrop-blur-md {
    backdrop-filter: blur(12px);
}

.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Images & Object Fit */
.object-cover {
    object-fit: cover;
}

.object-contain {
    object-fit: contain;
}

/* Transitions & Transforms */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-colors {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-opacity {
    transition-property: opacity;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-transform {
    transition-property: transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-\[flex\] {
    transition-property: flex;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.duration-300 {
    transition-duration: 300ms;
}

.duration-500 {
    transition-duration: 500ms;
}

.duration-700 {
    transition-duration: 700ms;
}

.duration-1000 {
    transition-duration: 1000ms;
}

.ease-in-out {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.translate-y-4 {
    transform: translateY(1rem);
}

.translate-y-0 {
    transform: translateY(0);
}

/* Hover States (.group-hover relies on nested logic) */
.hover\:bg-white:hover {
    background-color: var(--white);
}

.hover\:text-black:hover {
    color: var(--black);
}

.hover\:text-white:hover {
    color: var(--white);
}

.group:hover .group-hover\:scale-105 {
    transform: scale(1.05);
}

.group:hover .group-hover\:opacity-100 {
    opacity: 1;
}

.group:hover .group-hover\:translate-y-0 {
    transform: translateY(0);
}

.group:hover.hover\:\!flex-\[2\.5\] {
    flex: 2.5 !important;
}

/* Specific Components */
/* Glass/translucent nav bar */
.site-header {
    background: rgba(10, 10, 10, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Menu link base */
.main-navigation a {
    position: relative;
    text-decoration: none;
    padding-bottom: 6px;
}

/* Animated underline (hover + current page) */
.main-navigation a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
    opacity: 0.9;
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item > a::after,
.main-navigation .current_page_item > a::after,
.main-navigation .current-menu-ancestor > a::after {
    transform: scaleX(1);
}

/* Selected Works filters: text-only with underline like header nav */
.selected-filter-btn {
    background: transparent !important;
    border: 0 !important;
    padding: 0 0 6px 0 !important;
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    cursor: pointer;
    position: relative;
    transition: color 0.25s ease;
}

.selected-filter-btn::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
    opacity: 0.9;
}

.selected-filter-btn:hover {
    color: var(--white);
}

.selected-filter-btn:hover::after,
.selected-filter-btn.selected-filter-active::after {
    transform: scaleX(1);
}

.selected-filter-btn.selected-filter-active {
    color: var(--white);
}

/* 4:5 artwork frame for Selected Works */
.selected-work-frame {
    aspect-ratio: 4 / 5;
}

.selected-work-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Header logo sizing */
.site-branding .custom-logo,
.custom-logo-link img,
.site-logo img {
    max-height: 56px;
    width: auto;
    height: auto;
}

/* Hero logo can be larger than header logo */
.hero-brand .custom-logo,
.hero-brand .custom-logo-link img {
    max-height: 120px !important;
    width: auto;
    height: auto;
}

@media (max-width: 768px) {
    .hero-brand .custom-logo,
    .hero-brand .custom-logo-link img {
        max-height: 84px !important;
    }
}

/* Card title clamping for long post titles */
.latest-work-title,
.selected-work-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .site-branding .custom-logo,
    .custom-logo-link img,
    .site-logo img {
        max-height: 42px;
    }
}

/* CSS Masonry Fallback */
.columns-1 {
    column-count: 1;
}

.break-inside-avoid {
    break-inside: avoid;
}

/* Basic Gradients */
.bg-gradient-to-t {
    background-image: linear-gradient(to top, var(--tw-gradient-stops));
}

.bg-gradient-to-b {
    background-image: linear-gradient(to bottom, var(--tw-gradient-stops));
}

.from-black\/90 {
    --tw-gradient-from: rgba(0, 0, 0, 0.9);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent);
}

.from-black\/80 {
    --tw-gradient-from: rgba(0, 0, 0, 0.8);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent);
}

.from-transparent {
    --tw-gradient-from: transparent;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent);
}

.from-background {
    --tw-gradient-from: var(--background);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent);
}

.via-black\/20 {
    --tw-gradient-stops: var(--tw-gradient-from), rgba(0, 0, 0, 0.2), var(--tw-gradient-to, transparent);
}

.via-background\/80 {
    --tw-gradient-stops: var(--tw-gradient-from), rgba(10, 10, 10, 0.8), var(--tw-gradient-to, transparent);
}

.via-background\/50 {
    --tw-gradient-stops: var(--tw-gradient-from), rgba(10, 10, 10, 0.5), var(--tw-gradient-to, transparent);
}

.to-transparent {
    --tw-gradient-to: transparent;
}

.to-background {
    --tw-gradient-to: var(--background);
}

/* Responsive Media Queries */
@media (min-width: 768px) {
    .md\:flex {
        display: flex;
    }

    .md\:hidden {
        display: none;
    }

    .md\:flex-row {
        flex-direction: row;
    }

    .md\:w-64 {
        width: 16rem;
    }

    .md\:h-20 {
        height: 5rem;
    }

    .md\:px-12 {
        padding-left: 3rem;
        padding-right: 3rem;
    }

    .md\:py-24 {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }

    .md\:gap-24 {
        gap: 6rem;
    }

    .md\:mb-0 {
        margin-bottom: 0;
    }

    .md\:text-5xl {
        font-size: 3rem;
        line-height: 1;
    }

    .md\:text-6xl {
        font-size: 3.75rem;
        line-height: 1;
    }

    .md\:text-8xl {
        font-size: 6rem;
        line-height: 1;
    }

    .md\:text-9xl {
        font-size: 8rem;
        line-height: 1;
    }

    .md\:columns-2 {
        column-count: 2;
    }

    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .lg\:columns-3 {
        column-count: 3;
    }

    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Animations */
.animate-fade-in-up,
.animate-fade-in {
    will-change: opacity, transform;
}

/* Intro + Latest Works mobile refinements */
.intro-blurb {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.latest-works-heading {
    text-align: left;
    width: 100%;
    line-height: 1.15;
}

/* Latest Works hover expand effect (smoothed) */
.latest-works-row {
    isolation: isolate;
    height: auto;
}

.latest-work-item {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 140px;
    will-change: flex-grow;
    transition: flex 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.latest-work-image {
    transition: opacity 350ms ease;
}

@media (min-width: 768px) {
    .latest-works-row {
        height: 600px;
    }

    .latest-work-item {
        flex: 1 1 0%;
        min-height: 0;
    }

    /* Slightly compress siblings when hovering the Latest Works row */
    .latest-works-row:hover > .latest-work-item {
        flex: 0.92 1 0% !important;
    }

    /* Expand hovered item */
    .latest-works-row:hover > .latest-work-item:hover {
        flex: 2.2 1 0% !important;
    }
}