:root {
  /* the two pages and the one accent they share */
  --home-bg: #f1ebe1;
  --home-ink: #1d1a16;
  --collection-bg: #1c2537;
  --collection-ink: #efe7da;
  --acc: #e0492b;
  /* the desk the card lifts off */
  --desk: #14120f;
  --display: 'Bricolage Grotesque Variable', 'Helvetica Neue', system-ui, sans-serif;
  --ui: 'Mona Sans Variable', system-ui, sans-serif;
}

* { 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(--desk);
  background-image: radial-gradient(120% 90% at 50% 40%, #24201b 0%, var(--desk) 70%);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  isolation: isolate;
}

/* ---- the pages ---- */
.pages { position: absolute; inset: 0; }
.page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 3.6vh, 34px) clamp(18px, 4.4vw, 56px);
  background: var(--pbg);
  color: var(--pink);
  overflow: hidden;
}
.page[hidden] { display: none; }
.page--home { --pbg: var(--home-bg); --pink: var(--home-ink); --line: rgba(29, 26, 22, .14); }
.page--collection { --pbg: var(--collection-bg); --pink: var(--collection-ink); --line: rgba(239, 231, 218, .16); }
/* a soft light from the top left and a fine rule at the middle where the page will fold */
.page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(90% 70% at 18% 0%, rgba(255, 255, 255, .22), transparent 60%);
}
.page--collection::before { background: radial-gradient(90% 70% at 18% 0%, rgba(120, 150, 210, .16), transparent 60%); }
.page::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(transparent, var(--line) 20%, var(--line) 80%, transparent);
  opacity: .55;
  pointer-events: none;
}

.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
}
.mark {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--acc);
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.brand__name {
  font-family: var(--display);
  font-weight: 640;
  font-size: 17px;
  letter-spacing: -.02em;
}
.brand__name em { font-style: normal; font-weight: 380; margin-left: 4px; opacity: .7; }

.nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--pbg) 80%, #fff 20%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 6px 18px -10px rgba(0, 0, 0, .35);
}
.page--collection .nav { background: color-mix(in srgb, var(--pbg) 86%, #fff 14%); }
.nav__item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
  font-weight: 520;
  font-variation-settings: 'wdth' 100;
  transition: font-variation-settings .5s cubic-bezier(.34, 1.56, .64, 1), background-color .3s;
}
.nav__item.is-here { background: var(--pink); color: var(--pbg); }
/* the peek: a tiny card in the colour of the page it leads to, which folds a little on hover */
.peek {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 11px;
  perspective: 60px;
}
.peek b {
  position: absolute;
  top: 0;
  width: 7px;
  height: 11px;
  border: 1px solid var(--line);
  background: var(--to);
}
.peek b:first-child { left: 0; border-radius: 2px 0 0 2px; }
.peek b:last-child { left: 7px; border-radius: 0 2px 2px 0; transform-origin: left center; transition: transform .55s cubic-bezier(.34, 1.56, .64, 1); }
.page--home .peek { --to: var(--collection-bg); }
.page--collection .peek { --to: var(--home-bg); }
@media (hover: hover) {
  .nav__item:not(.is-here):hover { background: color-mix(in srgb, var(--pink) 8%, transparent); font-variation-settings: 'wdth' 112; }
  .nav__item:hover .peek b:last-child { transform: rotateY(-150deg); }
}

.body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(16px, 4vw, 56px);
  padding-bottom: clamp(6px, 3vh, 30px);
}
.text { max-width: 640px; }
.eyebrow {
  margin: 0 0 clamp(8px, 1.8vh, 16px);
  font-size: 12px;
  font-weight: 560;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--acc);
}
.title {
  margin: 0;
  font-family: var(--display);
  font-weight: 560;
  font-variation-settings: 'opsz' 96;
  font-size: min(9.6vw, 14vh);
  line-height: .94;
  letter-spacing: -.045em;
}
.title .line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.title .line > span { display: inline-block; }
.title i { font-style: normal; font-weight: 300; font-variation-settings: 'wdth' 75, 'opsz' 96; color: var(--acc); }
.lede {
  margin: clamp(10px, 2.2vh, 20px) 0 0;
  max-width: 380px;
  font-size: clamp(13px, 2vh, 15px);
  line-height: 1.5;
  opacity: .72;
}

/* the elastic pill */
.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: clamp(12px, 2.6vh, 24px);
  padding: 11px 18px 11px 20px;
  border-radius: 999px;
  color: var(--pbg);
  text-decoration: none;
  font-size: 13px;
  font-weight: 560;
  font-variation-settings: 'wdth' 100;
  transition: font-variation-settings .55s cubic-bezier(.34, 1.56, .64, 1);
  isolation: isolate;
}
.pill::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--pink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 8px 20px -10px rgba(0, 0, 0, .5);
  transition: transform .6s cubic-bezier(.34, 1.8, .64, 1);
}
.pill svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .5s cubic-bezier(.34, 1.56, .64, 1); }
@media (hover: hover) {
  .pill:hover { font-variation-settings: 'wdth' 118; }
  .pill:hover::before { transform: scale(1.06, 1.12); }
  .pill:hover svg { transform: translateX(3px); }
}

