@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&family=Inter:wght@300;400&display=swap');

:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
    --spacing-unit: 1rem;
    --header-height: 80px;
    --site-gap: 3vw; /* Unified margin/gap value */
}

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

html, body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    overscroll-behavior: none; /* Prevent rubber-band effect */
    height: 100vh;
    width: 100vw;
}

html.js [data-image-frame] {
    position: relative;
    isolation: isolate;
}

html.js [data-image-frame]::after {
    content: none;
}

html.js [data-image-frame].is-loaded::after {
    content: none;
}

html.js img[data-reveal-image] {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
    will-change: auto;
    backface-visibility: hidden;
}

html.js img[data-reveal-image].is-ready {
    opacity: 1;
    filter: none;
}

@media (prefers-reduced-motion: reduce) {
    html.js [data-image-frame]::after {
        content: none;
    }

    html.js img[data-reveal-image] {
        transition: none;
        transform: none;
        filter: none;
    }
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--site-gap);
    height: var(--header-height);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 5000;
    background: var(--bg-color);
}

.logo {
    font-size: 0.96rem;
    letter-spacing: 0.1em;
    font-weight: 400;
    text-transform: uppercase;
}

.logo a {
    display: inline-grid;
    gap: 0.1rem;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

.logo-title {
    line-height: 1;
}

.logo-subtitle {
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    line-height: 1;
    color: #6f6f6f;
}

.logo a:hover {
    opacity: 0.6;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    font-weight: 400;
    white-space: nowrap;
    opacity: 0.45;
    transition: opacity 0.3s ease;
}

nav ul li a.active {
    opacity: 1;
}

nav ul li a:hover {
    opacity: 0.75;
}

.nav-toggle {
    display: none;
    appearance: none;
    border: 0;
    background: transparent;
    width: 2.9rem;
    height: 2.9rem;
    padding: 0;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    cursor: pointer;
    z-index: 5200;
}

.nav-toggle-line {
    display: block;
    width: 1.2rem;
    height: 1px;
    background: #111;
    transition: transform 0.28s ease, opacity 0.28s ease;
}

body.nav-open .nav-toggle-line:nth-child(1) {
    transform: translateY(0.38rem) rotate(45deg);
}

body.nav-open .nav-toggle-line:nth-child(2) {
    opacity: 0;
}

body.nav-open .nav-toggle-line:nth-child(3) {
    transform: translateY(-0.38rem) rotate(-45deg);
}

/* Main Layout */
main {
    padding: 0 var(--site-gap); /* Force side margins on all content */
    margin-top: var(--header-height);
    height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: var(--site-gap); /* Bottom margin */
}

.page-static,
.page-static body {
    overflow: auto;
    height: auto;
    min-height: 100vh;
    width: 100%;
}

.page-static main {
    height: auto;
    min-height: calc(100vh - var(--header-height));
    justify-content: flex-start;
    padding-bottom: 2.5rem;
}

html.always-scrollbar {
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.32) transparent;
}

html.always-scrollbar::-webkit-scrollbar {
    width: 0.62rem;
}

html.always-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.04);
}

html.always-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.28);
    border-radius: 999px;
}

.project-grid {
    position: relative;
    overflow: hidden;
    cursor: grab;
    margin: 0;
    padding: 0;
    touch-action: pan-y;
    user-select: none;
}

.project-grid.is-dragging {
    cursor: grabbing;
}

.project-track {
    display: flex;
    align-items: flex-end;
    gap: var(--site-gap);
    will-change: transform;
}

.project-item {
    flex: 0 0 calc((100% - 2 * var(--site-gap)) / 3); /* Fits exactly 3 items with 2 gaps */
    min-width: 300px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-header {
    margin-bottom: 1.5rem;
    width: 100%;
}

.project-title {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 3.5vw, 2.8rem); /* Responsive font size */
    line-height: 0.94;
    text-transform: uppercase;
    font-weight: 400;
    letter-spacing: -0.025em;
    word-spacing: 0.12em;
    color: var(--text-color);
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}

.project-title span.italic {
    font-style: italic;
    font-family: var(--font-serif);
}

.project-image-container {
    width: 100%;
    aspect-ratio: 1.1 / 1;
    overflow: hidden;
    background-color: #f5f5f5;
}

.project-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-item:hover .project-image-container img {
    transform: scale(1.05);
}

.projects-page,
.tierra-page {
    position: fixed;
    inset: 0;
    z-index: 3500;
    padding: calc(var(--header-height) + 1.3rem) var(--site-gap) 1.8rem;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.45s ease, visibility 0.45s ease;
    background: #ffffff;
}

.projects-page.visible,
.tierra-page.visible {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

body[data-page="projects"] .projects-page,
body[data-page="tierra"] .tierra-page {
    position: relative;
    inset: auto;
    z-index: auto;
    padding: 0;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transition: none;
    background: transparent;
}

body[data-page="projects"] .projects-page-shell {
    max-width: 1480px;
    margin: 0 auto;
}

body[data-page="projects"] {
    overflow-y: scroll;
    overflow-x: hidden;
    height: auto;
    min-height: 100vh;
}

body[data-page="projects"] main {
    display: block;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    margin-top: 0;
    height: calc(100vh - var(--header-height));
    min-height: calc(100vh - var(--header-height));
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 2.5rem;
}

body[data-page="projects"] .projects-page,
body[data-page="projects"] .projects-page-shell {
    min-height: 0;
}

body[data-page="projects"] .projects-page {
    height: 100%;
    overflow: hidden;
}

body[data-page="projects"] .projects-page::-webkit-scrollbar {
    width: 0;
    height: 0;
}

body[data-page="tierra"] .tierra-page {
    overflow: visible;
}

body[data-page="tierra"] .tierra-page-shell {
    height: auto;
    min-height: auto;
}

body[data-page="tierra"] {
    overflow-y: scroll;
    overflow-x: hidden;
    height: auto;
    min-height: 100vh;
}

body[data-page="tierra"] main {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    margin-top: var(--header-height);
    height: auto;
    min-height: calc(100vh - var(--header-height));
    overflow: visible;
    padding-top: 0;
    padding-bottom: 2.5rem;
}

body[data-page="about"] {
    overflow-y: scroll;
    overflow-x: hidden;
    height: auto;
    min-height: 100vh;
}

body[data-page="about"] main {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    margin-top: 0;
    height: calc(100vh - var(--header-height));
    min-height: calc(100vh - var(--header-height));
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 1.8rem;
}

body[data-page="about"] .about-page,
body[data-page="about"] .about-page-shell {
    height: 100%;
    min-height: 100%;
    overflow: hidden;
}

.projects-page-shell {
    display: grid;
    gap: 2.2rem;
    max-width: 1480px;
    margin: 0 auto;
}

.projects-page-intro {
    display: grid;
    gap: 1.1rem;
    max-width: 680px;
}

.projects-page-heading {
    display: block;
}

#projects-page-title {
    font-family: var(--font-serif);
    font-size: clamp(2.8rem, 5.6vw, 4.4rem);
    line-height: 0.96;
    letter-spacing: -0.02em;
    word-spacing: 0.12em;
    font-weight: 400;
    text-transform: uppercase;
}

