/* Fan Deck: landing. A paint maker's colour fan deck on a viewing booth. */

:root {
  --card: #f4f1ea;
  --ink-card: #1b1a18;
  --small: #5e5a53;
  --quiet: #77726a;
  --brass: #c8a55e;
  --brass-soft: #b39a68;
  --table: #3a3936;
  --edge: 22px;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "Azeret Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }
html { background: var(--table); overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--table);
  color: #efebe2;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-x: clip;
}
h1, h2, p, ol { margin: 0; }

/* Top bar (bottom bar on a phone) */
.top {
  position: fixed;
  z-index: 50;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 32px;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.mark {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #f2eee5;
  text-decoration: none;
  border-radius: 4px;
}
.mark-name { font-weight: 800; font-size: 19px; line-height: 1; letter-spacing: -0.01em; }
.mark-line { font-family: var(--mono); font-size: 11px; line-height: 1.2; color: #cfc9bc; letter-spacing: 0.02em; }
.mark:focus-visible { outline: 2px solid #f0d27a; outline-offset: 6px; }
.bag {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(22, 21, 19, 0.62);
  color: #f2eee5;
}
.cue {
  position: fixed;
  left: 32px;
  bottom: 26px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ddd7ca;
  transition: opacity 0.4s ease, visibility 0.4s;
  pointer-events: none;
}
.cue.gone { opacity: 0; visibility: hidden; }

.mode-down .top {
  top: auto;
  bottom: 0;
  align-items: center;
  padding: 26px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(48, 47, 44, 0) 0%, rgba(48, 47, 44, 0.9) 48%);
}
.mode-down .mark-name { font-size: 17px; }
.mode-down .mark-line { display: none; }
.mode-down .cue { position: static; }

/* Deck and stage */
.deck { position: relative; }
.stage {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  overflow: clip;
  touch-action: pan-y;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}
.stage.grabbing, .stage.grabbing .strip { cursor: grabbing; }
.booth {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 85% at 50% -12%, #8d8b85 0%, #6a6863 34%, #4a4945 66%, #3a3936 100%);
}
.booth::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.09;
  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='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .7 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.mode-up .booth {
  background:
    radial-gradient(60% 46% at 50% 100%, rgba(20, 19, 17, 0.35) 0%, rgba(20, 19, 17, 0) 70%),
    radial-gradient(120% 85% at 50% -12%, #8d8b85 0%, #6a6863 34%, #4a4945 66%, #3a3936 100%);
}

.fan { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }

/* One strip. Its rotation point is the hole near its pivot end. */
.strip {
  position: absolute;
  left: calc(var(--W) * -0.5);
  width: var(--W);
  height: var(--H);
  display: block;
  color: var(--ink-card);
  text-decoration: none;
  outline: none;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-drag: none;
}
.mode-up .strip { top: calc((var(--H) - var(--e)) * -1); transform-origin: 50% calc(var(--H) - var(--e)); }
.mode-down .strip { top: calc(var(--e) * -1); transform-origin: 50% var(--e); }
a.strip { cursor: pointer; }
.strip.out { visibility: hidden; }

.face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--c, var(--card));
  border-radius: 9px 9px 18px 18px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.22), 0 0 20px rgba(0, 0, 0, 0.2);
}
.mode-down .face { flex-direction: column-reverse; border-radius: 18px 18px 9px 9px; }
.strip.f .face {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.25), 0 0 44px rgba(0, 0, 0, 0.36);
}
.strip:focus-visible .face { outline: 3px solid #f0d27a; outline-offset: 3px; }

.sw {
  position: relative;
  flex: 0 0 40%;
  background-color: var(--c);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 38%, rgba(0, 0, 0, 0.06) 100%);
}
.mode-down .sw {
  flex-basis: 37%;
  background-image: linear-gradient(0deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 38%, rgba(0, 0, 0, 0.06) 100%);
}

.lab {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-right: var(--edge);
  padding: 12px 12px 14px 14px;
  background: var(--card);
}
.row {
  display: flex;
  gap: 10px;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--quiet);
}
.row b { font-weight: 600; color: var(--ink-card); }
.name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-weight: 700;
  font-size: calc(var(--W) * 0.1);
  line-height: 1.04;
  letter-spacing: -0.012em;
  text-wrap: balance;
  overflow-wrap: break-word;
}
.tag {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.36;
  color: var(--small);
}
.mode-down .tag { font-size: 16px; line-height: 1.32; -webkit-line-clamp: 5; }
.mode-down .name { font-size: calc(var(--W) * 0.098); }

