@font-face {
  font-family: 'Grain';
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  height: 100%;
  overflow: hidden;
}
body {
  font-family: 'Consolas', monospace;
  color: #1a1a1a;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background-color: #242424;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.3'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  background-repeat: repeat;
  z-index: -1;
}

#scratchCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}
.series-list,
.contact-link {
  position: relative;
  z-index: 1;
}
.series-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 16px;
}
.serie-link {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.2s ease;
}
.serie-link:hover {
  opacity: 0.5;
}
.contact-link {
  position: absolute;
  bottom: 40px;
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 16px;
}
.contact-link:hover {
  opacity: 0.5;
}

.viewer {
  height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.image-container {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  padding: 8vh 10vw;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
#mainImage {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
}
.close-btn {
  position: fixed;
  top: 32px;
  right: 48px;
  font-size: 22px;
  color: #1a1a1a;
  text-decoration: none;
  z-index: 1;
  transition: opacity 0.3s ease;
}
.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 40px;
  color: #1a1a1a;
  cursor: pointer;
  z-index: 1;
  padding: 20px;
  transition: opacity 0.3s ease;
}
.nav-prev { left: 12px; }
.nav-next { right: 12px; }
.controls-hidden .close-btn,
.controls-hidden .nav-arrow,
.controls-hidden .gallery-btn {
  opacity: 0;
  pointer-events: none;
}
.gallery-btn {
  position: fixed;
  bottom: 32px;
  right: 48px;
  background: none;
  border: none;
  color: #1a1a1a;
  cursor: pointer;
  z-index: 1;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-view {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  z-index: 5;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.grid-view::-webkit-scrollbar {
  display: none;
}
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  padding: 10vh 8vw 8vh 8vw;
}
.grid-cell {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: pointer;
}
.grid-cell img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: opacity 0.2s ease;
}
.grid-cell:hover img {
  opacity: 0.7;
}

.contact-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 400px;
  padding: 0 24px;
}
.contact-form label {
  font-size: 14px;
}
.contact-form input,
.contact-form textarea {
  font-family: 'Consolas', monospace;
  font-size: 16px;
  padding: 8px;
  border: 1px solid #1a1a1a;
  background: none;
  color: #1a1a1a;
}
.contact-form button {
  font-family: 'Consolas', monospace;
  font-size: 16px;
  padding: 10px;
  background: none;
  border: 1px solid #1a1a1a;
  color: #1a1a1a;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.contact-form button:hover {
  opacity: 0.6;
}
.merci-text {
  font-size: 18px;
}
