@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;800;900&display=swap");

@font-face {
    font-family: "Best Stories";
    src: url("/fonts/best-stories.otf") format("opentype");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Pickleweasel";
    src: url("/fonts/Pickleweasel.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}

/* ============================================================
   TOKENS
============================================================ */

:root {
    --w: 680px;
    --gutter: 24px;
    --header-h: 68px;
    --footer-h: 110px;
    --ink: #141414;
    --paper: #fff;
    --aurora: #00c7bc;
    --lime: #ccf50c;
    --display: "Pickleweasel", "Arial Black", system-ui, sans-serif;
    --script: "Best Stories", "Snell Roundhand", "Brush Script MT", cursive;
    --sans: "Manrope", system-ui, -apple-system, sans-serif;
}

@media (max-width: 720px) {
    :root {
        --header-h: 62px;
        --gutter: 20px;
    }
}

/* ============================================================
   RESET + BASE
============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

html {
    scroll-behavior: smooth;
    overflow-x: clip;
}

body {
    display: flex;
    flex-direction: column;
    font-family: var(--sans);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    transition: background-color 400ms ease;
}

header,
main,
footer {
    width: 100%;
}

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

img {
    display: block;
}

body:has(a:hover:not(.project-card):not(.button):not(.no-hover-fx)) {
    background: var(--lime);
}

body:has(.menu-toggle svg:hover) {
    background: var(--lime);
}

/* ============================================================
   TYPE ROLES
============================================================ */

.project-card .year {
    font-size: 0.75rem;
    font-family: var(--sans);
    letter-spacing: 1px;
    margin-top: 4px;
    margin-bottom: 0px;
}

.project-card p {
    margin-top: 8px;
}

.year::before {
    content: "[";
}

.year::after {
    content: "]";
}

.script {
    font-family: var(--script);
    font-weight: 400;
    line-height: 1.15;
    text-transform: none;
    font-size: 32px;
}

#compass.script {
    line-height: 1.2em;
    text-transform: lowercase;
}

h1,
h2,
nav a,
.menu li > a {
    font-family: var(--display);
    font-weight: 400;
    font-size: 42px;
    /*transition: transform 0.25s ease;*/
    transition: transform 0.6s ease-in-out;
    transform-origin: center;
    text-transform: uppercase;
    line-height: 1;
}

h1 {
    font-size: clamp(48px, 12vw, 80px);
    text-align: center;
    margin-top: var(--gutter);
    margin-bottom: var(--gutter);
}

h1.script {
    font-size: 46px;
}

main h2 {
    font-size: 30px;
    text-align: center;
    line-height: 1;
    margin-top: 24px;
    margin-bottom: calc(1.5 * var(--gutter));
}

time {
    display: block;
    text-align: center;
    margin: 6px 0 22px;
    font-size: 17px;
}

p {
    font-size: 16px;
    max-width: 40em;
    margin: 14px auto 18px;
    text-align: left;
}

p.intro,
.filter-panel > p {
    text-align: center;
}

p a:not(.button) {
    font-weight: 900;
    text-decoration: underline dotted 3px;
    text-underline-offset: 3px;
}

/* ============================================================
   HEADER — aligned to --w column
============================================================ */

header {
    width: 100%;
    max-width: var(--w);
    margin: 0 auto;
    padding: 22px var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: relative;
    z-index: 50;
    flex-shrink: 0;
}

header .brand,
header > a.script {
    font-size: clamp(20px, 2.2vw, 24px);
    line-height: 1.05;
    flex-shrink: 0;
}

.header-nav {
    display: flex;
    gap: clamp(16px, 2.5vw, 32px);
    margin-left: auto;
    margin-right: clamp(12px, 2vw, 24px);
}

.header-nav a {
    font-family: var(--sans);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 6px 2px;

    display: inline-block;
    transition: transform 0.6s ease-in-out;
    transform-style: preserve-3d;
}

@media (max-width: 720px) {
    header {
        padding: 18px var(--gutter);
    }

    .header-nav {
        display: none;
    }
}

/* ============================================================
   HAMBURGER TOGGLE + FULL-SCREEN SLIDE-IN MENU
   (original architecture preserved — close-on-outside handled in functions.js)
============================================================ */

.menu-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 30px;
    cursor: pointer;
    flex-shrink: 0;
}

