/* Common Space
   Colours and type are set here. To use the licensed Favorit font, put
   favorit-regular.woff2 and favorit-bold.woff2 in /assets/fonts/ and it
   takes over automatically. Until then Inter Tight stands in. */

@font-face { font-family: "Favorit"; src: url("/assets/fonts/favorit-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Favorit"; src: url("/assets/fonts/favorit-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --navy: #001a57;
  --cream: #fcfaf8;
  --yellow: #ffe0aa;
  --olive: #5c6941;
  --white: #ffffff;

  --font: "Favorit", "Inter Tight", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(16px, 1.6vw, 28px);
  --logo-w: clamp(64px, 5.6vw, 100px);
  --header-h: calc(var(--gutter) + var(--logo-w) * 0.82 + clamp(18px, 2vw, 32px));
  --footer-h: 48px;

  --giant: clamp(44px, 6.6vw, 124px);
  --h1: clamp(36px, 4.4vw, 72px);
  --h2: clamp(30px, 3vw, 46px);
  --nav: clamp(17px, 1.45vw, 22px);
  --body: clamp(15px, 1.05vw, 17px);
  --caption: 13px;

  --bg: var(--cream);
  --fg: var(--navy);
  --chrome: var(--navy);
  --hover: var(--yellow);
}

body[data-theme="cream"] { --bg: var(--cream); --fg: var(--navy); --chrome: var(--navy); }
body[data-theme="image"] { --bg: #1c1c1a; --fg: var(--cream); --chrome: var(--cream); }
body[data-theme="olive"] { --bg: var(--olive); --fg: var(--cream); --chrome: var(--cream); --label: var(--yellow); }
body[data-theme="navy"] { --bg: var(--navy); --fg: var(--cream); --chrome: var(--cream); --label: var(--yellow); }
body[data-theme="yellow"] { --bg: var(--yellow); --fg: var(--navy); --chrome: var(--navy); --hover: var(--olive); --label: var(--olive); }
body[data-theme="cream"] { --label: var(--olive); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--body);
  line-height: 1.3;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  transition: background-color .35s ease, color .35s ease;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
p { margin: 0 0 1em; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: var(--gutter); z-index: 100; background: var(--cream); color: var(--navy); padding: 8px 12px; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }

/* ---------- Header ---------- */
.site-header {
  position: absolute; inset: 0 0 auto 0; z-index: 40;
  height: var(--header-h);
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: var(--gutter);
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }
body.home .site-header, body.previewing .site-header { position: fixed; }
.logo { display: block; line-height: 0; }
.logo img { width: var(--logo-w); height: auto; }
.site-nav { display: flex; gap: .9em; font-size: var(--nav); font-weight: 700; line-height: 1; }
.site-nav a { color: var(--chrome); text-decoration: none; transition: color .2s, opacity .3s; white-space: nowrap; }
.site-nav a:hover { color: var(--hover); }
.site-nav a.active { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .18em; }

@media (max-width: 700px) {
  :root { --logo-w: 64px; --header-h: 104px; --footer-h: 84px; }
  .site-footer { grid-template-columns: 1fr auto; row-gap: 6px; }
  .site-footer .copyright { grid-column: 1 / -1; }
  .site-nav { flex-direction: column; align-items: flex-end; gap: .28em; font-size: 20px; }
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;
  min-height: var(--footer-h);
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 20px;
  padding: 12px var(--gutter);
  font-size: var(--caption); line-height: 1.25;
  color: var(--chrome);
  position: relative; z-index: 5;
}
.site-footer a { text-decoration: none; }
.site-footer .mail { text-decoration: underline; text-underline-offset: 2px; }
.site-footer .ig svg { width: 16px; height: 16px; display: block; }
body.home .site-footer { position: fixed; inset: auto 0 0 0; color: var(--white); }

/* ---------- Backdrop (home slideshow + hover previews) ---------- */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .45s ease; background: #1c1c1a; }
.backdrop.on { opacity: 1; }
.backdrop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.4s ease; }
.backdrop img.show { opacity: .97; }
.backdrop.quick img { transition-duration: .35s; }

main { position: relative; z-index: 2; flex: 1 0 auto; }
main:focus, main:focus-visible { outline: none; }
.page { padding: var(--header-h) var(--gutter) var(--gutter); }
.page-enter { animation: pageIn .45s ease both; }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Home ---------- */
.giant { font-size: var(--giant); font-weight: 700; line-height: 1; letter-spacing: -0.04em; margin: 0; }
.home-wrap { min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding: var(--header-h) var(--gutter) calc(var(--footer-h) + var(--gutter) * .5); }
.home-names { color: var(--cream); max-width: 1500px; text-align: left; }
.home-names a { text-decoration: none; transition: color .25s; }
.home-names a:hover, .home-names a.is-active { color: var(--yellow); }
/* a soft shade at the foot of the photographs so the names always read */
.backdrop::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .45s; }
body.home .backdrop::after { opacity: 1; background: linear-gradient(to top, rgba(0, 0, 0, .38), rgba(0, 0, 0, 0) 62%); }
body.work-page.previewing .backdrop::after { opacity: 1; background: linear-gradient(to left, rgba(0, 0, 0, .42), rgba(0, 0, 0, 0) 55%), linear-gradient(to top, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0) 45%); }

