/* 15-errors.css — Error surfaces: "The Index"
   ═══════════════════════════════════════════════════════════════
   On an error page the visitor's success is leaving, so the exits get the
   whole page and the failure gets a line. The status code, the statement,
   and every way out share one ruled grammar top to bottom: a wine list,
   set the way a wine list is set. No centered monument, no giant numeral.
   ═══════════════════════════════════════════════════════════════ */

.cellar-index {
  --index-title-size: clamp(2.5rem, 5vw, 4rem);

  position: relative;
  display: flex;
  align-items: center;
  min-height: min(78vh, 46rem);
  padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(4rem, 7vw, 6rem);
  background: var(--noir-950);
  overflow: hidden;
}

/* Cellar light, falling from the upper left across the index rather than
   pooling behind a centered subject. Quieter than the homepage hero: this is
   a corridor, not a stage. */
.cellar-index::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 900px 620px at 10% 4%, rgba(139, 41, 66, 0.14), transparent 68%),
    radial-gradient(ellipse 720px 520px at 92% 88%, rgba(212, 168, 83, 0.09), transparent 70%);
}

.cellar-index__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* ─── Row 0: the failure, set as the head of the list ─── */

.cellar-index__statement {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: var(--space-5);
  align-items: baseline;
  padding-bottom: var(--space-7);
}

.cellar-index__title {
  grid-column: 1;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--index-title-size);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ivory-100);
  text-wrap: balance;
}

/* The status code as a folio, set in the outer margin the way a reference
   number sits on a magazine spread. Not a kicker: it is the only place the
   HTTP status is stated, and it is data. Registered on the title's own
   baseline by the statement grid, not by a magic offset. */
.cellar-index__status {
  grid-column: 2;
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--amber-400);
  white-space: nowrap;
}

.cellar-index__lede {
  grid-column: 1;
  margin: var(--space-4) 0 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ivory-300);
  max-width: 54ch;
  text-wrap: pretty;
}

/* ─── The list ─── */

.cellar-index__list {
  margin: 0;
  padding: 0;
  list-style: none;
  /* The one amber hairline on the page: where the index begins. */
  border-top: 1px solid var(--border-accent);
  border-bottom: 1px solid var(--border-default);
}

.cellar-index__group {
  padding: var(--space-6) 0 var(--space-2);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  /* Eyebrow typography, but ivory rather than the Eyebrow Rule's amber: the
     One Voice Rule caps amber at 10% of a screen, and on this page that
     budget is already spent on the folio and the hairline opening the index.
     Two group labels in amber would make three competing amber elements. */
  color: var(--ivory-400);
}

.cellar-index__list > li:first-child .cellar-index__group {
  padding-top: var(--space-5);
}

.cellar-index__list > li + li .cellar-index__row {
  border-top: 1px solid var(--border-default);
}

.cellar-index__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  column-gap: var(--space-5);
  width: 100%;
  padding: var(--space-4) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--duration-normal) var(--ease-out),
    background-image var(--duration-normal) var(--ease-out);
}

.cellar-index__name {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ivory-100);
  transition: color var(--duration-normal) var(--ease-out);
}

.cellar-index__desc {
  display: block;
  margin-top: var(--space-1);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ivory-400);
}

.cellar-index__figure {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--ivory-300);
  transition: color var(--duration-normal) var(--ease-out);
}

.cellar-index__kbd {
  font-family: var(--font-body);
  font-size: 0.65rem;
  padding: 1px 5px;
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  color: var(--ivory-400);
}

.cellar-index__chevron {
  display: flex;
  color: var(--ivory-400);
  transition:
    transform var(--duration-normal) var(--ease-out),
    color var(--duration-normal) var(--ease-out);
}

.cellar-index__chevron svg {
  width: 20px;
  height: 20px;
}

/* Hover: the lamp moves onto the row. */
.cellar-index__row:hover,
.cellar-index__row:focus-visible {
  background-image: linear-gradient(
    90deg,
    rgba(212, 168, 83, 0.07) 0%,
    rgba(212, 168, 83, 0.02) 48%,
    transparent 82%
  );
}

.cellar-index__row:hover .cellar-index__name,
.cellar-index__row:focus-visible .cellar-index__name {
  color: var(--amber-300);
}

.cellar-index__row:hover .cellar-index__chevron,
.cellar-index__row:focus-visible .cellar-index__chevron {
  transform: translateX(6px);
  color: var(--amber-400);
}

.cellar-index__row:hover .cellar-index__figure,
.cellar-index__row:focus-visible .cellar-index__figure {
  color: var(--ivory-200);
}

/* Border-Is-The-Shadow: the hairline above the hovered row warms rather than
   the row lifting. The index is made entirely of hairlines, so this is the
   system's own depth device doing the work. */
.cellar-index__list > li + li .cellar-index__row:hover,
.cellar-index__list > li + li .cellar-index__row:focus-visible {
  border-top-color: var(--border-accent-hover);
}

/* ─── Motion: one authored moment. The index sets itself, top to bottom,
       the way a list is written out. ─── */

@keyframes cellar-index-set {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* The rows rise WITHOUT fading. On the one surface whose whole job is fast
   recovery, no exit may be invisible at any point: a staggered fade-in from
   opacity 0 hid the last row for over a second. The statement, which is not
   an exit, keeps the fade. Same authored moment, nothing withheld. */
@keyframes cellar-index-rise {
  from {
    transform: translateY(10px);
  }
  to {
    transform: none;
  }
}

.cellar-index__statement {
  animation: cellar-index-set 0.5s var(--ease-out) both;
}

.cellar-index__list > li {
  animation: cellar-index-rise 0.4s var(--ease-out) both;
}

.cellar-index__list > li:nth-child(1) { animation-delay: 0.02s; }
.cellar-index__list > li:nth-child(2) { animation-delay: 0.04s; }
.cellar-index__list > li:nth-child(3) { animation-delay: 0.06s; }
.cellar-index__list > li:nth-child(4) { animation-delay: 0.08s; }
.cellar-index__list > li:nth-child(5) { animation-delay: 0.10s; }
.cellar-index__list > li:nth-child(6) { animation-delay: 0.12s; }
.cellar-index__list > li:nth-child(7) { animation-delay: 0.14s; }
.cellar-index__list > li:nth-child(8) { animation-delay: 0.16s; }
.cellar-index__list > li:nth-child(9) { animation-delay: 0.18s; }
.cellar-index__list > li:nth-child(n + 10) { animation-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  .cellar-index__statement,
  .cellar-index__list > li {
    animation: none;
  }


  .cellar-index__chevron {
    transition: color var(--duration-normal) var(--ease-out);
  }

  .cellar-index__row:hover .cellar-index__chevron,
  .cellar-index__row:focus-visible .cellar-index__chevron {
    transform: none;
  }
}

/* ─── Narrow screens ─── */

@media (max-width: 40rem) {
  .cellar-index {
    min-height: 0;
    align-items: flex-start;
  }

  .cellar-index__inner {
    padding: 0 var(--space-4);
  }

  .cellar-index__statement {
    column-gap: var(--space-4);
    padding-bottom: var(--space-6);
  }

  .cellar-index__status {
    letter-spacing: 0.2em;
  }

  .cellar-index__row {
    column-gap: var(--space-3);
    padding: var(--space-4) var(--space-2);
  }

  .cellar-index__desc {
    font-size: 0.8rem;
  }

  .cellar-index__figure {
    font-size: 0.8rem;
  }
}

/* Flush the error surface to the navbar: it owns the whole viewport, and the
   app shell's standard main padding would float it. */
.app-main--flush {
  padding: 0;
}