#projects-page-title .italic {
    font-style: italic;
}

.projects-page-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 1.4rem;
    padding-top: 0.2rem;
}

.projects-page-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0;
    border: 0;
}

.projects-page-stat span {
    font-family: var(--font-sans);
    font-size: 0.76rem;
    line-height: 1;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #222;
}

.projects-page-stat small {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #7a7a7a;
}

.projects-page-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem 1.35rem;
    align-items: start;
}

.projects-card {
    display: grid;
    gap: 0.8rem;
    cursor: pointer;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.projects-card:hover {
    transform: translateY(-0.35rem);
}

.projects-card-media {
    position: relative;
    overflow: hidden;
    background: #f2f2f2;
    aspect-ratio: 5 / 6;
}

.projects-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
}

.projects-card:hover .projects-card-media img {
    transform: scale(1.03);
    filter: saturate(1.02);
}

.projects-card-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.2rem 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.projects-card-meta {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 0.5rem;
    grid-column: 2;
    grid-row: 1;
    padding-top: 0.15rem;
    font-size: 0.66rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: #7f7f7f;
}

.projects-card-title {
    font-family: var(--font-serif);
    grid-column: 1;
    grid-row: 1;
    font-size: clamp(1.45rem, 2.2vw, 2.1rem);
    line-height: 0.96;
    letter-spacing: -0.015em;
    word-spacing: 0.12em;
    font-weight: 400;
    text-transform: uppercase;
}

.projects-card-title .italic {
    font-style: italic;
}

.tierra-page {
    overflow: visible;
}

.tierra-page-shell {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    grid-template-rows: auto;
    gap: clamp(2rem, 3vw, 4.1rem);
    max-width: 1480px;
    margin: 0 auto;
    align-items: start;
}

.tierra-story {
    min-width: 0;
    min-height: 0;
    display: grid;
    gap: clamp(1.45rem, 2.2vw, 2rem);
    align-content: start;
    padding-top: 0;
    padding-right: clamp(0.4rem, 1.05vw, 1rem);
    height: auto;
    overflow: visible;
}

.tierra-panel {
    min-width: 0;
}

.tierra-copy {
    display: grid;
    align-content: start;
    gap: clamp(1.45rem, 2vw, 1.95rem);
    max-width: 36rem;
    margin-top: 0;
}

.tierra-title {
    font-family: var(--font-serif);
    font-size: clamp(2.8rem, 5.6vw, 4.4rem);
    line-height: 0.96;
    letter-spacing: -0.02em;
    word-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 400;
}

.tierra-subtitle {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    line-height: 1.35;
    letter-spacing: 0.18em;
    font-weight: 400;
    text-transform: uppercase;
    color: #737373;
}

.tierra-rule {
    width: 3.7rem;
    height: 1px;
    background: rgba(0, 0, 0, 0.42);
    margin: 0.2rem 0 0.65rem;
}

.tierra-copy-body {
    display: grid;
    gap: 1.05rem;
    max-width: 32rem;
}

.tierra-copy-body p {
    font-family: var(--font-sans);
    font-size: clamp(0.82rem, 0.9vw, 0.95rem);
    line-height: 1.72;
    letter-spacing: 0.012em;
    color: #3f3f3f;
}

.tierra-signature {
    width: clamp(7.4rem, 18vw, 10.8rem);
    height: auto;
    display: block;
    margin-top: 0.2rem;
    opacity: 0.82;
}

.tierra-details {
    display: grid;
    gap: 0;
    padding-top: 1.55rem;
    padding-bottom: 1.55rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.tierra-block-kicker {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    letter-spacing: 0.19em;
    line-height: 1.4;
    text-transform: uppercase;
    color: #4b4b4b;
    margin-bottom: 1.2rem;
}

.tierra-chapters {
    display: grid;
}

.tierra-chapter-row {
    display: grid;
    grid-template-columns: minmax(145px, 0.72fr) minmax(0, 1.28fr);
    gap: 1.2rem;
    align-items: start;
    padding: 0.95rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.tierra-chapter-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.tierra-chapter-row:last-child {
    padding-bottom: 0;
}

.tierra-chapter-head {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    min-width: 0;
}

.tierra-chapter-index {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    line-height: 1;
    color: #9a9a9a;
    flex: none;
}

.tierra-chapter-title {
    font-family: var(--font-serif);
    font-size: clamp(1.38rem, 1.62vw, 1.72rem);
    line-height: 1.02;
    letter-spacing: -0.015em;
    word-spacing: 0.04em;
    font-weight: 400;
    text-transform: uppercase;
}

.tierra-chapter-text {
    font-family: var(--font-sans);
    font-size: 0.82rem;
    line-height: 1.64;
    letter-spacing: 0.01em;
    color: #4a4a4a;
}

.tierra-specs-block {
    max-width: 35rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.tierra-specs {
    margin: 0;
    padding-left: 1.05rem;
    display: grid;
    gap: 0.72rem 1.6rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tierra-specs li {
    font-family: var(--font-sans);
    font-size: 0.79rem;
    line-height: 1.58;
    letter-spacing: 0.01em;
    color: #2f2f2f;
}

.tierra-media-stage {
    min-width: 0;
    min-height: 0;
    position: static;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-self: start;
    height: auto;
    transform: none;
}

.tierra-media-stack {
    width: 100%;
    max-width: 49rem;
    margin: 0 0 0 auto;
    display: grid;
    gap: 1.35rem;
    align-content: start;
}

.tierra-media {
    display: grid;
    grid-template-columns: minmax(340px, 1fr) minmax(185px, 0.58fr);
    gap: 1rem;
    align-items: stretch;
}

.tierra-book-placeholder,
.tierra-photo-card {
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
    background: #f2f2f2;
}

.tierra-book-placeholder {
    background: #f6f4ef;
    min-height: clamp(22rem, 48vh, 30rem);
    display: grid;
    place-items: center;
    padding: clamp(1.3rem, 2vw, 1.9rem);
}

.tierra-lightbox-trigger {
    appearance: none;
    width: 100%;
    padding: 0;
    text-align: left;
    cursor: zoom-in;
}

.tierra-book-cover {
    position: relative;
    width: min(100%, 22rem);
    aspect-ratio: 4 / 5;
    border-radius: 0.16rem;
    overflow: hidden;
    background: #101010;
    box-shadow: -12px 0 0 #1a1a1a, 0 18px 34px rgba(0, 0, 0, 0.24);
}

.tierra-book-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 14, 19, 0.7) 0%, rgba(10, 14, 19, 0.14) 42%, rgba(10, 14, 19, 0.54) 100%);
}

.tierra-book-cover-image,
.tierra-photo-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

.tierra-book-cover-image {
    filter: saturate(0.9) contrast(1.02);
}

.tierra-book-flat-image,
.tierra-spread-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    filter: none;
}

