/* --- Fonts & Variables --- */

/* Local Aeonik Pro Font Definition */
@font-face {
    font-family: "Aeonik Pro";
    src: url("../assets/aeo-reg.woff2") format("woff2"),
        url("../assets/aeo-reg.woff") format("woff");
    font-weight: 300 500;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-color: #f1f0ef;
    --text-color: #000000;
    --text-muted: #555566;
    --accent-color: #1022BE;
    --font-sans: 'Aeonik Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Grid settings */
    --grid-columns: 12;
    --grid-gap-desktop: 20px;
    --grid-gap-mobile: 10px;

    /* Gutter for mobile animation */
    --mobile-gutter: 24px;
}

/* --- Reset & Base Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Smooth Scroll Support */
html.lenis {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overflow: anchor;
}

html.lenis.lenis-stopped {
    overflow: hidden;
}

html.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

@media (max-width: 768px) {
    html, body {
        scroll-behavior: auto !important;
    }
}

html {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    overflow-x: hidden;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: url("../assets/html_cursor.png") 15 15, auto;
    cursor: -webkit-image-set(url('../assets/html_cursor.png') 1x, url('../assets/html_cursor_2x.png') 2x) 15 15, auto;
}

a,
button,
.interactive {
    cursor: url("../assets/html_cursor_eyes.png") 15 15, auto;
    cursor: -webkit-image-set(url('../assets/html_cursor_eyes.png') 1x, url('../assets/html_cursor_eyes_2x.png') 2x) 15 15, auto;
}

/* Custom Selection Color */
::selection {
    background-color: var(--accent-color);
    color: #ffffff;
}

/* --- Header Navigation --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    border-bottom: 1px solid #ffffff;
    mix-blend-mode: difference;
    color: #ffffff;
}

.site-header a,
.site-header .logo {
    color: #ffffff;
    pointer-events: auto;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.logo-subtitle {
    font-weight: 400;
    opacity: 0.8;
}

.logo-subtitle .mobile-text {
    display: none;
}

.site-header a:hover {
    opacity: 0.7;
    color: #ffffff;
}

.site-header nav ul {
    display: flex;
    list-style: none;
    gap: 40px;
    justify-content: flex-end;
    width: 100%;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 500;
    letter-spacing: -0.02em;
}

p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* --- Layout --- */

.main-wrapper {
    width: 100%;
    position: relative;
}

/* 12-Column Grid Layout */
.grid-container {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
    gap: var(--grid-gap-desktop);
    width: 100%;
    padding: 0 24px;
}

/* --- Hero Section (Centered Phrase) --- */
.hero-section {
    height: 100vh;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 3;
    pointer-events: none;
    padding: 0 24px;
    mix-blend-mode: difference;
}

.hero-phrase-wrapper {
    text-align: left;
    padding: 0;
    width: 100%;
    max-width: 100%;
    pointer-events: none;
}

.hero-phrase {
    position: absolute;
    top: 0;
    font-size: 4vw;
    font-size: clamp(2.5rem, 4vw, 6rem);
    line-height: 1;
    font-weight: 500;
    color: #ffffff;
    mix-blend-mode: difference;
    transform-origin: left top;
}

.hero-phrase span {
    color: #ffffff;
}

/* Chars in hero phrase for entrance animation */
.hero-phrase {
    opacity: 0;
}

.hero-phrase .char {
    display: inline-block;
}

/* Initial state for first portfolio item to prevent FOUC */
.portfolio-section .portfolio-item:first-of-type {
    opacity: 0;
    transform: translateY(40px);
}

/* Spacer to push content down and allow scrolling */
.scroll-spacer {
    height: 72vh;
    pointer-events: none;
}

/* --- Portfolio Grid Section --- */
.portfolio-section {
    position: relative;
    z-index: 2;
    background-color: var(--bg-color);
    padding-top: 0;
}

/* Portfolio Grid Items */
.portfolio-item {
    margin-bottom: 100px;
    display: flex;
    flex-direction: column;
}

/* Image Container with Parallax Overflow Hidden */
.img-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 100px;
    aspect-ratio: 4/3;
}

.img-wrapper.vertical {
    aspect-ratio: 3/4;
}

.img-wrapper.horizontal {
    aspect-ratio: 16/10;
}

.img-wrapper.wide {
    aspect-ratio: 21/9;
}

