/* The wall of work with the columns running in opposite directions: the work page of an invented creative studio,
   Field & Form, inside one dark card on a warm paper page. Each column is a track of covers written twice, moved by
   GSAP with a wrapping y; every cover has its own --p (0 at rest, 1 under the pointer), animated by GSAP and read
   here for the corners, the zoom of the photo, the shadow and the caption's veil. */
:root {
  --page: #e6e1d8;          /* the page around the card */
  --page-light: #f3f0ea;    /* the light on the page */
  --card: #141311;          /* the card */
  --card-top: #1c1b18;      /* the top of the card, where it catches the light */
  --edge: rgba(255, 246, 230, 0.09); /* the 1px edge of the card */
  --ink: #f2eee6;           /* the words */
  --muted: #8d877c;         /* the small words */
  --accent: #e8a25a;        /* the one accent: the active tab, the year, the meters */
  --pointer: #f7f4ef;       /* the drawn pointer */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: radial-gradient(120% 90% at 30% 0%, var(--page-light), var(--page) 62%);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 12px;
  overflow: hidden;
}

/* ---- the card ---- */
.wall {
  position: relative;
  width: min(640px, 92vw);
  height: min(600px, 90vh);
  display: flex;
  flex-direction: column;
  border-radius: clamp(16px, 3vw, 22px);
  background: linear-gradient(180deg, var(--card-top), var(--card) 40%);
  box-shadow:
    inset 0 0 0 1px var(--edge),
    inset 0 1px 0 rgba(255, 250, 240, 0.1),
    0 1px 1px rgba(40, 30, 15, 0.08),
    0 12px 24px -10px rgba(40, 30, 15, 0.22),
    0 40px 80px -30px rgba(40, 30, 15, 0.45);
  overflow: hidden;
  isolation: isolate;
  opacity: 0;
}

/* a warm haze in the top corner and a fine grain, so the dark is a material and not a flat fill */
.wall::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 40% at 12% 0%, rgba(232, 162, 90, 0.1), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.wall::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  opacity: 0.06;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 4;
}

.wall__head,
.wall__foot {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 clamp(12px, 2.6vw, 18px);
  flex: none;
}

.wall__head {
  height: clamp(42px, 8vh, 54px);
  border-bottom: 1px solid rgba(255, 246, 230, 0.06);
}

.wall__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(12px, 2.2vw, 14px);
  font-weight: 620;
  font-stretch: 112%;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.wall__mark {
  width: 16px;
  height: 16px;
}

.wall__mark-a {
  fill: var(--ink);
}

.wall__mark-b {
  fill: var(--accent);
}

.wall__nav {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 246, 230, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 246, 230, 0.06);
}

.wall__tab {
  padding: 4px clamp(7px, 1.6vw, 11px);
  border-radius: 999px;
  font-size: clamp(10px, 1.8vw, 12px);
  font-weight: 520;
  color: var(--muted);
}

.wall__tab.is-on {
  color: #1a140c;
  background: linear-gradient(180deg, #f2b673, var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 2px 6px -2px rgba(232, 162, 90, 0.6);
}

/* ---- the window with the two columns ---- */
.wall__window {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 1.6vw, 12px);
  padding: 0 clamp(10px, 2.2vw, 16px);
  overflow: hidden;
  touch-action: none;
}

.col {
  position: relative;
  min-width: 0;
  height: 100%;
}

.col__track {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.6vw, 12px);
  will-change: transform;
}

.wall__fade {
  position: absolute;
  left: 0;
  right: 0;
  height: clamp(22px, 6vh, 44px);
  pointer-events: none;
  z-index: 2;
}

.wall__fade--top {
  top: 0;
  background: linear-gradient(180deg, var(--card), rgba(20, 19, 17, 0));
}

.wall__fade--bottom {
  bottom: 0;
  background: linear-gradient(0deg, var(--card), rgba(20, 19, 17, 0));
}

