/**
 * Appily Fifty — Yard Index (catalog)
 * New layout: crumb + asymmetric hero + meters
 * + sticky jump ribbon + horizontal aisle sheets + dark links
 */

.page-catalog-index {
  --index-ink: #111a17;
  --index-mid: #1b2a24;
  --index-paper: #FFFEF9;
  --index-mist: #EEF2EC;
  --index-chart: #C5D93D;
  --index-clay: #A65D3F;
  --index-line: rgba(17, 26, 23, 0.12);
  --index-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --index-snap: cubic-bezier(0.34, 1.4, 0.64, 1);
  background:
    radial-gradient(900px 360px at 100% 0%, rgba(197, 217, 61, 0.1), transparent 55%),
    radial-gradient(700px 280px at 0% 40%, rgba(166, 93, 63, 0.06), transparent 50%),
    var(--index-paper);
}
.page-catalog-index .page-main {
  padding-top: 0;
  overflow-x: clip;
}
.a50-index { padding-bottom: 2.5rem; }

.a50-index-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s var(--index-ease), transform 0.65s var(--index-ease);
}
.a50-index-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Crumb */
.a50-index-crumb-bar {
  background: var(--index-ink);
  border-bottom: 2px solid var(--index-chart);
  padding: 0.7rem 0;
}
.a50-index-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
}
.a50-index-crumb a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}
.a50-index-crumb a:hover { color: var(--index-chart); }
.a50-index-crumb [aria-current="page"] {
  color: var(--index-chart);
  font-weight: 700;
}

/* Hero */
.a50-index-hero {
  position: relative;
  color: #f5f8f4;
  padding: clamp(2.3rem, 5vw, 3.4rem) 0 clamp(2.4rem, 4vw, 3rem);
  overflow: hidden;
  isolation: isolate;
}
.a50-index-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(125deg, #0e1614 0%, #1b2a24 48%, #243038 100%);
}
.a50-index-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(197, 217, 61, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(197, 217, 61, 0.07) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(100deg, #000 25%, transparent 85%);
  animation: a50IndexGrid 18s linear infinite;
}
@keyframes a50IndexGrid {
  to { transform: translateX(-38px); }
}
.a50-index-beam {
  position: absolute;
  top: -20%;
  right: -6%;
  width: 46%;
  height: 140%;
  background: linear-gradient(160deg, rgba(197, 217, 61, 0.2), transparent 58%);
  clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%);
  animation: a50IndexBeam 7.5s var(--index-ease) infinite alternate;
}
@keyframes a50IndexBeam {
  from { opacity: .45; }
  to { opacity: 1; }
}
.a50-index-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--index-chart), transparent);
  animation: a50IndexScan 5.5s linear infinite;
  opacity: 0.5;
}
@keyframes a50IndexScan {
  from { top: 10%; }
  to { top: 90%; }
}

.a50-index-hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 1.5rem;
  align-items: end;
}
.a50-index-kicker {
  margin: 0 0 0.7rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.58);
}
.a50-index-hero-copy h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(2.1rem, 5vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
  max-width: 11ch;
}
.a50-index-hero-copy h1 em {
  font-style: italic;
  color: var(--index-chart);
}
.a50-index-lede {
  margin: 0;
  max-width: 42ch;
  color: rgba(255, 255, 255, 0.76);
  font-size: 1.02rem;
}

.a50-index-meters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
.a50-index-meter {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  clip-path: polygon(8% 0, 100% 0, 100% 100%, 0 100%, 0 16%);
  animation: a50IndexRise 0.65s var(--index-ease) both;
  min-width: 0;
}
.a50-index-meter:nth-child(2) { animation-delay: 0.05s; }
.a50-index-meter:nth-child(3) {
  animation-delay: 0.1s;
  grid-column: 1 / -1;
}
@keyframes a50IndexRise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.a50-index-meter span {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.a50-index-meter strong {
  font-family: var(--a50-font-serif);
  font-size: 1.35rem;
  color: #fff;
  line-height: 1.15;
  word-break: break-word;
}
.a50-index-meter--accent {
  background: rgba(197, 217, 61, 0.14);
  border-color: rgba(197, 217, 61, 0.28);
}
.a50-index-meter--accent strong { color: var(--index-chart); }

/* Sticky jump */
.a50-index-jump {
  position: sticky;
  top: 0;
  z-index: 25;
  background: var(--index-ink);
  color: #fff;
  border-bottom: 3px solid var(--index-chart);
}
.a50-index-jump-row {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.55rem 0;
  -webkit-overflow-scrolling: touch;
}
.a50-index-jump-label {
  flex: 0 0 auto;
  align-self: center;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--index-chart);
  padding: 0 0.5rem 0 0;
}
.a50-index-jump-link {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.25s var(--index-snap);
  white-space: nowrap;
}
.a50-index-jump-link em {
  font-family: var(--a50-font-serif);
  font-style: normal;
  font-weight: 700;
  color: var(--index-chart);
  font-size: 0.85rem;
}
.a50-index-jump-link span {
  font-size: 0.78rem;
  font-weight: 700;
}
.a50-index-jump-link strong {
  font-size: 0.7rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.45);
}
.a50-index-jump-link:hover,
.a50-index-jump-link.is-active {
  background: rgba(197, 217, 61, 0.14);
  border-color: rgba(197, 217, 61, 0.35);
  color: #fff;
  transform: translateY(-1px);
}
.a50-index-jump-link--all {
  background: var(--index-chart);
  border-color: var(--index-chart);
  color: var(--index-ink);
}
.a50-index-jump-link--all em,
.a50-index-jump-link--all strong {
  color: var(--index-ink);
}

