/*
Theme Name: Architecture Portfolio
Description: An architectural portfolio with split-panel transitions and an interactive project index.
Version: 1.8.3
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: terrain-studio
*/
:root {
    --ink: #252923;
    --paper: #f3efe7;
    --green: #7c8b62;
    --clay: #f37021;
    --edge: clamp(1.25rem, 4vw, 4.75rem);
    --serif: "Baskerville", "Palatino Linotype", Georgia, serif;
    --ease: cubic-bezier(.22,.72,.21,1);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.45 system-ui,sans-serif; }
a { color: inherit; text-underline-offset: .25em; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }
.sr-only,.skip-link:not(:focus) { clip-path: inset(50%); position: absolute; white-space: nowrap; width: 1px; height: 1px; overflow: hidden; }
.skip-link { position: fixed; top: 1rem; left: 1rem; z-index: 20; padding: .65rem; background: white; }
.site-header { position: absolute; z-index: 5; inset: 0 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.3rem var(--edge); }
.admin-bar .site-header { top: var(--wp-admin--admin-bar--height,32px); }
.site-header a { text-decoration: none; }
.brand { font: 1.5rem/1 var(--serif); }
.site-header nav { display: flex; gap: clamp(.85rem, 2.7vw, 2.75rem); padding: .6rem 1rem; background: var(--paper); border-radius: 2rem; font-size: .83rem; }
.site-header nav a:hover { text-decoration: underline; }
.scene { display: grid; grid-template-columns: 47% 53%; min-height: 100svh; overflow: clip; }
.panel { min-width: 0; position: relative; }
.hero-copy { background: var(--green); transition: background-color .74s cubic-bezier(.45,0,.25,1); display: grid; align-content: center; justify-items: start; gap: clamp(1.3rem,3vh,2.5rem); padding: 6rem var(--edge); }
.hero.is-clay .hero-copy { background: var(--clay); }
h1,h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.062em; line-height: .98; margin: 0; }
.hero h1 { max-width: 10ch; font-size: clamp(3rem,6.3vw,8rem); z-index: 1; text-wrap: balance; }
.hero-view { min-height: 100%; background: #555c46; }
.hero-inset { width: min(54%, 14rem); aspect-ratio: 4 / 5; margin-left: 13%; background: #6b6656; }
.media-stack { position: relative; overflow: hidden; }
.media-stack img,.project-images img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-stack img:nth-child(2) { opacity: 0; transform: scale(1.07); transition: opacity .64s var(--ease), transform 1.05s var(--ease); }
.hero.is-clay .media-stack img:nth-child(2) { opacity: 1; transform: scale(1); }
.image-toggle,.project-controls button { display: grid; place-items: center; border: 1px solid currentColor; background: transparent; border-radius: 50%; width: 2.7rem; height: 2.7rem; cursor: pointer; }
.image-toggle span { transition: transform .6s var(--ease); font-size: 1.2rem; }
.image-toggle:hover span,.image-toggle[aria-pressed=true] span { transform: rotate(70deg); }
.work { grid-template-columns: 53% 47%; background: var(--paper); }
.work-view { display: flex; align-items: end; min-height: 62vh; background: #4b5247; isolation: isolate; overflow: hidden; color: #fff; }
.work-view::after { content: ''; position: absolute; inset: 48% 0 0; background: linear-gradient(transparent,#141814b3); pointer-events: none; }
.project-images { position: absolute; inset: 0; overflow: hidden; }
.project-images img { transform-origin: 100% 50%; }
.work-view h2 { z-index: 1; margin: 0 var(--edge) clamp(2rem,5vw,5rem); font-size: clamp(3.1rem,7.4vw,9rem); }
.work-index { display: grid; align-content: center; gap: 2rem; padding: 4.5rem var(--edge); }
.index-inner { display: flex; align-items: center; gap: clamp(1rem,3vw,3rem); }
.project-controls { display: grid; justify-items: center; gap: .55rem; font-size: .72rem; white-space: nowrap; }
.project-controls button:hover,.image-toggle:hover { background: #ffffff55; }
.project-list { margin: 0; list-style: none; padding: .8rem 0 .8rem 1.2rem; border-left: 1px solid #8c927f; min-width: 0; max-height: 48vh; overflow: auto; }
.project-list li { margin-block: .2rem; }
.project-list a { display: block; padding: .45rem .25rem; --project-title-size: clamp(1.3rem,2.3vw,2.9rem); font: max(1rem, calc(var(--project-title-size) - 10pt))/1.05 var(--serif); text-decoration: none; color: #484c42; }
.project-list a[aria-current=true] { font-size: calc(var(--project-title-size) + 10pt); color: #693b32; text-decoration: underline; }
.project-list a:hover { color: #693b32; }
.project-notes { font-size: .92rem; border-top: 1px solid #a3a698; padding-block-start: 1rem; min-height: 8rem; }
.project-notes h3,.project-notes p { margin: 0 0 .4rem; }
.studio,.standard-content { padding: clamp(4rem,10vw,10rem) var(--edge); }
.studio { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; background: #d7dbcb; }
.studio img { grid-column: 2; width: 100%; max-height: 28rem; object-fit: cover; }
.studio p { max-width: 23ch; margin: 0; font: clamp(1.7rem,3.4vw,4.2rem)/1.1 var(--serif); }
.studio h2,.standard-content h1 { font-size: clamp(3rem,8vw,8rem); }
.standard-content { max-width: 76rem; margin: auto; }
.standard-content img { height: auto; margin-block: 2rem; }
.wordmark-wipe { position: fixed; inset: 0; z-index: 10; background: var(--paper); display: grid; place-items: center; pointer-events: none; visibility: hidden; clip-path: inset(0 0 100%); }
.wordmark-wipe span { font: clamp(2rem,5vw,5rem)/1 var(--serif); letter-spacing: -.06em; color: #693b32; }
@media (max-width: 720px) {
    .site-header { padding-top: .8rem; }
    .brand { font-size: 1.2rem; }
    .site-header nav { gap: .65rem; font-size: .76rem; padding: .42rem .65rem; }
    .scene,.studio { grid-template-columns: 1fr; }
    .hero-copy { padding: 5rem var(--edge) 4rem; gap: 1rem; }
    .hero h1 { font-size: clamp(3rem,11vw,6rem); }
    .hero-inset { width: min(34%,10rem); margin-left: 40%; }
    .hero-view,.work-view { min-height: 48svh; }
    .work-index { padding-block: 2rem; gap: 1.4rem; }
    .project-list { max-height: 35vh; }
    .project-list a { --project-title-size: clamp(1.45rem,6vw,2.4rem); }
    .studio img { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
    *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Keep the text fixed while two perpendicular masks reveal the next scene. */
.hero-copy { justify-items: center; gap: 0; padding: 5rem var(--edge) 5.75rem; }
.hero h1 { max-width: 17ch; text-align: center; font-size: clamp(2.2rem,3.65vw,5rem); line-height: 1.02; color: #20271f; }
.hero-inset { width: min(57%,20rem,34svh); margin: clamp(-1.6rem,-1.55vw,-.65rem) 0 0; }
.hero-inset::after { content: ''; position: absolute; inset: 0 0 auto; height: 18%; background: linear-gradient(#eee5ceab,transparent); pointer-events: none; }
.hero .media-stack img:nth-child(2) {
    opacity: 1;
    transform: none;
    transition: clip-path .9s cubic-bezier(.58,.02,.3,1);
}
.hero-view img:nth-child(2) { clip-path: inset(0 100% 0 0); }
.hero-inset img:nth-child(2) { clip-path: inset(0 0 100% 0); }
.hero.is-clay .media-stack img:nth-child(2) { clip-path: inset(0); }
@media (max-width: 720px) {
    .hero-copy { padding: 5rem var(--edge) 4.75rem; }
    .hero h1 { font-size: clamp(2.15rem,8.45vw,3.35rem); }
    .hero-inset { width: min(56%,13rem,28svh); }
}

.home .site-header {
    justify-content: flex-start;
    gap: clamp(.9rem,2vw,2.2rem);
    padding-inline: clamp(1rem,2.1vw,2.75rem);
}
.home .site-header nav { background: transparent; border-radius: 0; padding: 0; gap: clamp(.75rem,1.65vw,1.8rem); }
.hero-intro {
    position: absolute;
    inset: auto auto clamp(1.2rem,3.1vh,2.7rem) clamp(1rem,2.1vw,2.75rem);
    width: min(66%,43ch);
    margin: 0;
    font-size: clamp(.79rem,.92vw,1rem);
    line-height: 1.4;
}
.home.admin-bar .hero { min-height: calc(100svh - var(--wp-admin--admin-bar--height,32px)); }
.process { padding: clamp(4rem,10vw,10rem) var(--edge); background: var(--paper); display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.process h2 { font-size: clamp(3rem,8vw,8rem); }
.process p { max-width: 29ch; margin: 0; font: clamp(1.5rem,2.8vw,3.5rem)/1.15 var(--serif); }
@media (max-width: 820px) and (min-width: 721px) {
    .home .site-header { gap: .85rem; }
    .home .site-header nav { gap: .65rem; font-size: .73rem; }
    .home .brand { font-size: 1.15rem; }
}
@media (max-width: 720px) {
    .home .site-header { flex-wrap: wrap; row-gap: .5rem; }
    .hero-copy { padding-bottom: 1.5rem; }
    .hero-intro { position: static; justify-self: start; width: min(100%,43ch); margin-top: 1.5rem; }
    .process { grid-template-columns: 1fr; }
}
@media (max-height: 580px) and (min-width: 721px) {
    .hero-copy { padding-bottom: 1.5rem; }
    .hero-intro { position: static; justify-self: start; width: min(100%,43ch); margin-top: 1rem; }
}

/* The split is shared with the hero so the panels pass along the same seam. */
.work { position: relative; grid-template-columns: 47% 53%; --work-seam: 47%; }
.work-header { color: white; }
.work-header nav a { text-shadow: none; }
.work-header a:hover, .work-header a:focus-visible { text-decoration: underline; }
.work-view h2 { font-size: clamp(4rem,9vw,11rem); }
.work-detail {
    position: absolute; z-index: 3; top: 50%; left: var(--work-seam);
    transform: translate(-50%,-50%); display: grid; place-content: center;
    border: 1px solid #777764; border-radius: 50%;
    width: clamp(5rem,8vw,8rem); aspect-ratio: 1;
    background: var(--paper); color: var(--ink); text-align: center;
    font-size: .77rem; text-decoration: none;
}
.work-detail:hover { background: #dce0d0; }
.wheel-arc { display: none; }
.wheel-ready .work-index { display: block; min-height: 100%; padding: 0; }
.wheel-ready .index-inner { position: absolute; inset: 0; display: block; overflow: hidden; }
.wheel-ready .wheel-arc {
    display: block; position: absolute; pointer-events: none;
    width: 92%; height: 84%; top: 8%; left: -46%;
    border: 1px solid #a3a698; border-radius: 50%;
}
.wheel-ready .project-controls { position: absolute; top: 26%; bottom: 26%; left: 28%; display: flex; flex-direction: column; justify-content: space-between; align-items: center; z-index: 1; }
.wheel-ready .project-controls button { border-color: transparent; font-size: 1.35rem; }
.wheel-ready .project-list { position: absolute; inset: 0; border: 0; padding: 0; max-height: none; overflow: visible; }
.wheel-ready .project-list li {
    position: absolute; left: var(--wheel-x); top: var(--wheel-y);
    width: min(43%,29rem); margin: 0; transform: translateY(-50%);
}
.wheel-ready .project-list a {
    position: relative; padding: .35rem 0; --project-title-size: clamp(1rem,2.1vw,2.55rem);
    letter-spacing: -.045em; color: #31382e;
}
.wheel-ready .project-list a[aria-current=true] { color: #693b32; text-decoration: none; }
.wheel-ready .project-list a[aria-current=true]::before {
    content: ''; position: absolute; left: calc(-9.3% - .26rem); top: calc(50% - .24rem);
    width: .48rem; height: .48rem; background: #996150; outline: 1px solid #996150;
    outline-offset: 3px; border-radius: 50%;
}
.project-list a small { display: block; margin-top: .38rem; font: 400 clamp(.7rem,.85vw,.95rem)/1.15 system-ui,sans-serif; letter-spacing: 0; }
.wheel-ready .project-notes { position: absolute; z-index: 2; right: 8%; bottom: 2.6%; width: 43%; min-height: 0; }
.wheel-ready .project-notes h3 { font-size: .85rem; }
.wheel-ready .project-notes p { font-size: .78rem; }
.work-outgoing {
    position: fixed; z-index: 4; inset: 0; display: grid;
    grid-template-columns: 47% 53%; overflow: hidden; pointer-events: none;
}
.admin-bar .work-outgoing { top: var(--wp-admin--admin-bar--height,32px); }
.admin-bar .work { min-height: calc(100svh - var(--wp-admin--admin-bar--height,32px)); scroll-margin-top: var(--wp-admin--admin-bar--height,32px); }
@media (max-width: 720px) {
    .work { grid-template-columns: 1fr; }
    .work-detail { position: relative; inset: auto; transform: none; margin: 0 var(--edge) 1.2rem; grid-row: 4; width: auto; aspect-ratio: auto; padding: .65rem .8rem; border-radius: 2rem; justify-self: start; }
}

.home { overflow-anchor: none; }

.brand img { display: block; width: clamp(1.85rem,2.2vw,2.5rem); height: auto; }
.wordmark-wipe img { width: clamp(3rem,6vw,5rem); height: auto; }


.brand img { width: clamp(1.9rem,2.75vw,2.75rem); }

.wordmark-wipe img { width: clamp(2.75rem,5vw,4rem); }



.hero-stage { --toolbar: 0px; --hero-height: calc(100svh - var(--toolbar)); }
.admin-bar .hero-stage { --toolbar: var(--wp-admin--admin-bar--height,32px); }
.hero-stage .hero { min-height: var(--hero-height); }
.hero-copy .site-header { top: 0; }
.hero-stage .hero-copy { padding-block: clamp(5.5rem,12svh,10rem) clamp(5.8rem,14svh,10rem); }
.hero-stage h1 { font-size: clamp(1.8rem,min(3.65vw,7.4svh),5rem); }
.hero-stage .hero-inset { width: min(57%,22rem,33svh); }
@media (max-width: 720px) {
    .hero-stage .hero { grid-template-rows: minmax(0,auto) minmax(10rem,1fr); }
    .hero-stage .hero-copy { padding-block: 5.6rem 1rem; }
    .hero-stage h1 { font-size: clamp(1.65rem,min(7.4vw,5.9svh),3.1rem); }
    .hero-stage .hero-inset { width: min(56%,13rem,20svh); }
    .hero-stage .hero-intro { margin-top: .85rem; }
    .hero-stage .hero-view { min-height: 0; }
}




.site-footer {
    min-height: var(--section-height);
    display: grid;
    grid-template-rows: 1fr auto auto;
    gap: clamp(2rem,6vh,4.5rem);
    padding: clamp(2rem,5vw,4.5rem) var(--edge) 1.5rem;
    background: #292f29;
    color: var(--paper);
}
.footer-top, .footer-base { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; }
.footer-enquiries h2 { margin-bottom: .75rem; font-size: clamp(2.2rem,4.2vw,4.5rem); }
.footer-links, .footer-utilities { display: flex; flex-wrap: wrap; gap: .8rem clamp(1rem,3vw,3rem); }
.footer-links { padding-top: .5rem; }
.footer-links a, .footer-base a { text-decoration: none; }
.footer-links a:hover, .footer-base a:hover { text-decoration: underline; }
.footer-crest { justify-self: center; }
.footer-crest img { width: clamp(3.5rem,5.5vw,6rem); height: auto; }
.footer-base { align-items: baseline; border-top: 1px solid #f3efe746; padding-top: 1rem; font-size: .8rem; }
.footer-base small { font-size: inherit; }
@media (max-width: 560px) {

    .footer-top, .footer-base { flex-direction: column; gap: 1rem; }
}

.project-photo-wheel {
    position: absolute;
    inset: 0;
    clip-path: circle(44% at 100% 50%);
    pointer-events: none;
}
.project-photo-strip, .project-photo-tile { position: absolute; inset: 0; }
.project-photo-strip { transform-origin: 100% 50%; }
.project-photo-tile { bottom: auto; height: 100%; }
.project-photo-tile .project-photo-extension { left: 100%; right: auto; transform: scaleX(-1); }

body { --section-height: 100svh; }
body.admin-bar { --section-height: calc(100svh - var(--wp-admin--admin-bar--height,32px)); }
.studio, .process { min-height: var(--section-height); align-content: center; }
.studio { padding-block: clamp(2rem,7svh,6rem); }
.admin-bar :is(.studio,.process,.site-footer) { scroll-margin-top: var(--wp-admin--admin-bar--height,32px); }

/* Keep navigation text clear in both colour states. */
.site-header nav a,
.work-header nav a { text-shadow: none !important; }
/* Keep section landings aligned while allowing natural scrolling through long content. */
body #contact.terrain-footer { min-height: var(--section-height, 100svh); }

@media (min-width: 721px) and (min-height: 581px) and (prefers-reduced-motion: no-preference) {
    html:has(body.home #work) { scroll-snap-type: y proximity; }
    .home :is(#home, #work, #studio, #process, #contact) { scroll-snap-align: start; }
}

/* WordPress already reserves the toolbar height on the scroll container. */
.home.admin-bar :is(#work, #studio, #process, #contact) { scroll-margin-top: 0; }