/* ---- one cover ---- */
.tile {
  --p: 0;
  position: relative;
  display: block;
  flex: none;
  color: inherit;
  text-decoration: none;
  border-radius: calc(6px + var(--round, 12px) * var(--p));
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.tile__frame {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: #26241f;
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 230, calc(0.05 + 0.1 * var(--p))),
    0 calc(18px * var(--p)) calc(36px * var(--p)) calc(-14px * var(--p)) rgba(0, 0, 0, 0.7);
  transform: translateZ(0);
}

.tile__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(calc(1 + var(--grow, 0.08) * var(--p)));
  transition: filter 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* the other covers of the column under the pointer step back a little */
.col.is-looking .tile:not(.is-on) img {
  filter: brightness(0.62) saturate(0.8);
}

/* a soft light across the top of the cover, brighter under the pointer */
.tile__frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 250, 240, calc(0.04 + 0.08 * var(--p))), transparent 32%);
  pointer-events: none;
}

.tile__veil {
  position: absolute;
  inset: 40% 0 0;
  background: linear-gradient(180deg, rgba(10, 9, 8, 0), rgba(10, 9, 8, 0.72));
  opacity: var(--p);
  pointer-events: none;
}

.tile__cap {
  position: absolute;
  left: clamp(8px, 1.8vw, 12px);
  right: clamp(8px, 1.8vw, 12px);
  bottom: clamp(8px, 1.8vw, 12px);
  pointer-events: none;
}

.tile__client {
  display: block;
  overflow: clip;
  font-size: clamp(12px, 2.3vw, 15px);
  font-weight: 640;
  font-stretch: 108%;
  letter-spacing: -0.012em;
  line-height: 1.2;
  white-space: nowrap;
}

.tile__client .ch {
  display: inline-block;
}

.tile__meta {
  display: flex;
  gap: 8px;
  margin-top: 2px;
  overflow: clip;
  font-size: clamp(9.5px, 1.8vw, 11.5px);
  font-weight: 480;
  line-height: 1.3;
  white-space: nowrap;
}

.tile__meta span {
  display: inline-block;
}

.tile__year {
  color: var(--accent);
}

.tile__field {
  color: rgba(242, 238, 230, 0.7);
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile__view {
  position: absolute;
  top: clamp(7px, 1.6vw, 10px);
  right: clamp(7px, 1.6vw, 10px);
  display: grid;
  place-items: center;
  width: clamp(24px, 4.4vw, 30px);
  height: clamp(24px, 4.4vw, 30px);
  border-radius: 999px;
  background: rgba(20, 19, 17, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 246, 230, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: var(--p);
  transform: scale(calc(0.7 + 0.3 * var(--p))) rotate(calc(-45deg + 45deg * var(--p)));
  pointer-events: none;
}

.tile__view svg {
  width: 44%;
  height: 44%;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tile:focus-visible .tile__frame {
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* ---- the foot ---- */
.wall__foot {
  height: clamp(38px, 7vh, 48px);
  border-top: 1px solid rgba(255, 246, 230, 0.06);
  font-size: clamp(10.5px, 1.9vw, 12.5px);
}

.wall__now {
  display: block;
  overflow: clip;
  min-width: 0;
  line-height: 1.3;
}

.wall__now-roll {
  display: block;
  font-weight: 560;
  font-stretch: 104%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wall__drift {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.wall__arrow {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wall__meter {
  position: relative;
  width: clamp(22px, 5vw, 34px);
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 246, 230, 0.1);
  overflow: hidden;
}

.wall__meter-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.wall__meter + .wall__meter .wall__meter-fill {
  transform-origin: 100% 50%;
}

/* ---- the drawn pointer ---- */
.pointer {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  width: 22px;
  height: 22px;
  margin: -4px 0 0 -6px;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}

.pointer__shape {
  fill: var(--pointer);
  stroke: #141311;
  stroke-width: 1.2;
  stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
  .tile__frame img {
    transform: none;
  }
  .tile__view {
    transform: none;
  }
}