/* Image & Video Sizing */
.img-wrapper img,
.img-wrapper video {
    width: 100%;
    height: 106%;
    object-fit: cover;
    position: absolute;
    top: -3%;
    left: 0;
    transform: scale(1.04);
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.portfolio-item:hover .img-wrapper img,
.portfolio-item:hover .img-wrapper video {
    transform: scale(1.02);
}

/* Item Meta Information */
.item-info {
    margin-top: 15px;
    padding: 0;
}

.item-title {
    font-size: 1rem;
    margin-bottom: -2px;
    letter-spacing: 0.02em;
}

.item-category {
    font-size: 0.875rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* --- Aspect Ratio Presets --- */
.ratio-16-10-l {
    aspect-ratio: 16 / 10 !important;
}

.ratio-16-10-p {
    aspect-ratio: 10 / 16 !important;
}

.ratio-4-3-l {
    aspect-ratio: 4 / 3 !important;
}

.ratio-4-3-p {
    aspect-ratio: 3 / 4 !important;
}

.ratio-1-1 {
    aspect-ratio: 1 / 1 !important;
}

/* --- Alignment Helpers (Desktop) --- */
@media (min-width: 768px) {

    /* Left aligned images */
    .img-left {
        grid-column: 2 / span 6;
        /* Offset by 1, spans 6 */
    }

    .img-left-wide {
        grid-column: 1 / span 8;
    }

    /* Center aligned images */
    .img-center {
        grid-column: 4 / span 6;
    }

    .img-center-wide {
        grid-column: 3 / span 8;
    }

    /* Right aligned images */
    .img-right {
        grid-column: 6 / span 6;
    }

    .img-right-wide {
        grid-column: 5 / span 8;
    }

    /* Mixed vertical offsets for dynamic layout */
    .offset-up {
        transform: translateY(-50px);
    }

    .offset-down {
        transform: translateY(50px);
    }

    /* --- Fine-grained Layout Helpers (for side-by-side composite blocks) --- */
    /* Column Start positions (12-column grid) */
    .col-start-1 {
        grid-column-start: 1;
    }

    .col-start-2 {
        grid-column-start: 2;
    }

    .col-start-3 {
        grid-column-start: 3;
    }

    .col-start-4 {
        grid-column-start: 4;
    }

    .col-start-5 {
        grid-column-start: 5;
    }

    .col-start-6 {
        grid-column-start: 6;
    }

    .col-start-7 {
        grid-column-start: 7;
    }

    .col-start-8 {
        grid-column-start: 8;
    }

    .col-start-9 {
        grid-column-start: 9;
    }

    .col-start-10 {
        grid-column-start: 10;
    }

    .col-start-11 {
        grid-column-start: 11;
    }

    .col-start-12 {
        grid-column-start: 12;
    }

    /* Column Span widths */
    .col-span-1 {
        grid-column-end: span 1;
    }

    .col-span-2 {
        grid-column-end: span 2;
    }

    .col-span-3 {
        grid-column-end: span 3;
    }

    .col-span-4 {
        grid-column-end: span 4;
    }

    .col-span-5 {
        grid-column-end: span 5;
    }

    .col-span-6 {
        grid-column-end: span 6;
    }

    .col-span-7 {
        grid-column-end: span 7;
    }

    .col-span-8 {
        grid-column-end: span 8;
    }

    .col-span-9 {
        grid-column-end: span 9;
    }

    .col-span-10 {
        grid-column-end: span 10;
    }

    .col-span-11 {
        grid-column-end: span 11;
    }

    .col-span-12 {
        grid-column-end: span 12;
    }

    /* --- Spacing bottom presets (Desktop) --- */
    .spacing-large {
        margin-bottom: 140px !important;
    }

    .spacing-medium {
        margin-bottom: 80px !important;
    }

    .spacing-small {
        margin-bottom: 24px !important;
    }

    .spacing-spacer {
        margin-bottom: 300px !important;
    }
}

/* --- Tablet Breakpoint (768px - 1024px) & Unified About Column Collapse (< 1024px) --- */
@media (max-width: 1023px) {

    .hero-phrase {
        font-size: 5.5vw;
    }

    .about-col {
        grid-column: 1 / span 12 !important;
        padding-left: 24px;
        padding-right: 24px;
        margin-bottom: 40px;
    }
}

/* --- Responsive & Mobile Styles --- */
@media (max-width: 767px) {
    .portfolio-section {
        padding-top: 10vh;
    }

    .grid-container {
        padding: 0;
        gap: var(--grid-gap-mobile);
    }

    .portfolio-item {
        grid-column: 1 / span 12 !important;
        margin-bottom: 60px;
        padding-left: var(--mobile-gutter);
        padding-right: var(--mobile-gutter);
    }

    .img-wrapper {
        border-radius: 32px;
        aspect-ratio: 16 / 12 !important;
    }

    .img-wrapper img,
    .img-wrapper video {
        height: 108%;
        top: -4%;
    }

    .item-title {
        margin-bottom: 2px;
    }

    .item-category {
        line-height: 1.2rem;
    }

    .spacing-large,
    .spacing-medium,
    .spacing-small,
    .spacing-spacer {
        margin-bottom: 100px !important;
    }

    .hero-phrase {
        font-size: 7.5vw;
        letter-spacing: -0.01em;
    }

    .logo-subtitle .desktop-text {
        display: none;
    }

    .logo-subtitle .mobile-text {
        display: inline;
    }

    body.work-page .site-header nav ul li.nav-item-work {
        display: none !important;
    }

    body.about-page .site-header nav ul li.nav-item-about {
        display: none !important;
    }

    .scroll-spacer {
        height: 50vh;
    }
}

/* --- Footer --- */
footer {
    position: relative;
    width: 100%;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--text-color);
    color: var(--text-color);
    background-color: transparent;
}

.footer-content {
    width: 100%;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-color);
    font-weight: 500;
    font-size: 1rem;
}