.tierra-book-cover-copy {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    align-content: start;
    justify-items: center;
    gap: 0.55rem;
    padding: clamp(1.6rem, 3vw, 2.2rem) 1.15rem 1.3rem;
    text-align: center;
}

.tierra-book-cover-copy span {
    font-family: var(--font-serif);
    font-size: clamp(1.55rem, 2vw, 2rem);
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f2f1ec;
}

.tierra-book-cover-copy small {
    font-family: var(--font-sans);
    font-size: 0.68rem;
    line-height: 1.2;
    letter-spacing: 0.24em;
    color: rgba(242, 241, 236, 0.88);
}

.tierra-side-media {
    display: grid;
    gap: 1rem;
}

.tierra-photo-card {
    min-height: clamp(10rem, 21vh, 13rem);
    background: #f7f5f0;
    padding: 0.8rem;
    display: grid;
    place-items: center;
}

.tierra-side-media .tierra-photo-card:first-child {
    background: #f4f3f3;
}

.tierra-side-media .tierra-photo-card:last-child {
    background: #f1f0f0;
}

.tierra-photo-image {
    object-position: center;
}

.tierra-book-placeholder:hover .tierra-book-cover-image,
.tierra-photo-card:hover .tierra-photo-image {
    transform: scale(1.03);
}

.tierra-purchase {
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.tierra-purchase-frame {
    display: grid;
    grid-template-columns: minmax(0, 0.78fr) minmax(260px, 1fr);
    align-items: stretch;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
}

.tierra-price {
    min-width: 0;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0.35rem;
    padding: 1.55rem clamp(1.25rem, 2vw, 1.65rem);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    text-align: center;
}

.tierra-purchase-actions {
    min-width: 0;
    display: grid;
    justify-items: center;
    align-content: center;
    text-align: center;
    gap: 0.95rem;
    padding: 1.45rem clamp(1.2rem, 1.9vw, 1.75rem);
}

.tierra-price-value {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 4.2vw, 3.8rem);
    line-height: 0.92;
    letter-spacing: -0.02em;
    word-spacing: 0.1em;
    font-weight: 400;
    margin-bottom: 0.35rem;
}

.tierra-shipping {
    font-family: var(--font-sans);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    line-height: 1.4;
    color: #787878;
    margin-bottom: 0;
}

.tierra-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 15.5rem;
    border: 0;
    background: #101010;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0.92rem 1rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tierra-cta:hover {
    opacity: 0.86;
    transform: translateY(-1px);
}

.tierra-note {
    font-family: var(--font-sans);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    color: #888;
}

.content-page {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    gap: 2.4rem;
    padding-top: 1.3rem;
}

.contact-page {
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding-top: 0;
}

.contact-page-shell {
    display: grid;
    gap: 2.5rem;
    align-items: start;
    max-width: 42rem;
}

.contact-page-intro {
    display: grid;
    gap: 0.9rem;
    max-width: 40rem;
    padding-top: 0;
}

.contact-feedback {
    font-family: var(--font-sans);
    font-size: 0.82rem;
    line-height: 1.6;
    color: #4d5a48;
}

.contact-form-shell {
    width: 100%;
    max-width: 40rem;
    justify-self: start;
    padding: 0;
    border: 0;
    background: transparent;
}

.contact-form {
    display: grid;
    gap: 1.15rem;
}

.contact-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.contact-field {
    display: grid;
    gap: 0.58rem;
}

.contact-field-full {
    grid-column: 1 / -1;
}

.contact-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.contact-label {
    font-family: var(--font-sans);
    font-size: 0.66rem;
    line-height: 1.35;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #6d6d6d;
}

.contact-input {
    width: 100%;
    border: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.16);
    background: transparent;
    color: #111;
    font-family: var(--font-sans);
    font-size: 0.94rem;
    line-height: 1.5;
    padding: 0.78rem 0 0.88rem;
    border-radius: 0;
    appearance: none;
    transition: border-color 0.25s ease, color 0.25s ease;
}

.contact-input::placeholder {
    color: #8a8a8a;
}

.contact-input:focus {
    outline: none;
    border-bottom-color: #111;
}

.contact-textarea {
    min-height: 11.5rem;
    resize: vertical;
}

.contact-form-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    padding-top: 0.4rem;
}

.contact-form-note {
    max-width: 24rem;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    line-height: 1.55;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #7a7a7a;
}

.contact-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: #101010;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    min-width: 14rem;
    padding: 0.98rem 1.35rem;
    border-radius: 999px;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.contact-submit:hover {
    opacity: 0.86;
    transform: translateY(-1px);
}

.about-page {
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding-top: 0;
}

.about-photo-wrap {
    margin: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #f2f2f0;
    overflow: hidden;
}

.content-page-header {
    display: grid;
    gap: 1rem;
    max-width: 46rem;
}

.about-header {
    max-width: none;
    gap: 0;
    justify-self: start;
    width: 100%;
}

.about-header .content-page-title {
    width: fit-content;
}

.content-page-title {
    font-family: var(--font-serif);
    font-size: clamp(2.8rem, 5.6vw, 4.4rem);
    line-height: 0.96;
    letter-spacing: -0.02em;
    word-spacing: 0.12em;
    font-weight: 400;
    text-transform: uppercase;
}

.content-page-kicker {
    font-size: 0.72rem;
    line-height: 1.35;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #737373;
}

.content-page-lead {
    font-size: clamp(0.92rem, 1.3vw, 1.08rem);
    line-height: 1.72;
    color: #3d3d3d;
    max-width: 40rem;
}

.content-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
    gap: 1.6rem;
    align-items: start;
}

.about-page-shell {
    display: grid;
    grid-template-columns: minmax(245px, 0.56fr) minmax(0, 1.44fr);
    grid-template-areas: "media story";
    gap: clamp(2.2rem, 3.4vw, 4.6rem);
    align-items: stretch;
}