.menu-toggle svg {
    position: absolute;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.menu-toggle .icon-bars {
    opacity: 1;
}

.menu-toggle .icon-waves {
    opacity: 0;
}

.menu-toggle:hover .icon-bars {
    opacity: 0;
    transform: scaleY(1.2);
}

.menu-toggle:hover .icon-waves {
    opacity: 1;
}

.menu-open {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.menu-panel {
    position: fixed;
    inset: 0;
    background: var(--lime);
    padding: clamp(40px, 20vw, 400px);
    transform: translateX(100%);
    /*transition: transform 0.35s ease;*/
    transition: transform 0.6s ease-in-out;
    z-index: 100;
    display: flex;
    align-items: center;
}

.menu-open:checked ~ .menu-panel {
    transform: translateX(0);
}

.menu-panel ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.menu-panel ul ul {
    gap: 8px;
}

.menu-panel li > h2 > a,
.menu-panel li > a {
    font-family: var(--display);
    font-weight: 400;
    font-size: 40px;
    line-height: 1;
    display: inline-block;
}

.menu-panel li > ul > li a {
    font-family: var(--sans);
    margin-top: 4px;
    font-size: 15px;
    text-transform: uppercase;
    line-height: 1.2;
    letter-spacing: 1px;
}

.menu-panel li > ul > li > a:hover {
    font-weight: 900;
    letter-spacing: 2px;
    transform: none;
}

.menu-panel .script {
    position: absolute;
    right: clamp(40px, 18vw, 400px);
    bottom: 10vh;
    font-size: clamp(40px, 10vw, 60px);
}

/* ============================================================
   FOOTER — horizontal bar, all viewports
============================================================ */

footer {
    width: 100%;
    display: flex;
    flex-direction: column;
    margin-top: auto;
    background-color: var(--lime);
}

#menu-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: clamp(20px, 5vw, 60px);
    padding: 24px 16px 20px;
    background: none;
}

#menu-footer a {
    font-family: var(--display);
    font-size: 22px;
    line-height: 1;
    white-space: nowrap;
    text-transform: uppercase;
}

/*
  LINK FLIP EFFECT ON HOVER.
  Speed and settings controlled in each individual item.
*/
#menu-footer a:hover,
.menu-panel li h2 a:hover {
    transform: scaleX(-1);
}

.header-nav a:hover {
    transform: rotateY(180deg);
}

body.home #menu-footer a {
    font-size: clamp(22px, 3vw, 40px);
}

#social-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(20px, 6vw, 44px);
    padding: 0px 16px 12px;
    font-size: 20px;
}

#social-bar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

/* ============================================================
   MAIN — default (index-style) layout
   Project pages override with `main.project-feature` in portfoliostyles.css
============================================================ */

main {
    flex: 1;
    max-width: var(--w);
    margin: 0 auto;
    padding-top: calc(3 * var(--gutter));
    padding-bottom: calc(3 * var(--gutter));
}

/* Grid pages break out of the reading column */
main:has(.grid) {
    max-width: 100vw;
}

/* Portfolio index: hide main until a filter panel is targeted */
main:has(.filter-panel):not(:has(.filter-panel:target)) {
    display: none;
}

/* ============================================================
   BUTTONS + CATEGORY BUTTONS
============================================================ */

a.button {
    display: inline-block;
    background-color: var(--lime);
    padding: 10px 20px 11px;
    font-family: var(--sans);
    font-weight: 900;
    font-size: 14px;
    text-transform: uppercase;
    margin: 0px;
    width: fit-content;
    text-align: center;
    transition:
        background-color 400ms ease,
        transform 200ms ease-in;
}

a.button:hover {
    background-color: var(--aurora);
    transform: translateY(-3px);
}

.category-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
    margin-bottom: 30px;
}

.category-buttons .button,
.intro-hero .category-buttons .button {
    margin: 6px;
}

