/* ============================================================
   Doorbin — the craft rail
   ============================================================ */

.craft-page {
  height: 100vh;
  overflow: hidden;
  background: var(--ground);
}

.roll {
  height: 100svh;
  display: flex;
  flex-direction: column;
  padding-top: 88px;
  background: var(--ground);
}

/* ---------------- tier filter ---------------- */
.tiers {
  flex: none;
  order: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0;
  padding: 0 var(--gutter) 26px;
  opacity: 0;
}

.tier {
  padding: 15px 38px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 19px;
  font-weight: 300;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0;
  transform-origin: 50% 50%;
  transition: background 0.3s ease, color 0.4s ease, border-color 0.4s ease,
              transform 0.5s var(--ease);
}
.tier:hover { background: var(--wash); }
.tier[aria-pressed="true"]:hover { background: var(--ink); }
.tier[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ground);
}
.tier__label {
  display: inline-block;
  transform-origin: 50% 50%;
  font-variation-settings: 'wght' 300;
  transition: transform 0.5s var(--ease), font-variation-settings 0.5s var(--ease);
}

/* ---------------- the rail ---------------- */
.rail {
  flex: 1;
  min-width: 0;
  min-height: 0;
  order: 2;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 var(--gutter);
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.rail.is-ready { opacity: 1; }
/* the loop's silent jump must not be animated */
.rail.is-jumping .project-card,
.rail.is-jumping .project-card__image { transition: none; }
.rail::-webkit-scrollbar { width: 0; height: 0; }

.project-card {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
  overflow: hidden;
  border-radius: 0;
  background: var(--ground-card);
  color: var(--ink);
  display: block;
  will-change: transform, opacity;
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.project-card:hover { color: var(--ink); }

.project-card__image {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  will-change: transform;
  /* written every frame by the scroll: any transition makes it lag and lurch */
  transition: none;
}


.project-card__link { display: block; height: 100%; color: inherit; }
.project-card__veil {
  position: absolute;
  inset: 0;
  /* a light hand: enough at the foot for the title, almost nothing above */
  background: linear-gradient(
    rgba(8, 8, 10, 0.18) 0%,
    rgba(8, 8, 10, 0) 24%,
    rgba(8, 8, 10, 0) 58%,
    rgba(8, 8, 10, 0.62) 100%);
}

.project-card__index {
  position: absolute;
  left: 34px; top: 28px;
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: rgba(242, 239, 233, 0.76);
}

.project-card__info {
  position: absolute;
  left: 34px; right: 34px; bottom: 32px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.project-card__text { display: block; min-width: 0; }

.project-card__category {
  display: block;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.project-card__title {
  margin: 14px 0 0;
  font-weight: 200;
  font-size: clamp(20px, 1.7vw, 30px);
  line-height: 1.02;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  text-wrap: balance;
}
.project-card__meta {
  margin: 18px 0 0;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.2;
  color: var(--ink-dim);
}
.project-card__meta strong { font-weight: inherit; color: var(--ink); }
.project-card__dot {
  flex: none;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--ink-faint);
}

.project-card__arrow {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  border: 1px solid rgba(242, 239, 233, 0.42);
  border-radius: 50%;
  transition: background 0.4s ease, color 0.4s ease;
}
.project-card__arrow svg { width: 16px; height: 12px; display: block; }
.project-card:hover .project-card__arrow { background: var(--ink); color: var(--ground); }

@keyframes cf-nudge {
  0%, 100% { transform: translateY(-3px); }
  50%      { transform: translateY(3px); }
}
.project-card__cue {
  position: absolute;
  left: 50%; bottom: 18px;
  margin-left: -13px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 26px; height: 26px;
  color: rgba(242, 239, 233, 0.62);
  opacity: 0;
  transition: opacity 0.6s ease;
  animation: cf-nudge 1.9s cubic-bezier(0.4, 0, 0.3, 1) infinite;
}
.project-card__cue svg { width: 13px; height: 8px; display: block; }
.project-card.is-active .project-card__cue { opacity: 1; }

/* ---------------- tunnel ---------------- */
.tunnel {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  background: var(--ground);
}
.tunnel.is-running { display: block; }
.tunnel__canvas { width: 100%; height: 100%; display: block; }

.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--ground);
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.boot.is-gone { opacity: 0; }

/* ---------------- touch widths ---------------- */
@media (max-width: 1024px) {
  .roll { padding-top: 74px; }
  .tiers { order: 1; flex-wrap: nowrap; padding: 0 16px 16px; gap: 10px; }
  .rail { order: 2; padding: 0 16px 16px; gap: 14px; }
  .project-card { flex: 0 0 76.9%; height: 76.9%; border-radius: 0; }
  .tier { flex: 1 1 0; min-width: 0; padding: 12px 10px; font-size: 15px; }
  .project-card__title { font-size: clamp(20px, 5.4vw, 32px); }
  .project-card__info {
    left: var(--gutter-sm); right: var(--gutter-sm); bottom: 46px;
    align-items: flex-end;
    gap: 16px;
  }
  .project-card__text { flex: 1 1 auto; min-width: 0; }
  .project-card__arrow {
    align-self: flex-end;
    margin-bottom: 1px;
    width: 42px; height: 42px;
  }
  .project-card__arrow svg { width: 14px; height: 10px; }
  .project-card__cue { bottom: 16px; }
  .project-card__index { left: var(--gutter-sm); top: 20px; font-size: 18px; }
  .project-card__meta { font-size: 16px; margin-top: 12px; }
}
@media (max-width: 560px) {
  .tiers { gap: 8px; }
  .tier { padding: 11px 15px; font-size: 14px; }
  .project-card__meta { font-size: 14px; }
}
@media (max-width: 400px) {
  .tiers { gap: 6px; }
  .tier { padding: 10px 12px; font-size: 13px; }
}


/* ============================================================
   desktop: the roll runs sideways — one card whole, the next
   showing its first 30% at the right edge
   ============================================================ */
@keyframes cf-nudge-x {
  0%, 100% { transform: translateX(-3px); }
  50%      { transform: translateX(3px); }
}
@media (hover: hover) and (min-width: 1025px) {
  .rail {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: none;
    padding: 0 0 0 var(--gutter);
    cursor: grab;
  }
  .rail.is-dragging, .rail.is-dragging * { cursor: grabbing; }
  .project-card { scroll-snap-align: none; }
  .project-card {
    /* card + gap + 30% of a card fills what is right of the gutter */
    flex: 0 0 calc((100vw - var(--gutter) - 16px) / 1.3);
    width: calc((100vw - var(--gutter) - 16px) / 1.3);
    height: 100%;
  }
  /* the cue points the way the roll now travels */
  .project-card__cue {
    left: auto; right: 22px; bottom: auto; top: 50%;
    margin: -13px 0 0;
    align-items: center;
    animation-name: cf-nudge-x;
  }
  .project-card__cue svg { transform: rotate(-90deg); }
}

/* the card speaks in one voice, as the project pages do: the title's typeface, one ink */
.project-card__index,
.project-card__category,
.project-card__meta,
.project-card__meta strong,
.project-card__meta span {
  font-family: var(--font-sans);
  font-weight: 300 !important;
  font-variation-settings: 'wght' 300;
  color: #f2efe9;
}
.project-card__meta strong { font-weight: 300; }
.project-card__index { font-size: 15px; letter-spacing: 0.04em; }
.project-card__meta { font-size: 15px; letter-spacing: 0.04em; }
.project-card__dot { background: #f2efe9; }
@media (max-width: 1024px) {
  .project-card__index,
  .project-card__meta { font-size: 14px; }
}
