@font-face {
  font-family: "Neue Montreal";
  src: url(/fonts/NeueMontreal-Regular.woff2) format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "Neue Montreal";
  src: url(/fonts/NeueMontreal-Medium.woff2) format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: block;
}

:root {
  --fg: #292826;
  --bg: #f5f3ef;
  --muted: rgba(41, 40, 38, 0.4);
  --muted-strong: #706e69;  /* grey that passes 4.5:1 on the paper colour */
  --tile: #ebe8e2;
  --chip: rgba(235, 232, 226, 0.85);
  --text: clamp(14px, 1.1vw, 16px);
  --small: max(11px, calc(var(--text) * 0.75));
  --pad: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}
@media (min-width: 1920px) {
  :root { --text: clamp(16px, calc(10px + 0.3125vw), 18px); }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  font: 400 var(--text)/1.1 "Neue Montreal", "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: -0.01em;
  /* Set like rapolas.studio: Medium for names and navigation, Regular for
     copy and labels, and the font's alternates and ligatures switched off. */
  font-feature-settings: "calt" 0, "liga" 0, "dlig" 0, "ss01" 0, "ss02" 0, "ss03" 0, "ss04" 0, "ss05" 0, "ss06" 0, "ss07" 0, "ss08" 0;
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip { position: fixed; left: -9999px; top: 0; z-index: 3000; background: var(--bg); padding: 6px 8px; }
.skip:focus { left: var(--pad); top: var(--pad); }

/* ── Header ───────────────────────────────────────────── */
#site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; justify-content: space-between; align-items: baseline;
  padding: var(--pad);
  pointer-events: none;
}
#site-header::before {
  content: ""; position: absolute; inset: 0 0 -20px; z-index: -1;
  background: linear-gradient(var(--bg) 40%, rgba(245, 243, 239, 0));
  opacity: 0; transition: opacity 300ms;
}
body[data-page="index"] #site-header::before { opacity: 1; }
#site-header a { pointer-events: auto; }
.site-title, .site-nav { font-weight: 500; }
.site-nav { display: flex; gap: 1.15em; }
/* grey through opacity, not a see-through colour, so the melt filter keeps it */
.site-nav a { color: var(--fg); opacity: 0.4; transition: opacity 200ms; }
.site-nav a:hover, .site-nav a[aria-current="page"] { opacity: 1; }
body[data-page="info"] .site-title { visibility: hidden; }

/* ── Overview strip ───────────────────────────────────── */
html:has(body[data-page="overview"]), body[data-page="overview"] {
  height: var(--vh, 100dvh); overflow: hidden; overscroll-behavior: none;
}
.strip {
  position: fixed; top: 0; left: 0; right: 0; height: var(--vh, 100dvh);
  overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none;
}
.strip.is-dragging, .strip.is-dragging .strip__item { cursor: grabbing; }
.strip__track { position: relative; }
.strip__item {
  position: absolute; top: 0; left: 0; display: block; overflow: hidden;
  background: var(--tile); cursor: pointer; will-change: transform;
  contain: layout paint; backface-visibility: hidden;
  -webkit-user-drag: none; -webkit-tap-highlight-color: transparent;
}
.strip__item.is-off { display: none; }
.strip__item img, .strip__item video {
  display: block; width: 100%; height: 100%; max-width: none; object-fit: cover;
  pointer-events: none; -webkit-user-drag: none; user-select: none;
}
.strip.is-column .strip__item img, .strip.is-column .strip__item video { will-change: transform; }
.strip:not(.is-ready) .strip__item { visibility: hidden; }
.strip__item.is-entering { animation: fade-in 900ms ease backwards; }
@keyframes fade-in { from { opacity: 0; } }

.strip-title {
  position: fixed; left: var(--pad); bottom: calc(var(--pad) + env(safe-area-inset-bottom, 0px));
  z-index: 10; pointer-events: none;
}
.strip-title { font-weight: 500; }
.strip-title__role { color: var(--muted); min-height: 1.1em; font-weight: 400; }
.strip-title.is-swapping > div { animation: title-in 420ms var(--ease) both; }
@keyframes title-in { from { opacity: 0; transform: translateY(3px); } }

