:root {
  --studio-bg: #efe6d6;
  --studio-ink: #1f1b16;
  --papers-bg: #2d4bd2;
  --papers-ink: #f3efe4;
  --print-bg: #e0532f;
  --print-ink: #fff3e8;
  --visit-bg: #2f4a3a;
  --visit-ink: #ece7d4;
  --bg: var(--studio-bg);
  --ink: var(--studio-ink);
  --serif: "Fraunces Variable", Georgia, serif;
  --sans: "Instrument Sans Variable", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overflow: clip; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }

.stage {
  position: relative;
  height: 100vh;
  min-height: 300px;
  overflow: hidden;
  overflow: clip;
  background: var(--bg);
  color: var(--ink);
  isolation: isolate;
}
/* the grain of the paper, on every page and every sheet */
.stage::before, .sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .55 0'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
}

.top {
  position: absolute;
  z-index: 5;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(14px, 3.2vh, 28px) clamp(16px, 4vw, 44px);
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.brand__mark { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.brand__name { font-family: var(--serif); font-size: 18px; font-weight: 560; letter-spacing: -.01em; white-space: nowrap; }

.nav {
  position: relative;
  display: flex;
  padding: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent);
}
.nav__pill {
  position: absolute;
  top: 4px; bottom: 4px; left: 0;
  width: 0;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 6px 14px -8px rgba(0,0,0,.5);
}
.nav__item {
  position: relative;
  z-index: 1;
  padding: 7px 13px;
  border-radius: 999px;
  color: inherit;
  font-size: 13px;
  font-weight: 520;
  text-decoration: none;
  transition: color .3s;
}
.nav__item.is-here { color: var(--bg); }

.page {
  position: absolute;
  z-index: 1;
  left: clamp(16px, 6vw, 88px);
  right: clamp(16px, 6vw, 88px);
  top: 50%;
  transform: translateY(-58%);
}
.page__label {
  margin: 0 0 clamp(6px, 1.4vh, 14px);
  font-size: clamp(10px, 1.6vh, 12px);
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .72;
}
.page__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 440;
  font-size: clamp(46px, min(15vw, 22vh), 190px);
  line-height: .9;
  letter-spacing: -.035em;
  white-space: nowrap;
}
.page__title .w { display: inline-block; overflow: hidden; padding: .04em .02em .12em; margin: -.04em -.02em -.12em; vertical-align: top; }
.page__title .c { display: inline-block; will-change: transform; }
.page__line {
  max-width: 34ch;
  margin: clamp(10px, 2.4vh, 22px) 0 0;
  font-size: clamp(13px, min(1.6vw, 2.6vh), 17px);
  line-height: 1.45;
  opacity: .82;
}
.card {
  display: inline-grid;
  margin-top: clamp(14px, 3vh, 28px);
  gap: 2px;
  padding: 12px 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 14%, transparent), 0 14px 30px -22px rgba(0,0,0,.6);
  backdrop-filter: blur(6px);
}
.card__k { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.card__v { font-family: var(--serif); font-size: 16px; }

/* the pile of paper samples on the right */
.pile {
  position: absolute;
  z-index: 1;
  right: clamp(24px, 9vw, 150px);
  top: 50%;
  width: min(24vw, 30vh, 300px);
  aspect-ratio: 3 / 4;
  transform: translateY(-62%);
}
.swatch {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 1px 2px rgba(0,0,0,.18), 0 18px 34px -18px rgba(0,0,0,.45);
  overflow: hidden;
}
.swatch::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .22;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .6 0'/></filter><rect width='120' height='120' filter='url(%23n)'/></svg>");
}
/* the light that runs across the sample laid on top */
.swatch::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,.28) 50%, transparent 58%);
  transform: translateX(var(--shine, -60%));
  pointer-events: none;
}
.swatch__n {
  position: absolute;
  left: 12%; bottom: 14%;
  font-family: var(--serif);
  font-size: min(3.2vw, 4.2vh, 38px);
  letter-spacing: -.02em;
}
.swatch__g {
  position: absolute;
  left: 12%; top: 10%;
  font-size: min(1.1vw, 1.5vh, 12px);
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .75;
}
.swatch[data-swatch="studio"] { background: var(--studio-bg); color: var(--studio-ink); }
.swatch[data-swatch="papers"] { background: var(--papers-bg); color: var(--papers-ink); }
.swatch[data-swatch="print"] { background: var(--print-bg); color: var(--print-ink); }
.swatch[data-swatch="visit"] { background: var(--visit-bg); color: var(--visit-ink); }

/* the deck: the next sheets peek out of the bottom edge as index tabs */
.deck {
  position: absolute;
  z-index: 2;
  left: 0; right: 0; bottom: 0;
  height: clamp(30px, 6.4vh, 46px);
  display: flex;
  justify-content: center;
  gap: clamp(4px, 1vw, 10px);
  padding: 0 clamp(12px, 4vw, 44px);
}
.tab {
  position: relative;
  flex: 0 1 150px;
  min-width: 0;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 12px 12px 0 0;
  font: inherit;
  font-size: clamp(10px, 1.7vh, 12px);
  font-weight: 560;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 -1px 0 rgba(255,255,255,.35) inset, 0 -10px 22px -16px rgba(0,0,0,.55);
}
.tab span { position: relative; top: -20%; white-space: nowrap; }
.tab[data-tab="studio"] { background: var(--studio-bg); color: var(--studio-ink); }
.tab[data-tab="papers"] { background: var(--papers-bg); color: var(--papers-ink); }
.tab[data-tab="print"] { background: var(--print-bg); color: var(--print-ink); }
.tab[data-tab="visit"] { background: var(--visit-bg); color: var(--visit-ink); }
.tab:focus-visible, .nav__item:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* the sheets that riffle up during the change */
.sheets { position: absolute; z-index: 4; inset: 0; pointer-events: none; }
.sheet {
  position: absolute;
  left: -2%;
  width: 104%;
  top: 0;
  height: 112%;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -1px 0 rgba(255,255,255,.4) inset, 0 -24px 50px -20px rgba(0,0,0,.45);
  overflow: hidden;
}
/* the light on the top edge and the shade that runs down the sheet as it moves */
.sheet::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.22) 0, rgba(255,255,255,0) 7%, rgba(0,0,0,0) 60%, rgba(0,0,0,.14) 100%);
  pointer-events: none;
}
.sheet__name {
  position: absolute;
  left: clamp(18px, 6vw, 90px);
  top: clamp(64px, 13vh, 112px);
  font-size: clamp(10px, 1.7vh, 12px);
  font-weight: 560;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .8;
}
.sheet__big {
  position: absolute;
  left: clamp(16px, 6vw, 88px);
  bottom: 22%;
  font-family: var(--serif);
  font-size: clamp(46px, min(15vw, 22vh), 190px);
  line-height: .9;
  letter-spacing: -.035em;
  opacity: .14;
  white-space: nowrap;
}
/* the shade that falls on the old page as the deck covers it */
.shade { position: absolute; z-index: 3; inset: 0; background: #000; opacity: 0; pointer-events: none; }

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

.is-busy .nav, .is-busy .deck { pointer-events: none; }

@media (hover: hover) {
  .nav__item:not(.is-here):hover { opacity: .7; }
}
@media (max-width: 640px) {
  .pile { display: none; }
}
@media (max-width: 520px) {
  .brand__name { font-size: 15px; }
  .nav__item { padding: 6px 8px; font-size: 11px; }
}