/* Active-button highlight — visible whenever a panel is targeted */
body:has(#interactive-objects:target) .category-buttons a[href="#interactive-objects"],
body:has(#data-visualization:target) .category-buttons a[href="#data-visualization"],
body:has(#atmospherics:target) .category-buttons a[href="#atmospherics"],
body:has(#visual-art:target) .category-buttons a[href="#visual-art"],
body:has(#ai:target) .category-buttons a[href="#ai"],
body:has(#texts:target) .category-buttons a[href="#texts"],
body:has(#collaborations:target) .category-buttons a[href="#collaborations"] {
    background: var(--aurora);
}

/* Hide top-level nav on portfolio page when targets with their own navs are present */
body:has(.filter-panel:target) .intro-hero nav {
    display: none;
}

/* ============================================================
   INTRO HERO — the "landing card" pattern
   Full-viewport-minus-header. Centered. h1 + intro + button(s).
============================================================ */

.intro-hero {
    display: flex;
    flex-direction: column;
    align-content: center;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: calc(100svh - var(--header-h) - var(--footer-h));
}

.intro-hero .button {
    margin-top: 22px;
}

/* ============================================================
   HOME PAGE (body.home)
============================================================ */

body.home {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
}

body.home main {
    height: 80%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 100%;
    min-width: 100%;
    width: 100%;
    margin: 0px;
    background: url("/assets/digibg.jpg");
    background-size: cover;
}

body.home footer {
    height: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
}

body.home .script {
    font-size: clamp(44px, 15vw, 80px);
    display: inline-block;
    padding: 0.3em;
}

body.home p {
    max-width: 20em;
    margin-top: 1.3em;
    font-size: 17px;
    text-align: center;
}

body.home footer nav {
    display: flex;
    justify-content: center;
    gap: clamp(20px, 10vw, 80px);
}

span.highlighter-white {
    line-height: 1.7em;
    background-color: white;
    padding: 0 8px;
}

.small-text,
.small-text p {
    font-size: 0.8rem;
    line-height: 1rem;
    margin: 12px 0px;
}

/* ============================================================
   PROJECT INDEX GRID
============================================================ */

.grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: var(--gutter);
    grid-auto-flow: dense;
    align-items: stretch;
    margin-left: auto;
    margin-right: auto;
}


.grid-feature {
    grid-column: 1 / -1;
}

.grid-feature img {
    aspect-ratio: 21/9;
}


@media (min-width: 720px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2vw;
    }
}

@media (min-width: 980px) {
    .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px 20px;
    }
}

/* ============================================================
   PROJECT CARDS
============================================================ */

.project-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: inherit;
    min-width: 0;
    padding: 8px 10px;
    transition:
        transform 200ms ease-in,
        background-color 200ms ease-in;
    max-width: 30em;
    background-color: var(--paper);
    justify-self: center;
    box-shadow: 0 5px 10px rgba(154, 160, 185, .05), 0 15px 40px rgba(166, 173, 201, .2);
}

.project-card:hover {
    background: var(--lime);
    transform: translateY(-2px);
}

/* Picture-wrapped: the <picture> is the frame, img fills it */
.project-card picture {
    display: block;
    width: 100%;
    aspect-ratio: 4/5;
    aspect-ratio: 1200 / 630;
    overflow: hidden;
    background: #eee;
}

@media (min-width: 720px) {
    .project-card picture {
        aspect-ratio: 4 / 5;
        /* desktop: matches the portrait thumb */
    }
}

.project-card picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Bare img fallback: the img is the frame */
.project-card > img {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    object-position: center;
    background: #eee;
    display: block;
}

.project-card h3 {
    font-family: var(--sans);
    font-weight: 900;
    font-size: 14px;
    line-height: 1em;
    margin-top: 20px;
    text-align: center;
    text-transform: uppercase;
}

.project-card p {
    line-height: 1.5em;
    text-align: center;
}

.js-reveal .reveal {
    animation: none;
}

.js-reveal .project-card {
    opacity: 0;
    transform: translateY(6px);
    transition:
        opacity 0.5s ease,
        transform 0.5s ease;
}

.js-reveal .project-card.in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .js-reveal .project-card {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ============================================================
   PORTFOLIO INDEX — category filter via :target
============================================================ */

#details {
    display: none;
}

#details:target {
    display: block;
}

.filter-panels {
    max-width: 820px;
    margin: 0 auto;
}

.filter-panel {
    display: none;
    scroll-margin-top: calc(var(--header-h, 68px) + 12px);
    padding-top: 0;
}

.filter-panel:target {
    display: block;
}

.filter-panel__head {
    display: block;
    max-width: var(--w);
    margin: 0 auto clamp(24px, 4vw, 40px);
    padding: 0 var(--gutter);
}

/* Tighten the existing `main h2` margins only when it's the panel head */
.filter-panel > h2 {
    margin-top: 0;
    margin-bottom: 12px;
}

.filter-panel > p {
    max-width: 34em;
    margin: 0 auto 32px;
}

/* Portfolio index stays centered at every viewport, overriding the general mobile left-align */
.filter-panel h2,
.filter-panel p,
.filter-panel .project-card h3,
.filter-panel .project-card p {
    text-align: center;
}

/* ============================================================
   SECTION — full-bleed background bands with constrained inner
============================================================ */

.section {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: clamp(64px, 9vw, 128px) 0;
}

.section:has(.section-inner--wide) {
    padding-top: 0px;
    padding-bottom: 0px;
}

.section-inner {
    max-width: var(--w);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.section-inner--wide {
    max-width: 1000px;
}

.section-inner--full {
    max-width: none;
    padding: 0;
}

.section--offwhite {
    background: #f4f2ea;
    color: black;
}

.section p:last-child {
    margin-bottom: 0;
}

.section--ink a {
    color: var(--lime);
}

/* ============================================================
   MASONRY
============================================================ */

.masonry {
    column-count: 2;
    column-gap: 16px;
}

@media (min-width: 720px) {
    .masonry {
        column-count: 3;
    }
}

.masonry img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 16px;
    break-inside: avoid;
}

/* ============================================================
   LOADING SCREEN
============================================================ */

#loading-screen {
    position: fixed;
    inset: 0;
    background: var(--lime);
    z-index: 9999;
    transform: translateY(0);
    transition: transform 0.5s ease;
}

#loading-screen.loaded {
    transform: translateY(100%);
    pointer-events: none;
}

/* ============================================================
   ANIMATIONS
============================================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleUpFade {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    animation: scaleUpFade 0.4s ease-in forwards;
    opacity: 0;
    animation-delay: 0.2s;
}

p.intro {
    animation: fadeIn 0.6s ease-in forwards;
    opacity: 0;
    animation-delay: 0.4s;
}

body.home p.intro {
    animation-delay: 0.8s;
}

/* ============================================================
   MOBILE OVERRIDES
   (padding removed — container owns the gutter, not the element)
============================================================ */

@media (max-width: 720px) {

    p,
    main > p,
    p.intro,
    main h2 {
        text-align: left;
        margin-left: auto;
        margin-right: auto;
    }

    .project-card {
        gap: 0;
        max-width: 90%;
    }

    .intro-hero {
        text-align: left;
    }
}
