:root {
  color-scheme: light;
  --bg: #f7f5ef;
  --ink: #151515;
  --muted: #64615a;
  --line: rgba(21, 21, 21, 0.18);
  --paper: #fffdf7;
  --accent: #fff;
  --footer-h: clamp(58px, 8vh, 78px);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: #fff;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  letter-spacing: 0;
  text-transform: uppercase;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr) var(--footer-h);
  height: 100dvh;
  padding: 0;
  gap: 0;
}

.mosaic {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--cols, 8), var(--tile-size));
  grid-template-rows: repeat(var(--rows, 5), var(--tile-size));
  place-content: center;
  gap: 0;
  min-height: 0;
  overflow: hidden;
  background: #000;
}

.tile {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  overflow: hidden;
  isolation: isolate;
  border: 0;
  background: #000;
  color: var(--paper);
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
  text-decoration: none;
  touch-action: manipulation;
  user-select: none;
}

.tile::before {
  content: "";
  position: absolute;
  inset: -0.5px;
  z-index: -2;
  background-image: var(--image);
  background-position: center;
  background-size: var(--fit, cover);
  background-repeat: no-repeat;
  filter: saturate(0.88) contrast(1.02);
  transform: var(--image-transform, scale(var(--zoom, 1)));
}

.tile:focus,
.tile:focus-visible,
.tile:focus-within,
.tile:active {
  outline: 0 !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}

.tile::-moz-focus-inner {
  border: 0;
}

.hover-title {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  max-width: min(360px, calc(100vw - 20px));
  pointer-events: none;
  background: #000;
  color: #fff;
  padding: 8px 10px 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.36);
  font-size: 13px;
  line-height: 1.16;
  letter-spacing: 0;
  text-transform: uppercase;
  opacity: 0;
  overflow-wrap: break-word;
  transition: opacity 90ms ease;
  will-change: transform, opacity;
  backdrop-filter: blur(4px);
}

.hover-title.is-visible {
  opacity: 1;
}

.contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  overflow: hidden;
  min-height: var(--footer-h);
  border-top: 0;
  background: #000;
  padding: 0 16px 12px;
  color: #fff;
  font-size: clamp(14px, 1.08vw, 18px);
  line-height: 1.28;
  white-space: nowrap;
}

.contact > * {
  min-width: 0;
}

.about-toggle,
.about-close,
.tile-close {
  appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: 0;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
  cursor: pointer;
  padding: 0;
}

.about-toggle {
  text-decoration: none;
}

.about-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.tile-link:focus,
.tile-link:focus-visible,
.tile-link:active {
  outline: 0;
  box-shadow: none;
}

.about-scrim,
.tile-scrim {
  position: fixed;
  inset: 0;
  z-index: 24;
  background: transparent;
}

.about-panel,
.tile-panel {
  position: fixed;
  right: 16px;
  bottom: calc(var(--footer-h) + 16px);
  z-index: 25;
  width: min(420px, calc(100vw - 32px));
  max-height: min(58vh, 520px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #000;
  color: #fff;
  padding: 14px 16px 28px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  font-size: 14px;
  line-height: 1.28;
  letter-spacing: 0;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.about-panel.is-open,
.tile-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.about-panel p,
.tile-panel p {
  margin: 0;
}

.about-panel p + p {
  margin-top: 12px;
}

.about-links {
  display: grid;
  gap: 5px;
  margin-top: 28px;
}

.tile-link {
  display: block;
  width: fit-content;
  margin-top: 28px;
}

.about-close,
.tile-close {
  display: block;
  margin: -12px -12px 2px auto;
  min-width: 44px;
  min-height: 44px;
  padding: 12px;
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
}

.about-close:focus,
.tile-close:focus {
  outline: 0;
  box-shadow: none;
}


@media (max-width: 900px) {
  :root {
    --footer-h: clamp(78px, 13vh, 112px);
  }

  .site-shell {
    grid-template-rows: minmax(0, 1fr) var(--footer-h);
  }

  .mosaic {
    --mobile-cols: 4;
    place-content: start center;
  }

  .contact {
    font-size: 13px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 4px;
    white-space: normal;
    padding: 8px 10px 12px;
  }

  .about-toggle {
    justify-self: start;
    text-align: left;
  }

  .about-scrim,
  .tile-scrim {
    background: rgba(0, 0, 0, 0.26);
  }

  .tile-scrim {
    background: transparent;
  }

  .about-panel,
  .tile-panel {
    right: 0;
    bottom: 0;
    width: 100vw;
    max-height: min(62vh, 520px);
    border-width: 1px 0 0;
    padding: 14px 14px calc(28px + env(safe-area-inset-bottom));
    transform: translateY(100%);
  }

  .tile-panel {
    border-top: 0;
  }

  .about-panel.is-open,
  .tile-panel.is-open {
    transform: translateY(0);
  }
}

@media (hover: none), (pointer: coarse) {
  .hover-title {
    display: none;
  }
}

@media (max-width: 520px) {
  :root {
    --footer-h: clamp(108px, 18vh, 144px);
  }

  .site-shell {
    padding: 0;
    gap: 0;
  }

  .mosaic {
    --mobile-cols: 2;
    gap: 0;
  }

  .contact {
    display: grid;
    grid-template-columns: 1fr;
    padding: 8px 10px 14px;
    font-size: 12px;
    row-gap: 2px;
  }
}