.about-story {
    grid-area: story;
    min-width: 0;
    min-height: 0;
    display: grid;
    gap: clamp(1.55rem, 2.35vw, 2.15rem);
    align-content: start;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: clamp(5rem, 6.5vw, 6.2rem);
    padding-right: clamp(0.4rem, 1.05vw, 1rem);
    scrollbar-width: none;
}

.about-story::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.about-panel {
    min-width: 0;
}

.about-copy {
    display: grid;
    align-content: start;
    gap: 1.05rem;
    max-width: 43rem;
}

.about-media-column {
    width: 100%;
    max-width: 24rem;
    display: grid;
    align-content: start;
    gap: clamp(1.25rem, 2vw, 1.55rem);
}

.about-photo-shell {
    width: 100%;
    max-width: 23rem;
    aspect-ratio: 4 / 5.15;
}

.about-photo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.about-title {
    font-family: var(--font-serif);
    font-size: clamp(2.8rem, 5.6vw, 4.4rem);
    line-height: 0.96;
    letter-spacing: -0.02em;
    word-spacing: 0.12em;
    font-weight: 400;
    text-transform: uppercase;
}

.about-text-flow p {
    font-size: clamp(0.84rem, 0.94vw, 0.96rem);
    line-height: 1.72;
    letter-spacing: 0.012em;
    color: #3f3f3f;
}

.about-media-stage {
    grid-area: media;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.about-text-flow {
    display: grid;
    gap: 0.95rem;
    max-width: 42rem;
}

.about-signature {
    margin-top: 0.15rem;
}

.content-card {
    display: grid;
    gap: 0.9rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.content-card-title {
    font-family: var(--font-serif);
    font-size: clamp(1.4rem, 2vw, 1.8rem);
    line-height: 1;
    font-weight: 400;
    text-transform: uppercase;
}

.content-card p,
.content-card li,
.content-card a {
    font-size: 0.92rem;
    line-height: 1.7;
    color: #3f3f3f;
    text-decoration: none;
}

.content-card ul {
    list-style: none;
    display: grid;
    gap: 0.65rem;
    padding: 0;
}

.content-card a:hover {
    opacity: 0.65;
}

.tierra-media-stage {
    min-width: 0;
    height: auto;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.tierra-media {
    position: sticky;
    top: calc(var(--header-height) + 0.9rem);
    display: grid;
    grid-template-columns: minmax(330px, 1fr) minmax(185px, 0.58fr);
    gap: 1rem;
    align-items: stretch;
    width: 100%;
    max-width: 49rem;
    margin-left: auto;
}

.tierra-book-placeholder,
.tierra-photo-placeholder {
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
}

.tierra-book-placeholder {
    background: linear-gradient(155deg, #f2f1ed 0%, #e5e1d9 52%, #faf8f4 100%);
    min-height: clamp(21rem, 47vh, 28rem);
    display: grid;
    place-items: center;
    padding: 1.8rem;
}

.tierra-book-cover {
    width: min(100%, 20.5rem);
    aspect-ratio: 4 / 5;
    border-radius: 0.2rem;
    background: linear-gradient(175deg, #0f171f 0%, #233347 50%, #10171f 100%);
    box-shadow: -14px 0 0 #111, 0 16px 30px rgba(0, 0, 0, 0.24);
    display: grid;
    place-items: center;
    padding: 1.6rem;
}

.tierra-book-cover span {
    font-family: var(--font-serif);
    font-size: clamp(1.35rem, 2vw, 1.9rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f1f1f1;
    text-align: center;
}

.tierra-side-media {
    display: grid;
    gap: 1rem;
}

.tierra-photo-placeholder {
    min-height: clamp(9.8rem, 21vh, 13rem);
}

.tierra-photo-top {
    background: linear-gradient(160deg, #ccd2d8 0%, #8fa0aa 48%, #697b70 100%);
}

.tierra-photo-bottom {
    background: linear-gradient(155deg, #1b2f4f 0%, #234e78 52%, #8f7249 100%);
}

/* Tierra page: desktop split scroll */
body[data-page="tierra"] {
    overflow: hidden;
    height: 100vh;
    min-height: 100vh;
}

body[data-page="tierra"] main {
    display: block;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    margin-top: 0;
    height: calc(100vh - var(--header-height));
    min-height: calc(100vh - var(--header-height));
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 2rem;
}

body[data-page="tierra"] .tierra-page {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

body[data-page="tierra"] .tierra-page-shell {
    height: 100%;
    min-height: 0;
    align-items: stretch;
}

body[data-page="tierra"] .tierra-story {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: clamp(0.4rem, 1.05vw, 1rem);
    padding-bottom: 0.4rem;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
    overscroll-behavior: contain;
}

body[data-page="tierra"] .tierra-story::-webkit-scrollbar {
    width: 0.46rem;
}

body[data-page="tierra"] .tierra-story::-webkit-scrollbar-track {
    background: transparent;
}

body[data-page="tierra"] .tierra-story::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.22);
    border-radius: 999px;
}

body[data-page="tierra"] .tierra-media-stage {
    height: 100%;
    min-height: 0;
    align-self: stretch;
}

body[data-page="tierra"] .tierra-media-stack {
    height: 100%;
    max-height: 100%;
    grid-template-rows: auto auto;
    gap: 1.1rem;
}

body[data-page="tierra"] .tierra-media {
    position: static;
    height: min(100%, calc(100dvh - var(--header-height) - clamp(10.8rem, 18vh, 12.5rem)));
    max-height: calc(100dvh - var(--header-height) - clamp(10.8rem, 18vh, 12.5rem));
    min-height: 0;
    max-width: none;
    margin-left: 0;
    grid-template-columns: minmax(0, 1fr) minmax(145px, 0.5fr);
    gap: 0.9rem;
}

body[data-page="tierra"] .tierra-book-placeholder,
body[data-page="tierra"] .tierra-side-media,
body[data-page="tierra"] .tierra-photo-card {
    min-height: 0;
}

body[data-page="tierra"] .tierra-book-placeholder {
    height: 100%;
    padding: clamp(1.5rem, 3vw, 3rem); /* Increased padding */
    overflow: hidden;
    display: grid;
    place-items: center;
}

body[data-page="tierra"] .tierra-side-media {
    height: 100%;
    grid-template-rows: repeat(2, minmax(0, 1fr));
}

body[data-page="tierra"] .tierra-photo-card {
    height: 100%;
    padding: clamp(1rem, 2vw, 2rem); /* Increased padding */
    overflow: hidden;
    display: grid;
    place-items: center;
}

body[data-page="tierra"] .tierra-book-cover-image,
body[data-page="tierra"] .tierra-photo-image,
body[data-page="tierra"] .tierra-book-flat-image,
body[data-page="tierra"] .tierra-spread-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

body[data-page="tierra"] .tierra-book-placeholder:hover .tierra-book-cover-image,
body[data-page="tierra"] .tierra-photo-card:hover .tierra-photo-image {
    transform: none;
}

body[data-page="tierra"] .tierra-purchase {
    padding-top: 0;
    border-top: 0;
}

body[data-page="tierra"] .tierra-purchase-frame {
    grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr);
}

/* Gallery View */
#gallery-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color);
    z-index: 4000;
    overflow-y: auto;
    padding: var(--header-height) 0 var(--site-gap);
    transition: opacity 0.6s ease;
    opacity: 0;
    pointer-events: none;
    column-fill: auto; /* Prevent layout rebalancing during transition */
}

#gallery-view.visible {
    opacity: 1;
    pointer-events: auto;
}

.hidden {
    display: none;
}

.compact-source-hidden {
    display: none !important;
}

.gallery-controls {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 4rem;
    padding: 1rem var(--site-gap) 0; /* Internal padding for controls only */
}

.control-left { justify-self: start; }
.project-info {
    justify-self: center;
    width: min(100%, 44rem);
    display: grid;
    justify-items: center;
    gap: 0.8rem;
}
.control-right { justify-self: end; }

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn svg {
    fill: currentColor;
    transition: opacity 0.3s ease;
}

.minimal-btn {
    background: none;
    border: none;
    font-family: var(--font-sans);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    padding: 0;
    color: var(--text-color);
    transition: opacity 0.3s ease;
}

.minimal-btn:hover {
    opacity: 0.5;
}

#back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

#gallery-title {
    font-family: var(--font-serif);
    font-size: 3rem;
    text-transform: uppercase;
    font-weight: 400;
    letter-spacing: -0.025em;
    word-spacing: 0.12em;
    line-height: 0.94;
    margin: 0;
}

.gallery-description {
    margin-top: 0.35rem;
    max-width: 42rem;
    font-family: var(--font-sans);
    font-size: clamp(0.88rem, 1vw, 0.96rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    color: #494949;
    text-align: left;
}

.gallery-description p {
    margin: 0;
}

.gallery-description p + p {
    margin-top: 0.85rem;
}

.gallery-grid {
    column-count: 3;
    column-gap: var(--site-gap);
    padding: 0 var(--site-gap);
    width: 100%;
    display: block; /* column-count works best on block */
}

.gallery-grid.small-view {
    column-count: 5;
}

.gallery-item {
    width: 100%;
    display: inline-block; /* Essential for masonry columns */
    margin-bottom: 2rem;
    break-inside: avoid;
}

.gallery-item-header {
    margin-bottom: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.gallery-item-number {
    font-size: 0.6rem;
    color: #999;
    font-weight: 400;
}

html.js .gallery-item:not(.is-media-ready) .gallery-item-header {
    opacity: 0;
    visibility: hidden;
}

html.js .gallery-item.is-media-ready .gallery-item-header {
    opacity: 1;
    visibility: visible;
}

.gallery-image-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    background: #f3f0eb;
}

html.js .gallery-image-container[data-image-frame]::after {
    content: none;
}

.gallery-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

html.js .gallery-image-container img[data-reveal-image] {
    transform: none;
    filter: none;
    transition: none;
}

/* Transition classes */
.fade-out {
    opacity: 0 !important;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.hero-image-transition {
    position: fixed;
    z-index: 4500;
    transition: top 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                left 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                width 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                height 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                opacity 0.4s ease;
    pointer-events: none;
    object-fit: cover;
    transform-origin: top left;
}

/* Lightbox */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    z-index: 6000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: calc(var(--header-height) + clamp(0.9rem, 1.8vh, 1.4rem)) clamp(1rem, 2.8vw, 2.4rem) clamp(1rem, 2.5vh, 2rem);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#lightbox.visible {
    opacity: 1;
    pointer-events: auto;
}

#lightbox.visible #lightbox-img {
    transform: scale(1);
}

#lightbox-img {
    max-width: min(94vw, 1800px);
    max-height: calc(100dvh - var(--header-height) - clamp(5rem, 12vh, 8rem));
    object-fit: contain;
    transform: scale(0.95);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    max-height: 100%;
    gap: 2rem;
}

.lightbox-img-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    width: 100%;
}

.lightbox-footer {
    display: flex;
    align-items: center;
    gap: 3rem;
    padding-bottom: 2rem;
}

.lightbox-nav-btn {
    background: none;
    border: none;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--text-color);
    cursor: pointer;
    padding: 1rem;
    transition: opacity 0.3s ease;
    user-select: none;
    font-weight: 300;
}

