/* =====================================================
   RESET
===================================================== */

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

img,
video {
  display: block;
  max-width: 100%;
}

/* =====================================================
   FONT
===================================================== */

@font-face {
  font-family: "Unica77";
  src: url("./fonts/Unica77LLWeb-Regular.woff2") format("woff2"),
       url("./fonts/Unica77LLWeb-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* =====================================================
   BASE
===================================================== */

:root {
  --baseline: 1.2rem;
}

html {
  font-size: 12.5px;
}

body {
  font-family: "Unica77", sans-serif;
  background: #f2f2f2;
  color: #111;
  font-size: 1rem;
  line-height: 1.2;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-feature-settings: "liga" 1, "clig" 1, "calt" 1;
}

::selection {
  background: transparent;
  color: rgba(0, 0, 0, 0.4);
}

/* =====================================================
   NAV
===================================================== */

.nav {
  position: fixed;
  top: calc(var(--baseline) + env(safe-area-inset-top));
  left: calc(var(--baseline) + env(safe-area-inset-left));
  z-index: 10;

  display: flex;
  flex-direction: column;
  gap: var(--baseline);
}

.nav-projects {
  display: flex;
  flex-direction: column;
}

.nav a {
  text-decoration: none;
  color: rgba(0, 0, 0, 0.4);
  transition: color 0.25s ease;
}

.nav a.active {
  color: #000;
}

.nav a.nav-name {
  color: rgba(255, 0, 255, 0.4);
}

.nav a.nav-name.active {
  color: rgb(255, 0, 255);
}

/* =====================================================
   SCROLL CONTAINER + SECTIONS (SNAP)
===================================================== */

.projects {
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
}

.project {
  height: 100dvh;
  overflow: hidden;
  scroll-snap-stop: always;
  scroll-snap-align: center;
}

/* =====================================================
   GRID (DEFAULT PROJECTS)
===================================================== */

.grid {
  height: 100%;
  padding: var(--baseline);
  padding-top: calc(var(--baseline) + env(safe-area-inset-top));
  padding-left: calc(var(--baseline) + env(safe-area-inset-left));
  padding-right: calc(var(--baseline) + env(safe-area-inset-right));
  padding-bottom: calc(var(--baseline) + env(safe-area-inset-bottom));

  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(16, minmax(0, 1fr));
  gap: var(--baseline);
}

/* =====================================================
   ABOUT (special: internal scroll)
===================================================== */

.project.about {
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-align: start;
}

.project.about .grid {
  height: auto;
  min-height: 100%;
  grid-template-rows: none;
  grid-auto-rows: min-content;
  align-content: start;
}



/* Contact */

.about-contact {
  grid-column: 7 / span 6;
  grid-row: 1;
}

.about-contact a {
  text-decoration: none;
  color: inherit;
}

/* Education / Experience blocks */

.about-edu {
  grid-column: 7 / -1;
  grid-row: auto;
  margin-top: calc(var(--baseline) * 12);

  display: grid;
  row-gap: calc(var(--baseline) * 2);
}

.about-block {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  column-gap: var(--baseline);
  row-gap: var(--baseline);
}

.about-list {
  display: contents;
}

.about-item {
  display: contents;
}

.about-title {
  grid-column: 1;
  white-space: nowrap;
}

.about-year {
  grid-column: 2;
  white-space: nowrap;
}

.about-text,
.about-item a {
  grid-column: 3 / -1;
}

.about-credits {
  grid-column: 2 / -1;
  white-space: nowrap;
  margin-bottom: calc(var(--baseline) * 4);
  scroll-snap-align: start;
}

.about-item a {
  text-decoration: none;
  color: inherit;
  justify-self: start;
  align-self: start;
  width: fit-content;
  display: inline-block;
}

.about-item a:hover {
  text-decoration: underline;
  color: rgb(255, 0, 255);
}

/* =====================================================
   MEDIA (images / videos)
===================================================== */

.image {
  grid-column: 4 / 10;
  grid-row: 4 / 14;

  display: flex;
  align-items: center;
  justify-content: center;

  position: relative;
  min-height: 0;
}

.image img,
.image video {
  position: absolute;
  inset: 0;
  margin: auto;

  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;

  object-fit: contain;

  opacity: 0;
  transition: opacity 0.7s ease-in-out;

  cursor: url("svg/cursor_next.svg") 16 16, e-resize;
  user-select: none;
}

.image img.prev,
.image video.prev {
  cursor: url("svg/cursor_prev.svg") 16 16, w-resize;
}

.image.single img,
.image.single video {
  cursor: default;
}

.image img.active,
.image video.active {
  opacity: 1;
}

.image video {
  border-radius: 15px;
  box-shadow:
    -5px 5px 5px 0px rgba(255, 255, 255, 0.35) inset,
    5px -5px 5px 0px rgba(0, 0, 0, 0.14) inset,
    -20px 24px 19px 0px rgba(0, 0, 0, 0.11);
  border: 2px solid rgba(0, 0, 0, 0.2);
}

/* =====================================================
   INFO / DESCRIPTION
===================================================== */

.info {
  grid-column: 7 / span 2;
  grid-row: 1;
  align-self: start;
  z-index: 10;
}

.description {
  grid-column: 9 / -1;
  grid-row: 1;
  align-self: start;
  z-index: 10;
}

/* =====================================================
   PAGINATION
===================================================== */

.pagination {
  grid-column: 4 / 10;
  grid-row: 16;

  align-self: end;
  justify-self: center;

  display: flex;
  gap: var(--baseline);
  z-index: 10;
}

.page-number {
  cursor: pointer;
  color: rgba(0, 0, 0, 0.4);
  transition: color 0.25s ease;
  font-variant-numeric: tabular-nums;
}

.page-number.active {
  color: #000;
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 1150px) {
  .info {
    grid-column: 4 / span 3;
  }

  .description {
    grid-column: 7 / -1;
  }

  .about-edu {
    grid-column: 1 / -1;
  }

  .about-block {
    grid-template-columns: repeat(12, 1fr);
  }

  .about-title {
    grid-column: 1 / -1;
  }

  .about-credits,
  .about-year {
    grid-column: 1 / span 3;
  }

  .about-text,
  .about-item a {
    grid-column: 4 / -1;
  }
}

@media (max-width: 900px) {
  .image {
    grid-column: 1 / -1;
    grid-row: 5 / 13;
  }

  .description {
    display: none;
  }

  .info {
    grid-column: 7 / -1;
  }
}

@media (max-height: 650px) {
  .image {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    padding: var(--baseline);
  }

  .pagination,
  .info,
  .description {
    display: none;
  }

  .project {
    overflow: visible;
  }

  .grid {
    padding-top: calc(var(--baseline) + env(safe-area-inset-top));
    padding-bottom: var(--baseline);
  }
}
