:root {
  /* the four pages: background, ink and one accent each */
  --home-bg: #eee8dd;
  --home-ink: #1c1915;
  --home-acc: #b4552f;
  --work-bg: #121b26;
  --work-ink: #e6dfd2;
  --work-acc: #d9a66b;
  --studio-bg: #5a2318;
  --studio-ink: #f5dcc8;
  --studio-acc: #f0a274;
  --contact-bg: #c9d2bf;
  --contact-ink: #1b281f;
  --contact-acc: #46634d;
  /* the page on show (the script moves them) */
  --bg: var(--home-bg);
  --ink: var(--home-ink);
  --acc: var(--home-acc);
  --display: 'Bricolage Grotesque Variable', 'Helvetica Neue', system-ui, sans-serif;
  --ui: 'Mona Sans Variable', system-ui, sans-serif;
  --expo: cubic-bezier(.19, 1, .22, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--home-bg);
  overflow: hidden;
}

.stage {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  isolation: isolate;
}
.stage.is-moving { cursor: wait; }

/* the light of a window from the top left and a softer floor: the page is never flat */
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(90% 70% at 8% -10%, color-mix(in srgb, white 16%, transparent), transparent 62%),
    radial-gradient(80% 60% at 100% 110%, color-mix(in srgb, black 14%, transparent), transparent 70%);
}
/* and the faint shadow of a blind on the wall, slanted, that only moves when the pointer does */
.stage::after {
  content: "";
  position: absolute;
  inset: -10% -20%;
  z-index: 0;
  pointer-events: none;
  opacity: .05;
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 46px);
  transform: skewX(-14deg) translateX(var(--sx, 0px));
  -webkit-mask-image: radial-gradient(60% 70% at 78% 30%, black, transparent 75%);
  mask-image: radial-gradient(60% 70% at 78% 30%, black, transparent 75%);
}

/* ---- the top bar ---- */
.top {
  position: absolute;
  z-index: 8;
  top: clamp(10px, 2.4vh, 24px);
  left: clamp(12px, 3vw, 40px);
  right: clamp(12px, 3vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  flex: 0 0 auto;
}
.brand__mark {
  width: clamp(22px, 3.2vh, 26px);
  height: clamp(22px, 3.2vh, 26px);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
}
.brand__mark path { transition: transform .6s var(--expo); transform-origin: 50% 50%; transform-box: fill-box; }
@media (hover: hover) {
  .brand:hover .brand__mark path { transform: scaleX(3.2); }
}
.brand__name {
  font-family: var(--display);
  font-weight: 640;
  font-size: 18px;
  letter-spacing: -.02em;
  line-height: 1;
}
.brand__name em {
  font-style: normal;
  font-weight: 380;
  margin-left: 4px;
  opacity: .6;
}

.where {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 500;
  font-variation-settings: 'wdth' 110;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .62;
}
.where i {
  display: block;
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: .6;
}

.nav {
  position: relative;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--ink) 13%, transparent),
    inset 0 1px 0 color-mix(in srgb, white 22%, transparent),
    0 1px 2px color-mix(in srgb, black 8%, transparent),
    0 14px 34px -16px color-mix(in srgb, black 45%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
}
.nav.is-locked { pointer-events: none; }
.nav.is-locked .nav__item:not(.is-here) { opacity: .5; }

.nav__item {
  position: relative;
  z-index: 2;
  display: block;
  padding: 0 clamp(10px, 1.3vw, 17px);
  height: clamp(30px, 4.6vh, 36px);
  line-height: clamp(30px, 4.6vh, 36px);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(12px, 1.8vh, 14px);
  font-weight: 540;
  font-variation-settings: 'wdth' 100;
  white-space: nowrap;
  transition: color .45s var(--expo), opacity .3s ease, font-variation-settings .5s var(--expo);
  -webkit-tap-highlight-color: transparent;
}
.nav__item.is-here { color: var(--bg); }
.nav__item:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 2px; }
@media (hover: hover) {
  .nav__item:not(.is-here):hover { font-variation-settings: 'wdth' 112; }
}