.footer-content a {
    color: var(--text-color);
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.footer-content a:hover {
    opacity: 0.7;
    color: var(--text-color);
}

.footer-right p {
    color: var(--text-color);
    font-weight: 500;
    margin: 0;
}

/* --- 2x2 Composite Grid --- */
.grid-2x2 {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--grid-gap-desktop);
    width: 100%;
}

.grid-2x2 .img-wrapper {
    grid-column: span 6;
}

@media (max-width: 767px) {
    .grid-2x2 {
        gap: var(--grid-gap-mobile);
    }
}

/* --- Composite Block Layout (Swiss Grid) --- */
.portfolio-composite {
    grid-column: 1 / span 12;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--grid-gap-desktop);
    margin-bottom: 100px;
}

@media (min-width: 768px) {
    .composite-left {
        grid-column: 1 / span 7;
        grid-row: span 2;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .composite-left .portfolio-item {
        height: 100%;
        margin-bottom: 0;
    }

    .composite-left .img-wrapper {
        height: 100%;
        flex-grow: 1;
        aspect-ratio: auto;
    }

    .composite-right {
        grid-column: 8 / span 5;
        display: flex;
        flex-direction: column;
        gap: 40px;
    }

    .composite-right .portfolio-item {
        margin-bottom: 0;
    }
}

@media (max-width: 767px) {
    .portfolio-composite {
        display: block;
        margin-bottom: 0;
    }

    .composite-left,
    .composite-right {
        display: block;
        grid-column: 1 / span 12;
        width: 100%;
    }

    .composite-right {
        display: block;
    }

    .composite-left .img-wrapper {
        aspect-ratio: 1;
        height: auto;
    }
}

/* --- About Page Specific --- */
.about-page {
    background-color: #f1f0ef !important;
    color: #000000;
}

.about-page,
.about-page html {
    background-color: #f1f0ef !important;
    color: #000000;
}

.about-main {
    padding-top: 15vh;
    padding-bottom: 15vh;
}

.about-blurb {
    font-size: 1.333rem;
    line-height: 1.667rem;
    font-weight: 300;
    letter-spacing: 0.033rem;
}

.about-col {
    opacity: 0;
    transform: translateY(30px);
}

.quote-text {
    text-indent: -0.5em;
}

.main-statement {
    font-weight: 300;
}

.bio-text {
    font-size: 1.333rem;
    line-height: 1.76rem;
    font-weight: 300;
    letter-spacing: 0.033rem;
}

.bio-text p {
    font-size: 1.333rem;
    line-height: 1.76rem;
    font-weight: 300;
    letter-spacing: 0.033rem;
    color: #000000;
    margin-bottom: 1.667rem;
}

.bio-text a {
    color: #000000;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
    transition: color 0.3s ease, text-decoration-color 0.3s ease;
}

.bio-text a:hover {
    color: #1022BE;
    text-decoration-color: #1022BE;
}

.bio-text .links {
    margin-top: 2rem;
    line-height: 2rem;
}

@media screen and (max-width: 767px) {
    .about-main {
        padding-top: 12vh;
    }
}

footer ::selection {
    background-color: #EFDD41 !important;
    color: #000000 !important;
}

/* Custom Circular Cursor & Easter Egg Magnifying Lens */
.custom-cursor {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #000000;
    border: 1px solid #555555;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%) scale(0);
    will-change: transform, width, height;
    overflow: hidden;
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.35s ease;
}

.custom-cursor.is-magnifying {
    width: 100px;
    height: 100px;
    background-color: #000000;
    border: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.custom-cursor .cursor-lens-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-repeat: no-repeat;
    display: none;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.custom-cursor.is-magnifying .cursor-lens-preview {
    opacity: 1;
}

.custom-cursor .cursor-lens-video {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    display: none;
    object-fit: cover;
    transform-origin: 0 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.custom-cursor.is-magnifying .cursor-lens-video {
    opacity: 1;
}

body.has-custom-cursor {
    cursor: none !important;
}