.tints {
  flex: 1 1 0;
  min-height: 36px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-right: var(--edge);
  padding-top: 3px;
  background: var(--card);
}
.mode-down .tints { flex-direction: column-reverse; padding-top: 0; padding-bottom: 3px; }
.tints i { display: block; flex: 1 1 0; }
.tints i:nth-child(1) { background: var(--t1); }
.tints i:nth-child(2) { background: var(--t2); }
.tints i:nth-child(3) { background: var(--t3); }
.tints i:nth-child(4) { background: var(--t4); }

.end { position: relative; flex: 0 0 calc(var(--e) * 2); background: var(--card); }
.hole {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: #2c2b28;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* Code and name printed down the coloured edge, read when the strip sits in the stack */
.spine {
  position: absolute;
  right: 0;
  width: var(--edge);
  height: 46%;
  writing-mode: vertical-rl;
  line-height: var(--edge);
  text-align: start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink, var(--ink-card));
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.spine b { font-family: var(--mono); font-weight: 600; letter-spacing: 0.06em; margin-inline-end: 7px; }
.mode-up .spine { top: 12px; }
.mode-down .spine { top: calc(var(--e) * 2 + 10px); }
.mode-up .strip.r .spine,
.mode-down .strip.l .spine { transform: rotate(180deg); text-align: end; }
.strip.c .spine { opacity: 0; }

/* Front cover */
.cover .face { background: #171614; color: #e9e1cc; }
.cv {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 28px 30px 28px 20px;
}
.cv::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(200, 165, 94, 0.42);
  border-radius: 6px;
  pointer-events: none;
}
.cv-name {
  font-weight: 800;
  font-size: calc(var(--W) * 0.2);
  line-height: 0.9;
  letter-spacing: -0.025em;
  color: #d8b871;
}
.cv-name span { display: block; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .cv-name, .back-name {
    background: linear-gradient(100deg, #8f6c30 0%, #e9d18f 34%, #b48b3f 58%, #f2dfa2 80%, #9c7736 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
.cv-line { font-size: 14px; line-height: 1.38; color: #d6ccb6; max-width: 14em; }
.mode-down .cv-line { font-size: 16px; }
.cv-range {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass-soft);
}
.cover .end { background: #171614; }
.cover .hole { background: #0d0c0b; }
.cover .spine { color: var(--brass); height: 40%; }
.cover .spine b { font-family: var(--sans); letter-spacing: 0.02em; margin: 0; }

/* The unprinted strip at the end of the deck */
.blank { --c: #e4e0d6; --ink: #8b867c; }
.blank .sw { background: var(--card); }
.blank .sw::after {
  content: "";
  position: absolute;
  inset: 14px 14px 14px 14px;
  border: 2px dotted rgba(0, 0, 0, 0.22);
  border-radius: 6px;
}
.blank .tints i { background: #ebe7de; }

/* Brass binding post */
.rivet {
  position: absolute;
  left: -22px;
  top: -22px;
  width: 44px;
  height: 44px;
  z-index: 9999;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 36% 30%, #fff6d2 0%, #ecd08a 14%, #c49a43 40%, #8d6522 72%, #5e4012 100%);
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(70, 48, 12, 0.35), inset 0 -3px 4px rgba(0, 0, 0, 0.3);
}
.rivet::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 34%, #f8e3a4 0%, #cfa64f 45%, #93692a 100%);
  box-shadow: inset 0 1px 1px rgba(255, 250, 230, 0.6), inset 0 -1px 2px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(90, 62, 18, 0.35);
}

/* A strip pulled out and laid flat */
.table { position: fixed; inset: 0; z-index: 100; overflow: hidden; }
.table[hidden] { display: none; }
.shade {
  position: absolute;
  inset: 0;
  background: rgba(24, 23, 21, 0.64);
  opacity: 0;
  transition: opacity 0.32s ease;
}
.table.on .shade { opacity: 1; }
.mode-up .table { --fw: min(1080px, calc(100vw - 96px)); --fh: clamp(320px, 52vh, 460px); }
.mode-down .table { --fw: min(380px, calc(100vw - 28px)); --fh: min(720px, calc(100svh - 36px)); }
.flat {
  position: absolute;
  left: calc(50% - var(--fw) / 2);
  top: calc(50% - var(--fh) / 2);
  width: var(--fw);
  height: var(--fh);
  display: flex;
  overflow: hidden;
  color: var(--ink-card);
  background: var(--c);
  border-radius: 10px 18px 18px 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 24px 50px rgba(0, 0, 0, 0.42);
  transform-origin: 50% 50%;
  transform: translate(0px, 0px) rotate(-0.8deg) scale(1);
}
.mode-up .flat { flex-direction: row; top: calc(50% - var(--fh) / 2 - 2vh); }
.mode-down .flat {
  flex-direction: column-reverse;
  border-radius: 18px 18px 10px 10px;
  transform: translate(0px, 0px) rotate(0.5deg) scale(1);
}

.fsw {
  position: relative;
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 40%, rgba(0, 0, 0, 0.06) 100%);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mode-up .fsw { flex: 0 0 28%; }
.mode-down .fsw { flex: 0 0 15%; min-height: 88px; }
.fcode { position: absolute; left: 18px; top: 18px; font-weight: 600; font-size: 13px; }
.flrv { position: absolute; left: 18px; bottom: 18px; opacity: 0.85; }

.flab {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 30px 34px 26px;
  background: var(--card);
}
.mode-up .flab { margin-bottom: var(--edge); }
.mode-down .flab { margin-right: var(--edge); padding: 22px 18px 20px 20px; }
.frow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--quiet);
}
.frow b { font-weight: 600; color: var(--ink-card); }
.fname {
  font-weight: 800;
  font-size: clamp(30px, 3.3vw, 50px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: balance;
  overflow-wrap: break-word;
}
.ftag { font-size: 19px; line-height: 1.36; color: #3b3934; max-width: 34em; }
.flede { font-size: 16.5px; line-height: 1.5; color: #67635b; max-width: 38em; }
.mode-down .fname { font-size: 30px; }
.mode-down .ftag { font-size: 17px; }
.mode-down .flede { font-size: 16px; }
.fact { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 10px; }
.open, .putback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 26px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.open { background: var(--c); color: var(--ink); border: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14); }
.putback { background: transparent; color: var(--ink-card); border: 1.5px solid rgba(27, 26, 24, 0.55); }
.open:hover { filter: brightness(1.06); }
.putback:hover { border-color: var(--ink-card); }
.open:focus-visible, .putback:focus-visible { outline: 3px solid var(--ink-card); outline-offset: 3px; }

.ftints { display: flex; gap: 3px; background: var(--card); }
.mode-up .ftints { flex: 0 0 120px; flex-direction: row; margin-bottom: var(--edge); padding-left: 3px; }
.mode-down .ftints { flex: 0 0 72px; flex-direction: column-reverse; margin-right: var(--edge); padding-bottom: 3px; }
.ftints i { display: block; flex: 1 1 0; }
.ftints i:nth-child(1) { background: var(--t1); }
.ftints i:nth-child(2) { background: var(--t2); }
.ftints i:nth-child(3) { background: var(--t3); }
.ftints i:nth-child(4) { background: var(--t4); }
.fend { position: relative; background: var(--card); }
.mode-up .fend { flex: 0 0 76px; }
.mode-down .fend { flex: 0 0 48px; }
.fend .hole { background: #4a4844; }

/* Back cover with the index */
.back {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 14vh 32px 20vh;
  background: var(--table);
}
.back-card {
  position: relative;
  width: min(980px, 100%);
  padding: 48px 46px 70px;
  background: #171614;
  color: #ece5d2;
  border-radius: 12px 12px 22px 22px;
  box-shadow: 0 0 0 1px rgba(200, 165, 94, 0.16), 0 30px 60px rgba(0, 0, 0, 0.35);
}
.back-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(200, 165, 94, 0.3);
  border-radius: 8px 8px 14px 14px;
  pointer-events: none;
}
.back-hole {
  position: absolute;
  left: 50%;
  bottom: 24px;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  background: var(--table);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7);
}
.back-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 22px; margin-bottom: 30px; }
.back-title {
  flex-basis: 100%;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass-soft);
}
.back-name { font-weight: 800; font-size: 40px; line-height: 1; letter-spacing: -0.02em; color: #d8b871; }
.back-line { font-size: 16px; color: #d0c7b2; }
.index {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  column-gap: 30px;
}
.index li { min-width: 0; border-top: 1px solid rgba(200, 165, 94, 0.2); }
.index a, .index .slot {
  display: grid;
  grid-template-columns: 22px 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 2px;
  color: #efe8d6;
  text-decoration: none;
  border-radius: 4px;
}
.index .chip {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.index .slot .chip { background: transparent; box-shadow: none; border: 2px dotted rgba(200, 165, 94, 0.55); }
.index .code { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--brass-soft); }
.index .nm { font-size: 16px; line-height: 1.25; overflow-wrap: break-word; min-width: 0; }
.index .kd { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #8f8778; }
.index a:hover .nm { color: #f0d27a; }
.index a:focus-visible { outline: 2px solid #f0d27a; outline-offset: 2px; }

.mode-down .back { padding: 10vh 16px 18vh; }
.mode-down .back-card { padding: 34px 22px 64px; }
.mode-down .back-name { font-size: 32px; }

@media (max-width: 420px) {
  .index { grid-template-columns: minmax(0, 1fr); }
  .index a, .index .slot { grid-template-columns: 22px 46px minmax(0, 1fr) auto; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .shade, .spine, .cue { transition: none; }
}