.lightbox-nav-btn:hover {
    opacity: 0.5;
}

#lightbox-counter {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: #999;
    min-width: 60px;
    text-align: center;
}

.close-lightbox {
    position: absolute;
    top: calc(var(--header-height) + clamp(0.35rem, 1vh, 0.8rem));
    right: clamp(1rem, 2.8vw, 3rem);
    font-size: 2rem;
    cursor: pointer;
    z-index: 6001;
    font-weight: 200;
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    line-height: 1;
    color: #111;
}

body.lightbox-open {
    overflow: hidden !important;
}

/* Responsive */
@media (max-width: 1380px) {
    .tierra-page-shell {
        grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
        gap: 1.6rem;
    }
    .tierra-copy-body {
        max-width: 29rem;
    }
    .tierra-media-stack {
        max-width: 46rem;
    }
    .tierra-media {
        grid-template-columns: minmax(0, 1fr) minmax(145px, 0.5fr);
        gap: 0.85rem;
    }
    .tierra-book-placeholder {
        min-height: clamp(19rem, 42vh, 24rem);
        padding: 1.45rem;
    }
    .tierra-book-cover {
        width: min(100%, 19.1rem);
    }
    .tierra-photo-card {
        min-height: clamp(8.6rem, 18vh, 10.9rem);
    }
    .tierra-purchase-frame {
        grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr);
    }
    .tierra-price-value {
        font-size: clamp(2.55rem, 3.8vw, 3.2rem);
    }
}

