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

/* Accent colors: --accent for text, dots and chevrons; --card-bg for card fills. */
.design-page {
  --accent: var(--orange);
  --card-bg: var(--orange);
}

.tech-page {
  --accent: var(--blue-light);
  --card-bg: var(--blue);
}

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

.design-page > h2,
.tech-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(--accent);
}

.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(--accent);
}

.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-row.is-static .design-gallery-arrow {
  visibility: hidden;
}

.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(--card-bg);
}

.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(--card-bg);
  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(--card-bg) 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(--card-bg);
  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-section-lead {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 60ch;
  margin-bottom: 18px;
  text-transform: lowercase;
}

.design-gallery-row + .design-point-list {
  margin-top: 22px;
}

.design-point-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 62ch;
}

.design-point {
  position: relative;
  padding-left: 18px;
}

.design-point::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.page-content .design-point-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  text-transform: lowercase;
}

.page-content a.design-point-title:hover {
  text-decoration: none;
  color: var(--accent);
}

.design-point-desc {
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  opacity: 0.85;
  text-transform: lowercase;
}

.design-point-skills {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  text-transform: lowercase;
}

.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[hidden],
.design-modal-link[hidden] {
  display: none;
}

.design-modal-link {
  display: inline-block;
  margin: -8px 0 20px;
  font-size: 13px;
  color: #f2845a;
  text-decoration: none;
}

.design-modal-link:hover {
  text-decoration: underline;
}

.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;
}

/* The modal is appended to <body>, outside .wrap, so its panel color lives here. */
.design-modal {
  --design-grey: #2c2c29;
}

@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;
  }
}

/* ---------- tech deck cards (same layout as design, a text face instead of an image) ---------- */

.tech-sections {
  display: flex;
  flex-direction: column;
}

.tech-card-face {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  color: #f0eee8;
  text-transform: lowercase;
  transition: opacity 0.35s ease;
}

.tech-card-dates {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(240, 238, 232, 0.7);
}

.tech-card-title {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
}

.tech-card-role {
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(240, 238, 232, 0.8);
}

.tech-card-summary {
  margin-top: auto;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(240, 238, 232, 0.92);
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tech-card-more {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(240, 238, 232, 0.65);
}

.tech-card:hover .tech-card-face {
  opacity: 0;
}

/* ---------- modal extras: meta line, highlights, video ---------- */

.design-modal-meta {
  margin: -12px 0 18px;
  font-size: 13px;
  color: rgba(240, 238, 232, 0.6);
  text-transform: lowercase;
}

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

.design-modal-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.design-modal-highlights li {
  position: relative;
  padding-left: 16px;
  font-size: 14.5px;
  line-height: 1.65;
  color: #eceae4;
  text-transform: lowercase;
}

.design-modal-highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #f2845a;
}

.design-modal-video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #111110;
}

.design-modal-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.design-modal--tech .design-modal-link {
  color: #5b9fd8;
}

.design-modal--tech .design-modal-highlights li::before {
  background: #5b9fd8;
}
