/* Works page */
body { overflow: hidden; }

.stage {
  height: 100dvh;
  overflow: hidden;
}

.stage__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 85% 20%, rgba(212, 137, 74, 0.16), transparent 55%),
    radial-gradient(ellipse 55% 50% at 10% 80%, rgba(90, 110, 130, 0.14), transparent 50%),
    linear-gradient(155deg, #121417 0%, #0a0b0d 48%, #0d0f12 100%);
}

.frame {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  padding: clamp(1.15rem, 2.8vw, 2rem) clamp(1.25rem, 4vw, 3.25rem);
}

.board {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: clamp(1.25rem, 3vh, 2rem);
  height: 100%;
  min-height: 0;
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.9s var(--ease) 0.25s forwards;
}

.identity {
  flex-shrink: 0;
}

.identity .eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 0.55rem;
}

.identity .name {
  font-family: "Outfit", sans-serif;
  font-weight: 600;
  font-size: clamp(2.6rem, 5.8vw, 4.25rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.accent {
  width: 0;
  height: 2px;
  margin: 0.9rem 0 0.75rem;
  background: linear-gradient(90deg, var(--copper), transparent);
  animation: draw 1s var(--ease) 0.6s forwards;
}

.lede {
  color: var(--muted);
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
  max-width: none;
  white-space: nowrap;
}

.columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.15rem, 2.8vw, 2rem);
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
}

.col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  height: 100%;
}

.col__label {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.95rem;
  flex-shrink: 0;
}

.col__label span {
  font-family: "Outfit", sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}

.col__label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.col__count {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  flex: 1 1 auto;
  min-height: 0;
  /* lock column bottoms to the same edge on desktop */
  height: 100%;
  overflow: hidden;
}

.work {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.65rem;
  flex: 1 1 0;
  padding: 1.25rem 1.3rem 1.3rem;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(160deg, rgba(236, 233, 227, 0.05), rgba(236, 233, 227, 0.015));
  border-left: 2px solid rgba(212, 137, 74, 0.55);
  transition: transform 0.25s var(--ease), background 0.25s ease, border-color 0.25s ease;
  min-height: 0;
  overflow: hidden;
}

/* Mini: 3 cards share the same fixed column height as Papers/Final (2 cards) */
#mini .stack {
  gap: 0.55rem;
}

#mini .work {
  gap: 0.4rem;
  padding: 0.85rem 1.05rem 0.9rem;
}

#mini .work__tag {
  font-size: 0.66rem;
  padding: 0.1rem 0.38rem;
}

#mini .work__title {
  font-size: clamp(0.95rem, 1.35vw, 1.12rem);
  line-height: 1.25;
}

#mini .work__desc {
  font-size: 0.84rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#mini .techs {
  gap: 0.3rem;
  flex-wrap: nowrap;
  overflow: hidden;
  min-height: 0;
  flex-shrink: 1;
}

#mini .tech {
  padding: 0.24rem 0.48rem 0.24rem 0.34rem;
  font-size: 0.62rem;
}

#mini .tech img {
  width: 0.82rem;
  height: 0.82rem;
}

#mini .work__meta {
  font-size: 0.75rem;
  padding-top: 0.25rem;
}

.work:hover,
.stack--linked:hover .work,
.stack--linked:focus-within .work {
  transform: translateY(-2px);
  background: linear-gradient(160deg, rgba(236, 233, 227, 0.08), rgba(236, 233, 227, 0.03));
  border-left-color: var(--copper);
}

.work--final {
  border-left-color: #c4786a;
}

.work--final:hover,
.stack--final:hover .work--final,
.stack--final:focus-within .work--final {
  border-left-color: #d4894a;
}

.work__tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1a1410;
  background: var(--copper-soft);
  padding: 0.15rem 0.45rem;
  width: fit-content;
}

.work--final .work__tag {
  background: #c4786a;
}

.work__title {
  font-family: "Outfit", sans-serif;
  font-weight: 600;
  font-size: clamp(1.08rem, 1.7vw, 1.28rem);
  line-height: 1.35;
  letter-spacing: -0.015em;
}


.work__desc {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
}

.work__meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  margin-top: auto;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(236, 233, 227, 0.08);
}

@keyframes draw {
  to { width: 6.5rem; }
}

@media (max-width: 980px) {
  body { overflow: auto; }
  html, body { height: auto; }
  .stage { height: auto; min-height: 100dvh; overflow: visible; }
  .frame { height: auto; min-height: 100dvh; }
  .board { height: auto; }
  .lede { white-space: normal; }
  .columns { grid-template-columns: 1fr; flex: none; }
  .col { height: auto; }
  .stack {
    height: auto;
    overflow: visible;
  }
  .work {
    flex: none;
    overflow: visible;
  }
  #mini .work {
    gap: 0.65rem;
    padding: 1.25rem 1.3rem 1.3rem;
  }
  #mini .work__title {
    font-size: clamp(1.08rem, 1.7vw, 1.28rem);
    line-height: 1.35;
  }
  #mini .work__desc {
    font-size: 0.95rem;
    line-height: 1.5;
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  .board, .accent {
    opacity: 1;
    transform: none;
  }
  .accent { width: 6.5rem; }
}