/* ── Index grid ───────────────────────────────────────── */
.grid {
  list-style: none; margin: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 36px 14px; padding: 68px 18px 120px;
}
.grid__link { display: block; }
.grid__frame { display: block; aspect-ratio: 3 / 4; overflow: hidden; background: var(--tile); }
.grid__frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease); }
.grid__title {
  display: block; margin-top: 9px;
  font-size: var(--small); line-height: 1.2; letter-spacing: 0.01em; text-transform: uppercase;
}
@media (hover: hover) {
  .grid__link:hover .grid__frame img { transform: scale(1.03); }
}
/* Tiles below the fold reveal as they scroll in; on a first arrival from
   outside the site the ones on screen do too. */
.grid__item.is-hidden .grid__frame { clip-path: inset(100% 0 0); }
.grid__item.is-hidden .grid__frame img { transform: scale(1.12); transform-origin: 50% 100%; }
.grid__item.is-hidden .grid__title { opacity: 0; }
.grid__item.is-revealing .grid__frame { transition: clip-path 600ms var(--ease-io) var(--d, 0ms); }
.grid__item.is-revealing .grid__frame img { transition: transform 900ms var(--ease) var(--d, 0ms); transform-origin: 50% 100%; }
.grid__item.is-revealing .grid__title { transition: opacity 400ms ease calc(var(--d, 0ms) + 250ms); }

/* ── Info ─────────────────────────────────────────────── */
/* One text size throughout, like the rest of the site; contacts in Medium
   as on rapolas.studio. */
.info { width: min(560px, 46vw); padding: var(--pad); line-height: 1.3; }
.info__copy p { margin: 0 0 1.3em; }
.info__meta { margin: 0; }
.info__meta div { display: grid; grid-template-columns: 6.5em 1fr; }
.info__meta dt { color: var(--muted-strong); }
.info__meta dd { margin: 0; font-weight: 500; }
.info a { border-bottom: 1px solid transparent; transition: border-color 200ms; }
.info a:hover, .info a:focus-visible { border-bottom-color: currentColor; }

/* ── Set overlay ──────────────────────────────────────── */
html.has-set-open { overflow: hidden; }
.set {
  --pad-o: clamp(20px, 3vw, 45px); --gap-o: 12px;
  position: fixed; inset: 0; z-index: 2000; outline: none;
}
.set__backdrop { position: absolute; inset: 0; background: var(--bg); will-change: opacity; }
/* site.js paints a small blurred copy of the page into this canvas once;
   the paper-coloured veil sits on top, like frosted glass, without a live blur. */
.set__backdrop canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.set__backdrop::after { content: ""; position: absolute; inset: 0; background: rgba(245, 243, 239, 0.65); }
/* On a phone the set fills the screen: near-solid paper colour. */
@media (max-width: 767px) {
  .set__backdrop::after { background: rgba(245, 243, 239, 0.96); }
}
.set__scroller {
  position: absolute; inset: 0; overflow: auto hidden;
  overscroll-behavior: none; scrollbar-width: none;
}
.set__scroller::-webkit-scrollbar { display: none; }
.set__track {
  display: flex; align-items: flex-start; gap: var(--gap-o);
  width: max-content; height: 100%;
  padding: calc(var(--pad-o) + 2px) max(var(--pad-o), 16vw) calc(var(--pad-o) + 38px) var(--pad-o);
}
.set__item {
  flex: 0 0 auto; height: 100%; aspect-ratio: var(--r); margin: 0; overflow: hidden;
  background: rgba(0, 0, 0, 0.04) center / cover no-repeat;
}
.set__item video { display: block; width: 100%; height: 100%; object-fit: cover; }
.set__item img {
  width: 100%; height: 100%; max-width: none; object-fit: cover;
  -webkit-user-drag: none; user-select: none; transition: opacity 600ms;
}
.set__item img.is-pending { opacity: 0; }
.set__info {
  position: fixed; left: var(--pad-o); right: var(--pad-o);
  bottom: max(16px, calc(var(--pad-o) - 17px));
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--gap-o); row-gap: 12px; pointer-events: none; line-height: 1.2;
}
.set__credit { justify-self: start; pointer-events: auto; font-weight: 500; }
.set__label { opacity: 0.5; font-weight: 400; }
.set__close, .set__tail { display: none; }
.set__cursor {
  position: fixed; top: 0; left: 0; z-index: 5; translate: -50% -50%;
  font-size: var(--small); line-height: 1.2; letter-spacing: 0.01em; text-transform: uppercase;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 200ms;
}
.set__cursor.is-visible { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .set { cursor: none; }
  .set.is-dragging { cursor: grabbing; }
}
.set.is-closing { pointer-events: none; }
.set.is-busy, .set.is-busy * { cursor: default; }
.set__track { will-change: transform; }

