@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  overflow-x: clip;
  background: #0d0d0d;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #3a3a3a;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555555;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #3a3a3a transparent;
}

#navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #111111;
}

#navbar-body {
  overflow: hidden;
  max-height: 200px;
  transition: max-height 0.3s ease;
  border-bottom: 1px solid #2a2a2a;
}

#navbar.collapsed #navbar-body {
  max-height: 0;
}

#navbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 50px 8px 12px;
  gap: 12px;
}

#navbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

#logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

#logo-img {
  height: 28px;
  width: auto;
  display: block;
}

#project-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#project-title {
  color: #dddddd;
  font-size: 14px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#project-subtitle {
  color: #666666;
  font-size: 11px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: none;
}

#project-subtitle.visible {
  display: block;
}

#collapse-btn {
  position: fixed;
  top: 8px;
  right: 12px;
  background: #111111;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  color: #888888;
  cursor: pointer;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: border-color 0.15s ease, color 0.15s ease;
}

#collapse-btn:hover {
  border-color: #555555;
  color: #eeeeee;
}

#collapse-btn svg {
  display: block;
  transition: transform 0.25s ease;
}

#navbar.collapsed #collapse-btn svg {
  transform: rotate(180deg);
}

#navbar-collapsible {
  overflow: hidden;
  max-height: 60px;
  transition: max-height 0.25s ease;
}

#navbar.collapsed #navbar-collapsible {
  max-height: 0;
}

#controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-right: 50px;
}

.dropdown-label {
  color: #888888;
  font-size: 12px;
  font-family: 'Montserrat', sans-serif;
  white-space: nowrap;
}

select {
  background: #222222;
  color: #eeeeee;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  padding: 6px 30px 6px 10px;
  font-size: 14px;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

select:hover {
  border-color: #555555;
}

select:focus {
  border-color: #666666;
}

#description-row {
  padding: 8px 12px;
  border-top: 1px solid #2a2a2a;
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

#description-row.visible {
  display: flex;
}

#description-text {
  color: #aaaaaa;
  font-size: 13px;
  font-family: 'Montserrat', sans-serif;
  line-height: 1.4;
}

#letter-btn {
  background: none;
  border: none;
  color: #555555;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

#letter-btn:hover {
  color: #aaaaaa;
}

@media (max-width: 1024px) {
  #navbar-top {
    flex-wrap: wrap;
  }

  #controls-row {
    flex-basis: 100%;
    padding-right: 0;
    padding-bottom: 10px;
  }

  select {
    flex: 1;
    min-width: 0;
  }

  #project-titles {
    display: flex;
  }

  #description-row {
    text-align: left;
  }
}

#image-container {
  width: 100%;
  position: relative;
  margin: 0 auto;
  transition: max-width 0.3s ease;
}

#image-container.constrained {
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
}

#loader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#loader.active {
  opacity: 1;
  pointer-events: all;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #333333;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#mockup-img {
  width: 100%;
  display: block;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#mockup-img.loaded {
  opacity: 1;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-box {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #2a2a2a;
  flex-shrink: 0;
}

.modal-title {
  color: #888888;
  font-size: 18px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
}

.modal-close {
  background: none;
  border: none;
  color: #666666;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  transition: color 0.15s ease;
}

.modal-close:hover {
  color: #eeeeee;
}

.modal-body {
  padding: 20px 20px;
  color: #cccccc;
  font-size: 18px;
  font-family: 'Montserrat', sans-serif;
  line-height: 1.65;
  overflow-y: auto;
}

.modal-body ul,
.modal-body ol {
  padding-left: 1.4em;
}

.modal-body li + li {
  margin-top: 0.3em;
}

.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid #2a2a2a;
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

.modal-dismiss {
  background: #ffffff;
  color: #111111;
  border: none;
  border-radius: 4px;
  padding: 8px 20px;
  font-size: 13px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.modal-dismiss:hover {
  background: #dddddd;
}