/* the active pill slides on a spring; the hover pill takes the colour of the page it leads to, with three slats */
.nav__pill,
.nav__hover {
  position: absolute;
  z-index: 1;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);
  width: 60px;
  border-radius: 999px;
  pointer-events: none;
  overflow: hidden;
}
.nav__pill {
  background: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    inset 0 -1px 0 rgba(0, 0, 0, .18),
    0 6px 14px -6px color-mix(in srgb, var(--ink) 60%, transparent);
}
.nav__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .42) 48%, transparent 62%);
  transform: translateX(-120%);
}
.nav__hover {
  background: var(--hc, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 16%, transparent);
  opacity: 0;
  display: flex;
  justify-content: space-evenly;
}
.nav__hover i {
  display: block;
  width: 1px;
  height: 100%;
  background: color-mix(in srgb, var(--hi, #000) 22%, transparent);
  transform: scaleY(0);
}
.nav__item.is-hot { color: var(--hi, var(--ink)); }

/* ---- the pages ---- */
.pages {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.page {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(14px, 4vw, 60px);
  padding: 0 clamp(16px, 4vw, 56px) clamp(16px, 6vh, 60px);
}
.page[hidden] { display: none; }
.page__text { flex: 1 1 auto; min-width: 0; }

.eyebrow {
  margin: 0 0 clamp(6px, 1.6vh, 16px);
  font-size: clamp(11px, 1.6vh, 13px);
  font-weight: 520;
  font-variation-settings: 'wdth' 112;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--acc);
}

.title {
  margin: 0;
  font-family: var(--display);
  font-weight: 560;
  font-variation-settings: 'opsz' 96;
  font-size: min(10.4vw, 15vh);
  line-height: .92;
  letter-spacing: -.045em;
}
.title .line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; white-space: nowrap; }
.title .line > span { display: inline-block; will-change: transform; }
.title i {
  font-style: normal;
  font-weight: 300;
  color: var(--acc);
  font-variation-settings: 'opsz' 96, 'wdth' 76;
}

.text {
  margin: clamp(10px, 2.6vh, 26px) 0 0;
  max-width: 34ch;
  font-size: clamp(12px, 2vh, 16px);
  line-height: 1.45;
  font-weight: 420;
  opacity: .78;
}

/* ---- home: a drawn room with a window and its beam of light ---- */
.room {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
  width: min(30vw, 38vh);
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  overflow: hidden;
  background: #d9cfbf;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, .06),
    0 1px 2px rgba(0, 0, 0, .06),
    0 30px 60px -30px rgba(40, 24, 10, .5),
    0 12px 24px -16px rgba(40, 24, 10, .3);
  transition: transform .7s var(--expo), box-shadow .7s var(--expo);
}
.room__wall {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, #e7ddcd 0%, #d6c9b4 62%, #bfae95 100%);
}
.room__window {
  position: absolute;
  left: 18%;
  top: 14%;
  width: 40%;
  height: 46%;
  border-radius: 2px;
  background: linear-gradient(160deg, #fff7e6, #f2d7ad 70%, #e8b884);
  box-shadow: inset 0 0 0 3px #c9b89f, inset 0 0 18px rgba(255, 220, 160, .7), 0 0 40px rgba(255, 214, 150, .45);
  display: flex;
  justify-content: space-evenly;
  overflow: hidden;
}
/* the slats of the room's own blind, half open */
.room__window i {
  display: block;
  width: 9%;
  height: 100%;
  background: linear-gradient(90deg, #c7b59a, #e9dcc4 60%, #bca88b);
  transform: perspective(200px) rotateY(var(--ra, 52deg));
  box-shadow: 1px 0 2px rgba(80, 50, 20, .18);
}
.room__beam {
  position: absolute;
  left: 34%;
  top: 46%;
  width: 86%;
  height: 60%;
  background: repeating-linear-gradient(90deg, rgba(255, 236, 200, .55) 0 7%, transparent 7% 12%);
  transform: skewX(-28deg);
  transform-origin: 0 0;
  -webkit-mask-image: linear-gradient(180deg, black, transparent 90%);
  mask-image: linear-gradient(180deg, black, transparent 90%);
  mix-blend-mode: soft-light;
  opacity: .9;
}
.room__floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 24%;
  background: linear-gradient(180deg, #a98f72, #8e735a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
}
.room__tag {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
  border-radius: 9px;
  color: #1c1915;
  background: rgba(250, 245, 236, .72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5), 0 6px 14px -8px rgba(0, 0, 0, .35);
  font-size: 11px;
}
.room__tag b { font-family: var(--display); font-weight: 620; font-size: 13px; letter-spacing: -.01em; }
.room__tag span { opacity: .62; }
@media (hover: hover) {
  .room:hover { transform: translateY(-4px) rotate(-.6deg); }
  .room:hover .room__window i { --ra: 18deg; }
}
.room__window i { transition: transform .9s var(--expo); }

/* ---- work: three rows with small drawn thumbnails ---- */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  width: min(42vw, 460px);
  border-top: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
}
.row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0 14px;
  padding: clamp(7px, 1.6vh, 12px) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  font-size: clamp(11px, 1.8vh, 13px);
  transition: transform .6s var(--expo);
}
.row b {
  font-family: var(--display);
  font-weight: 560;
  font-size: clamp(14px, 2.4vh, 18px);
  letter-spacing: -.02em;
  grid-column: 2;
  grid-row: 1;
}
.row > span:not(.thumb):not(.row__year) { grid-column: 2; grid-row: 2; opacity: .6; }
.row em { font-style: normal; opacity: .6; grid-column: 3; grid-row: 1 / 3; }
.row__year { grid-column: 4; grid-row: 1 / 3; color: var(--acc); font-variant-numeric: tabular-nums; }
.thumb {
  grid-column: 1;
  grid-row: 1 / 3;
  width: clamp(34px, 6vh, 48px);
  aspect-ratio: 1;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 8px 16px -10px rgba(0, 0, 0, .6);
  transition: transform .6s var(--expo);
}
.thumb--a { background: linear-gradient(170deg, #9fb5c6 0%, #6b8296 52%, #2f3d4b 53%, #253240 100%); }
.thumb--b { background: linear-gradient(160deg, #f0d8b8 0%, #d79f6c 48%, #8e4f2c 49%, #6f3a20 100%); }
.thumb--c { background: linear-gradient(180deg, #c9c7bd 0%, #a4a296 40%, #59584f 41%, #3b3a34 100%); }
@media (hover: hover) {
  .row:hover { transform: translateX(6px); }
  .row:hover .thumb { transform: scale(1.08) rotate(-2deg); }
}

/* ---- studio: three facts ---- */
.facts {
  flex: 0 0 auto;
  display: flex;
  gap: clamp(14px, 3vw, 40px);
  margin: 0;
}
.facts div {
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  padding-left: 12px;
  border-left: 1px solid color-mix(in srgb, var(--ink) 24%, transparent);
}
.facts dt { font-size: 11.5px; font-weight: 500; letter-spacing: .04em; opacity: .66; white-space: nowrap; }
.facts dd {
  margin: 0;
  font-family: var(--display);
  font-weight: 460;
  font-size: clamp(28px, 6vh, 54px);
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

/* ---- contact: the address as a pill ---- */
.reach {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.mail {
  display: flex;
  align-items: center;
  gap: 10px;
  height: clamp(40px, 7vh, 52px);
  padding: 0 18px 0 22px;
  border-radius: 999px;
  color: var(--bg);
  background: var(--ink);
  text-decoration: none;
  font-size: clamp(13px, 2.1vh, 16px);
  font-weight: 560;
  font-variation-settings: 'wdth' 100;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 16px 30px -16px color-mix(in srgb, var(--ink) 80%, transparent);
  transition: font-variation-settings .5s var(--expo), transform .5s var(--expo);
  white-space: nowrap;
}
.mail svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .5s var(--expo);
}
@media (hover: hover) {
  .mail:hover { font-variation-settings: 'wdth' 114; }
  .mail:hover svg { transform: translateX(3px) rotate(-45deg); }
}
.mail:active { transform: scale(.97); }
.reach__hours { font-size: 12px; opacity: .62; white-space: nowrap; }

/* ---- the blind ---- */
.blind {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
  visibility: hidden;
}
.blind.is-on { visibility: visible; }
.slat {
  position: absolute;
  top: 0;
  bottom: 0;
  overflow: hidden;
  background: var(--c, #000);
  backface-visibility: hidden;
  will-change: transform;
  /* the edge of every slat: a hair of shadow on one side and a hair of light on the other, the gaps of a real blind */
  box-shadow:
    inset -1px 0 0 color-mix(in srgb, black 16%, transparent),
    inset 1px 0 0 color-mix(in srgb, white 10%, transparent);
}
/* the curve of the slat: brighter in the middle, as metal or lacquered wood catches the light */
.slat::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, color-mix(in srgb, black 7%, transparent), color-mix(in srgb, white 8%, transparent) 46%, transparent 60%, color-mix(in srgb, black 9%, transparent));
}
/* the shade it takes while it turns: the script sets its opacity and its side */
.slat__shade {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, .5), rgba(0, 0, 0, .05) 70%, rgba(255, 255, 255, .12));
  opacity: 0;
}
/* every slat holds its slice of the page name: put together they read as one word */
.slat__name {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vh, 18px);
  color: var(--n, #fff);
}
.slat__word {
  font-family: var(--display);
  font-weight: 560;
  font-variation-settings: 'opsz' 96;
  font-size: min(21vw, 30vh);
  line-height: .9;
  letter-spacing: -.05em;
  white-space: nowrap;
}
.slat__sub {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(10px, 1.6vh, 12px);
  font-weight: 520;
  font-variation-settings: 'wdth' 112;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .7;
  white-space: nowrap;
}
.slat__sub i { display: block; width: 22px; height: 1px; background: currentColor; }
.slat__sub b { font-weight: inherit; }
@media (max-width: 560px) {
  .slat__sub b, .slat__sub i { display: none; }
}

/* the cord of the blind: a thin line that drops to the point of the click, with a small wooden pull */
.cord {
  position: absolute;
  z-index: 7;
  left: 0;
  top: 0;
  width: 1px;
  height: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--ink) 70%, transparent) 30%);
  visibility: hidden;
}
.cord i {
  position: absolute;
  left: -3px;
  bottom: -14px;
  width: 7px;
  height: 14px;
  border-radius: 3px 3px 4px 4px;
  background: linear-gradient(90deg, #8a6a4a, #c9a47a 45%, #7a5a3c);
  box-shadow: 0 3px 6px -2px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .3);
}

/* ---- grain over everything, slats included ---- */
.grain {
  position: absolute;
  inset: -50%;
  z-index: 9;
  pointer-events: none;
  opacity: .12;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.4 -.2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}

.ghost {
  position: absolute;
  z-index: 10;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  opacity: 0;
  pointer-events: none;
  fill: #fff;
  stroke: #111;
  stroke-width: 1.3;
  stroke-linejoin: round;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .35));
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* narrower screens: the side pieces stack under the title */
@media (max-width: 860px) {
  .where { display: none; }
  .page { flex-direction: column; align-items: stretch; justify-content: flex-end; }
  .page__text { flex: 0 0 auto; }
  .list { width: 100%; }
  .reach { align-items: flex-start; }
  .room { position: absolute; right: clamp(16px, 4vw, 56px); top: clamp(60px, 13vh, 110px); width: min(34vw, 26vh); }
  .title { font-size: min(12.4vw, 13vh); }
}
@media (max-width: 560px) {
  .brand__name { display: none; }
  .nav { padding: 3px; }
  .nav__pill, .nav__hover { top: 3px; height: calc(100% - 6px); }
  .nav__item { padding: 0 min(10px, 2.4vw); font-size: min(12.5px, 3.3vw); }
  .top { gap: 8px; }
  .text { max-width: none; }
  .row em { display: none; }
  .row { grid-template-columns: auto 1fr auto; }
  .facts dd { font-size: clamp(24px, 5.4vh, 40px); }
}
@media (max-height: 520px) {
  .text { display: none; }
  .room { display: none; }
  .row:nth-child(3) { display: none; }
}
