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

body {
  font-family: 'Inter', 'Arial', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f6f6f8;
  overflow-x: hidden;
  font-size: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Main Container */
.main-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Portfolio Section */
.portfolio-section {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  padding: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: auto;
  min-height: 0;
}

.portfolio-section::-webkit-scrollbar {
  display: none;
}

/* Portfolio Layout */
.portfolio-layout {
  display: flex;
  gap: 2px;
  height: 100%;
  min-width: max-content;
  align-items: center;
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

.large-project {
  overflow: hidden;
  cursor: default;
  flex-shrink: 0;
  height: 100%;
  max-height: 100%;
  width: auto;
  min-width: 0;
  content-visibility: auto;
  contain: layout paint;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  border-radius: 2px;
}

.large-project:active {
  transform: scale(0.98);
}

.large-project.clickable {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  pointer-events: none;
  position: relative;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.large-project.clickable.loaded {
  pointer-events: auto;
  cursor: pointer;
}

.large-project.clickable.loaded .project-media {
  cursor: pointer;
}

.large-project.clickable.loaded * {
  cursor: pointer;
}

.large-project.clickable:hover {
  transform: scale(0.98);
  opacity: 0.9;
}

.large-project-with-padding {
  background-color: #ffffff;
}

/* Two Rows Container */
.two-rows-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100%;
  flex-shrink: 0;
  width: auto;
}

.top-row {
  display: flex;
  gap: 2px;
  height: calc(50% - 1px);
  align-items: center;
  align-content: center;
}

.bottom-row {
  display: flex;
  gap: 2px;
  height: calc(50% - 1px);
  align-items: center;
  align-content: center;
}

.small-project {
  background-color: #ffffff;
  overflow: hidden;
  cursor: default;
  flex-shrink: 0;
  height: 100%;
  max-height: 100%;
  width: auto;
  min-width: 0;
  content-visibility: auto;
  contain: layout paint;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.3s ease;
  border-radius: 2px;
}

.small-project:active {
  transform: scale(0.98);
}

.small-project.clickable {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  pointer-events: none;
  position: relative;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.small-project.clickable.loaded {
  pointer-events: auto;
  cursor: pointer;
}

.small-project.clickable.loaded .project-media {
  cursor: pointer;
}

.small-project.clickable.loaded * {
  cursor: pointer;
}

.small-project.clickable:hover {
  transform: scale(0.98);
  opacity: 0.9;
}

.project-media {
  width: auto;
  height: 100%;
  max-width: none;
  max-height: 100%;
  display: block;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  flex-shrink: 0;
  object-position: center;
  -webkit-user-select: none;
  user-select: none;
}

.small-project,
.large-project {
  position: relative;
}

.project-description {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(255, 255, 255, 0.9);
  color: black;
  padding: 6px 8px;
  border-radius: 2px;
  font-size: 12px;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 10;
  max-width: 400px;
  line-height: 1.3;
}

.small-project:hover .project-description,
.large-project:hover .project-description {
  opacity: 1;
  transform: translateY(0);
}

/* Top Section */
.top-section {
  height: 33vh;
  min-height: 33vh;
  max-height: 33vh;
  background-color: transparent;
  color: black;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 16px;
  flex-shrink: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.bottom-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  gap: 1rem;
  box-sizing: border-box;
}

.bottom-content .name {
  font-weight: 400;
  line-height: 1.1;
  font-size: 12px;
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

h3.name {
  font-size: 12px;
}

/* Navigation Links */
.navigation-links {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  transform: translate3d(0, 0, 0);
  opacity: 1;
  --nav-link-color: #a4a4a4;
  --nav-link-hover-color: #000000;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group-right {
  align-items: flex-end;
}

.nav-text {
  color: var(--nav-link-color, #a4a4a4);
  font-size: 12px;
  font-weight: 400;
}

.nav-link {
  color: var(--nav-link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.email-text {
  display: block;
  transition: transform 0.15s ease-out, opacity 0.15s ease-out;
}

.nav-link:hover {
  color: var(--nav-link-hover-color);
}

/* Mobile */
@media (max-width: 768px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
    height: auto;
    min-height: 100vh;
  }

  .main-container {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    display: block;
  }

  .top-section {
    height: auto;
    min-height: auto;
    max-height: none;
  }

  .nav-link,
  .nav-text {
    font-size: 14px;
  }

  .bottom-content .name {
    font-size: 14px;
  }

  .portfolio-section {
    overflow-x: hidden;
    overflow-y: visible;
    height: auto;
    min-height: auto;
    max-height: none;
    padding: 4px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
  }

  .portfolio-layout {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    min-width: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .large-project {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    box-sizing: border-box;
    overflow: hidden;
  }

  .two-rows-container {
    width: 100%;
    max-width: 100%;
    gap: 4px;
    box-sizing: border-box;
  }

  .top-row,
  .bottom-row {
    flex-direction: column;
    height: auto;
    width: 100%;
    max-width: 100%;
    gap: 4px;
    box-sizing: border-box;
  }

  .small-project {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    box-sizing: border-box;
    overflow: hidden;
  }

  .project-media {
    max-width: 100%;
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  .project-description {
    display: none;
  }
}

