/* ══════════════════════════════════════════════
   WORK PAGE — Editorial Layout
   OpenAI "Recent News" style:
   image-first, no boxes, content-placed, minimal.
══════════════════════════════════════════════ */

/* ── Page content area ─────────────────────── */

.work-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

/* Header section — constrained width (title + filter) */
.work-inner {
  padding: 60px var(--pad-x) 0;
  max-width: 860px;
}

/* Grid section — full viewport width, same side padding as nav */
.work-grid {
  padding: 0 var(--pad-x) 80px;
}


/* ── Page title ─────────────────────────────── */

.work-title {
  font-size: clamp(32px, 3.5vw, 42px);
  font-weight: 400;
  letter-spacing: -0.025em;
  color: var(--c-ink-90);
  line-height: 1.1;
  margin-bottom: 32px;
}


/* ── Category filter row ────────────────────── */

.work-filter {
  display: flex;
  align-items: baseline;
  gap: 0;
  border-bottom: 1px solid var(--c-border);
  padding-bottom: 14px;
  margin-bottom: 52px;
  flex-wrap: wrap;
  row-gap: 8px;
}

.work-filter__item {
  font-family: var(--f-sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--c-ink-45);
  margin-right: 22px;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
  background: none;
  border: none;
  -webkit-font-smoothing: antialiased;
  transition: color var(--dur-fast) var(--ease-out);
}

.work-filter__item:hover:not(.is-active) {
  color: var(--c-ink-70);
}

.work-filter__item.is-active {
  font-weight: 500;
  color: var(--c-ink-90);
}


/* ── Editorial grid ─────────────────────────── */

.work-row {
  display: grid;
  grid-template-columns: minmax(0, 17fr) minmax(0, 10fr);
  gap: 28px;
  margin-bottom: 64px;
}

.work-stack {
  display: flex;
  flex-direction: column;
  gap: 36px;
}


/* ── Project item — no card, editorial placement ── */

.work-card {
  /* No border. No background. No box. Just content. */
  background: none;
  border: none;
  border-radius: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

/* Hover lifts just the image area, not a box */
.work-card:hover .work-card__cover {
  opacity: 0.92;
}


/* ── Cover image area ── */

.work-card__cover {
  position: relative;
  width: 100%;
  display: block;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  transition: opacity var(--dur-fast) var(--ease-out);
}

/* Featured (left, large) — sticky scroll behavior */
.work-card--featured {
  position: sticky;
  /* 这里可以更改 sticky 之后 project card上缘和 navigation bar之间的距离*/
  top: 0px;
  align-self: start; /* required: prevents grid stretch from disabling sticky */
}

.work-card--featured .work-card__cover {
  aspect-ratio: 4 / 3;
}

/* Stacked (right column) */
.work-stack .work-card .work-card__cover {
  aspect-ratio: 16 / 9;
}


/* ── Caption area — sits below image, no padding box ── */

.work-card__body {
  padding: 14px 0 0 0;
}

.work-card__title {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--c-ink-90);
  line-height: 1.4;
  margin-bottom: 6px;
}