/* ── Phone menu ───────────────────────────────────────── */
.mobile-bar, .mobile-menu { display: none; }

@media (max-width: 767px) {
  #site-header .site-title, #site-header .site-nav { display: none; }
  #site-header::before { display: none; }

  .mobile-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1600;
    display: flex; justify-content: center;
    padding: 40px 20px calc(14px + env(safe-area-inset-bottom, 0px));
    pointer-events: none;
  }
  .mobile-bar__toggle {
    position: relative; pointer-events: auto;
    display: flex; align-items: center; gap: 10px;
    min-height: 44px; padding: 0 10px; border: 0; background: none;
    line-height: 1.1; font-weight: 500; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .mobile-bar__toggle::before {
    content: ""; position: absolute; inset: 7px 0; z-index: -1; border-radius: 2px;
    background: var(--chip); -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6);
    transition: opacity 400ms;
  }
  html.is-menu-open .mobile-bar__toggle::before { opacity: 0; }
  .mobile-bar__icon { position: relative; top: -0.06em; width: 13px; height: 13px; flex: 0 0 auto; }
  .mobile-bar__icon i {
    position: absolute; left: 50%; top: 50%; width: 2.5px; height: 2.5px; border-radius: 50%;
    background: currentColor; transform: translate(-50%, -50%) translate(var(--x), var(--y));
    transition: transform 450ms var(--ease);
  }
  .mobile-bar__icon i:nth-child(1) { --x: -3.875px; --y: -3.5px; }
  .mobile-bar__icon i:nth-child(2) { --x: 3.875px; --y: -3.5px; }
  .mobile-bar__icon i:nth-child(3) { --x: -3.875px; --y: 3.5px; }
  .mobile-bar__icon i:nth-child(4) { --x: 3.875px; --y: 3.5px; }
  html.is-menu-open .mobile-bar__icon i:nth-child(1) { --x: 0px; --y: -5.25px; }
  html.is-menu-open .mobile-bar__icon i:nth-child(2) { --x: 5.25px; --y: 0px; }
  html.is-menu-open .mobile-bar__icon i:nth-child(3) { --x: -5.25px; --y: 0px; }
  html.is-menu-open .mobile-bar__icon i:nth-child(4) { --x: 0px; --y: 5.25px; }

  .mobile-menu {
    position: fixed; inset: 0; z-index: 1500;
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 20px 20px calc(80px + env(safe-area-inset-bottom, 0px));
    background: rgba(245, 243, 239, 0.65);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    opacity: 0; visibility: hidden; transition: opacity 450ms, visibility 0s linear 450ms;
  }
  html.is-menu-open .mobile-menu { opacity: 1; visibility: visible; transition: opacity 450ms; }
  .mobile-menu ul { list-style: none; margin: 0; padding: 0; text-align: center; }
  .mobile-menu a {
    display: inline-block; font-size: clamp(44px, 16vw, 78px); line-height: 1.16; letter-spacing: -0.03em; font-weight: 500;
    opacity: 0; transform: translateY(40px); transition: transform 450ms linear, opacity 300ms;
  }
  html.is-menu-open .mobile-menu a { opacity: 1; transform: none; transition: transform 800ms cubic-bezier(0.16, 1, 0.3, 1) 120ms, opacity 500ms; }
  html.is-menu-open .mobile-menu li:nth-child(2) a { transition-delay: 200ms; }
  html.is-menu-open .mobile-menu li:nth-child(3) a { transition-delay: 280ms; }
  html.is-menu-open .mobile-menu a[aria-current="page"] { opacity: 0.3; }

  /* strip runs top to bottom and scrolls natively */
  .strip { overflow: hidden auto; overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: none; }
  .strip::-webkit-scrollbar { display: none; }
  .strip-title {
    left: 50%; right: auto; bottom: auto; top: calc(18px + env(safe-area-inset-top, 0px));
    z-index: 1001; transform: translateX(-50%); text-align: center; white-space: nowrap;
    max-width: calc(100vw - 56px);
  }
  .strip-title::before {
    content: ""; position: absolute; inset: -5px -8px; z-index: -1; border-radius: 2px;
    background: rgba(245, 243, 239, 0.72); -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6);
  }
  .strip-title__role:empty { display: none; }

  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 10px; padding: 24px 12px 120px; }

  .info { width: auto; padding-top: calc(24px + env(safe-area-inset-top, 0px)); padding-bottom: 160px; }

  .set__scroller { overflow: hidden auto; }
  .set__track {
    flex-direction: column; align-items: stretch; width: auto; height: auto;
    padding: 0 20px 100px; gap: 10px;
  }
  .set__item { width: 100%; height: auto; }
  .set__info { display: contents; }
  .set__info .set__credit:not(:first-child) { display: none; }
  .set__tail { display: block; align-self: stretch; width: 100%; padding: 14px 0 24px; text-align: center; line-height: 1.2; }
  .set__tail .set__credit { justify-self: stretch; }
  .set__tail .set__credit + .set__credit { margin-top: 14px; }
  .set__info .set__credit:first-child {
    position: fixed; top: calc(18px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
    z-index: 3; width: max-content; max-width: calc(100% - 56px); margin: 0; padding: 0;
  }
  .set__info .set__credit:first-child::before {
    content: ""; position: absolute; inset: -5px -8px; z-index: -1; border-radius: 2px;
    background: rgba(245, 243, 239, 0.72); -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6);
  }
  .set__close {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 3;
    display: block; min-height: 44px; padding: 0 14px; border: 0; background: none;
    font-size: var(--small); letter-spacing: 0.01em; text-transform: uppercase; cursor: pointer;
  }
  .set__close::before {
    content: ""; position: absolute; inset: 8px 4px; z-index: -1; border-radius: 2px;
    background: rgba(245, 243, 239, 0.72); -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6);
  }
  .set__cursor { display: none; }
  .set { cursor: auto; }
  html.has-set-open .mobile-bar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .strip__item.is-entering { animation-duration: 200ms; }
  .grid__item.is-hidden .grid__frame { clip-path: none; }
  .grid__item.is-hidden .grid__frame img { transform: none; }
  .grid__item.is-hidden .grid__title { opacity: 1; }
  .mobile-menu a, html.is-menu-open .mobile-menu a { transition: opacity 200ms; transform: none; }
}

/* ── Melting set names ───────────────────────────────────── */
.melt-defs { position: absolute; width: 0; height: 0; }
.strip-title__name.is-melting { display: grid; }
.strip-title__name.is-melting > span { grid-area: 1 / 1; }
.strip-title.is-swapping > .strip-title__name.is-melting { animation: none; }

/* ── Touch and small screens ──────────────────────────────── */
/* small labels never go under 12px on a phone */
@media (max-width: 767px) { :root { --small: 12px; } }
/* on touch screens, short text links get a 44px tall tap area without
   changing how they look */
@media (pointer: coarse) {
  :root { --small: max(12px, calc(var(--text) * 0.75)); }
  .site-title, .site-nav a, .info a { display: inline-block; padding: 15px 0; margin: -15px 0; }
  .site-nav { gap: 0.4em; }
  .site-nav a { padding-left: 0.4em; padding-right: 0.4em; }
}
