/* ==========================================================================
   SCENE 3: THINGS I'VE BUILT — EDITORIAL INTERACTIVE DIRECTORY
   Typography: Aeonik Black, Aeonik Bold & Aeonik Medium (Landing Page Brand System)
   Creative Direction: Monumental Typography, Pill Tags, Floating Cursor Follower
   Reference Design: Weirdo.is editorial layout
   ========================================================================== */

/* Outer Section */
.editorial-projects-section {
  position: relative;
  background-color: #FFFFFF;
  color: #0A0A0C;
  width: 100%;
  padding-top: clamp(80px, 12vh, 130px);
  padding-bottom: clamp(200px, 140vh, 150px);
  padding-left: clamp(20px, 5vw, 64px);
  padding-right: clamp(20px, 5vw, 64px);
  box-sizing: border-box;
  overflow: visible;
}

.editorial-projects-container {
  width: 100%;
  max-width: min(94vw, 1320px);
  margin: 0 auto;
  box-sizing: border-box;
}

/* ==========================================================================
   SECTION HEADER
   ========================================================================== */

.editorial-projects-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin-bottom: 0;
  padding-bottom: clamp(28px, 4vh, 42px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.projects-heading {
  font-family: BlinkMacSystemFont, sans-serif;
  font-size: clamp(2.4rem, 4.8vw, 4.2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 0.94;
  color: #0A0A0C;
  text-transform: uppercase;
  margin: 0;
}

.projects-subtext {
  font-family: 'Aeonik Medium', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(0.92rem, 1.1vw, 1.05rem);
  font-weight: 500;
  color: #72727D;
  line-height: 1.6;
  max-width: 440px;
  margin: 0;
}

/* ==========================================================================
   EDITORIAL PROJECT DIRECTORY LIST
   ========================================================================== */

.editorial-projects-list {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Individual Project Row */
.editorial-project-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(24px, 3.5vw, 56px);
  padding: clamp(38px, 5.2vh, 60px) 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.09);
  background-color: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.35s ease,
    opacity 0.35s ease,
    padding 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  outline: none;
}

/* Row Focus State for Keyboard Accessibility */
.editorial-project-row:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

/* Left Column: Monumental Title + Subtitle */
.editorial-project-row .row-left {
  flex: 1 1 50%;
  max-width: 52%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.editorial-project-row .project-title {
  font-family: 'Aeonik Black', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(1.95rem, 3.4vw, 3.4rem);
  font-weight: 100;
  letter-spacing: -0.05em;
  line-height: 0.94;
  color: #0A0A0C;
  text-transform: uppercase;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: baseline;
  transition: color 0.32s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.title-word {
  display: inline-block;
  white-space: nowrap;
}

.editorial-project-row .project-title-link {
  color: inherit;
  text-decoration: none;
  display: inline;
}

.project-title-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 6px;
}

.editorial-project-row .project-subtitle {
  font-family: 'Aeonik Bold', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(0.70rem, 0.8vw, 0.78rem);
  font-weight: 700;
  letter-spacing: 0.10em;
  color: #72727D;
  text-transform: uppercase;
  margin-top: 10px;
  display: block;
  transition: color 0.32s ease;
}

/* Middle Column: Tech & Keyword Pills */
.editorial-project-row .row-middle {
  flex: 1 1 34%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}

.project-pills-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.project-pill {
  font-family: 'Aeonik Bold', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(0.68rem, 0.76vw, 0.74rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 15px;
  border-radius: 9999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #555562;
  background-color: rgba(0, 0, 0, 0.035);
  transition: border-color 0.3s ease, color 0.3s ease, background-color 0.3s ease;
  white-space: nowrap;
}

/* Right Column: Arrow & Quick Actions */
.editorial-project-row .row-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(16px, 2.2vw, 28px);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Distinctive Monumental Arrow (Matching Weirdo.is design scale) */
.row-arrow-wrap {
  width: clamp(48px, 4.2vw, 64px);
  height: clamp(48px, 4.2vw, 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0A0A0C;
  flex-shrink: 0;
  transition: color 0.32s ease, transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

.row-arrow-icon {
  width: 200%;
  height: 200%;
  stroke: currentColor;
}

/* ==========================================================================
   ACTIVE & HOVER ROW INTERACTIONS
   ========================================================================== */

/* Active Row Highlighting (Matching reference Weirdo.is accent glow) */
.editorial-project-row.is-active {
  background: linear-gradient(90deg, rgba(254, 60, 1, 0.06) 0%, rgba(0, 0, 0, 0.015) 100%);
  border-color: rgba(254, 60, 1, 0.4);
}

.editorial-project-row.is-active .project-title {
  color: var(--color-accent);
  transform: translateX(4px);
}

.editorial-project-row.is-active .project-subtitle {
  color: rgba(254, 60, 1, 0.85);
}

.editorial-project-row.is-active .row-arrow-wrap {
  color: var(--color-accent);
  transform: translate(6px, -6px);
}

.editorial-project-row.is-active .project-pill {
  border-color: rgba(254, 60, 1, 0.35);
  color: #FE3C01;
  background-color: rgba(254, 60, 1, 0.08);
}

/* Sibling Dimming on Desktop */
@media (hover: hover) and (min-width: 769px) {
  .editorial-projects-list.has-active-row .editorial-project-row:not(.is-active) {
    opacity: 0.35;
  }
}

/* ==========================================================================
   FLOATING CURSOR PREVIEW (Smooth Physics Follower)
   ========================================================================== */

.project-floating-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: clamp(320px, 28vw, 440px);
  aspect-ratio: 16 / 10;
  border-radius: 18px;
  overflow: hidden;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transform: scale(0.85);
  will-change: transform, opacity;
  box-shadow: 0 32px 75px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.08);
  background-color: #121216;
}

.preview-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.preview-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.preview-card.is-active {
  opacity: 1;
  transform: scale(1);
}

.preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

/* Mobile Inline Media (hidden on desktop) */
.mobile-project-media {
  display: none;
}

/* ==========================================================================
   RESPONSIVE DESIGN (<= 1024px TABLET)
   ========================================================================== */

@media screen and (max-width: 1024px) {
  .editorial-project-row {
    gap: 24px;
    padding: 34px 10px;
  }

  .editorial-project-row .row-left {
    flex: 1 1 45%;
    max-width: 48%;
  }

  .editorial-project-row .project-title {
    font-size: clamp(1.6rem, 2.8vw, 2.4rem);
  }

  .row-arrow-wrap {
    width: 42px;
    height: 42px;
  }

  .project-floating-preview {
    width: clamp(280px, 32vw, 380px);
  }
}

/* ==========================================================================
   RESPONSIVE DESIGN (<= 768px MOBILE & TOUCH ADAPTATION)
   ========================================================================== */

@media screen and (max-width: 768px) {
  .project-floating-preview {
    display: none !important;
  }

  .editorial-projects-section {
    padding-top: calc(var(--header-height, 64px) + 24px);
    padding-bottom: 70px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .editorial-projects-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 20px;
  }

  .editorial-project-row {
    flex-wrap: wrap;
    padding: 24px 8px;
    gap: 14px;
  }

  .editorial-project-row .row-left {
    flex: 1 1 75%;
    max-width: 80%;
  }

  .editorial-project-row .row-right {
    flex: 0 0 auto;
  }

  .editorial-project-row .row-middle {
    flex: 1 1 100%;
    margin-top: 2px;
  }

  .editorial-project-row .project-title {
    font-size: clamp(1.4rem, 6.2vw, 1.95rem);
  }

  .editorial-project-row .project-subtitle {
    font-size: 0.72rem;
    margin-top: 6px;
  }

  .row-arrow-wrap {
    width: 34px;
    height: 34px;
  }

  .editorial-project-row.is-active .project-title {
    transform: none;
  }

  .editorial-project-row.is-active .row-arrow-wrap {
    transform: rotate(45deg);
  }

  .row-actions {
    width: 100%;
    margin-top: 6px;
  }

  /* Mobile Inline Media Reveal on Tap */
  .mobile-project-media {
    display: block;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background-color: #F4F4F6;
    border: 1px solid rgba(0, 0, 0, 0.08);
    max-height: 0;
    opacity: 0;
    transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1),
      opacity 0.35s ease,
      margin 0.35s ease;
    margin-top: 0;
  }

  .editorial-project-row.is-active .mobile-project-media {
    max-height: 240px;
    opacity: 1;
    margin-top: 14px;
    margin-bottom: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  }

  .mobile-project-media img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    object-position: top center;
    display: block;
  }
}

/* ==========================================================================
   ACCESSIBILITY: PREFERS-REDUCED-MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

  .editorial-project-row,
  .project-title,
  .project-subtitle,
  .row-arrow-wrap,
  .project-pill,
  .project-floating-preview,
  .preview-card {
    transition: none !important;
  }
}