.work-card--featured .work-card__title {
  font-size: 18px;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.work-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.work-card__cat {
  font-weight: 400;
  color: var(--c-ink-45);
}

.work-card__year {
  color: var(--c-ink-45);
}

/* Dot separator between cat and year */
.work-card__meta .work-card__cat::after {
  content: "·";
  margin-left: 8px;
  color: var(--c-ink-20);
}

.work-card__meta .work-card__cat--inline-meta::after {
  content: none;
  margin-left: 0;
}


/* ── Cover color themes ─────────────────────── */

/* Warm stone — Cider QC */
.cover-cider-qc {
  background: linear-gradient(155deg, #ECE7DF 0%, #DDD4C6 100%);
}

/* Dreamwriter */
.cover-dreamwriter {
  background-image: url("purple/purple 1.png");
  background-size: cover;
  background-position: center;
}

.dw-track {
  position: absolute;
  inset: 0;
}

.dw-slide {
  position: absolute;
}

/* dream 1 — 左上，从左往右 */
.dw-slide:nth-child(1) {
  top: 5%;
  left: -2%;
  width: 68%;
  animation: dw-right 6s ease-in-out infinite alternate;
}

/* dream 2 — 右下，从右往左 */
.dw-slide:nth-child(2) {
  bottom: 5%;
  right: -2%;
  width: 62%;
  animation: dw-left 6s ease-in-out infinite alternate;
}

@keyframes dw-right {
  from { transform: translateX(-6%); }
  to   { transform: translateX(6%); }
}

@keyframes dw-left {
  from { transform: translateX(6%); }
  to   { transform: translateX(-6%); }
}

/* Adobe */
.cover-adobe {
  background-image: url("Adobe 封面/adoe full image.png");
  background-size: cover;
  background-position: center;
}

/* checkout — 右上，从上往下 slide in */
.ab-checkout {
  position: absolute;
  width: 72%;
  right: -10%;
  top: -6%;
  z-index: 1;
  animation: ab-checkout-loop 7s cubic-bezier(0.22, 1, 0.36, 1) 0s infinite;
}

.ab-home {
  position: absolute;
  width: 72%;
  left: -15%;
  bottom: -9%;
  z-index: 2;
  animation: ab-home-loop 7s cubic-bezier(0.22, 1, 0.36, 1) 0.35s infinite;
}

.ab-checkout img,
.ab-home img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  user-select: none;
}

/* slide in → hold → slide out → pause */
@keyframes ab-checkout-loop {
  0%        { transform: translateY(-110%); }
  18%, 51%  { transform: translateY(0); }
  64%, 100% { transform: translateY(-110%); }
}

@keyframes ab-home-loop {
  0%        { transform: translateY(110%); }
  18%, 51%  { transform: translateY(0); }
  64%, 100% { transform: translateY(110%); }
}

/* Sage — Cider Size Selection */
.cover-cider-size {
  background-image: url("cider size 封面/shopify green.png");
  background-size: cover;
  background-position: center;
}

/* Near-black — Motion Thesis */
.cover-motion {
  background: linear-gradient(155deg, #252525 0%, #181818 100%);
}

/* Soft lavender — Vibe Coding */
.cover-vibe {
  background: linear-gradient(155deg, #E8E4F0 0%, #D8D0EA 100%);
}

/* Muted indigo — Motion Toys */
.cover-motion-toys {
  background: linear-gradient(155deg, #DDE0EE 0%, #CDD2E8 100%);
}


/* ── Filter: hide non-matching items ────────── */

.work-card.is-hidden {
  display: none;
}

.work-row.is-empty {
  display: none;
}

/* ── Filtered layout: centered “spreading” gallery ────────── */

.work-grid.is-filtered {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(var(--pad-x), 10vw);
  padding-inline: max(var(--pad-x), 10vw);
  gap: 56px;
}

/* Flatten the editorial row/stack wrappers so cards lay out in one flow */
.work-grid.is-filtered .work-row,
.work-grid.is-filtered .work-stack {
  display: contents;
}

/* Remove sticky behavior in gallery mode */
.work-grid.is-filtered .work-card--featured {
  position: static;
  top: auto;
  align-self: auto;
}

/* Single centered “slide” cards */
.work-grid.is-filtered .work-card {
  flex: 0 0 auto;
  width: min(980px, calc(100vw - (var(--pad-x) * 2)));
  scroll-snap-align: center;
}

.work-grid.is-filtered .work-card__cover {
  border-radius: 18px;
  aspect-ratio: 4 / 3;
}

@media (max-width: 900px) {
  .work-grid.is-filtered .work-card {
    width: calc(100vw - (var(--pad-x) * 2));
  }
}

/* Hide scrollbar (still scrollable) */
.work-grid.is-filtered {
  scrollbar-width: none; /* Firefox */
}
.work-grid.is-filtered::-webkit-scrollbar {
  width: 0;
  height: 0;
}