@media (max-height: 860px) and (min-width: 769px) {
    .tierra-page {
        padding: calc(var(--header-height) + 1rem) var(--site-gap) 1rem;
    }
    .tierra-page-shell {
        gap: 1.2rem;
    }
    .tierra-story {
        gap: 1.45rem;
    }
    .tierra-copy-body {
        gap: 0.85rem;
    }
    .tierra-book-placeholder {
        min-height: clamp(18rem, 38vh, 21rem);
    }
    .tierra-photo-card {
        min-height: clamp(8.1rem, 16.5vh, 9.6rem);
    }
    .tierra-block-kicker {
        margin-bottom: 0.9rem;
    }
    .tierra-chapter-row {
        padding: 0.75rem 0 0.82rem;
    }
    .tierra-specs {
        gap: 0.65rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1200px) {
    body[data-page="tierra"] {
        overflow: auto;
        height: auto;
    }
    body[data-page="tierra"] main {
        position: static;
        top: auto;
        left: auto;
        right: auto;
        margin-top: var(--header-height);
        height: auto;
        min-height: calc(100vh - var(--header-height));
        overflow: visible;
        padding-top: 0;
        padding-bottom: 2.5rem;
    }
    body[data-page="tierra"] .tierra-page {
        overflow: visible;
    }
    body[data-page="tierra"] .tierra-page-shell {
        height: auto;
        min-height: auto;
    }
    body[data-page="tierra"] .tierra-story {
        height: auto;
        overflow: visible;
        padding-bottom: 0;
        scrollbar-gutter: auto;
    }
    body[data-page="tierra"] .tierra-media-stage {
        height: auto;
        min-height: auto;
    }
    body[data-page="tierra"] .tierra-media-stack {
        height: auto;
        max-height: none;
        grid-template-rows: auto;
        gap: 1.35rem;
    }
    body[data-page="tierra"] .tierra-media {
        height: auto;
        min-height: auto;
    }
    body[data-page="tierra"] .tierra-book-placeholder,
    body[data-page="tierra"] .tierra-side-media,
    body[data-page="tierra"] .tierra-photo-card {
        height: auto;
    }
    body[data-page="tierra"] .tierra-side-media {
        grid-template-rows: none;
    }
    body[data-page="tierra"] .tierra-book-flat-image,
    body[data-page="tierra"] .tierra-spread-image {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    body[data-page="about"] {
        overflow: auto;
        height: auto;
    }
    body[data-page="about"] main {
        position: static;
        top: auto;
        left: auto;
        right: auto;
        margin-top: var(--header-height);
        height: auto;
        min-height: calc(100vh - var(--header-height));
        overflow: visible;
        padding-top: 0;
        padding-bottom: 2.5rem;
    }
    body[data-page="about"] .about-page,
    body[data-page="about"] .about-page-shell {
        height: auto;
        min-height: auto;
        overflow: visible;
    }
    .project-item {
        flex: 0 0 calc((100% - 1 * var(--site-gap)) / 2); /* Fits 2 items */
        min-width: 250px;
    }
    .project-title {
        font-size: 2.2rem;
    }
    .gallery-grid {
        column-count: 2;
    }
    .projects-page-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .tierra-page-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 1.45rem;
    }
    .tierra-story {
        gap: 1.5rem;
        height: auto;
        overflow: visible;
        padding-right: 0;
    }
    .tierra-copy {
        max-width: 100%;
        gap: 1.2rem;
        padding-top: 0;
        margin-top: 0;
    }
    .tierra-signature {
        width: clamp(6.8rem, 34vw, 9.6rem);
        margin-top: 0.1rem;
    }
    .tierra-copy-body {
        max-width: 35rem;
    }
    .tierra-media-stack {
        position: static;
        max-width: none;
        margin: 0;
        align-content: start;
    }
    .tierra-media-stage {
        position: static;
        top: auto;
        justify-content: flex-start;
        height: auto;
        transform: none;
    }
    .tierra-media {
        grid-template-columns: minmax(0, 1fr) minmax(180px, 0.55fr);
    }
    .tierra-photo-card {
        padding: 0.7rem;
    }
    .tierra-purchase-frame {
        grid-template-columns: minmax(0, 0.82fr) minmax(245px, 1fr);
    }
    .tierra-specs-block {
        max-width: 38rem;
    }
    .about-page-shell {
        grid-template-columns: 1fr;
        grid-template-areas:
            "media"
            "story";
        gap: 1.6rem;
    }
    .about-story {
        gap: 1.5rem;
        height: auto;
        overflow: visible;
        padding-top: 0;
        padding-right: 0;
    }
    .about-copy,
    .about-text-flow {
        max-width: 100%;
    }
    .about-media-stage {
        justify-content: flex-start;
        align-items: flex-start;
    }
    .about-media-column {
        max-width: min(30rem, 100%);
        gap: 1.2rem;
    }
    .about-photo-shell {
        max-width: min(31rem, 100%);
        aspect-ratio: 4 / 5;
    }
}

@media (max-width: 1024px) {
    :root {
        --header-height: 88px;
        --site-gap: clamp(1rem, 3vw, 1.45rem);
        --home-title-space: clamp(7.55rem, 12.6vw, 8.75rem);
        --home-title-gap: clamp(1.25rem, 2.2vw, 1.7rem);
    }
    html,
    body {
        overflow: auto;
        height: auto;
        width: 100%;
        overscroll-behavior: auto;
    }
    header {
        padding: 0 var(--site-gap);
        height: var(--header-height);
    }
    .nav-toggle {
        display: inline-flex;
        flex-direction: column;
        margin-left: auto;
    }
    nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        align-items: flex-start;
        padding: 1.2rem var(--site-gap) 2rem;
        background: rgba(255, 255, 255, 0.98);
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        backdrop-filter: blur(12px);
        opacity: 0;
        transform: translateY(-0.6rem);
        pointer-events: none;
        overflow-y: auto;
        transition: opacity 0.28s ease, transform 0.28s ease;
    }
    body.nav-open nav {
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }
    body.nav-open {
        overflow: hidden;
    }
    nav ul {
        flex-direction: column;
        gap: 1rem;
    }
    nav ul li a {
        font-size: clamp(1rem, 2vw, 1.15rem);
        letter-spacing: 0.1em;
    }
    main {
        height: auto;
        min-height: calc(100vh - var(--header-height));
        margin-top: calc(var(--header-height) + 0.2rem);
        justify-content: flex-start;
        padding-bottom: 1.7rem;
    }
    .page-static main {
        padding-bottom: 2rem;
    }
    body[data-page="projects"] {
        overflow: auto;
        height: auto;
    }
    body[data-page="projects"] main {
        position: static;
        top: auto;
        left: auto;
        right: auto;
        margin-top: calc(var(--header-height) + 0.2rem);
        height: auto;
        min-height: calc(100vh - var(--header-height));
        overflow: visible;
        padding-top: 0;
        padding-bottom: 2rem;
    }
    body[data-page="projects"] .projects-page {
        height: auto;
        min-height: auto;
        overflow: visible;
    }
    body[data-page="projects"] .projects-page-shell {
        padding-right: 0;
    }
    .contact-page-shell {
        gap: 2.2rem;
    }
    .contact-page-intro {
        gap: 0.9rem;
        max-width: 34rem;
        padding-top: 0;
    }
    .contact-form-shell {
        max-width: none;
        justify-self: stretch;
        padding: 0;
    }
    .contact-form {
        gap: 1.2rem;
    }
    .contact-form-grid {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }
    .contact-form-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.9rem;
    }
    .contact-form-note {
        max-width: none;
    }
    .contact-input,
    .contact-textarea {
        font-size: 16px;
    }
    body[data-page="home"] main {
        height: calc(100dvh - var(--header-height));
        min-height: calc(100svh - var(--header-height));
        justify-content: flex-end;
        padding-top: clamp(0.8rem, 3.8vh, 1.8rem);
        padding-bottom: max(var(--site-gap), calc(env(safe-area-inset-bottom) + 0.35rem));
    }
    body[data-page="home"] .project-grid {
        align-self: stretch;
    }
    .project-grid {
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 0.2rem;
        cursor: default;
        touch-action: pan-x;
        user-select: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-padding-left: var(--site-gap);
        scroll-padding-right: var(--site-gap);
    }
    .project-grid::-webkit-scrollbar {
        display: none;
    }
    .project-track {
        width: max-content;
        align-items: flex-start;
        gap: clamp(0.95rem, 2vw, 1.2rem);
        padding-right: max(var(--site-gap), 8vw);
        will-change: auto;
    }
    body[data-page="home"] .project-track {
        align-items: flex-end;
    }
    .project-item {
        flex: 0 0 clamp(18rem, 55vw, 26rem);
        min-width: clamp(18rem, 55vw, 26rem);
        scroll-snap-align: start;
    }
    body[data-page="home"] .project-item {
        display: grid;
        grid-template-rows: calc(var(--home-title-space) + var(--home-title-gap)) auto;
        align-content: end;
    }
    .project-item.visible {
        transform: translateY(0);
    }
    .project-header {
        margin-bottom: 0.85rem;
    }
    body[data-page="home"] .project-header {
        min-height: calc(var(--home-title-space) + var(--home-title-gap));
        display: flex;
        align-items: flex-end;
        margin-bottom: 0;
        padding-bottom: var(--home-title-gap);
    }
    .project-title {
        font-size: clamp(1.95rem, 5.4vw, 3rem);
    }
    .project-image-container {
        aspect-ratio: 4 / 5;
    }
    body[data-page="home"] .project-image-container {
        aspect-ratio: 3.75 / 5;
    }
    .projects-page {
        padding: calc(var(--header-height) + 1rem) var(--site-gap) 1.8rem;
    }
    .projects-page-shell {
        gap: 1.8rem;
    }
    #gallery-view {
        padding: calc(var(--header-height) + 0.95rem) 0 1.6rem;
    }
    body.gallery-open {
        overflow: auto;
    }
    body.gallery-open main {
        height: auto;
        min-height: calc(100vh - var(--header-height));
        justify-content: flex-start;
        padding-bottom: 1.7rem;
    }
    body.gallery-open #gallery-view {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 0 0 1.6rem;
        opacity: 1;
        pointer-events: auto;
        overflow: visible;
        background: transparent;
        z-index: auto;
    }
    body.gallery-open .gallery-controls {
        margin-bottom: 1.2rem;
        padding-top: 0.15rem;
    }
    .gallery-controls {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 0.8rem;
        margin-bottom: 1.35rem;
        padding: 0 var(--site-gap);
    }
    .control-left,
    .project-info,
    .control-right {
        justify-self: stretch;
    }
    .project-info {
        width: 100%;
    }
    .gallery-description {
        max-width: none;
        font-size: 0.84rem;
        line-height: 1.64;
    }
    .control-right {
        display: none;
    }
    .minimal-btn {
        font-size: 0.66rem;
        letter-spacing: 0.15em;
    }
    #gallery-title {
        font-size: clamp(2.2rem, 7vw, 3.2rem);
        line-height: 0.92;
        max-width: 8ch;
    }
    .gallery-grid {
        column-count: 2;
        column-gap: 1rem;
    }
    .gallery-item {
        margin-bottom: 1.35rem;
    }
    .gallery-item-header {
        margin-bottom: 0.55rem;
    }
    .content-page {
        gap: 2rem;
        padding-top: 0.6rem;
    }
    .content-page-header {
        gap: 0.9rem;
    }
    .content-page-title {
        font-size: clamp(2.7rem, 7vw, 4rem);
    }
    .about-page-shell {
        gap: 1.45rem;
    }
    .about-media-column {
        gap: 1.1rem;
    }
    .about-story {
        gap: 1.35rem;
        padding-top: 0;
    }
    .about-copy {
        gap: 1rem;
    }
    .about-text-flow p {
        font-size: 0.88rem;
        line-height: 1.66;
    }
    .about-text-flow {
        gap: 0.95rem;
        padding-top: 0.15rem;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 82px;
        --site-gap: 1rem;
        --home-title-space: clamp(7rem, 27vw, 8rem);
        --home-title-gap: clamp(1.15rem, 3.2vw, 1.45rem);
    }
    header {
        justify-content: space-between;
    }
    nav ul {
        gap: 0.8rem;
    }
    nav ul li a {
        font-size: 0.86rem;
    }
    main {
        height: auto;
        margin-top: calc(var(--header-height) + 0.1rem);
        padding: 0 var(--site-gap) 1.35rem;
    }
    body[data-page="home"] main {
        height: calc(100dvh - var(--header-height));
        min-height: calc(100svh - var(--header-height));
        justify-content: flex-end;
        padding-top: 0.75rem;
        padding-bottom: max(var(--site-gap), calc(env(safe-area-inset-bottom) + 0.35rem));
    }
    .project-grid {
        overflow-x: auto;
        overflow-y: hidden;
        cursor: default;
        touch-action: pan-x;
        user-select: auto;
    }
    .project-track {
        flex-direction: row;
        gap: 0.95rem;
        width: max-content;
        padding-right: max(var(--site-gap), 10vw);
        transform: none !important;
    }
    .project-item {
        flex: 0 0 72vw;
        width: 72vw;
        min-width: 72vw;
        margin-bottom: 0;
    }
    .project-image-container {
        aspect-ratio: 4 / 5;
    }
    body[data-page="home"] .project-image-container {
        aspect-ratio: 3.7 / 5;
    }
    .project-title {
        font-size: clamp(1.8rem, 9.6vw, 2.55rem);
    }
    body[data-page="home"] .project-header {
        padding-bottom: var(--home-title-gap);
    }
    .projects-page {
        padding: calc(var(--header-height) + 1.2rem) var(--site-gap) 2rem;
    }
    .projects-page-shell {
        gap: 1.8rem;
    }
    .content-page {
        gap: 1.8rem;
        padding-top: 1.2rem;
    }
    .contact-page-shell {
        gap: 2rem;
    }
    .contact-page-intro {
        gap: 0.8rem;
    }
    .contact-form-shell {
        padding: 0;
    }
    .contact-form {
        gap: 1.05rem;
    }
    .contact-label {
        font-size: 0.64rem;
    }
    .contact-input {
        padding: 0.85rem 0 0.82rem;
    }
    .contact-textarea {
        min-height: 12.5rem;
    }
    .contact-form-note {
        font-size: 0.68rem;
        line-height: 1.5;
    }
    .contact-submit {
        width: 100%;
        padding: 0.95rem 1rem;
        min-width: 0;
    }
    .content-page-header {
        gap: 0.8rem;
    }
    .content-page-title {
        font-size: clamp(2.4rem, 11vw, 3.6rem);
    }
    .content-page-lead,
    .content-card p,
    .content-card li,
    .content-card a {
        font-size: 0.84rem;
        line-height: 1.62;
    }
    .about-page {
        padding-top: 0;
    }
    .about-page-shell {
        gap: 1.3rem;
    }
    .about-media-stage {
        justify-content: flex-start;
    }
    .about-media-column {
        max-width: 100%;
        gap: 0.9rem;
    }
    .about-photo-shell {
        max-width: 100%;
        aspect-ratio: 4 / 5;
    }
    .about-story {
        gap: 1rem;
        padding-top: 0;
    }
    .about-text-flow p {
        font-size: 0.84rem;
        line-height: 1.64;
    }
    .about-title {
        font-size: clamp(2.5rem, 11vw, 3.5rem);
    }
    .about-text-flow {
        gap: 0.82rem;
        padding-top: 0.1rem;
    }
    .tierra-page {
        padding: calc(var(--header-height) + 1.2rem) var(--site-gap) 2rem;
    }
    .tierra-page-shell {
        grid-template-columns: 1fr;
        gap: 1.6rem;
    }
    .tierra-story {
        gap: 1.35rem;
    }
    .tierra-copy {
        gap: 0.95rem;
    }
    .tierra-title {
        font-size: clamp(2.4rem, 11vw, 3.6rem);
    }
    .tierra-subtitle {
        font-size: 0.66rem;
    }
    .tierra-copy-body {
        gap: 0.85rem;
        max-width: none;
    }
    .tierra-copy-body p {
        font-size: 0.8rem;
        line-height: 1.65;
    }
    .tierra-details {
        padding-top: 1rem;
    }
    .tierra-specs-block {
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        padding-top: 1rem;
        max-width: none;
    }
    .tierra-specs {
        grid-template-columns: 1fr;
        gap: 0.72rem;
    }
    .tierra-media-stack {
        gap: 1rem;
    }
    .tierra-media {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .tierra-book-placeholder {
        min-height: 18rem;
        padding: 1rem;
    }
    .tierra-side-media {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    .tierra-photo-card {
        min-height: 8.5rem;
        padding: 0.55rem;
    }
    .tierra-purchase {
        padding-top: 1rem;
    }
    .tierra-purchase-frame {
        grid-template-columns: 1fr;
    }
    .tierra-price {
        border-right: 0;
    }
    .tierra-purchase-actions {
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        padding-top: 1rem;
    }
    .tierra-chapter-row {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }
    .tierra-chapter-head {
        gap: 0.8rem;
    }
    .tierra-chapter-index {
        font-size: 1.35rem;
    }
    .tierra-chapter-title {
        font-size: 1.3rem;
    }
    .tierra-chapter-text {
        font-size: 0.8rem;
        max-width: none;
    }
    .tierra-specs li {
        font-size: 0.78rem;
    }
    .tierra-price-value {
        font-size: 2.55rem;
    }
    .tierra-cta {
        max-width: none;
    }
    #projects-page-title {
        font-size: clamp(2.4rem, 12vw, 3.6rem);
        word-spacing: 0.1em;
    }
    .projects-page-stats {
        gap: 0.7rem 1rem;
    }
    .projects-page-grid {
        grid-template-columns: 1fr;
        gap: 1.8rem;
    }
    .projects-card-media {
        aspect-ratio: 6 / 7;
    }
    .projects-card-title {
        font-size: 1.65rem;
        word-spacing: 0.08em;
    }
    .projects-card-body {
        gap: 0.25rem 0.85rem;
    }
    .gallery-controls {
        gap: 0.65rem;
        margin-bottom: 1rem;
    }
    .gallery-grid {
        column-count: 1;
        column-gap: 0;
    }
    #gallery-title {
        font-size: clamp(2rem, 14vw, 2.8rem);
        max-width: 9ch;
    }
    .gallery-description {
        font-size: 0.8rem;
        line-height: 1.62;
    }
    .gallery-item {
        margin-bottom: 1rem;
    }
    .tierra-side-media {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .tierra-photo-card {
        min-height: auto;
    }
}

@media (max-width: 1024px) and (min-width: 700px) {
    .about-page-shell {
        grid-template-columns: minmax(250px, 0.84fr) minmax(0, 1.16fr);
        grid-template-areas: "media story";
        gap: clamp(1.45rem, 3vw, 2rem);
        align-items: start;
    }
    .about-media-stage {
        justify-content: flex-start;
        align-items: flex-start;
    }
    .about-media-column {
        max-width: none;
        gap: 0.95rem;
    }
    .about-title {
        font-size: clamp(2.85rem, 6vw, 3.45rem);
    }
    .about-photo-shell {
        width: 100%;
        max-width: none;
        aspect-ratio: 4 / 5.2;
    }
    .about-story {
        gap: 1rem;
        padding-top: clamp(4.05rem, 7vw, 4.85rem);
    }
    .about-copy,
    .about-text-flow {
        max-width: none;
    }
    .about-text-flow p {
        font-size: 0.86rem;
        line-height: 1.68;
    }
    .about-text-flow {
        gap: 0.9rem;
        padding-top: 0.05rem;
    }
}