/* ---------- Directory pages (Work, Artists) ---------- */
.directory { min-height: calc(100svh - var(--header-h) - var(--gutter) - var(--footer-h)); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-content: end; }
.directory .list { grid-column: 1 / span 7; margin: 0; padding: 0; list-style: none; }
.directory .intro { grid-column: 9 / span 4; align-self: start; margin-bottom: .3em; }
.list a { font-size: var(--h1); font-weight: 700; line-height: 1.04; letter-spacing: -0.025em; text-decoration: none; color: var(--fg); transition: color .2s, opacity .35s; display: inline-block; }
.list a:hover, .list a.is-active { color: var(--hover); }
.list .soon { font-size: var(--caption); font-weight: 500; letter-spacing: 0; vertical-align: super; margin-left: .4em; opacity: .7; }

body.previewing .site-header .site-nav a,
body.previewing .site-footer { color: var(--cream); }
.directory .intro { transition: opacity .3s ease; display: grid; }
.intro-default, .intro-syn { grid-area: 1 / 1; transition: opacity .3s ease; }
.intro-syn { opacity: 0; visibility: hidden; }
.intro.has-syn .intro-default { opacity: 0; visibility: hidden; }
.intro.has-syn .intro-syn { opacity: 1; visibility: visible; }
body.previewing .list a:not(.is-active),
body.previewing .directory .intro:not(.has-syn) { opacity: 0; }
body.previewing .directory .intro { color: var(--cream); }
body.previewing .list a.is-active { color: var(--cream); }

@media (max-width: 800px) {
  .directory .list, .directory .intro { grid-column: 1 / -1; }
  .directory .intro { order: -1; margin-bottom: 2em; max-width: 34em; }
  .work-page .directory { align-content: end; }
}

/* ---------- Slideshow (artist pages) ---------- */
.slideshow { position: relative; height: min(80svh, 66vw); margin: calc(var(--gutter) * .5) 0 0; user-select: none; }
.slideshow .slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .55s ease; }
.slideshow .slide.show { opacity: 1; }
.slideshow img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.ss-btn { position: absolute; top: 0; bottom: 0; width: 40%; border: 0; padding: 0; background: transparent; z-index: 2; }
.ss-btn.prev { left: 0; cursor: w-resize; }
.ss-btn.next { right: 0; cursor: e-resize; }
.ss-bar { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 14px; font-size: var(--caption); }
.ss-count { min-width: 4.5em; text-align: center; font-variant-numeric: tabular-nums; opacity: .8; }

/* single line arrows, used by every gallery */
.arrow { border: 0; background: none; padding: 8px 2px; cursor: pointer; color: var(--fg); display: inline-flex; align-items: center; opacity: .8; transition: opacity .2s, transform .25s ease; }
.arrow svg { width: 30px; height: 12px; display: block; }
.arrow:hover { opacity: 1; }
.arrow.prev:hover { transform: translateX(-3px); }
.arrow.next:hover { transform: translateX(3px); }

/* ---------- Artist page ---------- */
.artist-fold { height: calc(100svh - var(--header-h) - var(--gutter)); min-height: 440px; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.artist-fold.no-images { height: auto; min-height: 0; }
.artist-fold .slideshow { height: auto; min-height: 0; margin: 0; }
.artist-fold .slideshow .slide { align-items: flex-end; }
.artist-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px 32px; padding-top: clamp(18px, 2.2vw, 34px); }
.artist-head h1 { font-size: var(--h1); font-weight: 700; line-height: 1.02; letter-spacing: -0.025em; margin: 0; padding-bottom: .06em; }
.artist-head .ss-bar { margin: 0 0 .5em; }
.artist-body { margin-top: clamp(40px, 6vw, 96px); }
.artist-body { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 28px; }
.artist-body .portrait { grid-column: 1 / span 3; }
.artist-body .portrait img { width: 100%; height: auto; }
.artist-body .bio { grid-column: 7 / span 5; max-width: 40em; }
.artist-body .bio p:first-child { margin-top: 0; }
.links { display: flex; gap: 14px; margin-top: 1.4em; }
.links a { display: inline-flex; width: 22px; height: 22px; color: var(--fg); transition: color .2s; }
.links a:hover { color: var(--olive); }
.links svg { width: 100%; height: 100%; }
.more { text-align: center; margin: clamp(48px, 7vw, 96px) 0 24px; }
.more a { color: var(--olive); font-size: 15px; text-underline-offset: 3px; }
.artist-pager { display: flex; justify-content: space-between; gap: 16px; font-size: var(--caption); margin-bottom: 8px; }
.artist-pager a { text-decoration: none; }
.artist-pager a:hover { text-decoration: underline; }

