@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree-latin-ext.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Dark like the floor and doors in the photos, with the sofa's mustard as the one strong colour. */
:root {
  color-scheme: dark;
  --page: #171412;
  --ink: #f5f1ea;
  --muted: #a89f93;
  --tile: #27221e;
  --bar: rgb(44 38 33 / 0.72);
  --bar-line: rgb(255 255 255 / 0.12);
  --bar-ink: #f5f1ea;
  --mustard: #e0b23c;
  --on-mustard: #171412;
  --edge: clamp(0.75rem, 2vw, 1.75rem);
  --gap: clamp(0.5rem, 0.9vw, 0.75rem);
  --radius: clamp(0.75rem, 1.3vw, 1.25rem);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--mustard);
  outline-offset: 2px;
}

/* Top line */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(0.875rem, 1.6vw, 1.25rem) var(--edge);
}

h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.languages {
  display: flex;
  gap: 0.125rem;
  font-size: 0.875rem;
}

.languages a {
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}

.languages a:hover {
  color: var(--ink);
}

.languages a[aria-current="true"] {
  background: var(--tile);
  color: var(--ink);
  font-weight: 500;
}

/* Name of the open tab and its comment */

.panel {
  padding: 0 var(--edge) 6.5rem;
}

.panel-head {
  padding: clamp(0.5rem, 1.6vw, 1.5rem) 0 clamp(1rem, 1.8vw, 1.5rem);
}

h2 {
  margin: 0 0 clamp(0.5rem, 1vw, 0.75rem);
  font-size: clamp(2.5rem, 5.4vw, 5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}

.note {
  max-width: 42rem;
  margin: 0;
  color: #e2dbd0;
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
}

/* Masonry: the columns end level, and the viewer always shows the whole photo */

.masonry {
  display: grid;
  gap: var(--gap);
}

.masonry-column {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-width: 0;
  min-height: 0;
}

.shot {
  position: relative;
  flex-basis: 0;
  min-height: 0;
  margin: 0;
  border-radius: var(--radius);
  background: var(--tile);
  overflow: hidden;
  animation: tile-in 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  animation-delay: calc(var(--order) * 35ms);
}

@keyframes tile-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
}

.shot-lead {
  margin-bottom: var(--gap);
}

.shot-open {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.shot-open:focus-visible {
  outline-offset: -4px;
}

.shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s ease-out, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.shot img.is-loaded {
  opacity: 1;
}

@media (hover: hover) {
  .shot-open:hover img {
    transform: scale(1.035);
  }
}

/* A warm paper colour, which the plan's white background takes on through the blend. */
.is-plan {
  background: #efe9df;
}

/* The space at the bottom keeps the room and label off the drawing. */
.is-plan img {
  padding: 2.5% 2.5% 2.5rem;
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* Room and label on each photo */

.chips {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  pointer-events: none;
}

.room,
.label {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.1875rem 0.5625rem;
  border-radius: 999px;
  background: rgb(23 20 18 / 0.62);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
  white-space: nowrap;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* The dot's colour says what kind of photo it is: linen for layout, mustard for style, brick for shared. */
.label::before {
  content: "";
  flex: none;
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: #f5f1ea;
}

.label[data-type="style"]::before {
  background: var(--mustard);
}

.label[data-type="shared"]::before {
  background: #d98f55;
}

.viewer .label {
  background: rgb(255 255 255 / 0.1);
}

/* Tabs float over the photos, within reach of a thumb */

.tabs {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 2;
  display: flex;
  max-width: calc(100vw - 1.5rem);
  padding: 0.3125rem;
  border: 1px solid var(--bar-line);
  border-radius: 999px;
  background: var(--bar);
  box-shadow: 0 10px 34px rgb(0 0 0 / 0.38);
  transform: translateX(-50%);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
}

.tab-marker {
  position: absolute;
  top: 0.3125rem;
  bottom: 0.3125rem;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: var(--mustard);
  transition: transform 0.32s cubic-bezier(0.3, 0.8, 0.3, 1), width 0.32s cubic-bezier(0.3, 0.8, 0.3, 1);
}

.tab {
  position: relative;
  display: flex;
  flex: none;
  align-items: baseline;
  gap: 0.4375rem;
  padding: 0.5625rem 1.125rem;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--bar-ink);
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s;
}

.tab[aria-selected="true"] {
  color: var(--on-mustard);
}

.tab-count {
  font-size: 0.8125rem;
  opacity: 0.65;
}

.tab:focus-visible {
  outline-color: #fff;
  outline-offset: -3px;
}

.tab[aria-selected="true"]:focus-visible {
  outline-color: var(--on-mustard);
}

.noscript {
  padding: 2rem var(--edge);
}

/* ---------- Full-screen viewer ---------- */

.viewer {
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0f0d0c;
  color: #f5f1ea;
  overflow: hidden;
}

.viewer[open] {
  display: block;
  animation: viewer-in 0.2s ease-out;
}

.viewer::backdrop {
  background: #0f0d0c;
}

@keyframes viewer-in {
  from {
    opacity: 0;
  }
}

.viewer-figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  margin: 0;
  padding: 0.75rem clamp(0.75rem, 6vw, 5.5rem) 0;
}

.viewer-figure img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.viewer-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  width: 100%;
  max-width: 60rem;
  margin: 0 auto;
  padding: 0.75rem 0 max(0.875rem, env(safe-area-inset-bottom));
  font-weight: 500;
}

.viewer-count {
  margin-left: auto;
  color: #a89f93;
  font-variant-numeric: tabular-nums;
}

.viewer button {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.1);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.viewer button:hover {
  background: rgb(255 255 255 / 0.2);
}

.viewer svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
}

.viewer-close {
  top: 0.625rem;
  right: 0.625rem;
}

.viewer-step {
  top: calc(50% - 2.25rem);
}

.viewer-prev {
  left: 0.625rem;
}

.viewer-next {
  right: 0.625rem;
}

/* ---------- Narrow screens ---------- */

@media (max-width: 760px) {
  .chips {
    left: 0.375rem;
    bottom: 0.375rem;
  }

  .room,
  .label {
    padding: 0.125rem 0.4375rem;
    font-size: 0.75rem;
  }

  .tab {
    padding: 0.5625rem 0.875rem;
  }

  /* Three names need the room here. */
  .tab-count {
    display: none;
  }

  /* Swiping moves the photos on a phone. */
  .viewer .viewer-step {
    display: none;
  }

  .viewer-figure {
    padding: 3.5rem 0 0;
  }

  .viewer-caption {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shot,
  .viewer[open] {
    animation: none;
  }

  .shot img,
  .tab,
  .tab-marker {
    transition: none;
  }
}
