/* fonts — local files in /fonts */
@font-face {
  font-family: "Bugrino";
  src: url("../fonts/Bugrino-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Neue Montreal Text";
  src: url("../fonts/PPNeueMontrealText-Book.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Neue Montreal";
  src: url("../fonts/PPNeueMontreal-Medium.otf") format("opentype");
  font-weight: 500;
  font-display: swap;
}

:root {
  --white: #fff;
  --black: #000;
  --grey: grey;
  --medium: "Neue Montreal", Arial, sans-serif;
  --display: "Bugrino", Arial, sans-serif;
  --text: "Neue Montreal Text", "Neue Montreal", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  text-transform: lowercase;
  font-family: var(--text);
  font-synthesis: none;
  font-size: 14px;
  line-height: 125%;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { background: var(--black); color: var(--white); }
a, .image-wrapper, .project_header-container { cursor: pointer; }
::selection { color: #fff; background: #000; }

img, video { display: block; }

/* ---------- background layers ---------- */
.background-gridlines {
  position: fixed; inset: 0;
  z-index: -1;
  display: flex; justify-content: space-between;
  height: 120vh;
  padding: 0 5px;
  pointer-events: none;
}
.grid-line {
  width: 1px; height: 100%;
  background: var(--grey);
  transform: scaleX(.5);
  transform-origin: 0;
}
.background_pixelgrid {
  position: fixed; inset: 0;
  z-index: -10;
  opacity: .04;
  pointer-events: none;
}
.bg-flex_horizontal {
  position: absolute; inset: 0 0 auto;
  display: flex; gap: 10px;
  width: 100%; height: 100%;
  padding: 0 7.5px;
}
.bg-flex_vertical {
  position: absolute; inset: 0 0 auto;
  display: flex; flex-direction: column; gap: 10px;
  width: 100%;
  padding: 8px 0 10px;
}
.line_horizontal { flex: none; width: .1px; height: 100%; background: var(--grey); }
.line_vertical { flex: none; width: 100%; height: 1px; background: var(--grey); }

.ascii-animation {
  position: fixed; inset: -2% 0 auto;
  height: 115vh;
  z-index: -20;
  pointer-events: none;
}
.ascii-animation iframe { width: 100%; height: 100%; border: 0; display: block; }

/* hidden 12-col overlay, toggle with shift+g */
.gridlayout-invisible {
  position: fixed; inset: 0;
  z-index: -10;
  display: none;
  gap: 10px;
  padding: 0 10px;
  pointer-events: none;
}
.gridlayout-column { flex: 1; height: 100vh; background: #00000008; }

/* ---------- 12 column grids ---------- */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 10px;
  width: 100%;
}

/* ---------- navbar ---------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  mix-blend-mode: difference;
}
.header { padding: 15px 10px; justify-items: start; }
.header .nav-name { grid-column: span 6; }
.header .nav-link { grid-column: span 3; }

.nav_button {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  font-family: var(--medium);
  font-weight: 500;
  color: var(--white);
  overflow: clip;
}
.nav_button:hover { background: none; }
.nav_button:hover, .nav_button.is-current { overflow: visible; }
.button-square {
  position: absolute; left: -20px;
  width: 10px; height: 10px;
  background: var(--white);
}
.button-square.not-blinking { position: static; }
.name-short { display: none; }

/* ---------- hero ---------- */
.hero {
  width: 100vw; height: 100svh;
  display: flex; align-items: flex-end;
  padding: 15px 10px;
}
.hero.subpage-hero { height: auto; }
.title-h1 {
  min-width: 100%;
  margin: 0;
  padding-bottom: .4vw;
  font-family: var(--display);
  font-weight: 400;
  font-size: 10vh;
  line-height: 102%;
  text-indent: 25%;
}
.title-h1.small-h1 { margin-top: 25vh; font-size: 5vh; }

.scroll-down-tag {
  position: absolute; right: 10px; bottom: 10px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  font-family: var(--text);
  font-weight: 400;
  font-size: 12px; line-height: 18px;
}
.scroll-down-tag span { display: inline-block; opacity: 0; }
.hero { position: relative; }
@media (hover: hover) { .scroll-down-tag { position: fixed; right: auto; bottom: auto; } }
.hero._404 { justify-content: center; align-items: center; }
._404-error { font-family: var(--display); font-size: 10vh; line-height: 10vh; }

/* word scan overlay */
.scan-overlay { position: fixed; inset: 0; z-index: 9999; pointer-events: none; display: none; }
.scan-overlay canvas { position: fixed; top: 0; left: 0; }
.scan-box { position: fixed; background: rgba(0,0,0,.3); border: 1px solid #000; display: none; }
.scan-label { position: fixed; font-family: var(--text); font-size: 11px; line-height: 1; color: #000; white-space: nowrap; display: none; }

/* ---------- projects ---------- */
.project_wrapper { width: 100vw; margin: 20vh 0 50vh; }
.project_wrapper + .project_wrapper { margin-top: 0; }

.project-tag_wrapper { height: 14px; padding: 0 10px; display: flex; }
.project-tag, .project-image-tag {
  font-family: var(--text);
  font-weight: 400;
  font-size: 12px; line-height: 18px;
}
.project-image-tag { overflow-wrap: anywhere; }

.project_header-container { width: 100%; padding: 10px; }
.project_header { font-family: var(--medium); font-weight: 500; }
.project_header.is-hover { background: var(--black); }
.project-info_container {
  display: flex; justify-content: space-between; align-items: center;
  mix-blend-mode: difference;
  color: var(--white);
}
.project-info_container.c-name { grid-column: span 6; }
.project-info_container.c-tags { grid-column: span 3; }
.project-info_container.c-year { grid-column: span 3; justify-self: stretch; }
.project-info { margin: 0; font-size: 14px; font-weight: 500; line-height: 125%; }
.plus-icon { position: relative; z-index: 2; width: 16px; height: 16px; display: block; }

.project-content_wrapper { height: 0; overflow: hidden; }
.project-content_grid { padding: 0 10px 20px; }
.acc-desc { grid-column: 1 / 6; }
.acc-labels { grid-column: 7 / 10; }
.acc-values { grid-column: 10 / 13; }

/* image grid, clicking an item doubles its width */
.project-image_grid, .photos-image_grid { padding: 0 5px; }
.layout-grid_list {
  --columns: 4;
  display: flex; flex-wrap: wrap;
  row-gap: 2em;
  position: relative;
}
.layout-grid_item {
  width: calc(100% / var(--columns));
  position: relative;
  will-change: transform;
  user-select: none;
}
.layout-grid_item.is--active { width: calc(100% / var(--columns) * 2); }
.project-image_outer { width: 100%; margin-bottom: 15px; padding: 0 5px; }
.image-wrapper { width: 100%; }
.thumbnail { width: 100%; object-fit: cover; background: #eee; }
.thumbnail.portrait { aspect-ratio: 4 / 5; }
.thumbnail.landscape { aspect-ratio: 4 / 3; }
.thumbnail.square { aspect-ratio: 1; }
.project-title_wrapper { padding-top: 2px; }
.video-container { aspect-ratio: 4 / 3; display: flex; justify-content: center; align-items: center; overflow: hidden; cursor: pointer; }
.video-container.square { aspect-ratio: 1; }
.video-container.portrait { aspect-ratio: 4 / 5; }
.project-video { width: 100%; height: 108%; object-fit: cover; }

/* ---------- about ---------- */
.about-text_container {
  display: flex; flex-direction: column; gap: 60px;
  margin-top: 20vh;
}
.about-text_grid { padding: 10px; }
.h2-about { grid-column: 1 / 4; margin: 0; font-size: 14px; font-weight: 400; line-height: 125%; }
.about-text_grid > div { grid-column: 7 / 13; }

/* stacked images top right; js scatters them over a 24-col grid */
.about-img_container {
  position: fixed; inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  grid-template-rows: 100%;
  gap: 10px;
  width: 100vw; height: 100vh;
  padding: 10px;
  overflow: hidden;
  pointer-events: none;
}
.about-img { overflow: clip; cursor: pointer; pointer-events: auto; }
.about-img .image-wrapper, .about-img .video-container { aspect-ratio: 1; }
.about-img img, .about-img video { width: 100%; height: 100%; object-fit: cover; }

.photos_wrapper { width: 100vw; margin-top: 20vh; }

/* ---------- footer ---------- */
.footer {
  mix-blend-mode: difference;
  margin-top: 35vh;
  font-family: var(--medium);
  font-weight: 500;
  color: var(--white);
}
.footer_grid { padding: 15px 10px; align-items: end; }
.credits-container { grid-column: span 6; }
.copyright-container { grid-column: span 6; justify-self: end; }

/* ---------- page transition: 4 black columns ---------- */
.page-transition { position: fixed; inset: 0; z-index: 1000; display: block; }
.transition_column-container { position: absolute; inset: 0; display: flex; }
.transition_column { height: 100%; width: 25%; overflow: hidden; }
.transition_column:first-child, .transition_column:last-child { width: calc(25% + 2.5px); }
.transition_column:nth-child(2), .transition_column:nth-child(3) { width: calc(25% - 2.5px); }
.transition_column-background { width: 100%; height: 100%; background: var(--black); }
.no-scroll-transition { overflow: hidden; position: relative; }

/* ---------- responsive ---------- */
@media (min-width: 1920px) {
  body, .project-info, .h2-about { font-size: 16px; }
  .project-tag, .project-image-tag { font-size: 14px; }
  .button-square { width: 12px; height: 12px; }
}
@media (max-width: 991px) {
  .title-h1.small-h1 { font-size: 4vh; }
}
@media (max-width: 767px) {
  .layout-grid_list { --columns: 2; }
  .h2-about { grid-column: 1 / -1; }
  .about-text_grid > div { grid-column: 1 / -1; }
  .acc-desc { grid-column: 1 / -1; }
  .acc-labels { grid-column: 1 / 5; }
  .acc-values { grid-column: 5 / -1; }
}
@media (max-width: 479px) {
  .project_header.is-hover { background: transparent; }
  .name-short { display: block; }
  .name-long { display: none; }
  .grid-line { transform: scaleX(.25); }
  .ascii-animation { height: 100vh; top: 2%; }
  .title-h1 { font-size: 4.5vh; }
  .title-h1.small-h1 { margin-top: 20vh; font-size: 3vh; }
  .project_wrapper { margin: 10vh 0 25vh; }
  .layout-grid_list { row-gap: 1em; }
  .project-info_container { justify-content: flex-end; }
  .mobile_invisible { display: none; }
  .footer { margin-top: 25vh; }
  .about-text_container { margin-top: 15vh; }
  .photos_wrapper { margin-top: 10vh; }
}
@media (prefers-reduced-motion: reduce) {
  .page-transition { display: none; }
}
