:root {
  --text: #323338;
  --muted: rgba(50, 51, 56, 0.58);
  --border: rgba(50, 51, 56, 0.2);
  --text-on-dark: #f2f2ee;
  --col-left: #f3efe7;
  --col-mid: #e9f0ff;
  --col-right: #f3e9ff;
  --row-even: rgba(50, 51, 56, 0.03);

  --header-h: 68px;
  --footer-h: 68px;
  --pad: 20px;
  --grid-pad: 20px;
  --cell-text-size: clamp(17px, 0.72vw, 24px);
  --nav-text-size: clamp(14px, 0.56vw, 20px);
  --row-h: clamp(252px, 16vw, 360px);

  --index-media-hover-duration: 520ms;
  --index-media-hover-ease: cubic-bezier(0.22, 1, 0.45, 1);
  --index-media-fade-opacity-duration: 420ms;
  --index-media-fade-opacity-ease: cubic-bezier(0.33, 1, 0.68, 1);
}

@font-face {
  font-family: "Publisher";
  src: url("./fonts/Publisher-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Publisher", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  -webkit-user-select: none;
  user-select: none;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 10;
}

.topbar__title {
  font-size: var(--nav-text-size);
  letter-spacing: 0.3px;
  text-transform: none;
}

.topbar__home {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.page {
  height: 100%;
  padding-top: var(--header-h);
  padding-bottom: var(--footer-h);
}

.about-panel {
  display: none;
  height: calc(100vh - var(--header-h) - var(--footer-h));
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 30px;
  text-align: center;
  padding: 0 clamp(24px, 10vw, 160px);
}

.about-panel__text {
  margin: 0;
  max-width: 980px;
  font-size: var(--cell-text-size);
  line-height: 1.3;
}

.about-panel__features {
  margin-top: 22px;
  max-width: 980px;
  font-size: var(--cell-text-size);
  line-height: 1.3;
}

.about-panel__features-title {
  margin-bottom: 10px;
}

.about-panel__features-list {
  color: var(--text);
}

.about-panel__copyright {
  margin: 22px 0 0;
  max-width: 980px;
  font-size: var(--nav-text-size);
  color: var(--muted);
  letter-spacing: 0.3px;
}

body.is-about .grid {
  display: none;
}

body.is-about .about-panel {
  display: flex;
}

body.is-about .topbar__home {
  visibility: hidden;
  pointer-events: none;
}

.grid {
  height: calc(100vh - var(--header-h) - var(--footer-h));
  overflow: auto;
  padding: 0 var(--grid-pad);
}

.grid__row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(340px, 1.2fr) minmax(260px, 1fr);
  height: var(--row-h);
}

.is-unfolding .grid__row {
  opacity: 0;
  transform: translateY(-8px) scaleY(0.94);
  transform-origin: top center;
  transition: opacity 1050ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 1050ms cubic-bezier(0.16, 1, 0.3, 1);
}

.is-unfolding .grid__row.is-visible {
  opacity: 1;
  transform: translateY(0) scaleY(1);
}

@media (prefers-reduced-motion: reduce) {
  .is-unfolding .grid__row {
    transition: none;
    opacity: 1;
    transform: none;
  }

  .project-media,
  .cell--image-fade-hover .project-media--fade {
    transition-duration: 0.01ms !important;
  }
}

.cell {
  padding: 8px var(--pad);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.cell--title {
  font-size: var(--cell-text-size);
  line-height: 1.2;
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cell--image {
  overflow: hidden;
}

.cell--type {
  font-size: var(--cell-text-size);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cell-text {
  cursor: pointer;
}

.grid__row:last-child .cell--image .cell-text {
  cursor: default;
}

.grid__row:has(.cell:hover) .cell--title {
  transform: translateX(12px);
}

.grid__row:has(.cell:hover) .cell--type {
  transform: translateX(-12px);
}

.project-media {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: clamp(232px, 14vw, 340px);
  object-fit: contain;
  object-position: center;
  display: block;
  cursor: pointer;
  transform-origin: center center;
  transition: transform var(--index-media-hover-duration) var(--index-media-hover-ease);
  will-change: transform;
}

.project-media:hover {
  transform: scale(1.015);
}

.cell--image-fade-hover {
  display: grid;
  place-items: center;
  overflow: hidden;
}

.cell--image-fade-hover .project-media {
  grid-area: 1 / 1;
  z-index: 1;
}

.cell--image-fade-hover .project-media--fade {
  grid-area: 1 / 1;
  opacity: 0;
  z-index: 2;
  transform-origin: center center;
  transition: opacity var(--index-media-fade-opacity-duration) var(--index-media-fade-opacity-ease),
    transform var(--index-media-hover-duration) var(--index-media-hover-ease);
  pointer-events: none;
}

.cell--image-fade-hover:has(.project-media:hover) .project-media--fade {
  opacity: 1;
}

.cell--image-fade-hover:has(.project-media:hover) .project-media {
  transform: scale(1.015);
}

.cell--image-video-hover {
  display: grid;
  place-items: center;
  overflow: hidden;
}

.cell--image-video-hover img.project-media {
  grid-area: 1 / 1;
  z-index: 1;
  opacity: 1;
  pointer-events: auto;
  transform-origin: center center;
  transition: transform var(--index-media-hover-duration) var(--index-media-hover-ease);
}

.cell--image-video-hover .project-media--hover-video {
  grid-area: 1 / 1;
  z-index: 2;
  display: block;
  opacity: 0;
  pointer-events: none;
  transform-origin: center center;
  transition: transform var(--index-media-hover-duration) var(--index-media-hover-ease),
    opacity var(--index-media-fade-opacity-duration) var(--index-media-fade-opacity-ease);
}

.cell--image-video-hover.is-video-active img.project-media {
  pointer-events: none;
}

.cell--image-video-hover.is-video-active .project-media--hover-video {
  opacity: 1;
  pointer-events: auto;
}

.cell--image-video-hover:has(.project-media:hover) .project-media,
.cell--image-video-hover:has(.project-media:hover) .project-media--hover-video {
  transform: scale(1.015);
}

.bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 10;
}

.bottombar__nav {
  display: flex;
  gap: 30px;
}

.navlink {
  color: var(--muted);
  text-decoration: none;
  font-size: var(--nav-text-size);
  letter-spacing: 0.3px;
  text-transform: lowercase;
}

.navlink:hover {
  color: var(--text);
}

.navlink.is-active {
  color: var(--text);
}

