/* ==========================================================================
   Project Cards & Untangling Micro-Interactions (Minimalist)
   ========================================================================== */

.projects-section,
#case-studies,
#projects,
.projects-anchor-target {
  scroll-margin-top: 85px;
}

.projects-anchor-target {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  pointer-events: none;
  visibility: hidden;
}

@media (max-width: 768px) {
  .projects-section,
  #case-studies,
  #projects,
  .projects-anchor-target {
    scroll-margin-top: 70px;
  }
}

.projects-section {
  position: relative;
  padding: var(--space-xl) 0 var(--space-5xl);
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  width: 100%;
}

@media (min-width: 960px) {
  body:not(.mobile-preview-active) .projects-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
  }
}

/* Individual Project Card: Completely Minimalist, No Shadows */
.project-card {
  position: relative;
  background-color: var(--color-white);
  border-radius: var(--radius-sm);
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  overflow: visible;
  border: none;
  box-shadow: none; /* No shadow */
  transition: none; /* No elevation */
}

/* No shadow on hover */
.project-card:hover,
.project-card.untangled {
  transform: none;
  box-shadow: none;
}

/* Card Border Overlay: Custom SVG Squiggly Scallop Border */
.card-border-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 10;
}

.card-border-path {
  fill: none;
  stroke: #c8cee0; /* Lighter color in default tangled state */
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s ease;
}

.project-card:hover .card-border-path,
.project-card:focus-within .card-border-path,
.project-card.untangled .card-border-path {
  stroke: var(--brand-dark-blue); /* Dark solid blue on hover/focused/untangled */
}

/* Card Body Content */
.card-body-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

/* Card Header: Company, Title & Untangling Arrow */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.card-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-company {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-grey-700);
  text-transform: none;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--brand-dark-blue);
}

/* Untangling Arrow Icon */
.card-arrow-wrapper {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.untangle-arrow-svg {
  width: 28px;
  height: 28px;
  overflow: visible;
}

.untangle-arrow-path {
  fill: none;
  stroke: var(--brand-dark-blue);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke var(--transition-fast);
}

.project-card:hover .untangle-arrow-path,
.project-card.untangled .untangle-arrow-path {
  stroke: var(--brand-primary);
}

/* Card Description */
.card-description {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--brand-dark-blue);
  margin-bottom: var(--space-md);
  min-height: 60px;
}

/* Untangling Divider */
.card-divider-wrapper {
  position: relative;
  width: 100%;
  height: 16px;
  margin: var(--space-xs) 0 var(--space-md);
  overflow: visible;
}

.card-divider-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.card-divider-path {
  fill: none;
  stroke: var(--color-grey-300, #c8cee0);
  stroke-width: 1.5;
  stroke-linecap: round;
  transition: stroke 0.3s ease;
}

.project-card:hover .card-divider-path,
.project-card:focus-within .card-divider-path,
.project-card.untangled .card-divider-path {
  stroke: var(--brand-dark-blue);
}

/* End Result Section */
.card-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.results-label {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-dark-blue);
}

.metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.metric-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--brand-primary);
}

.metric-desc {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.4;
  color: var(--brand-dark-blue);
}

/* Mockup Image Container - Clean Minimalist */
.card-mockup-wrapper {
  width: 100%;
  margin-top: auto;
  border-radius: var(--radius-xs);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--color-grey-50);
  padding: var(--space-xs);
  border: 1px solid var(--color-grey-100);
  position: relative;
  z-index: 2;
}

.card-mockup-img {
  width: 100%;
  height: auto;
  object-fit: contain;
}