@media (max-width: 800px) {
  .slideshow { height: min(60svh, 125vw); }
  .artist-body .portrait { grid-column: 1 / span 6; }
  .artist-body .bio { grid-column: 1 / -1; }
}

/* ---------- Project page: one fold, images left, scrolling text right ---------- */
body.project-mode .site-footer { min-height: var(--footer-h); }
.project {
  height: calc(100svh - var(--footer-h));
  padding: var(--header-h) var(--gutter) 0;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(300px, 4fr);
  column-gap: clamp(24px, 3.5vw, 64px);
}
.stage { position: relative; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.stage-frame { position: relative; min-height: 0; }
.stage .slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .5s ease; }
.stage .slide.show { opacity: 1; }
.stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.stage-bar { display: flex; align-items: center; gap: 16px; padding: 12px 0 14px; font-size: var(--caption); min-height: 44px; }
.stage-bar .credit { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-bar .credit a { text-decoration: none; }
.stage-bar .credit a:hover { text-decoration: underline; }
.stage-bar .count { font-variant-numeric: tabular-nums; }
.stage-bar button { border: 0; background: none; padding: 4px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.stage-bar .arrows { display: flex; gap: 14px; }
.stage-bar .arrows button { text-decoration: none; padding: 8px 2px; }

.thumbs { position: absolute; inset: 0; background: var(--bg); overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; align-content: start; padding: 4px 4px 20px; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 3; }
.thumbs.open { opacity: 1; pointer-events: auto; }
.thumbs button { border: 0; padding: 0; background: rgba(0, 26, 87, .05); aspect-ratio: 1; cursor: pointer; display: grid; place-items: center; overflow: hidden; }
.thumbs img { max-width: 100%; max-height: 100%; object-fit: contain; transition: opacity .2s; }
.thumbs button:hover img { opacity: .75; }
.thumbs button.current { outline: 2px solid var(--navy); outline-offset: 2px; }

.text-panel { position: relative; min-height: 0; display: flex; flex-direction: column; }
.text-scroll {
  min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 10px calc(var(--gutter) * 1.5) 0;
  scrollbar-width: thin; scrollbar-color: rgba(0, 26, 87, .25) transparent;
  --fade-top: 0px; --fade-bottom: 0px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade-top), #000 calc(100% - var(--fade-bottom)), transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade-top), #000 calc(100% - var(--fade-bottom)), transparent 100%);
}
.text-scroll.fade-top { --fade-top: 36px; }
.text-scroll.fade-bottom { --fade-bottom: 56px; }
.text-scroll::-webkit-scrollbar { width: 6px; }
.text-scroll::-webkit-scrollbar-thumb { background: rgba(0, 26, 87, .22); border-radius: 3px; }
.text-panel h1 { font-size: var(--h2); font-weight: 700; line-height: 1.04; letter-spacing: -0.02em; margin: 0 0 .25em; }
.text-panel .sub { margin: 0 0 1.6em; }
.text-panel .statement { max-width: 36em; }
.text-panel .featuring { font-size: var(--caption); margin-top: 2em; }

@media (max-width: 860px) {
  .project { height: auto; display: block; padding-bottom: var(--gutter); }
  .stage { height: auto; }
  .stage-frame { height: min(62svh, 112vw); }
  .text-scroll { overflow: visible; mask-image: none; -webkit-mask-image: none; padding: 20px 0 0; }
}

/* the flying saucer on The Unexplained */
.ufo { position: fixed; z-index: 30; width: clamp(50px, 5.8vmax, 90px); top: 18vh; left: 0; pointer-events: none; animation: fly 34s linear 4s infinite; opacity: 0; }
@keyframes fly {
  0% { transform: translate(-12vw, 6vh) rotate(-4deg); opacity: 1; }
  25% { transform: translate(28vw, -4vh) rotate(3deg); }
  50% { transform: translate(55vw, 12vh) rotate(-2deg); }
  75% { transform: translate(82vw, 0vh) rotate(4deg); }
  99% { transform: translate(112vw, 8vh) rotate(0deg); opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .ufo { display: none; } }

/* ---------- About: one statement per screen ---------- */
body.about-page { overflow: hidden; height: 100svh; overscroll-behavior: none; transition: background-color .9s ease, color .9s ease; }
body.about-page .site-header { position: fixed; }
body.about-page .site-footer { position: fixed; inset: auto 0 0 0; transition: color .9s ease; }
body.about-page .site-nav a { transition: color .9s ease, opacity .3s; }
.deck { position: fixed; inset: 0; z-index: 2; touch-action: none; }
.deck-slide {
  position: absolute; inset: 0;
  padding: var(--header-h) calc(var(--gutter) * 2 + 24px) calc(var(--footer-h) + var(--gutter)) var(--gutter);
  opacity: 0; visibility: hidden; transform: translateY(7vh);
  transition: opacity .4s ease, transform .6s cubic-bezier(.4, 0, .6, 1), visibility 0s linear .6s;
}
.deck-slide.past { transform: translateY(-7vh); }
.deck-slide.on {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .7s ease .42s, transform 1s cubic-bezier(.16, .84, .3, 1) .36s, visibility 0s;
}
.deck-inner { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; }
.deck-slide .giant { padding-bottom: .14em; }
.deck-slide.right .deck-inner { align-items: flex-end; }
.deck-slide.right .giant { max-width: 11em; }
.deck-slide .giant { max-width: 15em; }
.deck-slide[data-scheme="olive"], .deck-slide[data-scheme="navy"] { color: var(--cream); }
.deck-slide[data-scheme="cream"], .deck-slide[data-scheme="yellow"] { color: var(--navy); }
.deck-slide[data-scheme="olive"] .label, .deck-slide[data-scheme="navy"] .label { color: var(--yellow); }
.deck-slide[data-scheme="cream"] .label, .deck-slide[data-scheme="yellow"] .label { color: var(--olive); }

.deck-cta {
  display: inline-flex; align-items: center; gap: .7em; margin-top: clamp(22px, 3vw, 44px);
  font-size: clamp(18px, 1.7vw, 26px); font-weight: 700; letter-spacing: -0.01em; line-height: 1;
  color: inherit; text-decoration: none;
}
.deck-cta span { background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; padding-bottom: .18em; transition: background-size .35s ease; }
.deck-cta svg { width: 2.1em; height: auto; flex: none; transition: transform .35s ease; }
.deck-cta:hover span, .deck-cta:focus-visible span { background-size: 100% 2px; }
.deck-cta:hover svg, .deck-cta:focus-visible svg { transform: translateX(6px); }
.deck-slide.right .deck-cta { align-self: flex-start; }
.deck-dots { position: fixed; z-index: 6; right: var(--gutter); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.deck-dots button { border: 0; background: none; padding: 7px 0; cursor: pointer; color: var(--chrome); transition: color .9s ease; }
.deck-dots button::before { content: ""; display: block; width: 14px; height: 2px; background: currentColor; opacity: .4; transition: width .5s ease, opacity .5s ease; }
.deck-dots button.on::before { width: 28px; opacity: 1; }
.deck-dots button:hover::before { opacity: .9; }

@media (prefers-reduced-motion: reduce) {
  .deck-slide, .deck-slide.on, .deck-slide.past { transform: none; transition: opacity .3s ease, visibility 0s; }
}

/* ---------- Contact ---------- */
.label { display: block; color: var(--label, var(--yellow)); font-size: clamp(15px, 1.25vw, 19px); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; margin-bottom: .35em; }
.contact { min-height: calc(100svh - var(--header-h) - var(--gutter) - var(--footer-h)); display: flex; flex-direction: column; justify-content: flex-end; gap: 1.2em; }
.contact .giant { font-size: clamp(26px, 6vw, 112px); overflow-wrap: anywhere; }
.contact a.giant { text-decoration: none; display: inline-block; transition: color .2s; }
.contact a.giant:hover { color: var(--yellow); }

.notfound { min-height: 70svh; display: flex; align-items: flex-end; }

/* preview bar for members checking drafts */
.preview-bar { position: fixed; z-index: 60; left: 50%; bottom: 60px; transform: translateX(-50%); background: var(--navy); color: var(--cream); padding: 10px 16px; border-radius: 6px; font-size: 13px; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.preview-bar a { color: var(--yellow); margin-left: 8px; }