/* Stage */
.a50-index-stage {
  padding: 1.5rem 0 0;
}
.a50-index-stage-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.a50-index-badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--index-clay);
}
.a50-index-stage-head h2 {
  margin: 0.25rem 0 0.2rem;
  font-size: 1.5rem;
}
.a50-index-stage-head p {
  margin: 0;
  color: var(--a50-muted);
  font-size: 0.9rem;
}
.a50-index-stage-cta {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--index-ink);
  text-decoration: none;
  border-bottom: 2px solid var(--index-chart);
  padding-bottom: 0.1rem;
}
.a50-index-stage-cta:hover { color: var(--index-clay); }

/* Sheets */
.a50-index-sheets {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.a50-index-sheet {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) 1.35fr;
  gap: 0;
  background: #fff;
  border: 1px solid var(--index-line);
  box-shadow: 0 14px 36px rgba(17, 26, 23, 0.05);
  overflow: hidden;
  position: relative;
  scroll-margin-top: 5.5rem;
  transition: transform 0.35s var(--index-snap), box-shadow 0.35s ease;
}
.a50-index-sheet:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 48px rgba(17, 26, 23, 0.09);
}
.a50-index-sheet::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--index-chart);
  z-index: 2;
}
.a50-index-sheet.tone-summer::before { background: #c4a35a; }
.a50-index-sheet.tone-autumn::before { background: var(--index-clay); }
.a50-index-sheet.tone-winter::before { background: #5a7a8c; }
.a50-index-sheet.tone-staple::before { background: #7a9e3e; }
.a50-index-sheet.tone-chef::before { background: #8c5a4a; }
.a50-index-sheet.tone-field::before { background: #3d7a5c; }

.a50-index-sheet-media {
  position: relative;
  min-height: 240px;
  background: var(--index-ink);
}
.a50-index-sheet-hero {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 240px;
  overflow: hidden;
}
.a50-index-sheet-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s var(--index-ease);
}
.a50-index-sheet:hover .a50-index-sheet-hero img {
  transform: scale(1.05);
}
.a50-index-sheet-num {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  font-family: var(--a50-font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--index-ink);
  background: var(--index-chart);
  padding: 0.25rem 0.55rem;
  line-height: 1;
}

.a50-index-sheet-body {
  padding: 1.15rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  min-width: 0;
}
.a50-index-sheet-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
}
.a50-index-sheet-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--index-mist);
  font-family: var(--a50-font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--index-clay);
  clip-path: polygon(12% 0, 100% 0, 88% 100%, 0 100%);
}
.a50-index-sheet-count {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--index-clay);
  margin-bottom: 0.2rem;
}
.a50-index-sheet-head h3 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
}
.a50-index-sheet-head h3 a {
  color: var(--index-ink);
  text-decoration: none;
}
.a50-index-sheet-head h3 a:hover { color: var(--index-clay); }
.a50-index-sheet-head p {
  margin: 0;
  color: var(--a50-muted);
  font-size: 0.9rem;
}

.a50-index-sheet-film {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}
.a50-index-sheet-thumb {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--index-ink);
  min-width: 0;
  animation: a50IndexRise 0.5s var(--index-ease) both;
  animation-delay: calc(var(--strip-i, 0) * 0.05s);
}
.a50-index-sheet-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--index-mist);
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
  transition: transform 0.35s var(--index-snap);
}
.a50-index-sheet-thumb:hover img {
  transform: translateY(-2px) scale(1.03);
}
.a50-index-sheet-thumb span {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.a50-index-sheet-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--index-line);
}
.a50-index-sheet-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.a50-index-sheet-tags a,
.a50-index-sheet-tags span {
  display: inline-block;
  padding: 0.3rem 0.55rem;
  background: var(--index-mist);
  border: 1px solid var(--index-line);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--index-ink);
  text-decoration: none;
}
.a50-index-sheet-tags a:hover {
  background: var(--index-ink);
  color: #fff;
}
.a50-index-sheet-btn {
  display: inline-flex;
  padding: 0.7rem 1.05rem;
  background: var(--index-ink);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
  transition: background 0.2s ease, color 0.2s ease, transform 0.25s var(--index-snap);
}
.a50-index-sheet-btn:hover {
  background: var(--index-chart);
  color: var(--index-ink);
  transform: translateY(-2px);
}

/* Links */
.a50-index-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}
.a50-index-link {
  background: var(--index-ink);
  color: #fff;
  padding: 1rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 108px;
  text-decoration: none;
  transition: transform 0.3s var(--index-snap), background 0.25s ease;
}
.a50-index-link:hover {
  transform: translateY(-3px);
  background: #1c2a24;
}
.a50-index-link span {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--index-chart);
}
.a50-index-link strong { font-size: 0.95rem; }
.a50-index-link small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.78rem;
}

@media (prefers-reduced-motion: reduce) {
  .a50-index-grid,
  .a50-index-beam,
  .a50-index-scan,
  .a50-index-meter,
  .a50-index-sheet-thumb {
    animation: none !important;
  }
  .a50-index-reveal { opacity: 1; transform: none; }
}

@media (max-width: 980px) {
  .a50-index-hero-grid,
  .a50-index-sheet {
    grid-template-columns: 1fr;
  }
  .a50-index-sheet-film {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .a50-index-links {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .a50-index-sheet-film {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .a50-index-links {
    grid-template-columns: 1fr;
  }
  .a50-index-sheet-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .a50-index-sheet-btn {
    text-align: center;
    justify-content: center;
  }
}
