:root {
  --edge: clamp(12px, 2.7vw, 48px);
  color-scheme: light;
  font-family: Arial, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  color: #151515;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid #2680ec; outline-offset: 3px; }

.page-header, .gallery {
  width: min(1660px, calc(100% - 2 * var(--edge)));
  margin: 0 auto;
}

.page-header {
  min-height: clamp(64px, 6vw, 88px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(22px, 2.1vw, 30px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.055em;
}

.page-header a {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.page-header a:hover, .source:hover { text-decoration: underline; text-underline-offset: 3px; }

.gallery {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(3px, .45vw, 7px);
  padding-bottom: var(--edge);
}

.tile {
  position: relative;
  display: block;
  min-width: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #f3f3f2;
  text-decoration: none;
}

.tile:focus-visible { z-index: 1; }
.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .14s;
}

@media (hover: hover) { .tile:hover img { opacity: .9; } }

.tile[data-kind="reel"]::after {
  content: '';
  position: absolute;
  top: 9px;
  right: 9px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid white;
  filter: drop-shadow(0 0 2px #333b);
  pointer-events: none;
}

.tile[data-kind="carousel"]::before, .tile[data-kind="carousel"]::after {
  content: '';
  position: absolute;
  top: 9px;
  right: 9px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: 1.5px solid white;
  box-shadow: 0 0 3px #3339;
  pointer-events: none;
}

.tile[data-kind="carousel"]::after {
  transform: translate(-3px, 3px);
  background: white;
}

body.viewer-open { overflow: hidden; }
#viewer:not([open]) { display: none; }
#viewer {
  width: min(100%, 1220px);
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100%;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: white;
}
#viewer::backdrop { background: rgba(14, 14, 14, .96); }

.viewer-surface {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: max(7px, env(safe-area-inset-top)) clamp(12px, 2.5vw, 36px) max(7px, env(safe-area-inset-bottom));
}

.viewer-top, .viewer-tools { display: flex; align-items: center; gap: 12px; }
.viewer-top { justify-content: space-between; }
.viewer-title {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  font-size: 13px;
}

#viewer button {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  font: inherit;
  font-size: 23px;
  color: white;
  background: transparent;
  cursor: pointer;
}
#viewer button.close { font-size: 32px; font-weight: 300; }
#viewer button:disabled { opacity: .23; cursor: default; }
#viewer button:hover:enabled { background: #ffffff12; }
#viewer :focus-visible { outline-offset: -3px; }
.stage { min-height: 0; display: grid; place-items: center; }
.stage img { display: block; width: 100%; height: 100%; min-height: 0; max-height: 100%; object-fit: contain; }
.viewer-tools { justify-content: center; gap: clamp(12px, 3vw, 40px); padding-top: 3px; }
.source { display: inline-flex; min-height: 44px; align-items: center; font-size: 13px; text-decoration: none; }

@media (min-width: 1500px) { .gallery { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  :root { --edge: 8px; }
  .page-header { padding: 0 7px; min-height: 58px; }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
  .tile[data-kind]::after, .tile[data-kind]::before { top: 6px; right: 6px; }
  .viewer-surface { padding-inline: 6px; }
  .viewer-title { padding-left: 8px; }
}

@media (prefers-reduced-motion: reduce) { .tile img { transition: none; } }

/* The wordmark is cropped from the studio’s own published artwork. */
.page-header { border-bottom: 1px solid #171717; }
.wordmark { display: block; width: clamp(82px, 8.9vw, 125px); height: auto; }
.gallery { margin-top: clamp(8px, 1vw, 16px); }
a:focus-visible, button:focus-visible { outline-color: #111; box-shadow: 0 0 0 3px #fff; }
#viewer :focus-visible { outline-color: #fff; box-shadow: none; }
