/* Claude Monet, one-page portfolio, high tier.
   Same type, labels and pills as the other tiers, but you are inside a room, and everything
   you read sits over it like a card in your hand. The page takes the colours of the room:
   look a (warm daylight, default), b (white cube) or night, set on <html data-look>. */

:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --ink: #22231f;
  --ink-2: #5f5d56;
  --line: rgba(34, 35, 31, .14);
  --surface: #fbfaf6;          /* index sheet: one step lighter than the room */
  --view: #efece5;
  --view-ink: #22231f;
  --view-muted: #5f5d56;
  --scrim: 244, 241, 234;      /* behind the contact card at the end */
  --halo: rgba(244, 241, 234, .7);
  --pill-line-bg: rgba(244, 241, 234, .55);
  --backdrop: rgba(60, 54, 44, .28);
  --hover: rgba(34, 35, 31, .05);
  --img-shadow: rgba(60, 50, 38, .35);

  --font: "Switzer", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-display: clamp(4rem, 9.6vw, 9.5rem);
  --fs-h2: clamp(1.75rem, 2.6vw, 2.5rem);
  --fs-body: 1.125rem;
  --fs-label: .875rem;

  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.16, 1, .3, 1);

  --z-ui: 20;
  --z-curtain: 60;
}
[data-look="b"] {
  --bg: #f6f6f5;
  --ink: #1d1f21;
  --ink-2: #5b5f63;
  --line: rgba(29, 31, 33, .13);
  --surface: #ffffff;
  --view: #f1f1f0;
  --view-ink: #1d1f21;
  --view-muted: #5b5f63;
  --scrim: 246, 246, 245;
  --halo: rgba(246, 246, 245, .7);
  --pill-line-bg: rgba(246, 246, 245, .55);
  --backdrop: rgba(40, 44, 48, .25);
  --hover: rgba(29, 31, 33, .05);
  --img-shadow: rgba(40, 46, 52, .3);
}
[data-look="c"] {
  --bg: #f2eee7;
  --ink: #26241f;
  --ink-2: #625d53;
  --line: rgba(38, 36, 31, .14);
  --surface: #faf8f4;
  --view: #eee9e1;
  --view-ink: #26241f;
  --view-muted: #625d53;
  --scrim: 242, 238, 231;
  --halo: rgba(242, 238, 231, .7);
  --pill-line-bg: rgba(242, 238, 231, .55);
  --backdrop: rgba(62, 54, 42, .28);
  --hover: rgba(38, 36, 31, .05);
  --img-shadow: rgba(66, 54, 38, .35);
}
[data-look="d"] {
  --bg: #eef0ea;
  --ink: #22261f;
  --ink-2: #5b6156;
  --line: rgba(34, 38, 31, .14);
  --surface: #f8f9f5;
  --view: #eaede5;
  --view-ink: #22261f;
  --view-muted: #5b6156;
  --scrim: 238, 240, 234;
  --halo: rgba(238, 240, 234, .7);
  --pill-line-bg: rgba(238, 240, 234, .55);
  --backdrop: rgba(44, 52, 40, .28);
  --hover: rgba(34, 38, 31, .05);
  --img-shadow: rgba(44, 52, 40, .35);
}
[data-look="e"] {
  --bg: #eff2f4;
  --ink: #1f2428;
  --ink-2: #59616a;
  --line: rgba(31, 36, 40, .13);
  --surface: #fafbfc;
  --view: #ebeff2;
  --view-ink: #1f2428;
  --view-muted: #59616a;
  --scrim: 239, 242, 244;
  --halo: rgba(239, 242, 244, .7);
  --pill-line-bg: rgba(239, 242, 244, .55);
  --backdrop: rgba(36, 46, 56, .25);
  --hover: rgba(31, 36, 40, .05);
  --img-shadow: rgba(36, 46, 56, .3);
}
[data-look="f"] {
  --bg: #f5f5f3;
  --ink: #1f1f1d;
  --ink-2: #5d5d58;
  --line: rgba(31, 31, 29, .13);
  --surface: #ffffff;
  --view: #f0f0ee;
  --view-ink: #1f1f1d;
  --view-muted: #5d5d58;
  --scrim: 245, 245, 243;
  --halo: rgba(245, 245, 243, .7);
  --pill-line-bg: rgba(245, 245, 243, .55);
  --backdrop: rgba(40, 40, 38, .25);
  --hover: rgba(31, 31, 29, .05);
  --img-shadow: rgba(40, 40, 38, .3);
}
[data-look="slate"] {
  color-scheme: dark;
  --bg: #24282b;
  --ink: #eeede8;
  --ink-2: #b3b7b9;
  --line: rgba(238, 237, 232, .16);
  --surface: #2d3236;
  --view: #1c1f22;
  --view-ink: #eeede8;
  --view-muted: #a9aeb2;
  --scrim: 30, 33, 36;
  --halo: rgba(20, 22, 24, .55);
  --pill-line-bg: rgba(30, 33, 36, .45);
  --backdrop: rgba(10, 12, 14, .5);
  --hover: rgba(238, 237, 232, .06);
  --img-shadow: #0b0c0d;
}
[data-look="night"] {
  color-scheme: dark;
  --bg: #121211;
  --ink: #ecebe5;
  --ink-2: #aeafa7;
  --line: rgba(236, 235, 229, .16);
  --surface: #1b1c1a;
  --view: #0f1010;
  --view-ink: #e8e8e4;
  --view-muted: #a4a7ac;
  --scrim: 12, 12, 11;
  --halo: rgba(8, 8, 7, .5);
  --pill-line-bg: rgba(18, 18, 17, .35);
  --backdrop: rgba(8, 8, 7, .55);
  --hover: rgba(236, 235, 229, .06);
  --img-shadow: #050505;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
html.has-room { scroll-snap-type: y proximity; scrollbar-width: none; }
html.has-room::-webkit-scrollbar { display: none; }
html.is-locked { overflow: hidden; }
html.is-over-painting { cursor: zoom-in; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
h1, h2, p, figure, ol { margin: 0; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
[hidden] { display: none !important; }

h2 { font-size: var(--fs-h2); font-weight: 500; letter-spacing: -.022em; line-height: 1.08; text-wrap: balance; }
.label { font-size: var(--fs-label); line-height: 1.45; }

.skip {
  position: absolute; left: -9999px; top: 16px; z-index: 100;
  padding: 8px 16px; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); cursor: pointer;
}
.skip:focus { left: 16px; position: fixed; }

/* ---------- pills: anything you press ---------- */
.pill {
  --h: 48px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--h); padding: 0 24px;
  overflow: hidden;
  border: 0; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-size: var(--fs-body); font-weight: 500; line-height: var(--h); white-space: nowrap;
  text-decoration: none; cursor: pointer;
  pointer-events: auto;
  transition: transform .16s var(--ease), background-color .3s var(--ease), color .3s var(--ease);
}
.pill > span { position: relative; display: block; transition: transform .5s var(--ease); }
.pill > span::after {
  content: attr(data-t);
  content: attr(data-t) / "";
  position: absolute; left: 0; right: 0; top: 100%; text-align: center;
}
@media (hover: hover) { .pill:hover > span { transform: translateY(-100%); } }
.pill:active { transform: scale(.97); }
.pill:focus-visible { outline: 2px solid var(--ink); }
.pill--small { --h: 40px; padding: 0 20px; font-size: var(--fs-label); }
.pill--line { background: var(--pill-line-bg); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.pill--dark { background: var(--view-ink); color: var(--view); }
.pill--dark-line { background: transparent; color: var(--view-ink); box-shadow: inset 0 0 0 1.5px var(--view-ink); }
.pill:disabled { opacity: .4; cursor: default; transform: none; }
.pill:disabled > span { transform: none; }

/* ---------- the room ---------- */
.room { position: fixed; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.track { position: relative; }
.track__stop { position: absolute; left: 0; width: 1px; height: 1px; scroll-snap-align: start; }
html:not(.has-room) .room, html:not(.has-room) .track { display: none; }

/* waiting for the paintings: a dark room and one thin line */
.curtain {
  position: fixed; inset: 0; z-index: var(--z-curtain);
  display: grid; place-content: center; justify-items: center; gap: 16px;
  background: var(--bg);
  transition: opacity .9s var(--ease), visibility .9s;
}
.curtain__text { color: var(--ink-2); }
.curtain__bar { width: 160px; height: 1px; background: var(--line); overflow: hidden; }
.curtain__bar > span { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease); }
.is-open .curtain { opacity: 0; visibility: hidden; }
.is-flat .curtain { display: none; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-ui);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 72px; padding: 0 var(--gutter);
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav__name {
  font-weight: 500; text-decoration: none; letter-spacing: -.01em;
  text-shadow: 0 0 12px var(--halo), 0 0 2px var(--halo); /* it can sit over a bright ceiling */
  opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility .4s;
}
.nav.is-in .nav__name, .is-flat .nav__name { opacity: 1; visibility: visible; }
.nav__actions { display: flex; gap: 8px; }
.nav__btn { --h: 40px; padding: 0 20px; font-size: var(--fs-label); }
.is-flat [data-index-open] { display: none; }

/* everything written over the room gets a soft shadow so it reads on a lit wall too */
.intro, .exit { text-shadow: 0 0 24px var(--halo); }
.cap { text-shadow: 0 0 2px var(--halo); } /* small: the caption can sit close to a painting */
.pill { text-shadow: none; }

/* ---------- outside the door ---------- */
.intro {
  position: fixed; left: var(--gutter); right: var(--gutter); bottom: 56px; z-index: var(--z-ui);
  pointer-events: none;
}
.intro.is-gone { visibility: hidden; }
.intro__name { font-size: var(--fs-display); font-weight: 500; letter-spacing: -.045em; line-height: .9; margin-left: -.05em; }
.intro__room { margin-top: 24px; font-size: var(--fs-h2); font-weight: 500; letter-spacing: -.022em; line-height: 1.08; }
.intro__line { margin-top: 8px; color: var(--ink-2); max-width: 30em; }
.intro__enter { position: absolute; right: 0; bottom: 0; }
.is-flat .intro { display: none; }

/* the one moment: the curtain lifts and the name rises in, line by line */
.line { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .18em; margin-bottom: -.18em; }
.line > span { display: inline-block; }
.js .intro .line > span { transform: translateY(105%); }
.js.is-open .intro .line > span { transform: none; transition: transform 1.2s var(--ease) .5s; }
.js.is-open .intro__name .line:nth-child(2) > span { transition-delay: .58s; }
.js.is-open .intro__room .line > span { transition-delay: .72s; }
.js.is-open .intro__line .line > span { transition-delay: .8s; }
.js .intro__enter { opacity: 0; }
.js.is-open .intro__enter { opacity: 1; transition: opacity 1s var(--ease) 1.4s, transform .16s var(--ease); }

/* ---------- the painting you stand at ---------- */
.cap {
  position: fixed; left: var(--gutter); bottom: 40px; z-index: var(--z-ui);
  max-width: min(420px, calc(100vw - 2 * var(--gutter)));
  display: grid; gap: 4px;
  /* its own backing, like the hint: it can sit over a lit wall or a dark floor */
  padding: 16px 20px; border-radius: 16px;
  background: var(--pill-line-bg);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  pointer-events: none;
  opacity: 0; transform: translateY(12px); visibility: hidden;
  transition: opacity .35s var(--ease), transform .35s var(--ease), visibility .35s;
}
.cap.is-on { opacity: 1; transform: none; visibility: visible; }
.cap__title { font-size: var(--fs-body); font-weight: 400; font-style: italic; letter-spacing: 0; line-height: 1.35; }
.cap__meta { color: var(--ink-2); }
.cap__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.is-flat .cap { display: none; }

/* a one-time hint once you are inside, until you first step over to a painting */
.tip {
  position: fixed; left: var(--gutter); bottom: 40px; z-index: var(--z-ui);
  padding: 8px 16px; border-radius: 999px;
  background: var(--pill-line-bg); color: var(--ink); /* its own backing, so it reads over any floor */
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  pointer-events: none;
  opacity: 0; transform: translateY(8px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.tip.is-on { opacity: 1; transform: none; }
.is-flat .tip { display: none; }

/* ---------- the end: you turn round, and the contact card comes up ---------- */
.exit {
  position: fixed; inset: auto 0 0 0; z-index: var(--z-ui);
  padding: 120px var(--gutter) 40px;
  display: grid; gap: 16px; justify-items: start;
  background: linear-gradient(to top, rgba(var(--scrim), .94) 0%, rgba(var(--scrim), .8) 55%, rgba(var(--scrim), 0) 100%);
  pointer-events: none;
  opacity: 0; transform: translateY(24px); visibility: hidden;
  transition: opacity .5s var(--ease), transform .5s var(--ease), visibility .5s;
}
.exit.is-on { opacity: 1; transform: none; visibility: visible; pointer-events: auto; }
.exit__bio { max-width: 34em; color: var(--ink-2); }
.exit__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.exit__credit { margin-top: 16px; max-width: 48em; color: var(--ink-2); }
.is-flat .exit { display: none; }

/* ---------- index: a sheet from the right ---------- */
.index {
  position: fixed; inset: 0 0 0 auto;
  width: min(420px, 100vw); height: 100%; max-height: none; max-width: none;
  margin: 0; padding: 0; border: 0;
  background: var(--surface); color: var(--ink);
  overflow: auto; overscroll-behavior: contain;
}
.index[open] { animation: sheet-in .3s var(--ease); }
.index::backdrop { background: var(--backdrop); }
@keyframes sheet-in { from { transform: translateX(32px); opacity: 0; } }
.index__head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; padding: 0 24px; background: var(--surface);
  box-shadow: 0 1px 0 var(--line);
}
.index__title { font-size: var(--fs-body); font-weight: 500; letter-spacing: -.01em; }
.index__list { list-style: none; padding: 8px 0 16px; }
.index__looks { padding: 16px 24px 16px; box-shadow: 0 -1px 0 var(--line); }
.index__looks-title { font-weight: 500; margin: 0; }
.index__looks-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.look {
  display: flex; align-items: center; gap: 12px;
  height: 40px; padding: 0 16px 0 8px;
  border: 0; border-radius: 999px; background: var(--hover); text-align: left; cursor: pointer;
  transition: background-color .2s var(--ease), transform .16s var(--ease);
}
@media (hover: hover) { .look:hover { background: var(--line); } }
.look:active { transform: scale(.97); }
.look[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--ink); }
/* the swatch is the room in miniature: wall above, floor below */
.look__swatch { flex: none; width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(var(--wall) 50%, var(--floor) 50%); box-shadow: inset 0 0 0 1px var(--line); }
.index__flat { padding: 16px 24px 40px; color: var(--ink-2); box-shadow: 0 -1px 0 var(--line); }
.index__item {
  display: grid; grid-template-columns: 88px 1fr; gap: 16px; align-items: center;
  width: 100%; padding: 12px 24px; border: 0; background: none; text-align: left; cursor: pointer;
  transition: background-color .2s var(--ease);
}
@media (hover: hover) { .index__item:hover { background: var(--hover); } }
.index__item:active { background: var(--line); }
.index__item:focus-visible { outline-offset: -4px; }
.index__item img { width: 88px; height: 64px; object-fit: contain; background: var(--line) center / cover no-repeat; }
.index__name { display: block; font-style: italic; line-height: 1.35; }
.index__date { display: block; color: var(--ink-2); }

/* ---------- viewer: the photograph large, on a dark wall ---------- */
.view {
  position: fixed; inset: 0;
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 88px var(--gutter) 40px; border: 0;
  background: var(--view); color: var(--view-ink);
  display: none;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 48px;
}
.view[open] { display: grid; animation: view-in .24s var(--ease); }
.view::backdrop { background: var(--view); }
@keyframes view-in { from { opacity: 0; } }
.view__fig { min-height: 0; display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.view__img {
  width: auto; height: auto; max-width: 100%; max-height: 100%;
  object-fit: contain; cursor: zoom-in;
  box-shadow: 0 48px 96px -48px var(--img-shadow);
  transition: opacity .2s var(--ease);
}
.view__img.is-swapping { opacity: 0; }
.view.is-zoomed .view__fig { display: block; overflow: auto; overscroll-behavior: contain; touch-action: auto; scrollbar-width: none; }
.view.is-zoomed .view__fig::-webkit-scrollbar { display: none; }
.view.is-zoomed .view__img { max-width: none; max-height: none; height: auto; box-shadow: none; cursor: zoom-out; user-select: none; -webkit-user-drag: none; }
.view.is-zoomed.is-panning .view__img { cursor: grabbing; }
.view__info { align-self: end; display: grid; gap: 12px; }
.view__title { font-size: var(--fs-h2); font-weight: 400; font-style: italic; }
.view__meta, .view__count { color: var(--view-muted); }
.view__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.view__bar { position: absolute; right: var(--gutter); top: 16px; display: flex; gap: 8px; }

/* ---------- no room: the paintings as a list ---------- */
.flat { padding: 120px var(--gutter) 96px; }
.flat__name { font-size: clamp(3rem, 8vw, 7rem); font-weight: 500; letter-spacing: -.045em; line-height: .9; }
.flat__room { margin-top: 24px; max-width: 34em; color: var(--ink-2); }
.flat__list { list-style: none; padding: 0; margin-top: 96px; display: grid; gap: 112px; }
.flat__work { --cw: min(100%, 1100px, calc(80svh * var(--ar))); display: grid; justify-items: center; }
.flat__open { display: block; width: var(--cw); padding: 0; border: 0; background: none; cursor: zoom-in; }
.flat__open img { width: 100%; aspect-ratio: var(--ar); background: var(--line) center / cover no-repeat; }
.flat__cap { width: var(--cw); margin-top: 16px; color: var(--ink-2); }
.flat__title { color: var(--ink); font-style: italic; }
.flat__contact { margin-top: 128px; display: grid; gap: 24px; }
.noscript { padding: 120px var(--gutter); color: var(--ink-2); }

/* ---------- phones: designed, not shrunk ---------- */
@media (max-width: 719px) {
  :root { --fs-display: 21vw; }
  .nav { height: 64px; }
  .nav__btn { --h: 36px; padding: 0 16px; }
  .intro { bottom: 32px; }
  .intro__name .line { display: block; }
  .intro__room { margin-top: 16px; }
  .intro__enter { position: static; margin-top: 32px; }
  .cap, .tip { bottom: 24px; }
  .exit { padding-top: 96px; padding-bottom: 24px; }
  .exit__actions { width: 100%; flex-direction: column; }
  .exit__actions .pill { width: 100%; }
  .flat { padding-top: 96px; }
  .flat__list { gap: 80px; margin-top: 56px; }

  .view {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 24px;
    padding: 72px var(--gutter) 24px;
  }
  .view__info { gap: 4px; }
  .view__title { font-size: var(--fs-body); }
  .view__bar { left: var(--gutter); right: var(--gutter); justify-content: flex-end; }
}

/* phone held sideways: keep the name and the card to the first screen */
@media (max-height: 560px) and (orientation: landscape) {
  :root { --fs-display: min(9.6vw, 22svh); }
  .intro { bottom: 24px; }
  .intro__room { margin-top: 8px; }
  .cap { bottom: 16px; }
  .exit { padding: 48px var(--gutter) 16px; gap: 8px; }
  .exit__bio, .exit__credit { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .js .intro .line > span { transform: none; }
  .js .intro__enter { opacity: 1; }
}
