:root {
  --bg: #fff;
  --text: #000;
  --border: #fff;
  --header-height: 3.5rem;
  --space: 1rem;
  --space-sm: 0.5rem;
  --transition: 0.2s;
  --font-sans: "JTPicolo-Medium", sans-serif;
  --font-italic: "JTPicolo-MediumItalic", serif;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  transition: background var(--transition), color var(--transition);
  cursor: auto;
}

.custom-cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 140px;
  height: 140px;
  border-radius: 0;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  z-index: 9999;
  opacity: 1;
  transform: translate3d(-50%, -50%, 0);
  filter: none;
}

body[data-cursor-mode="image"] .custom-cursor {
  display: block;
}

body[data-cursor-mode="default"] .custom-cursor {
  display: none;
}

header {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
padding: var(--space) var(--space) var(--space) 0.5rem;
font-size: 1.5rem;
background: transparent;
width: 100%;
}

header {
mix-blend-mode: difference;
}
header .navigation a {
color: white;
}

.navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

body,
header,
footer {
  transition: background var(--transition), color var(--transition);
}

h1 {
  font-size: 1.5rem;
  margin: 0.45rem 0;
  font-family: inherit;
}

h2 {
  font-size: 1.4rem;
  margin: 0.275rem 0;
  font-family: inherit;
}

nav ul {
  display: flex;
  list-style: none;
  margin: 0 0.45rem;
  padding: 0;
  justify-content: space-between;
}

::selection {
  background: #000;
  color: #fff;
}

a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: color var(--transition);
}

a:hover {
  filter: blur(1px);
}

.dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background-color: #515151;
  font-size: 0.75rem;
  min-width: 10rem;
  z-index: 1;
  padding: 0.6rem 0;
  margin: 0;
  text-align: right;
}

.dropdown-menu li {
  list-style: none;
}

.dropdown-menu a {
  display: block;
  padding: 0.3rem;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.dropdown-menu a:hover {
  filter: blur(1px);
}

.dropdown:hover .dropdown-menu {
  display: block;
}

.main {
  display: grid;
  grid-template-columns: 1fr;
  padding-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

.main-left {
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  align-self: start;
}

.carousel-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.25rem;
}

.carousel-counter {
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
  padding: 0.45rem;
  margin-left: auto;
}

.carousel-arrow {
  display: inline-grid;
  place-items: center;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.25rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1.9;
  cursor: pointer;
}

.project-intro {
  font-family: var(--font-italic), serif;
  padding: 0.45rem;
  color: var(--text);
}

.project + .project h1 {
  margin-top: 1.3rem;
}

.presentation,
.projects-panel,
.projects-content {
  margin: 0;
  padding: 0.9rem;
  line-height: 1.3rem;
  word-break: break-word;
}

.projects-content {
  width: 100%;
  margin: 0 0 3rem 0;
  padding: 0.9rem;
}

.projects-content .project h1 {
  position: sticky;
  top: var(--header-height);
  z-index: 50;
  margin: 0;
  padding: 0.4rem 0;
  box-sizing: border-box;
  background: transparent;
  color: white;
  mix-blend-mode: difference;
}

.project {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.projects-menu ul {
  display: block;
}

.projects-menu button {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: color var(--transition);
  display: block;
  width: 100%;
  margin: 0 0 0 -0.45rem;
  padding: 0;
}

.projects-menu button:hover {
  filter: blur(1px);
}

.carousel {
  width: 100%;
  position: relative;
  overflow: hidden;
}

body.gallery-fullscreen {
  overflow: hidden;
}

body.gallery-fullscreen::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--bg);
}

.carousel.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.75rem;
  width: auto;
  height: auto;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: var(--bg);
}

.carousel.is-fullscreen .carousel-image,
.carousel.is-fullscreen .carousel-video {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.carousel.is-fullscreen .carousel-controls {
  width: 100%;
  color: var(--text);
}

.carousel.is-fullscreen .carousel-counter {
  border: 0;
}

.project-embed-carousel.is-fullscreen .project-embed-browser,
.project-embed-carousel.is-fullscreen .project-embed-mobile {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  aspect-ratio: auto;
  border: 0;
}

.project-embed-carousel.is-fullscreen .project-embed-iframe,
.project-embed-carousel.is-fullscreen .project-embed-mobile-screen {
  width: 100%;
  height: 100%;
}

body.gallery-fullscreen .custom-cursor {
  display: none;
}

.carousel-image,
.carousel-video {
  width: 100%;
  height: auto;
  display: block;
  position: relative;
  object-fit: cover;
}

.project-embed-browser {
  width: min(100%, 1440px);
  max-width: 1440px;
  margin: 0 auto;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  aspect-ratio: 756/491;
  position: relative;
}

.project-embed-iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #111;
  margin: 0 auto;
}

.project-embed-mobile {
  width: min(100%, 390px);
  max-width: 390px;
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  aspect-ratio: 9 / 16;
  box-sizing: border-box;
  overflow: hidden;
}

.project-embed-mobile-screen {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #111;
}

.desktop-preview {
  display: block;
}

.mobile-preview {
  display: none;
}

@media (max-width: 800px) {
  .desktop-preview {
    display: none;
  }

  .mobile-preview {
    display: block;
  }
}

.project-link-row {
  margin-top: 0.7rem;
}

.project-open-link {
  display: inline-block;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.15rem;
  line-height: 1.4;
}

.project-open-link:hover {
  filter: blur(1px);
}

.separator {
  width: 1px;
  background: var(--border);
  cursor: grab;
  position: relative;
  z-index: 10;
}

.separator::before {
  content: "";
  position: absolute;
  left: -2.5rem;
  top: 0;
  width: 3.1875rem;
  height: 100%;
  cursor: pointer;
  filter: blur(1px);
}

.separator:active,
.separator-hint:active {
  cursor: pointer;
  filter: blur(1px);
}

#backToTop {
  background: none;
  color: var(--text);
  border: none;
  padding: 0.6rem;
  cursor: pointer;
  font-family: "JTPicolo-medium", serif;
  font-size: 1rem;
}

#backToTop:hover {
  filter: blur(1px);
}

@media (min-width: 801px) {
  .main {
    grid-template-columns: 1fr 2fr;
  }

  .main-left {
    border-right: 1px solid var(--border);
    position: sticky;
    top: var(--header-height);
  }
}

@media (max-width: 800px) {
  .main {
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
    margin: 0;
  }

  .main-left {
    gap: 1rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
    position: static;
  }

  nav ul,
  header .navigation ul {
    margin: 0;
    padding: 0;
    list-style: none;
    justify-content: flex-start;
  }

  header {
    padding-left: calc(1.2rem + 0.45rem);
    padding-right: 1.2rem;
    padding-top: 0.9rem;
  }

  header .navigation a {
    display: inline-block;
    padding: 0;
  }
  .presentation,
  .projects-panel,
  .projects-content {
    padding: 1.2rem;
  }

  .projects-content img,
  .projects-content .carousel,
  .projects-content .project {
    width: 100%;
  }

  .projects-content .project h1 {
    top: var(--header-height);
    padding-left: 0.45rem;
    padding-right: 0;
  }

}