body {
  margin: 0;
  padding: 0;
  background-color: #FAFAFA;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  color: #2E2E2E;
}

@keyframes fadeinall {
  0% {
    opacity: 1;
  }
  97% {
    opacity: 0;
  }
  98% {
    opacity: 0;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-100%);
    z-index: -1;
  }
}

#fadein {
  opacity: 1;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: translateY(0);
  background-color: #FAFAFA;
  z-index: 999;
  animation-fill-mode: forwards;
  animation: fadeinall 1s normal both;
  animation-delay: 0.3s;
}

main {
  padding: 120px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

body:has(.category-pill) main,
body:has(.categories-list) main {
  padding-top: 120px;
}

@media screen and (max-width: 720px) {
  body:has(.category-pill) main,
  body:has(.categories-list) main {
    padding-top: 0;
    margin-top: 16px;
  }
}

/* Floating Navigation */
.floating-menu {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: rgba(244, 244, 244, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0;
  margin: 0;
  height: 46px;
  border-radius: 46px;
  box-shadow: 0 6px 36px rgba(0,0,0,0.16);
  border: 1px solid rgba(255, 255, 255, 0.7);
  text-wrap-mode: nowrap;
  display: inline-flex;
  box-sizing: border-box;
}

@media screen and (max-width: 720px) {
  main {
    margin: 16px 16px 96px 16px;
    padding: 0;
  }
  
  .floating-menu {
    bottom: 16px;
  }
  
  .floating-menu.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  
  .floating-menu:not(.hidden) {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
}

.floating-menu-indicator {
  position: absolute;
  top: -1px;
  height: 46px;
  background: #ffffff;
  border-radius: 46px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
  pointer-events: none;
}

.floating-menu a {
  text-decoration: none;
  font-weight: 400;
  font-size: 15px;
  height: 46px;
  line-height: 43px;
  color: #434343;
  padding: 0px 22px;
  margin: 0;
  border-radius: 46px;
  position: relative;
  z-index: 1;
  transition: color 0.2s;
}

.floating-menu a:first-child {
  margin-left: 0px;
  padding-left: 18px;
}

.floating-menu a:hover {
  color: #2E2E2E;
}

.floating-menu a.active {
  color: #000;
}

/* Category Pill */
.category-pill {
  position: fixed;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: rgba(244, 244, 244, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0px 22px;
  height: 46px;
  line-height: 46px;
  border-radius: 46px;
  box-shadow: 0 6px 36px rgba(0,0,0,0.16);
  border: 1px solid rgba(255, 255, 255, 0.7);
  font-weight: 400;
  font-size: 15px;
  color: #434343;
  text-align: center;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
  transition: color 0.2s, background 0.2s;
}

.category-pill:hover {
  color: #2E2E2E;
  background: rgba(244, 244, 244, 0.7);
}

@media screen and (max-width: 720px) {
  .category-pill {
    top: 16px;
  }
}

@media (prefers-color-scheme: dark) {
  .category-pill {
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid rgba(180, 180, 180, 0.1);
    color: #DFDFDF;
  }

  .category-pill:hover {
    color: #DFDFDF;
    background: rgba(30, 30, 30, 0.85);
  }
}

/* Image Feed */
.image-feed {
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: center;
}

@media screen and (max-width: 720px) {
  .image-feed {
    gap: 16px;
  }
}

.image-item {
  width: 100%;
  max-width: 1200px;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.image-item img {
  width: 100%;
  height: auto;
  display: block;
}

.image-item img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.image-item img[loading="lazy"].loaded {
  opacity: 1;
}

/* Categories List */
.categories-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 720px;
  margin: 0 auto;
}

@media screen and (max-width: 720px) {
  .categories-list {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
}

.category-item {
  padding: 20px;
  background: #fff;
  border-radius: 16px;
  text-decoration: none;
  color: #2E2E2E;
  transition: background 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-item:hover {
  background: #f5f5f5;
}

.category-thumbnail {
  width: 100%;
  height: 200px;
  overflow: hidden;
  border-radius: 12px;
  background: #f5f5f5;
}

.category-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.category-item h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 400;
  color: #111;
}

/* About Page */
.about-content {
  max-width: 680px;
  margin: 0 auto;
  text-align: left;
}

.about-image {
  width: 100%;
  max-width: 680px;
  border-radius: 16px;
  margin-bottom: 40px;
}

.about-text {
  font-size: 24px;
  line-height: 37px;
  color: #2E2E2E;
}

.about-text p {
  margin-bottom: 37px;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-text a.highlight {
  font-weight: 600;
  text-decoration: none;
  color: #111;
}

.about-text a.highlight:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 3px;
  text-decoration-color: #2E2E2E;
  text-decoration-skip-ink: none;
}

/* Upload Page */
.upload-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px;
  background: #fff;
  border-radius: 16px;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.upload-form input[type="file"] {
  padding: 20px;
  border: 2px dashed #ddd;
  border-radius: 8px;
  cursor: pointer;
}

.upload-form button {
  padding: 15px 30px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
}

.upload-form button:hover {
  background: #2E2E2E;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #171717;
    color: #A1A1A1;
  }

  #fadein {
    background-color: #171717;
  }

  main {
    color: #A1A1A1;
  }

  .floating-menu {
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid rgba(180, 180, 180, 0.1);
  }

  .floating-menu-indicator {
    background: rgba(161, 161, 161, 0.15);
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.3);
  }

  .floating-menu a {
    color: #7a7a7a;
  }

  .floating-menu a:hover {
    color: #DFDFDF;
  }

  .floating-menu a.active {
    color: #DFDFDF;
  }

  .image-item {
    background: #222;
  }

  .category-item {
    background: #222;
    color: #A1A1A1;
  }

  .category-item:hover {
    background: #2a2a2a;
  }

  .category-thumbnail {
    background: #2a2a2a;
  }

  .category-item h2 {
    color: #DFDFDF;
  }

  .about-text {
    color: #A1A1A1;
  }

  .about-text p {
    color: #A1A1A1;
  }
  
  .about-text h2 {
    color: #DFDFDF;
  }
  
  .about-text ul li a {
    color: #A1A1A1;
  }
  
  .about-text ul li a:hover {
    border-bottom-color: #DFDFDF !important;
  }
  
  .about-text a.highlight {
    color: #DFDFDF;
  }
  
  .about-text a.highlight:hover {
    text-decoration-color: #444;
  }

  .upload-container {
    background: #222;
  }

  .upload-form input[type="file"] {
    border-color: #444;
    background: #2a2a2a;
    color: #A1A1A1;
  }

  .upload-form button {
    background: #DFDFDF;
    color: #171717;
  }

  .upload-form button:hover {
    background: #fff;
  }

  .success-message h1 {
    color: #DFDFDF;
  }

  .success-message p {
    color: #A1A1A1;
  }

  .success-message a {
    background: #DFDFDF;
    color: #171717;
  }

  .success-message a:hover {
    background: #fff;
  }
}

