/* ===== PROJECTS PAGE — Additional Work / Side Projects tabs ===== */

.projects-tabs-section {
  padding: 14px 0 40px;
  max-width: 100%;
  margin: 0;
}

/* Tab bar */
.projects-tabs-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 5px 20px;
  border-bottom: 0.5px solid transparent;
}

.projects-tab {
  font-family: 'Helvetica Neue', sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1;
  color: #767676;
  background: none;
  border: none;
  padding: 5px 0;
  cursor: pointer;
  position: relative;
  transition: color 0.25s ease;
}

.projects-tab:hover {
  color: #2b2b2b;
}

.projects-tab.active {
  color: #2b2b2b;
}

.projects-tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 0.5px;
  background-color: #767676;
}

.projects-tab.active::after {
  background-color: #2b2b2b;
}

/* Second tab offset (Figma: left calc(12.5%+18px)) */
.projects-tab:last-child {
  margin-left: calc(12.5% - 2ch);
}

.projects-tabs-divider {
  width: 100%;
  height: 0.5px;
  background-color: #b5b5b5;
  margin: 0;
  display: block;
}

/* Panel brief */
.projects-panel-brief {
  font-family: 'Helvetica Neue', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.4;
  color: #767676;
  margin: 0 0 40px 10px;
  opacity: 0;
  transform: translateY(8px);
  animation: briefFadeIn 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) 0.15s forwards;
}

.projects-panel.active .projects-panel-brief {
  animation: briefFadeIn 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) 0.15s forwards;
}

@keyframes briefFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Panels container — relative so inactive panels can overlay during fade */
.projects-panels {
  position: relative;
  min-height: 520px;
  margin-top: 16px;
  padding: 0 10px;
}

.projects-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
              visibility 0.4s step-end;
}

.projects-panel.active {
  position: relative;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
              visibility 0s step-end;
}

/* When switching: outgoing panel fades on top so both transitions are visible */
.projects-panel.fading-out {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Grid layouts */
.projects-grid {
  display: grid;
  gap: clamp(16px, 2vw, 24px);
  align-items: start;
}

.projects-grid--two {
  grid-template-columns: repeat(2, 1fr);
}

.projects-grid--three {
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}

/* Project card */
.project-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 540px;
}

.project-card--tall {
  max-width: 352px;
}

.project-card-image-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.project-card-image {
  width: 100%;
  height: 298px;
  overflow: hidden;
  background-color: #f5f5f5;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card-image--gray {
  background-color: #e0e0e2;
}

.project-card-image--gray img {
  object-fit: contain;
  padding: 1rem;
}

.project-card-image--tall {
  height: 534px;
}

.project-card-image--tall img {
  object-fit: cover;
}

.project-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.project-card-title {
  font-family: 'Helvetica Neue', sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 1;
  color: #000;
  margin: 0;
}

.project-card-roles {
  font-family: 'Helvetica Neue', sans-serif;
  font-weight: 300;
  font-size: 12px;
  line-height: 1;
  color: #767676;
  margin: 0;
}

.project-card-desc {
  font-family: 'Helvetica Neue', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.25;
  color: #000;
  margin: 0;
}

/* Status badges */
.project-status {
  font-family: 'Helvetica Neue', sans-serif;
  font-weight: 300;
  font-size: 12px;
  line-height: 1;
  padding: 3px 10px;
  border-radius: 15px;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.project-status--hold {
  color: #ff5e00;
  background: rgba(255, 94, 0, 0.15);
  border: 1px solid rgba(255, 94, 0, 0.1);
}

.project-status--review {
  color: #1eff00;
  background: rgba(30, 255, 0, 0.15);
  border: 1px solid rgba(30, 255, 0, 0.1);
}

.project-status--project {
  color: #8a38f5;
  background: rgba(138, 56, 245, 0.15);
  border: 1px solid rgba(138, 56, 245, 0.15);
}

.project-status-icon {
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* CTA — same as homepage .work-link */
.project-card-links {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.work-link,
.work-link:hover,
.work-link:active,
.work-link:focus {
  text-decoration: none;
}

.work-link {
  font-family: 'Helvetica Neue', sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: #09090b;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 0.5px solid #e5e5e5;
  background-color: #fff;
  cursor: pointer;
  transition: background-color 0.15s ease,
              border-color 0.15s ease,
              box-shadow 0.15s ease,
              transform 0.1s ease;
}

.work-link:hover {
  background-color: #f5f5f5;
  border-color: #d4d4d4;
}

.work-link:active {
  transform: scale(0.97);
  background-color: #efefef;
}

.work-link .link-arrow {
  width: 12px;
  height: 12px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.work-link:hover .link-arrow {
  transform: translateX(2px);
}

/* Focus visible */
.projects-tab:focus-visible,
.work-link:focus-visible,
.project-card-image-link:focus-visible {
  outline: 2px solid #2b2b2b;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== Responsive ===== */

/* Tablet */
@media (max-width: 960px) {
  .projects-tabs-bar {
    padding: 5px 16px;
  }

  .projects-panels {
    padding: 0 8px;
  }

  .projects-tab:last-child {
    margin-left: 24px;
  }

  .project-card-image {
    height: 240px;
  }

  .project-card-image--tall {
    height: 420px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .project-card,
  .project-card--tall {
    max-width: none;
  }

  .projects-tabs-bar {
    padding: 8px 0;
  }

  .projects-tab {
    font-size: 14px;
  }

  .projects-tab:last-child {
    margin-left: 16px;
  }

  .projects-panels {
    margin-top: 24px;
    min-height: auto;
    padding: 0 4px;
  }

  .projects-grid--two {
    grid-template-columns: 1fr;
  }

  .project-card-image {
    height: 260px;
  }

  .project-card-image--tall {
    height: 380px;
  }

  .project-card-title {
    font-size: 16px;
  }

  .project-card-desc {
    font-size: 14px;
  }

  .projects-panel-brief {
    font-size: 13px;
    margin: 0 0 28px 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .projects-panel,
  .projects-panel.active {
    transition: none;
  }

  .projects-panel-brief {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
