/**
 * CODECURV HERO & MECHANICAL SORTER STYLES
 * Concept: The Kinetic Drafting Laboratory
 */

/* ==========================================================================
   1. ASYMMETRIC HERO GRID
   ========================================================================== */

.hero-container {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-10, 40px);
  align-items: center;
  min-height: calc(100vh - 120px);
  padding: var(--space-12, 48px) 0 var(--space-16, 64px) 0;
  box-sizing: border-box;
  width: 100%;
}

.hero-statement-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: var(--space-4, 16px);
  box-sizing: border-box;
}

.hero-sorter-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.hero-marginalia {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
  margin-bottom: var(--space-6, 24px);
  flex-wrap: wrap;
}

/* ==========================================================================
   2. HERO ACTION CTA PRESENTATION DECK
   ========================================================================== */

.hero-actions-deck {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4, 16px);
  margin-top: var(--space-8, 32px);
  margin-bottom: var(--space-6, 24px);
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .hero-actions-deck {
    grid-template-columns: 1fr;
    gap: var(--space-3, 12px);
    margin-top: var(--space-6, 24px);
    margin-bottom: var(--space-8, 32px);
  }
}

/* ==========================================================================
   3. THE MECHANICAL SORTER STAGE
   ========================================================================== */

.sorter-stage {
  background: var(--bg-sheet);
  border: 1px solid var(--rule-base);
  border-radius: var(--radius-none);
  padding: var(--space-8, 32px);
  position: relative;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.04);
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.sorter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-4, 16px);
  margin-bottom: var(--space-6, 24px);
  border-bottom: 1px solid var(--rule-subtle);
  flex-wrap: wrap;
  gap: var(--space-3, 12px);
  box-sizing: border-box;
}

.sorter-track {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-4, 16px);
  width: 100%;
  box-sizing: border-box;
}

/* ==========================================================================
   4. TACTILE FRICTION SLATS
   ========================================================================== */

.sorter-slat {
  position: relative;
  z-index: var(--z-sheet);
  background: var(--bg-sheet-raised);
  border: 1px solid var(--rule-base);
  border-radius: var(--radius-none);
  padding: 18px 22px;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
  width: 100%;
  transform-origin: center center;
  transition: transform 220ms var(--ease-spring), 
              border-color 140ms var(--ease-mechanical), 
              background-color 140ms var(--ease-mechanical),
              box-shadow 140ms var(--ease-mechanical);
}

.sorter-slat:hover {
  border-color: var(--rule-strong);
  background-color: var(--bg-sheet);
}

/* Initial Tilted Misalignments (Active on All Screens) */
.sorter-slat[data-index="1"] { transform: rotate(-1.6deg) translate3d(-3px, 0, 0); }
.sorter-slat[data-index="2"] { transform: rotate(1.8deg) translate3d(4px, 0, 0); }
.sorter-slat[data-index="3"] { transform: rotate(-1.2deg) translate3d(-3px, 0, 0); }

/* Calibrated Slat State */
.sorter-slat.is-aligned {
  transform: rotate(0deg) translate3d(0, 0, 0) !important;
  border-color: var(--vermilion) !important;
  border-left: 4px solid var(--vermilion) !important;
  background-color: var(--bg-sheet) !important;
  box-shadow: 0 4px 16px rgba(217, 56, 30, 0.09) !important;
}

.slat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2, 8px);
  gap: var(--space-2, 8px);
}

.slat-grip {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.slat-grip-dot {
  width: 3px;
  height: 3px;
  background-color: var(--ink-dim);
  border-radius: 50%;
}

.sorter-slat.is-aligned .slat-grip-dot {
  background-color: var(--vermilion);
}

.slat-body {
  margin-top: 10px;
  padding-left: 2px;
}

.slat-content-friction {
  display: block;
  color: var(--ink-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
}

.slat-content-resolution {
  display: none;
  color: var(--ink-primary);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.6;
}

.sorter-slat.is-aligned .slat-content-friction {
  display: none;
}

.sorter-slat.is-aligned .slat-content-resolution {
  display: block;
}

/* ==========================================================================
   5. SORTER FOOTER
   ========================================================================== */

.sorter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-6, 24px);
  padding-top: var(--space-4, 16px);
  border-top: 1px solid var(--rule-subtle);
  flex-wrap: wrap;
  gap: var(--space-3, 12px);
  box-sizing: border-box;
}

.sorter-btn-calibrate {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 8px 14px;
  border: 1px solid var(--rule-base);
  background: var(--bg-canvas-subtle);
  color: var(--ink-primary);
  border-radius: var(--radius-none);
  transition: all 120ms var(--ease-mechanical);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
}

.sorter-btn-calibrate:hover {
  background: var(--ink-primary);
  color: var(--bg-canvas);
  border-color: var(--ink-primary);
}

@media (max-width: 1024px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: var(--space-12, 48px);
    min-height: auto;
    padding: var(--space-8, 32px) 0 var(--space-12, 48px) 0;
  }

  .hero-statement-col {
    padding-right: 0;
  }

  .hero-sorter-col {
    margin-top: var(--space-4, 16px);
  }
}