/* the folded sample card on the home page */
.sample {
  position: relative;
  flex: none;
  margin: 0;
  width: min(26vw, 30vh, 260px);
  aspect-ratio: 1.3;
  perspective: 700px;
  transition: transform .7s cubic-bezier(.34, 1.56, .64, 1);
}
.sample__l, .sample__r {
  position: absolute;
  top: 0;
  width: 50%;
  height: 76%;
  background: linear-gradient(135deg, #fbf8f2, #e9e2d5);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 18px 30px -18px rgba(40, 28, 15, .55);
}
.sample__l { left: 0; border-radius: 4px 0 0 4px; transform-origin: right center; transform: rotateY(18deg); }
.sample__r {
  left: 50%;
  border-radius: 0 4px 4px 0;
  display: grid;
  place-items: center;
  transform-origin: left center;
  transform: rotateY(-14deg);
  background: linear-gradient(225deg, #fffdf8, #ebe4d8);
  transition: transform .7s cubic-bezier(.34, 1.56, .64, 1);
}
.sample__r .mark { width: 34%; height: auto; stroke-width: 1.3; }
.sample figcaption {
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}
.sample figcaption b { font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: -.01em; }
.sample figcaption span { opacity: .6; }
@media (hover: hover) {
  .sample:hover { transform: translateY(-4px); }
  .sample:hover .sample__r { transform: rotateY(-38deg); }
}

/* the list of the collection */
.list {
  flex: none;
  margin: 0;
  padding: 0;
  list-style: none;
  width: min(40vw, 440px);
  border-top: 1px solid var(--line);
}
.row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 14px;
  padding: clamp(9px, 1.9vh, 16px) 2px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  transition: transform .5s cubic-bezier(.34, 1.56, .64, 1), padding .5s cubic-bezier(.34, 1.56, .64, 1);
}
.row b { font-family: var(--display); font-weight: 560; font-size: clamp(14px, 2.3vh, 18px); letter-spacing: -.015em; }
.row span { opacity: .58; }
.row em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--acc); font-weight: 560; }
@media (hover: hover) {
  .row:hover { transform: translateX(6px); }
}

/* ---- the fold ---- */
.fold {
  position: absolute;
  inset: 0;
  z-index: 5;
  perspective: 1700px;
  visibility: hidden;
  pointer-events: none;
}
.fold.is-on { visibility: visible; }
.fold__shadow {
  position: absolute;
  left: 25%;
  top: 8%;
  width: 50%;
  height: 90%;
  border-radius: 14px;
  background: rgba(0, 0, 0, .8);
  filter: blur(26px);
  opacity: 0;
}
.fold__group { position: absolute; inset: 0; transform-style: preserve-3d; }
.half, .flap { position: absolute; top: 0; width: 50%; height: 100%; }
.half { overflow: hidden; }
.flap { transform-style: preserve-3d; }
.face { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face--back { transform: rotateY(180deg); }
.half__in { position: absolute; top: 0; }
.half__in > .page { position: absolute; inset: auto; top: 0; left: 0; }
.half__shade, .face__shade, .face__gloss, .half__crease { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.face__shade { background: #000; }
.face__gloss { background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .22) 48%, transparent 62%); mix-blend-mode: soft-light; }
.half__crease { width: 14px; }

/* the cover on the back of the folding half: the colour of the next page, a pressed frame, the mark and the name */
.cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.8vh, 14px);
  background: var(--cbg);
  color: var(--cink);
  text-align: center;
}
.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 60% at 30% 10%, rgba(255, 255, 255, .16), transparent 65%);
}
.cover__frame {
  position: absolute;
  inset: clamp(10px, 2.4vh, 22px);
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--cink) 18%, transparent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .12), 0 -1px 0 rgba(0, 0, 0, .18) inset;
}
.cover__mark { width: clamp(22px, 5vh, 36px); height: auto; stroke-width: 1.3; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .18)); }
.cover__name { display: block; overflow: hidden; padding: 0 .1em .08em; }
.cover__name > span {
  display: inline-block;
  font-family: var(--display);
  font-weight: 560;
  font-size: min(6.4vw, 9vh);
  letter-spacing: -.04em;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .1), 0 -1px 0 rgba(0, 0, 0, .25);
}
.cover__rule { display: block; width: 34px; height: 1px; background: var(--acc); transform-origin: center; }
.cover__brand { font-size: 11px; font-weight: 560; letter-spacing: .12em; text-transform: uppercase; opacity: .6; }

/* ---- grain over everything ---- */
.grain {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: .1;
  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 piece goes under the title */
@media (max-width: 720px) {
  .brand__name em { display: none; }
  .body { flex-direction: column; align-items: stretch; justify-content: flex-end; gap: clamp(10px, 2.4vh, 22px); }
  .title { font-size: min(12.4vw, 9.4vh); }
  .lede { display: none; }
  .sample { position: absolute; right: 0; top: clamp(4px, 2vh, 20px); width: min(30vw, 22vh); }
  .sample figcaption { display: none; }
  .list { width: 100%; }
  .nav__item { padding: 7px 11px; font-size: 12px; }
  .cover__name > span { font-size: min(9vw, 7vh); }
}
@media (max-width: 380px) {
  .brand__name { display: none; }
}

/* the autopilot shows the hover with a class */
.nav__item.is-hot { background: color-mix(in srgb, var(--pink) 8%, transparent); font-variation-settings: 'wdth' 112; }
.nav__item.is-hot .peek b:last-child { transform: rotateY(-150deg); }

@media (prefers-reduced-motion: reduce) {
  .nav__item, .pill, .pill::before, .pill svg, .sample, .sample__r, .row, .peek b { transition-duration: .01s !important; }
}
