.design-page,
.design-modal {
  font-family: var(--font-sans);
  --design-card-width: clamp(188px, 20vw, 240px);
}

.design-page {
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 5vh, 56px);
}

.design-page > h2 {
  margin-bottom: 4px;
  text-transform: lowercase;
  font-size: 26px;
}

.design-section {
  display: flex;
  flex-direction: column;
}

.design-section + .design-section {
  margin-top: clamp(8px, 1.5vh, 14px);
  padding-top: clamp(16px, 2.5vh, 24px);
  border-top: 0.5px solid var(--border);
}

.design-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}

.design-section-toggle:hover .design-section-title {
  color: var(--orange);
}

.design-section-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  text-transform: lowercase;
  letter-spacing: 0.01em;
  transition: color 0.15s ease;
}

.design-section-chevron {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.28s ease, border-color 0.15s ease;
  margin-top: -4px;
}

.design-section.is-expanded .design-section-chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
  border-color: var(--orange);
}

.design-section-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.design-section.is-expanded .design-section-panel {
  grid-template-rows: 1fr;
}

.design-section-panel-inner {
  overflow: hidden;
  min-height: 0;
}

.design-section.is-expanded .design-section-panel-inner {
  padding-top: 18px;
}

.design-gallery-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
}

.design-gallery-arrow {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 0.5px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease;
}

.design-gallery-arrow:hover {
  color: var(--text);
  background: var(--surface);
}

.design-gallery-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 4px 0 10px;
}

.design-gallery-track::-webkit-scrollbar {
  display: none;
}

.design-project-card {
  flex: 0 0 var(--design-card-width);
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  border-radius: 10px;
}

.design-project-media {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  overflow: hidden;
  background: var(--orange);
}

.design-project-image {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: opacity 0.35s ease;
}

.design-project-fallback,
.design-project-thumb-fade,
.design-project-corner-title,
.design-project-hover {
  position: absolute;
  transition: opacity 0.35s ease;
}

.design-project-fallback {
  inset: 0;
  z-index: 1;
  background: var(--orange);
  opacity: 1;
}

.design-project-thumb-fade {
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  height: 52%;
  background: linear-gradient(to bottom, transparent 0%, var(--orange) 88%);
  pointer-events: none;
}

.design-project-corner-title {
  left: 14px;
  bottom: 14px;
  z-index: 3;
  font-family: var(--font-sans);
  font-size: 17px;
  color: #f0eee8;
  line-height: 1.35;
  max-width: calc(100% - 28px);
  text-transform: lowercase;
}

.design-project-hover {
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  padding: 18px;
  background: var(--orange);
  opacity: 0;
}

.design-project-hover-title {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 500;
  color: #f0eee8;
  line-height: 1.35;
  text-transform: lowercase;
}

.design-project-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.design-project-skills span,
.design-modal-skills span {
  font-size: 12px;
  color: #eceae4;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 4px 10px;
  text-transform: lowercase;
}

.design-project-skills-empty {
  font-size: 12px;
  color: rgba(240, 238, 232, 0.65);
  font-style: italic;
}

.design-project-card--no-thumb:hover .design-project-fallback,
.design-project-card--no-thumb:hover .design-project-corner-title {
  opacity: 0;
}

.design-project-card:not(.design-project-card--no-thumb):hover .design-project-image,
.design-project-card:not(.design-project-card--no-thumb):hover .design-project-thumb-fade,
.design-project-card:not(.design-project-card--no-thumb):hover .design-project-corner-title {
  opacity: 0;
}

.design-project-card:hover .design-project-hover {
  opacity: 1;
}

.design-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 28px;
}

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

.design-modal-backdrop {
  position: absolute;
  inset: 0;
  background: #111110;
}

.design-modal-panel {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: min(82vh, 760px);
  overflow-y: auto;
  background: var(--design-grey);
  border-radius: 12px;
  padding: clamp(24px, 3.5vw, 32px);
  color: #f0eee8;
}

.design-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #f0eee8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.design-modal-title {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 20px;
  padding-right: 40px;
  text-transform: lowercase;
}

.design-modal-section {
  margin-bottom: 22px;
}

.design-modal-section:last-child {
  margin-bottom: 0;
}

.design-modal-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: rgba(240, 238, 232, 0.55);
  margin-bottom: 10px;
}

.design-modal-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.design-modal-image-wrap {
  padding: 0;
  background: none;
  min-height: 0;
}

.design-modal-gallery-row {
  margin: 0;
}

.design-modal-gallery-track img {
  flex: 0 0 var(--design-card-width);
  width: var(--design-card-width);
  max-width: none;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  cursor: zoom-in;
}

.design-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 110;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.design-lightbox[hidden] {
  display: none;
}

.design-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  cursor: zoom-out;
}

.design-lightbox-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 24px 24px;
  box-sizing: border-box;
  pointer-events: none;
}

.design-lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #f0eee8;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}

.design-lightbox-image {
  display: block;
  max-width: min(calc(100vw - 48px), 100%);
  max-height: min(calc(100dvh - 80px), calc(100vh - 80px));
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  cursor: default;
  user-select: none;
  pointer-events: auto;
}

.design-modal-empty {
  font-size: 13px;
  color: rgba(240, 238, 232, 0.45);
  font-style: italic;
  text-transform: lowercase;
  margin: 0;
}

.design-modal-description {
  font-size: 15px;
  line-height: 1.7;
  color: #eceae4;
  white-space: pre-wrap;
  text-transform: lowercase;
}

.design-gallery-error {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}

body.design-modal-open {
  overflow: hidden;
}

.wrap.dark {
  --design-grey: #3a3a37;
}

.wrap.light {
  --design-grey: #4a4a46;
}

@media (prefers-reduced-motion: reduce) {
  .design-section-panel {
    transition: none;
  }

  .design-section-chevron {
    transition: none;
  }
}

@media (max-width: 720px) {
  .design-gallery-row {
    grid-template-columns: 1fr;
  }

  .design-gallery-arrow {
    display: none;
  }
}
